Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Support six-coedge bspline-only revolved loop family

Yuechen Li95c38dcf3cfd
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
index 60b04f80..3511e443 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
@@ -6,7 +6,7 @@ public sealed class Step242RevolvedTopologyFamilyRegressionTests
{
[Theory]
[InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "Face 284 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'other (coedges=4, uniqueEdges=4)'. Observed")]
- [InlineData("testdata/step242/nist/FTC/nist_ftc_07_asme1_ap242-e2.stp", "Face 74 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'six-coedge bspline-only revolved loop'. Observed")]
+ [InlineData("testdata/step242/nist/FTC/nist_ftc_07_asme1_ap242-e2.stp", "Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily 'other (coedges=4, uniqueEdges=4)'. Observed")]
[InlineData("testdata/step242/nist/FTC/nist_ftc_10_asme1_ap242-e2.stp", "Face 67 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'other (coedges=5, uniqueEdges=5)'. Observed")]
public void Step242_RepeatedCurvedRevolvedTargets_AdvanceWithExplicitDeterministicNextBlocker(
string relativePath,
@@ -36,6 +36,31 @@ public sealed class Step242RevolvedTopologyFamilyRegressionTests
Assert.StartsWith(expectedMessagePrefix, first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
}
+ [Fact]
+ public void Step242_Ftc07_SixCoedgeBsplineOnlyRevolvedLoop_AdvancesDeterministically_ToExplicitConeBlocker()
+ {
+ const string relativePath = "testdata/step242/nist/FTC/nist_ftc_07_asme1_ap242-e2.stp";
+ var entry = new Step242CorpusManifestEntry(
+ Id: Path.GetFileNameWithoutExtension(relativePath),
+ Path: relativePath,
+ Group: "nist-revolved-family-regression",
+ Notes: "six-coedge bspline-only revolved loop progression",
+ ExpectedFirstDiagnostic: null,
+ ExpectHashStableAfterCanonicalization: null,
+ ExpectTopologyCounts: null,
+ ExpectGeometryKinds: null);
+
+ var first = Step242CorpusManifestRunner.RunOne(entry);
+ var second = Step242CorpusManifestRunner.RunOne(entry);
+
+ Assert.Equal(first.FirstFailureLayer, second.FirstFailureLayer);
+ Assert.Equal(first.FirstDiagnostic.Source, second.FirstDiagnostic.Source);
+ Assert.Equal(first.FirstDiagnostic.MessagePrefix, second.FirstDiagnostic.MessagePrefix);
+
+ Assert.DoesNotContain("unsupported subfamily 'six-coedge bspline-only revolved loop'", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
+ Assert.StartsWith("Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily 'other (coedges=4, uniqueEdges=4)'. Observed", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
+ }
+
[Theory]
[InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "Face 12 spherical trim loop must contain at least three coedges. Observed")]
[InlineData("testdata/step242/nist/STC/nist_stc_08_asme1_ap242-e3.stp", "Face 62 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'circle-only non-seam loop'. Observed")]
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index ae362f70..ccf48d5f 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -639,6 +639,15 @@ public static class BrepDisplayTessellator
CalculateAxialSegments(sixCoedgeSingleCircleParameters.VStart, sixCoedgeSingleCircleParameters.VEnd, options)), sixCoedgeSingleCircleDiagnostics);
}
+ if (TryResolveSixUseBsplineOnlyRevolvedLoop(body, coedges, bSplineCoedges, axialParameterFromPoint, faceId, out var sixUseBsplineOnlyParameters, out var sixUseBsplineOnlyDiagnostics))
+ {
+ return KernelResult<(double, double, int, int)>.Success((
+ sixUseBsplineOnlyParameters.VStart,
+ sixUseBsplineOnlyParameters.VEnd,
+ CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options),
+ CalculateAxialSegments(sixUseBsplineOnlyParameters.VStart, sixUseBsplineOnlyParameters.VEnd, options)), sixUseBsplineOnlyDiagnostics);
+ }
+
if (TryResolveRepeatedMixedRevolvedLoop(body, coedges, lineCoedges, circleCoedges, axialParameterFromPoint, faceId, out var repeatedMixedParameters, out var repeatedMixedDiagnostics))
{
return KernelResult<(double, double, int, int)>.Success((
@@ -879,6 +888,43 @@ public static class BrepDisplayTessellator
return true;
}
+ private static bool TryResolveSixUseBsplineOnlyRevolvedLoop(
+ BrepBody body,
+ IReadOnlyList<Coedge> coedges,
+ IReadOnlyList<Coedge> bSplineCoedges,
+ Func<Point3D, double>? axialParameterFromPoint,
+ FaceId faceId,
+ out (double VStart, double VEnd) parameters,
+ out IReadOnlyList<KernelDiagnostic> diagnostics)
+ {
+ parameters = default;
+ diagnostics = [];
+ if (coedges.Count != 6 || bSplineCoedges.Count != 6 || axialParameterFromPoint is null)
+ {
+ return false;
+ }
+
+ var uniqueEdgeCount = coedges
+ .Select(c => c.EdgeId)
+ .Distinct()
+ .Count();
+ if (uniqueEdgeCount != 6)
+ {
+ return false;
+ }
+
+ var result = TryResolveAxialBoundsFromProjectedLoopVertices(body, coedges, axialParameterFromPoint, faceId);
+ if (!result.IsSuccess)
+ {
+ diagnostics = result.Diagnostics;
+ return false;
+ }
+
+ parameters = result.Value;
+ diagnostics = result.Diagnostics;
+ return true;
+ }
+
private static bool TryResolveFourCoedgeSingleCircleThreeBsplineRevolvedLoop(
BrepBody body,
IReadOnlyList<Coedge> coedges,
@@ -1228,6 +1274,11 @@ public static class BrepDisplayTessellator
return "four-coedge bspline-only revolved loop";
}
+ if (lineCoedges.Count == 0 && circleCoedges.Count == 0 && bSplineCoedges.Count == 6 && coedges.Count == 6 && uniqueEdgeIds.Length == 6 && seamUses > 0)
+ {
+ return "six-coedge bspline-only seam-reused revolved loop";
+ }
+
if (lineCoedges.Count == 0 && circleCoedges.Count == 0 && bSplineCoedges.Count == 6 && coedges.Count == 6 && uniqueEdgeIds.Length == 6)
{
return "six-coedge bspline-only revolved loop";
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index 75b1c6b8..a39ea9c0 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -152,7 +152,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 74 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027six-coedge bspline-only revolved loop\u0027. Observed"
+ "messagePrefix": "Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=4, uniqueEdges=4)\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,