Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Classify NIST FTC -tg fixture as unsupported in BRep audit corpus
Yuechen Li91609c5e66b9
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242CorpusManifestRunner.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242CorpusManifestRunner.csindex dfc65d23..9df64368 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242CorpusManifestRunner.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242CorpusManifestRunner.cs@@ -14,6 +14,7 @@ namespace Aetheris.Kernel.Core.Tests.Step242;internal static class Step242CorpusManifestRunner{+ private const string NistFtc08TgPath = "testdata/step242/nist/FTC/nist_ftc_08_asme1_ap242-e1-tg.stp";private static readonly Regex PositionInParensRegex = new(@"\(position\s+\d+\)", RegexOptions.CultureInvariant | RegexOptions.Compiled);private static readonly Regex PositionTokenRegex = new(@"position\s+\d+", RegexOptions.CultureInvariant | RegexOptions.Compiled);@@ -54,6 +55,30 @@ internal static class Step242CorpusManifestRunnertry{+ if (string.Equals(entry.Path, NistFtc08TgPath, StringComparison.Ordinal))+ {+ var parse = Step242SubsetParser.Parse(text);+ if (!parse.IsSuccess)+ {+ return BuildAp242Failure(entry, sizeBytes, "parser", parse.Diagnostics);+ }++ if (Step242TessellatedImportLane.HasTessellatedRoot(parse.Value))+ {+ return BuildAp242Failure(+ entry,+ sizeBytes,+ "importer-representation",+ [+ new KernelDiagnostic(+ KernelDiagnosticCode.NotImplemented,+ KernelDiagnosticSeverity.Error,+ "Unsupported tessellation-only STEP geometry: file contains TESSELLATED_SOLID and no exact BRep representation for Aetheris AP242 exact import corpus.",+ "Importer.Representation.Unsupported")+ ]);+ }+ }+var import = Step242Importer.ImportBody(text);if (!import.IsSuccess){diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.csindex d054ecff..4da17d5d 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242ImporterTests.cs@@ -118,23 +118,18 @@ public sealed class Step242ImporterTests}[Fact]- public void NistFtc08Tg_TessellatedVariant_ImportsDeterministically()+ public void NistFtc08Tg_TessellatedVariant_IsClassifiedAsUnsupportedForExactBrepCorpus(){var text = LoadFixture("testdata/step242/nist/FTC/nist_ftc_08_asme1_ap242-e1-tg.stp");+ var parse = Step242SubsetParser.Parse(text);+ Assert.True(parse.IsSuccess);- var first = Step242Importer.ImportBody(text);- var second = Step242Importer.ImportBody(text);-- Assert.True(first.IsSuccess, string.Join(" | ", first.Diagnostics.Select(d => $"{d.Source}: {d.Message}")));- Assert.True(second.IsSuccess, string.Join(" | ", second.Diagnostics.Select(d => $"{d.Source}: {d.Message}")));-- Assert.Equal(first.Value.Topology.Vertices.Count(), second.Value.Topology.Vertices.Count());- Assert.Equal(first.Value.Topology.Edges.Count(), second.Value.Topology.Edges.Count());- Assert.Equal(first.Value.Topology.Faces.Count(), second.Value.Topology.Faces.Count());-- var tessellation = BrepDisplayTessellator.Tessellate(first.Value);- Assert.True(tessellation.IsSuccess);- Assert.NotEmpty(tessellation.Value.FacePatches);+ var import = Step242ExactBRepImportLane.ImportExactBrep(parse.Value);+ Assert.False(import.IsSuccess);+ var diagnostic = Assert.Single(import.Diagnostics);+ Assert.Equal(KernelDiagnosticCode.NotImplemented, diagnostic.Code);+ Assert.Equal("Importer.TopologyRoot", diagnostic.Source);+ Assert.StartsWith("Missing MANIFOLD_SOLID_BREP", diagnostic.Message, StringComparison.Ordinal);}[Fact]diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.csindex 252f8283..a37a85d3 100644--- a/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242NistAuditHarnessTests.cs@@ -85,6 +85,21 @@ public sealed class Step242NistAuditHarnessTestsAssert.Equal(first.DisplayFirstDiagnostic.MessagePrefix, second.DisplayFirstDiagnostic.MessagePrefix);}+ [Fact]+ public void NistCorpus_Ftc08Tg_IsExplicitlyClassifiedAsUnsupportedTessellationOnly()+ {+ const string relativePath = "testdata/step242/nist/FTC/nist_ftc_08_asme1_ap242-e1-tg.stp";+ var entry = BuildNistEntry(relativePath);++ var report = Step242CorpusManifestRunner.RunOne(entry);++ Assert.Equal("importFail", report.Status);+ Assert.Equal("importer-representation", report.FirstFailureLayer);+ Assert.Equal("Importer.Representation.Unsupported", report.FirstDiagnostic.Source);+ Assert.StartsWith("Unsupported tessellation-only STEP geometry", report.FirstDiagnostic.MessagePrefix, StringComparison.Ordinal);+ Assert.Null(report.CanonicalSha256);+ }+public static IEnumerable<object[]> NistCorpusEntries() => GetNistCorpusRelativePaths().Select(path => new object[] { path });private static IReadOnlyList<Step242CorpusManifestEntry> GetNistCorpusEntries() => GetNistCorpusRelativePaths().Select(BuildNistEntry).ToArray();diff --git a/testdata/step242/manifests/nist.v0.report.json b/testdata/step242/manifests/nist.v0.report.jsonindex 1557ab16..5b00ded7 100644--- a/testdata/step242/manifests/nist.v0.report.json+++ b/testdata/step242/manifests/nist.v0.report.json@@ -143,21 +143,21 @@"fileId": "testdata_step242_nist_FTC_nist_ftc_08_asme1_ap242-e1-tg","path": "testdata/step242/nist/FTC/nist_ftc_08_asme1_ap242-e1-tg.stp","sizeBytes": 2120356,- "status": "success",- "firstFailureLayer": "",+ "status": "importFail",+ "firstFailureLayer": "importer-representation","firstDiagnostic": {- "code": "Unknown",- "source": "Audit.None",- "messagePrefix": "No diagnostics."+ "code": "NotImplemented",+ "source": "Importer.Representation.Unsupported",+ "messagePrefix": "Unsupported tessellation-only STEP geometry"},- "diagnosticCount": 0,+ "diagnosticCount": 1,"exceptionEscaped": false,"topologyCounts": {- "vertices": 10083,- "edges": 10083,- "faces": 3361+ "vertices": 0,+ "edges": 0,+ "faces": 0},- "canonicalSha256": "02272208c101eede63651658006f4b483dbabe4d7148654a12dc9e01f8509b19"+ "canonicalSha256": null},{"fileId": "testdata_step242_nist_FTC_nist_ftc_08_asme1_ap242-e2",