Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add mixed circle/bspline 3-coedge cone routing and runtime-verified blockers
Yuechen Lie3cac80cbbd6
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.csindex d2eee1b4..50f73344 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 ")]+ [InlineData("testdata/step242/nist/CTC/nist_ctc_04_asme1_ap242-e1.stp", "tessellator", "", "Face 174 curved tessellation does not support this torus/revolved boundary topology yet. Observed")][InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "tessellator", "", "Face 2 curved tessellation does not support this torus/revolved boundary topology yet. Observed")][InlineData("testdata/step242/nist/FTC/nist_ftc_09_asme1_ap242-e1.stp", "tessellator", "", "Face 73 curved tessellation does not support this torus/revolved boundary topology yet. Observed")][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.csindex 1cb9de00..e46c52ff 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs@@ -5,7 +5,7 @@ namespace Aetheris.Kernel.Core.Tests.Step242;public sealed class Step242RevolvedTopologyFamilyRegressionTests{[Theory]- [InlineData("testdata/step242/nist/FTC/nist_ftc_07_asme1_ap242-e2.stp", "Face ")]+ [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 does not support this torus/revolved boundary topology yet. Observed")]public void Step242_RepeatedCurvedRevolvedTargets_AdvanceWithExplicitDeterministicNextBlocker(string relativePath,diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.csindex c7b89cfa..452727ce 100644--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs@@ -619,6 +619,13 @@ public static class BrepDisplayTessellatorreturn KernelResult<(double, double, int, int)>.Success((threeCoedgeBsplineParameters.VStart, threeCoedgeBsplineParameters.VEnd, angularSegments, axialSegments), threeCoedgeBsplineDiagnostics);}+ if (allowThreeCoedgeConeTopology && TryResolveThreeCoedgeMixedCircleBsplineConeLoop(body, coedges, circleCoedges, bSplineCoedges, axialParameterFromPoint, faceId, out var threeCoedgeMixedCircleBsplineParameters, out var threeCoedgeMixedCircleBsplineDiagnostics))+ {+ var angularSegments = CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options);+ var axialSegments = CalculateAxialSegments(threeCoedgeMixedCircleBsplineParameters.VStart, threeCoedgeMixedCircleBsplineParameters.VEnd, options);+ return KernelResult<(double, double, int, int)>.Success((threeCoedgeMixedCircleBsplineParameters.VStart, threeCoedgeMixedCircleBsplineParameters.VEnd, angularSegments, axialSegments), threeCoedgeMixedCircleBsplineDiagnostics);+ }+if (allowThreeCoedgeConeTopology && TryResolveConeRevolvedLoop(body, coedges, lineCoedges, circleCoedges, axialParameterFromPoint, faceId, out var coneRevolvedParameters, out var coneRevolvedDiagnostics)){var angularSegments = CalculateSegmentCount(2d * double.Pi, System.Math.Max(1e-6d, radiusHint), options);@@ -775,6 +782,44 @@ public static class BrepDisplayTessellatorreturn true;}+ private static bool TryResolveThreeCoedgeMixedCircleBsplineConeLoop(+ 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 != 3 || circleCoedges.Count != 1 || bSplineCoedges.Count != 2 || 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 TryResolveThreeCoedgeBsplineConeLoop(BrepBody body,IReadOnlyList<Coedge> coedges,@@ -988,6 +1033,11 @@ public static class BrepDisplayTessellatorreturn "three-coedge cone/revolved bspline loop";}+ if (circleCoedges.Count == 1 && bSplineCoedges.Count == 2 && coedges.Count == 3 && uniqueEdgeIds.Length == 3)+ {+ return "three-coedge cone/revolved mixed circle/bspline loop";+ }+if (lineCoedges.Count == 2 && circleCoedges.Count == 2 && coedges.Count == 4){return "four-coedge mixed line/circle loop";