Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add narrow support for 6-coedge single-circle revolved family

Yuechen Liaaae2ef97581
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
index f467342f..96486599 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
@@ -81,7 +81,7 @@ public sealed class Step242ConicalSurfaceRegressionTests
[InlineData("testdata/step242/nist/CTC/nist_ctc_01_asme1_ap242-e1.stp", "", "Audit.None", "No diagnostics.")]
[InlineData("testdata/step242/nist/CTC/nist_ctc_02_asme1_ap242-e2.stp", "", "Audit.None", "No diagnostics.")]
[InlineData("testdata/step242/nist/CTC/nist_ctc_03_asme1_ap242-e2.stp", "", "", "")]
- [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "tessellator", "", "Face 252 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'other (coedges=4, uniqueEdges=4)'. Observed")]
+ [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "tessellator", "", "Face 252 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'four-coedge single-circle/three-bspline revolved loop'. Observed")]
[InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "tessellator", "", "Face 12 spherical trim loop must contain at least three coedges. Observed")]
[InlineData("testdata/step242/nist/FTC/nist_ftc_09_asme1_ap242-e1.stp", "", "Audit.None", "No diagnostics.")]
[InlineData("testdata/step242/nist/FTC/nist_ftc_10_asme1_ap242-e2.stp", "tessellator", "", "Face ")]
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
index cf644e62..b3dd9be4 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
@@ -5,9 +5,9 @@ namespace Aetheris.Kernel.Core.Tests.Step242;
public sealed class Step242RevolvedTopologyFamilyRegressionTests
{
[Theory]
- [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "Face 252 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 43 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'other (coedges=6, uniqueEdges=6)'. Observed")]
- [InlineData("testdata/step242/nist/FTC/nist_ftc_10_asme1_ap242-e2.stp", "Face 27 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'other (coedges=6, uniqueEdges=6)'. Observed")]
+ [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "Face 252 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'four-coedge single-circle/three-bspline revolved loop'. 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_10_asme1_ap242-e2.stp", "Face 52 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'four-coedge single-circle/three-bspline revolved loop'. Observed")]
public void Step242_RepeatedCurvedRevolvedTargets_AdvanceWithExplicitDeterministicNextBlocker(
string relativePath,
string expectedMessagePrefix)
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index 7f46ee87..29262680 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -621,6 +621,15 @@ public static class BrepDisplayTessellator
CalculateAxialSegments(repeatedCircleBsplineParameters.VStart, repeatedCircleBsplineParameters.VEnd, options)), repeatedCircleBsplineDiagnostics);
}
+ if (TryResolveSixCoedgeSingleCircleFiveBsplineRevolvedLoop(body, coedges, circleCoedges, bSplineCoedges, axialParameterFromPoint, faceId, out var sixCoedgeSingleCircleParameters, out var sixCoedgeSingleCircleDiagnostics))
+ {
+ return KernelResult<(double, double, int, int)>.Success((
+ sixCoedgeSingleCircleParameters.VStart,
+ sixCoedgeSingleCircleParameters.VEnd,
+ CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options),
+ CalculateAxialSegments(sixCoedgeSingleCircleParameters.VStart, sixCoedgeSingleCircleParameters.VEnd, options)), sixCoedgeSingleCircleDiagnostics);
+ }
+
if (TryResolveRepeatedMixedRevolvedLoop(body, coedges, lineCoedges, circleCoedges, axialParameterFromPoint, faceId, out var repeatedMixedParameters, out var repeatedMixedDiagnostics))
{
return KernelResult<(double, double, int, int)>.Success((
@@ -736,6 +745,36 @@ public static class BrepDisplayTessellator
return true;
}
+ private static bool TryResolveSixCoedgeSingleCircleFiveBsplineRevolvedLoop(
+ BrepBody body,
+ IReadOnlyList<Coedge> coedges,
+ IReadOnlyList<Coedge> circleCoedges,
+ IReadOnlyList<Coedge> bSplineCoedges,
+ Func<Point3D, double>? axialParameterFromPoint,
+ FaceId faceId,
+ out (double VStart, double VEnd) parameters,
+ out IReadOnlyList<KernelDiagnostic> diagnostics)
+ {
+ parameters = default;
+ diagnostics = [];
+ var uniqueEdgeCount = coedges.Select(c => c.EdgeId).Distinct().Count();
+ if (coedges.Count != 6 || uniqueEdgeCount != 6 || circleCoedges.Count != 1 || bSplineCoedges.Count != 5 || axialParameterFromPoint is null)
+ {
+ 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 TryResolveFourUseMixedRevolvedLoop(
BrepBody body,
IReadOnlyList<Coedge> coedges,
@@ -1102,6 +1141,11 @@ public static class BrepDisplayTessellator
return "repeated mixed circle/bspline revolved loop";
}
+ if (lineCoedges.Count == 0 && circleCoedges.Count == 1 && bSplineCoedges.Count == 5 && coedges.Count == 6 && uniqueEdgeIds.Length == 6)
+ {
+ return "six-coedge single-circle/five-bspline revolved loop";
+ }
+
if (lineCoedges.Count >= 2 && circleCoedges.Count >= 1 && coedges.Count == 3)
{
return "three-coedge cone/revolved loop";
@@ -1127,11 +1171,21 @@ public static class BrepDisplayTessellator
return "four-coedge mixed circle/bspline loop";
}
+ if (lineCoedges.Count == 0 && circleCoedges.Count == 1 && bSplineCoedges.Count == 3 && coedges.Count == 4 && uniqueEdgeIds.Length == 4)
+ {
+ return "four-coedge single-circle/three-bspline revolved loop";
+ }
+
if (lineCoedges.Count == 0 && circleCoedges.Count == 0 && bSplineCoedges.Count == 4 && coedges.Count == 4)
{
return "four-coedge bspline-only 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";
+ }
+
return $"other (coedges={coedges.Count}, uniqueEdges={uniqueEdgeIds.Length})";
}
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index 893e62ec..fed0ca28 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -80,7 +80,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 252 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=4, uniqueEdges=4)\u0027. Observed"
+ "messagePrefix": "Face 252 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027four-coedge single-circle/three-bspline revolved loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -152,7 +152,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 43 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=6, uniqueEdges=6)\u0027. Observed"
+ "messagePrefix": "Face 74 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027six-coedge bspline-only revolved loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -248,7 +248,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 27 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=6, uniqueEdges=6)\u0027. Observed"
+ "messagePrefix": "Face 52 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027four-coedge single-circle/three-bspline revolved loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,