Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Support ftc_06 spherical two-coedge bspline surrogate trim
Yuechen Li26915bae73b8
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.csindex a29c00e3..352b2e1f 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242ConicalSurfaceRegressionTests.cs@@ -82,7 +82,7 @@ public sealed class Step242ConicalSurfaceRegressionTests[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", "", "Audit.None", "No diagnostics.")]- [InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "tessellator", "", "Face 12 spherical two-coedge trim classified as unsupported subfamily (requires bi-arc circles; observed edge kinds 'BSp")]+ [InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "", "Audit.None", "No diagnostics.")][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 ")][InlineData("testdata/step242/nist/STC/nist_stc_09_asme1_ap242-e3.stp", "", "", "")]diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.csindex 244c8db3..4a6614f0 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242RevolvedTopologyFamilyRegressionTests.cs@@ -90,7 +90,7 @@ public sealed class Step242RevolvedTopologyFamilyRegressionTests}[Theory]- [InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "Face 12 spherical two-coedge trim classified as unsupported subfamily (requires bi-arc circles; observed edge kinds 'BSp")]+ [InlineData("testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp", "No diagnostics.")][InlineData("testdata/step242/nist/STC/nist_stc_08_asme1_ap242-e3.stp", "No diagnostics.")]public void Step242_RevolvedTopologyFamilyBlockers_StayDeterministic_AndRemainExplicit(string relativePath, string expectedMessagePrefix){diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.csindex 07863ac1..a0f09864 100644--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs@@ -28,6 +28,7 @@ public static class BrepDisplayTessellatorprivate const string SphereTrimSingleCoedgeLatitudeCapSource = "Viewer.Tessellation.SphereTrim.SingleCoedgeLatitudeCap";private const string SphereTrimSingleCoedgeUnsupportedSource = "Viewer.Tessellation.SphereTrim.SingleCoedgeUnsupported";private const string SphereTrimTwoCoedgeBiArcLuneSource = "Viewer.Tessellation.SphereTrim.TwoCoedgeBiArcLune";+ private const string SphereTrimTwoCoedgeBsplineBiArcSurrogateSource = "Viewer.Tessellation.SphereTrim.TwoCoedgeBsplineBiArcSurrogate";private const string SphereTrimTwoCoedgeUnsupportedSource = "Viewer.Tessellation.SphereTrim.TwoCoedgeUnsupported";public static KernelResult<DisplayTessellationResult> Tessellate(BrepBody body, DisplayTessellationOptions? options = null)@@ -1780,11 +1781,13 @@ public static class BrepDisplayTessellatorvar firstCurve = body.GetEdgeCurve(coedges[0].EdgeId);var secondCurve = body.GetEdgeCurve(coedges[1].EdgeId);- if (firstCurve.Kind != CurveGeometryKind.Circle3 || secondCurve.Kind != CurveGeometryKind.Circle3)+ var isBiArcCircleLune = firstCurve.Kind == CurveGeometryKind.Circle3 && secondCurve.Kind == CurveGeometryKind.Circle3;+ var isBsplineBiArcSurrogate = firstCurve.Kind == CurveGeometryKind.BSpline3 && secondCurve.Kind == CurveGeometryKind.BSpline3;+ if (!isBiArcCircleLune && !isBsplineBiArcSurrogate){return KernelResult<(double, double, double, double)>.Failure([CreateNotImplemented(- $"Face {faceId.Value} spherical two-coedge trim classified as unsupported subfamily (requires bi-arc circles; observed edge kinds '{firstCurve.UnsupportedKind ?? firstCurve.Kind.ToString()}' and '{secondCurve.UnsupportedKind ?? secondCurve.Kind.ToString()}').",+ $"Face {faceId.Value} spherical two-coedge trim classified as unsupported subfamily (requires bi-arc circle pair or bspline bi-arc surrogate pair; observed edge kinds '{firstCurve.UnsupportedKind ?? firstCurve.Kind.ToString()}' and '{secondCurve.UnsupportedKind ?? secondCurve.Kind.ToString()}').",SphereTrimTwoCoedgeUnsupportedSource)]);}@@ -1812,11 +1815,20 @@ public static class BrepDisplayTessellatorreturn generalResolution;}+ if (isBiArcCircleLune)+ {+ return KernelResult<(double, double, double, double)>.Success(+ generalResolution.Value,+ [CreateValidationWarning(+ $"Face {faceId.Value} spherical two-coedge trim classified as bi-arc circle lune with two shared vertices (edges {coedges[0].EdgeId.Value}/{coedges[1].EdgeId.Value}).",+ SphereTrimTwoCoedgeBiArcLuneSource)]);+ }+return KernelResult<(double, double, double, double)>.Success(generalResolution.Value,[CreateValidationWarning(- $"Face {faceId.Value} spherical two-coedge trim classified as bi-arc circle lune with two shared vertices (edges {coedges[0].EdgeId.Value}/{coedges[1].EdgeId.Value}).",- SphereTrimTwoCoedgeBiArcLuneSource)]);+ $"Face {faceId.Value} spherical two-coedge trim classified as bspline bi-arc surrogate pair with two shared vertices (edges {coedges[0].EdgeId.Value}/{coedges[1].EdgeId.Value}).",+ SphereTrimTwoCoedgeBsplineBiArcSurrogateSource)]);}private static KernelResult<(double UStart, double USpan, double VStart, double VEnd)> TryResolveGeneralSphereTrimPatch(diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.jsonindex 515a5bb0..6bef5ca5 100644--- a/testdata/step242/manifests/nist.v0.report.json+++ b/testdata/step242/manifests/nist.v0.report.json@@ -123,14 +123,14 @@"fileId": "testdata_step242_nist_FTC_nist_ftc_06_asme1_ap242-e2","path": "testdata/step242/nist/FTC/nist_ftc_06_asme1_ap242-e2.stp","sizeBytes": 1960222,- "status": "importFail",- "firstFailureLayer": "tessellator",+ "status": "success",+ "firstFailureLayer": "","firstDiagnostic": {- "code": "NotImplemented",- "source": "Viewer.Tessellation.SphereTrim.TwoCoedgeUnsupported",- "messagePrefix": "Face 12 spherical two-coedge trim classified as unsupported subfamily (requires bi-arc circles; observed edge kinds \u0027BSp"+ "code": "Unknown",+ "source": "Audit.None",+ "messagePrefix": "No diagnostics."},- "diagnosticCount": 1,+ "diagnosticCount": 0,"exceptionEscaped": false,"topologyCounts": {"vertices": 310,@@ -138,10 +138,10 @@"faces": 187},"tessellationCounts": {- "facePatches": 0,- "edgePolylines": 0+ "facePatches": 187,+ "edgePolylines": 476},- "canonicalSha256": null+ "canonicalSha256": "4c9eee2cc02bff8f4a0eb27f69651214a773d03acab2ed5322cc396ada0592ae"},{"fileId": "testdata_step242_nist_FTC_nist_ftc_07_asme1_ap242-e2",