Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Support four-coedge single-circle/three-bspline revolved loop family

Yuechen Li3575d6f7e041
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
index 96486599..5ba8969d 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 'four-coedge single-circle/three-bspline revolved loop'. Observed")]
+ [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "tessellator", "", "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_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 b3dd9be4..60b04f80 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 'four-coedge single-circle/three-bspline revolved loop'. Observed")]
+ [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_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")]
+ [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,
string expectedMessagePrefix)
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index 29262680..ae362f70 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -603,6 +603,15 @@ public static class BrepDisplayTessellator
CalculateAxialSegments(circleBsplineParameters.VStart, circleBsplineParameters.VEnd, options)), circleBsplineDiagnostics);
}
+ if (TryResolveFourCoedgeSingleCircleThreeBsplineRevolvedLoop(body, coedges, circleCoedges, bSplineCoedges, axialParameterFromPoint, faceId, out var fourCoedgeSingleCircleParameters, out var fourCoedgeSingleCircleDiagnostics))
+ {
+ return KernelResult<(double, double, int, int)>.Success((
+ fourCoedgeSingleCircleParameters.VStart,
+ fourCoedgeSingleCircleParameters.VEnd,
+ CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options),
+ CalculateAxialSegments(fourCoedgeSingleCircleParameters.VStart, fourCoedgeSingleCircleParameters.VEnd, options)), fourCoedgeSingleCircleDiagnostics);
+ }
+
if (TryResolveFourUseBsplineOnlyRevolvedLoop(body, coedges, bSplineCoedges, axialParameterFromPoint, faceId, out var bsplineOnlyParameters, out var bsplineOnlyDiagnostics))
{
return KernelResult<(double, double, int, int)>.Success((
@@ -870,6 +879,44 @@ public static class BrepDisplayTessellator
return true;
}
+ private static bool TryResolveFourCoedgeSingleCircleThreeBsplineRevolvedLoop(
+ 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 = [];
+ if (coedges.Count != 4 || circleCoedges.Count != 1 || bSplineCoedges.Count != 3 || axialParameterFromPoint is null)
+ {
+ return false;
+ }
+
+ var uniqueEdgeCount = coedges
+ .Select(c => c.EdgeId)
+ .Distinct()
+ .Count();
+ if (uniqueEdgeCount < 3)
+ {
+ 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 TryResolveConeRevolvedLoop(
BrepBody body,
IReadOnlyList<Coedge> coedges,
@@ -1171,7 +1218,7 @@ 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)
+ if (lineCoedges.Count == 0 && circleCoedges.Count == 1 && bSplineCoedges.Count == 3 && coedges.Count == 4 && uniqueEdgeIds.Length >= 3)
{
return "four-coedge single-circle/three-bspline revolved loop";
}
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index fed0ca28..75b1c6b8 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 \u0027four-coedge single-circle/three-bspline revolved loop\u0027. Observed"
+ "messagePrefix": "Face 284 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=4, uniqueEdges=4)\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -248,7 +248,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 52 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027four-coedge single-circle/three-bspline revolved loop\u0027. Observed"
+ "messagePrefix": "Face 67 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=5, uniqueEdges=5)\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,