Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Support 4-coedge three-circle/single-bspline revolved family

Yuechen Li9e81b6c6907c
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs
index 5ba8969d..3ecfe223 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 284 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 327 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'circle-only non-seam 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 3511e443..1ac56103 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
@@ -5,8 +5,8 @@ namespace Aetheris.Kernel.Core.Tests.Step242;
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 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily 'other (coedges=4, uniqueEdges=4)'. Observed")]
+ [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "Face 327 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'circle-only non-seam 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 'four-coedge mixed line/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,
@@ -58,7 +58,7 @@ public sealed class Step242RevolvedTopologyFamilyRegressionTests
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);
+ Assert.StartsWith("Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily 'four-coedge mixed line/bspline revolved loop'. Observed", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
}
[Theory]
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index ccf48d5f..6a91015c 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -612,6 +612,15 @@ public static class BrepDisplayTessellator
CalculateAxialSegments(fourCoedgeSingleCircleParameters.VStart, fourCoedgeSingleCircleParameters.VEnd, options)), fourCoedgeSingleCircleDiagnostics);
}
+ if (TryResolveFourCoedgeThreeCircleSingleBsplineRevolvedLoop(body, coedges, circleCoedges, bSplineCoedges, axialParameterFromPoint, faceId, out var fourCoedgeThreeCircleParameters, out var fourCoedgeThreeCircleDiagnostics))
+ {
+ return KernelResult<(double, double, int, int)>.Success((
+ fourCoedgeThreeCircleParameters.VStart,
+ fourCoedgeThreeCircleParameters.VEnd,
+ CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options),
+ CalculateAxialSegments(fourCoedgeThreeCircleParameters.VStart, fourCoedgeThreeCircleParameters.VEnd, options)), fourCoedgeThreeCircleDiagnostics);
+ }
+
if (TryResolveFourUseBsplineOnlyRevolvedLoop(body, coedges, bSplineCoedges, axialParameterFromPoint, faceId, out var bsplineOnlyParameters, out var bsplineOnlyDiagnostics))
{
return KernelResult<(double, double, int, int)>.Success((
@@ -963,6 +972,44 @@ public static class BrepDisplayTessellator
return true;
}
+ private static bool TryResolveFourCoedgeThreeCircleSingleBsplineRevolvedLoop(
+ 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 != 3 || bSplineCoedges.Count != 1 || axialParameterFromPoint is null)
+ {
+ return false;
+ }
+
+ var uniqueEdgeCount = coedges
+ .Select(c => c.EdgeId)
+ .Distinct()
+ .Count();
+ if (uniqueEdgeCount != 4)
+ {
+ 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,
@@ -1269,6 +1316,16 @@ public static class BrepDisplayTessellator
return "four-coedge single-circle/three-bspline revolved loop";
}
+ if (lineCoedges.Count == 0 && circleCoedges.Count == 3 && bSplineCoedges.Count == 1 && coedges.Count == 4 && uniqueEdgeIds.Length == 4)
+ {
+ return "four-coedge three-circle/single-bspline revolved loop";
+ }
+
+ if (lineCoedges.Count == 2 && circleCoedges.Count == 0 && bSplineCoedges.Count == 2 && coedges.Count == 4 && uniqueEdgeIds.Length == 4)
+ {
+ return "four-coedge mixed line/bspline revolved loop";
+ }
+
if (lineCoedges.Count == 0 && circleCoedges.Count == 0 && bSplineCoedges.Count == 4 && coedges.Count == 4)
{
return "four-coedge bspline-only revolved loop";
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index a39ea9c0..2e121012 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 284 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=4, uniqueEdges=4)\u0027. Observed"
+ "messagePrefix": "Face 327 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027circle-only non-seam loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,
@@ -152,7 +152,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=4, uniqueEdges=4)\u0027. Observed"
+ "messagePrefix": "Face 129 curved tessellation supports selected repeated cone/revolved boundary subfamilies; unsupported subfamily \u0027four-coedge mixed line/bspline revolved loop\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,