Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Run M98 with .NET 8 and capture ftc_11 runtime blocker

Yuechen Li631c4de7301f
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
index c0295027..07b8411f 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
@@ -81,6 +81,33 @@ public sealed class Step242LoopRoleNormalizationRegressionTests
Assert.Contains(first, d => d.MajorSeamCrossings > 0 && d.MinorSeamCrossings == 0);
Assert.Contains(first, d => d.RepeatedMajorSeamPointCount == 0 && d.RepeatedMinorSeamPointCount == 0);
Assert.Contains(first, d => d.MajorSpan >= 5.4d && d.MinorSpan <= 1e-8d);
+ Assert.Contains(first, d => d.FullMajorSpanNearConstantMinorCandidate);
+ }
+
+
+ [Fact]
+ public void Step242_NistFtc11_TorusMajorRingDegeneracy_AdvancesPastMinorSpanBlocker_Deterministically()
+ {
+ const string relativePath = "testdata/step242/nist/FTC/nist_ftc_11_asme1_ap242-e2.stp";
+ var entry = new Step242CorpusManifestEntry(
+ Id: Path.GetFileNameWithoutExtension(relativePath),
+ Path: relativePath,
+ Group: "nist-loop-role-regression",
+ Notes: "torus major-ring progression",
+ ExpectedFirstDiagnostic: null,
+ ExpectHashStableAfterCanonicalization: null,
+ ExpectTopologyCounts: null,
+ ExpectGeometryKinds: null);
+
+ var first = Step242CorpusManifestRunner.RunOne(entry);
+ var second = Step242CorpusManifestRunner.RunOne(entry);
+
+ Assert.Equal(first.FirstFailureLayer, second.FirstFailureLayer);
+ Assert.Equal(first.FirstDiagnostic.Source, second.FirstDiagnostic.Source);
+ Assert.Equal(first.FirstDiagnostic.MessagePrefix, second.FirstDiagnostic.MessagePrefix);
+
+ Assert.NotEqual("Importer.LoopRole.TorusDegenerateMinorSpan", first.FirstDiagnostic.Source);
+ Assert.DoesNotContain("TorusDegenerateMinorSpan", first.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);
}
[Theory]
diff --git a/Aetheris.Kernel.Core/Step242/Step242Importer.cs b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
index e954b15c..762ed354 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Importer.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
@@ -1515,6 +1515,8 @@ public static class Step242Importer
}
}
+ var majorRingCandidate = IsToroidalFullMajorRevolutionConstantMinor(analysis);
+
ReportTorusProjectionDiagnostic(new LoopRoleTorusProjectionDiagnostic(
FaceEntityId: faceEntityId,
LoopId: loop.LoopId.Value,
@@ -1529,7 +1531,8 @@ public static class Step242Importer
RepeatedMinorSeamPointCount: analysis.RepeatedMinorSeamPointCount,
Degeneracy: analysis.Degeneracy.ToString(),
InitialDegeneracy: analysisRaw.Degeneracy.ToString(),
- InitialSignedArea: areaRaw));
+ InitialSignedArea: areaRaw,
+ FullMajorSpanNearConstantMinorCandidate: majorRingCandidate));
if (uniqueCount < 3 || double.Abs(area) <= AreaEps)
{
@@ -2229,11 +2232,17 @@ public static class Step242Importer
private static bool IsToroidalFullMajorRevolutionConstantMinor(TorusProjectionAnalysis analysis)
{
- var almostFullMajorTurn = analysis.MajorSpan >= (2d * double.Pi) - 1e-3d;
- var nearConstantMinor = analysis.MinorSpan <= ContainmentEps;
+ var almostFullMajorTurn = analysis.MajorSpan >= (2d * double.Pi) - 1e-3d
+ || analysis.MajorSeamCrossings > 0;
+ var nearConstantMinor = analysis.MinorSpan <= 1e-6d;
+ var supportedDegeneracy = analysis.Degeneracy == TorusProjectionDegeneracy.RepeatedSeamProjectionCollapse
+ || analysis.Degeneracy == TorusProjectionDegeneracy.DegenerateMinorSpan;
+
+ // Major-ring/band boundaries are non-contractible loops that can project as near-zero-area
+ // traces in toroidal UV despite being valid topological boundaries on the surface.
return almostFullMajorTurn
&& nearConstantMinor
- && analysis.Degeneracy == TorusProjectionDegeneracy.RepeatedSeamProjectionCollapse;
+ && supportedDegeneracy;
}
private static TorusProjectionAnalysis AnalyzeToroidalProjection(int uniqueCount, double signedArea, IReadOnlyList<UvPoint> projected)
@@ -2697,7 +2706,8 @@ public static class Step242Importer
int RepeatedMinorSeamPointCount,
string Degeneracy,
string InitialDegeneracy,
- double InitialSignedArea);
+ double InitialSignedArea,
+ bool FullMajorSpanNearConstantMinorCandidate);
private enum CylinderProjectionDegeneracy
{
diff --git a/Aetheris.Kernel.Core/Topology/TopologyGraphValidator.cs b/Aetheris.Kernel.Core/Topology/TopologyGraphValidator.cs
index dabcfa60..1e281bd2 100644
--- a/Aetheris.Kernel.Core/Topology/TopologyGraphValidator.cs
+++ b/Aetheris.Kernel.Core/Topology/TopologyGraphValidator.cs
@@ -123,8 +123,8 @@ public static class TopologyGraphValidator
}
private static KernelDiagnostic Error(string message) =>
- new(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Error, message);
+ new(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Error, message, "Topology.GraphValidator");
private static KernelDiagnostic Warning(string message) =>
- new(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Warning, message);
+ new(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Warning, message, "Topology.GraphValidator");
}
diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.json
index 00c9d052..a0abd040 100644
--- a/testdata/step242/manifests/nist.v0.report.json
+++ b/testdata/step242/manifests/nist.v0.report.json
@@ -199,7 +199,7 @@
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
"code": "ValidationFailed",
- "source": "",
+ "source": "Topology.GraphValidator",
"messagePrefix": "Loop 73 references missing child ID CoedgeId { Value = 342, IsValid = True }."
},
"diagnosticCount": 20,
@@ -271,10 +271,10 @@
"firstFailureLayer": "importer-topology",
"firstDiagnostic": {
"code": "ValidationFailed",
- "source": "Importer.LoopRole.TorusDegenerateMinorSpan",
- "messagePrefix": "Toroidal loop normalization failed"
+ "source": "Topology.GraphValidator",
+ "messagePrefix": "Loop 8 references missing child ID CoedgeId { Value = 38, IsValid = True }."
},
- "diagnosticCount": 1,
+ "diagnosticCount": 6,
"exceptionEscaped": false,
"topologyCounts": {
"vertices": 0,