Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Step242: validate STC-10 progression and refresh NIST blocker snapshot

Yuechen Lie860f268ee11
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
index 352b2e1f..a5d4b9a6 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
@@ -151,8 +151,8 @@ public sealed class Step242ConicalSurfaceRegressionTests
[InlineData(
"testdata/step242/nist/STC/nist_stc_10_asme1_ap242-e2.stp",
"importer-topology",
- "Importer.LoopRole.InnerDisjointAfterNormalization",
- "Inner loop could not be normalized")]
+ "Importer.LoopRole.CylinderAmbiguousOuter",
+ "Unable to choose a unique cylindrical outer loop")]
public void Step242_NistTargets_AdvancePastCircleTrim_AndKeepDeterministicNextBlocker(
string relativePath,
string expectedLayer,
diff --git a/Aetheris.Kernel.Core/Step242/Step242Importer.cs b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
index 6988f797..68eb4667 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Importer.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
@@ -669,7 +669,7 @@ public static class Step242Importer
return KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)>.Failure(circleResult.Diagnostics);
}
- var trimResult = ComputeCircleTrim(circleResult.Value, startPoint, endPoint);
+ var trimResult = ComputeCircleTrim(circleResult.Value, startPoint, endPoint, edgeSameSense);
if (!trimResult.IsSuccess)
{
return KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)>.Failure(trimResult.Diagnostics);
@@ -689,7 +689,7 @@ public static class Step242Importer
return KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)>.Failure(ellipseResult.Diagnostics);
}
- var trimResult = ComputeEllipseTrim(ellipseResult.Value, startPoint, endPoint);
+ var trimResult = ComputeEllipseTrim(ellipseResult.Value, startPoint, endPoint, edgeSameSense);
if (!trimResult.IsSuccess)
{
return KernelResult<(CurveGeometry CurveGeometry, ParameterInterval TrimInterval)>.Failure(trimResult.Diagnostics);
@@ -1105,7 +1105,7 @@ public static class Step242Importer
source)
]);
- private static KernelResult<ParameterInterval> ComputeEllipseTrim(Ellipse3Curve ellipse, Point3D startPoint, Point3D endPoint)
+ private static KernelResult<ParameterInterval> ComputeEllipseTrim(Ellipse3Curve ellipse, Point3D startPoint, Point3D endPoint, bool edgeSameSense)
{
var tolerance = ComputeEllipseTrimTolerance(ellipse, startPoint, endPoint);
@@ -1121,7 +1121,7 @@ public static class Step242Importer
return KernelResult<ParameterInterval>.Failure(endAngleResult.Diagnostics);
}
- var intervalResult = CanonicalizeCircleTrimInterval(startAngleResult.Value, endAngleResult.Value, tolerance);
+ var intervalResult = CanonicalizeCircleTrimInterval(startAngleResult.Value, endAngleResult.Value, tolerance, edgeSameSense);
if (!intervalResult.IsSuccess)
{
return FailureEllipseTrim(intervalResult.Diagnostics[0].Message, intervalResult.Diagnostics[0].Source);
@@ -1161,7 +1161,7 @@ public static class Step242Importer
return System.Math.Max(1e-6d, scale * 1e-8d);
}
- private static KernelResult<ParameterInterval> ComputeCircleTrim(Circle3Curve circle, Point3D startPoint, Point3D endPoint)
+ private static KernelResult<ParameterInterval> ComputeCircleTrim(Circle3Curve circle, Point3D startPoint, Point3D endPoint, bool edgeSameSense)
{
var tolerance = ComputeCircleTrimTolerance(circle, startPoint, endPoint);
if ((startPoint - endPoint).Length <= tolerance)
@@ -1181,7 +1181,7 @@ public static class Step242Importer
return KernelResult<ParameterInterval>.Failure(endAngleResult.Diagnostics);
}
- var intervalResult = CanonicalizeCircleTrimInterval(startAngleResult.Value, endAngleResult.Value, tolerance);
+ var intervalResult = CanonicalizeCircleTrimInterval(startAngleResult.Value, endAngleResult.Value, tolerance, edgeSameSense);
if (!intervalResult.IsSuccess)
{
return KernelResult<ParameterInterval>.Failure(intervalResult.Diagnostics);
@@ -1238,11 +1238,13 @@ public static class Step242Importer
return double.Max(baseTolerance, scale * scaleFactor);
}
- private static KernelResult<ParameterInterval> CanonicalizeCircleTrimInterval(double startAngle, double endAngle, double tolerance)
+ private static KernelResult<ParameterInterval> CanonicalizeCircleTrimInterval(double startAngle, double endAngle, double tolerance, bool edgeSameSense)
{
var start = NormalizeAngle(startAngle);
var end = NormalizeAngle(endAngle);
- var span = NormalizePositiveAngle(end - start);
+ var canonicalStart = edgeSameSense ? start : end;
+ var canonicalEnd = edgeSameSense ? end : start;
+ var span = NormalizePositiveAngle(canonicalEnd - canonicalStart);
var angleTolerance = tolerance;
if (span <= angleTolerance)
@@ -1255,13 +1257,13 @@ public static class Step242Importer
return KernelResult<ParameterInterval>.Success(new ParameterInterval(0d, 2d * double.Pi));
}
- var normalizedEnd = start + span;
- if (normalizedEnd <= start)
+ var normalizedEnd = canonicalStart + span;
+ if (normalizedEnd <= canonicalStart)
{
return FailureCircleTrim("Unable to compute circle trim interval with a positive span after canonicalization.", "Importer.Geometry.CircleTrim.Interval");
}
- return KernelResult<ParameterInterval>.Success(new ParameterInterval(start, normalizedEnd));
+ return KernelResult<ParameterInterval>.Success(new ParameterInterval(canonicalStart, normalizedEnd));
}
private static double NormalizeAngle(double angle)
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index 449ba63a..92f6fef9 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -285,7 +285,7 @@
"facePatches": 42,
"edgePolylines": 104
},
- "canonicalSha256": "29eaa5ebd9a0be6d11a9a1482f21107c30804083435a31911c365aef2ffc21bd"
+ "canonicalSha256": "d941e5707a91b7a8be0049455af81c42e2499cb620c71875435175e1cccf8426"
},
{
"fileId": "testdata_step242_nist_STC_nist_stc_06_asme1_ap242-e3",
@@ -316,18 +316,18 @@
"path": "testdata/step242/nist/STC/nist_stc_07_asme1_ap242-e3.stp",
"sizeBytes": 1927905,
"status": "importFail",
- "firstFailureLayer": "importer-topology",
+ "firstFailureLayer": "tessellator",
"firstDiagnostic": {
- "code": "ValidationFailed",
- "source": "Importer.LoopRole.DisconnectedCoedges",
- "messagePrefix": "Planar loop contains disconnected consecutive coedges and cannot be normalized safely. innerLoopId=252, outerLoopId=251,"
+ "code": "NotImplemented",
+ "source": "",
+ "messagePrefix": "Face 20 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027circle-only non-seam loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
"topologyCounts": {
- "vertices": 0,
- "edges": 0,
- "faces": 0
+ "vertices": 588,
+ "edges": 871,
+ "faces": 306
},
"tessellationCounts": {
"facePatches": 0,
@@ -391,8 +391,8 @@
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
"code": "ValidationFailed",
- "source": "Importer.LoopRole.InnerDisjointAfterNormalization",
- "messagePrefix": "Inner loop could not be normalized"
+ "source": "Importer.LoopRole.CylinderAmbiguousOuter",
+ "messagePrefix": "Unable to choose a unique cylindrical outer loop."
},
"diagnosticCount": 1,
"exceptionEscaped": false,