Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Support four-coedge BSpline-only revolved loop family

Yuechen Lie8c62e557530
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
index c5909d61..cf644e62 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs
@@ -7,7 +7,7 @@ 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 25 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily 'four-coedge bspline-only revolved loop'. 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")]
public void Step242_RepeatedCurvedRevolvedTargets_AdvanceWithExplicitDeterministicNextBlocker(
string relativePath,
string expectedMessagePrefix)
@@ -32,6 +32,7 @@ public sealed class Step242RevolvedTopologyFamilyRegressionTests
Assert.DoesNotContain("supports repeated torus/revolved families with mixed line/circle loops; this topology family is still unsupported", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
Assert.DoesNotContain("supports repeated cone/revolved families with mixed line/circle loops; this topology family is still unsupported", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
Assert.DoesNotContain("unsupported subfamily 'other (coedges=3, uniqueEdges=3)'", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
+ Assert.DoesNotContain("unsupported subfamily 'four-coedge bspline-only revolved loop'", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
Assert.StartsWith(expectedMessagePrefix, first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
}
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index 4054b78c..7f46ee87 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 (TryResolveFourUseBsplineOnlyRevolvedLoop(body, coedges, bSplineCoedges, axialParameterFromPoint, faceId, out var bsplineOnlyParameters, out var bsplineOnlyDiagnostics))
+ {
+ return KernelResult<(double, double, int, int)>.Success((
+ bsplineOnlyParameters.VStart,
+ bsplineOnlyParameters.VEnd,
+ CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options),
+ CalculateAxialSegments(bsplineOnlyParameters.VStart, bsplineOnlyParameters.VEnd, options)), bsplineOnlyDiagnostics);
+ }
+
if (TryResolveRepeatedCircleBsplineRevolvedLoop(body, coedges, circleCoedges, bSplineCoedges, axialParameterFromPoint, faceId, out var repeatedCircleBsplineParameters, out var repeatedCircleBsplineDiagnostics))
{
return KernelResult<(double, double, int, int)>.Success((
@@ -785,6 +794,43 @@ public static class BrepDisplayTessellator
return true;
}
+ private static bool TryResolveFourUseBsplineOnlyRevolvedLoop(
+ 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 != 4 || bSplineCoedges.Count != 4 || 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,
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index cf78c084..893e62ec 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -248,7 +248,7 @@
"firstDiagnostic": {
"code": "NotImplemented",
"source": "",
- "messagePrefix": "Face 25 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027four-coedge bspline-only revolved loop\u0027. Observed"
+ "messagePrefix": "Face 27 curved tessellation supports selected repeated torus/revolved boundary subfamilies; unsupported subfamily \u0027other (coedges=6, uniqueEdges=6)\u0027. Observed"
},
"diagnosticCount": 1,
"exceptionEscaped": false,