Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Repair STEP loop connectivity and validate analytic geometry round-trips
Yuechen Lib97b912ffd58
diff --git a/Aetheris.CLI.Tests/CliBaselineTests.cs b/Aetheris.CLI.Tests/CliBaselineTests.csindex dd526dc3..e5b3a8a1 100644--- a/Aetheris.CLI.Tests/CliBaselineTests.cs+++ b/Aetheris.CLI.Tests/CliBaselineTests.cs@@ -718,7 +718,9 @@ public sealed class CliBaselineTestsAssert.True(root.GetProperty("summary").GetProperty("analyticHitCount").GetInt32() > 0);Assert.Equal(0, root.GetProperty("summary").GetProperty("tessellatedFallbackHitCount").GetInt32());var hits = root.GetProperty("hits").EnumerateArray().Where(h => h.GetProperty("surfaceFamily").GetString() == "torus").ToArray();- Assert.Single(hits);+ // The exact full-torus bounds now start the probe outside the tube, so the+ // ray correctly observes both the entering and exiting intersections.+ Assert.Equal(2, hits.Length);Assert.All(hits, hit =>{Assert.Equal("analytic", hit.GetProperty("intersectionMode").GetString());diff --git a/Aetheris.CLI.Tests/StepAnalyzerTorusBoundsTests.cs b/Aetheris.CLI.Tests/StepAnalyzerTorusBoundsTests.csnew file mode 100644index 00000000..3437ce01--- /dev/null+++ b/Aetheris.CLI.Tests/StepAnalyzerTorusBoundsTests.cs@@ -0,0 +1,37 @@+using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Core.Step242;++namespace Aetheris.CLI.Tests;++public sealed class StepAnalyzerTorusBoundsTests+{+ [Fact]+ public void Analyze_ReimportedFullTorus_ReportsAnalyticBoundsInsteadOfSeamVertexBounds()+ {+ var torus = BrepPrimitives.CreateTorus(10d, 3d);+ Assert.True(torus.IsSuccess);++ var export = Step242Exporter.ExportBody(torus.Value);+ Assert.True(export.IsSuccess);++ var path = Path.Combine(Path.GetTempPath(), $"aetheris-torus-bounds-{Guid.NewGuid():N}.step");+ try+ {+ File.WriteAllText(path, export.Value);++ var analysis = StepAnalyzer.Analyze(path);++ Assert.NotNull(analysis.Summary.BoundingBox);+ Assert.Equal(-13d, analysis.Summary.BoundingBox!.Value.Min.X, 9);+ Assert.Equal(-3d, analysis.Summary.BoundingBox.Value.Min.Y, 9);+ Assert.Equal(-13d, analysis.Summary.BoundingBox.Value.Min.Z, 9);+ Assert.Equal(13d, analysis.Summary.BoundingBox.Value.Max.X, 9);+ Assert.Equal(3d, analysis.Summary.BoundingBox.Value.Max.Y, 9);+ Assert.Equal(13d, analysis.Summary.BoundingBox.Value.Max.Z, 9);+ }+ finally+ {+ File.Delete(path);+ }+ }+}diff --git a/Aetheris.CLI/StepAnalyzer.cs b/Aetheris.CLI/StepAnalyzer.csindex 493097e7..233e2ef9 100644--- a/Aetheris.CLI/StepAnalyzer.cs+++ b/Aetheris.CLI/StepAnalyzer.cs@@ -1878,6 +1878,27 @@ public sealed record VolumeAnalysisResult(points.Add(new Point3D(circle.Center.X + dx, circle.Center.Y + dy, circle.Center.Z + dz));}+ // A full torus is periodic in both parameters. Its seam vertices (and even its+ // circular seam edges) do not reach the extrema of the body, so a vertex-only+ // box can collapse to a point after STEP reimport. Include the exact world-axis+ // extrema only for faces whose boundary is made entirely of full circular seams.+ foreach (var face in body.Topology.Faces)+ {+ if (!body.TryGetFaceSurface(face.Id, out var surface)+ || surface?.Torus is not { } torus+ || !IsFullPeriodicTorusFace(body, face.Id))+ {+ continue;+ }++ var axis = torus.Axis.ToVector();+ var xExtent = (torus.MajorRadius * Math.Sqrt(Math.Max(0d, 1d - (axis.X * axis.X)))) + torus.MinorRadius;+ var yExtent = (torus.MajorRadius * Math.Sqrt(Math.Max(0d, 1d - (axis.Y * axis.Y)))) + torus.MinorRadius;+ var zExtent = (torus.MajorRadius * Math.Sqrt(Math.Max(0d, 1d - (axis.Z * axis.Z)))) + torus.MinorRadius;+ points.Add(new Point3D(torus.Center.X - xExtent, torus.Center.Y - yExtent, torus.Center.Z - zExtent));+ points.Add(new Point3D(torus.Center.X + xExtent, torus.Center.Y + yExtent, torus.Center.Z + zExtent));+ }+if (points.Count > 0){return ComputeBoundingBox(points);@@ -1907,6 +1928,35 @@ public sealed record VolumeAnalysisResult(new Point3D(sphereBounds.Max(b => b.Max.X), sphereBounds.Max(b => b.Max.Y), sphereBounds.Max(b => b.Max.Z)));}+ private static bool IsFullPeriodicTorusFace(BrepBody body, FaceId faceId)+ {+ var edgeIds = body.GetLoopIds(faceId)+ .SelectMany(loopId => body.GetCoedgeIds(loopId))+ .Select(coedgeId => body.Topology.GetCoedge(coedgeId))+ .Select(coedge => coedge.EdgeId)+ .Distinct()+ .ToArray();++ if (edgeIds.Length == 0)+ {+ return false;+ }++ foreach (var edgeId in edgeIds)+ {+ if (!body.Bindings.TryGetEdgeBinding(edgeId, out var binding)+ || binding.TrimInterval is not { } interval+ || Math.Abs(Math.Abs(interval.End - interval.Start) - (2d * Math.PI)) > 1e-9d+ || !body.Geometry.TryGetCurve(binding.CurveGeometryId, out var curve)+ || curve?.Circle3 is null)+ {+ return false;+ }+ }++ return true;+ }+private static BoundingBox3D ComputeBoundingBox(IReadOnlyList<Point3D> points){var minX = points.Min(p => p.X);diff --git a/Aetheris.Kernel.Core.Tests/Brep/Surgery/BrepSurgeryRecipeParityTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Surgery/BrepSurgeryRecipeParityTests.csindex f5ad1b17..748d8825 100644--- a/Aetheris.Kernel.Core.Tests/Brep/Surgery/BrepSurgeryRecipeParityTests.cs+++ b/Aetheris.Kernel.Core.Tests/Brep/Surgery/BrepSurgeryRecipeParityTests.cs@@ -2,6 +2,7 @@ using System.Security.Cryptography;using System.Text;using Aetheris.Kernel.Core.Brep;using Aetheris.Kernel.Core.Brep.Boolean;+using Aetheris.Kernel.Core.Brep.Verification;using Aetheris.Kernel.Core.Step242;using Aetheris.Kernel.StandardLibrary;@@ -17,7 +18,7 @@ public sealed class BrepSurgeryRecipeParityTestsnew AxisAlignedBoxExtents(2d, 4d, 0d, 2d, 0d, 1d),]).Value;- AssertCanonical(body, 8, 12, 6, "09e6b8d838d08748d60fe6f08f0bfcb09282eb983d26d6fc51956cf5e8828de2");+ AssertCanonical(body, 8, 12, 6, "39692ac0ea3c48d9f2f6fb1155e3b494c1b946bf56cd8dd2ade2c9005cd38048", expectClosedManifold: true);}[Fact]@@ -28,7 +29,7 @@ public sealed class BrepSurgeryRecipeParityTestsnew AxisAlignedBoxExtents(5d, 15d, -3d, 3d, -45d, 45d)).Value;var body = BrepBoolean.Subtract(shaft, tool).Value;- AssertCanonical(body, 8, 12, 6, "b91443673ab595a0449e91359aa697ae597a03efdb90d7394ac937107e25ae98");+ AssertCanonical(body, 8, 12, 6, "7eb11479eaa1e14a51d1d60d8fc16f0521d80bd05203cf4aad400846298b605b", expectClosedManifold: true);}[Fact]@@ -41,7 +42,7 @@ public sealed class BrepSurgeryRecipeParityTestsAssertCanonical(body, 128, 192, 66, "8554faf173a41abeb15facbeb2bd3cceb4f2ea486d6aa1e1b11c0740b922fe7d");}- private static void AssertCanonical(BrepBody body, int vertices, int edges, int faces, string expectedStepSha256)+ private static void AssertCanonical(BrepBody body, int vertices, int edges, int faces, string expectedStepSha256, bool expectClosedManifold = false){Assert.Equal(vertices, body.Topology.Vertices.Count());Assert.Equal(edges, body.Topology.Edges.Count());@@ -59,6 +60,12 @@ public sealed class BrepSurgeryRecipeParityTestsvar reimport = Step242Importer.ImportBody(export.Value);Assert.True(reimport.IsSuccess, string.Join(Environment.NewLine, reimport.Diagnostics.Select(diagnostic => diagnostic.Message)));Assert.True(BrepBindingValidator.Validate(reimport.Value, requireAllEdgeAndFaceBindings: true).IsSuccess);+ if (expectClosedManifold)+ {+ var mass = BrepMassProperties.Evaluate(reimport.Value);+ Assert.True(mass.IsEnclosed, string.Join(Environment.NewLine, mass.Diagnostics));+ Assert.True(mass.IsOrientationConsistent, string.Join(Environment.NewLine, mass.Diagnostics));+ }}private static string Sha256(string value)diff --git a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs b/Aetheris.Kernel.Core/Step242/Step242Exporter.csindex d3351664..650e3114 100644--- a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs+++ b/Aetheris.Kernel.Core/Step242/Step242Exporter.cs@@ -205,9 +205,9 @@ public static class Step242Exporter// Loop.CoedgeIds is the authoritative cyclic order. Sorting this list can// silently turn a coherent loop into a disconnected STEP EDGE_LOOP.- foreach (var coedgeId in loop.CoedgeIds)+ foreach (var loopUse in ResolveConnectedLoopUses(body, model, loop)){- var coedge = model.GetCoedge(coedgeId);+ var coedge = loopUse.Coedge;if (!edgeCurveIds.TryGetValue(coedge.EdgeId, out var edgeCurveId)){@@ -227,9 +227,9 @@ public static class Step242Exporter"$","$",Step242TextWriter.Ref(edgeCurveId),- Step242TextWriter.BooleanLogical(!coedge.IsReversed));+ Step242TextWriter.BooleanLogical(!loopUse.IsReversed));- orientedEdgeIds[coedgeId] = orientedEdgeId;+ orientedEdgeIds[coedge.Id] = orientedEdgeId;oriented.Add(orientedEdgeId);}@@ -253,6 +253,137 @@ public static class Step242Exporterreturn writer.AddEntity("CLOSED_SHELL", "$", Step242TextWriter.List(faceIds.ToArray()));}+ private static IReadOnlyList<StepLoopUse> ResolveConnectedLoopUses(BrepBody body, TopologyModel model, Loop loop)+ {+ var authored = loop.CoedgeIds+ .Select(model.GetCoedge)+ .Select(coedge => new StepLoopUse(coedge, coedge.IsReversed))+ .ToArray();+ if (IsConnectedCycle(body, model, authored))+ {+ return authored;+ }++ // Some valid analytic constructions intentionally use distinct seam vertices+ // at the same point. A malformed authored ordering must never be emitted as a+ // disconnected STEP EDGE_LOOP, so reconnect it by geometric endpoint identity.+ // Keep the repair bounded: unusually large malformed loops are rejected by the+ // normal export preflight instead of spending factorial time searching a cycle.+ if (authored.Length > 16)+ {+ return authored;+ }++ for (var startIndex = 0; startIndex < authored.Length; startIndex++)+ {+ foreach (var startReversed in OrderedDirections(authored[startIndex]))+ {+ var candidate = new List<StepLoopUse>(authored.Length)+ {+ authored[startIndex] with { IsReversed = startReversed }+ };+ var used = new bool[authored.Length];+ used[startIndex] = true;+ if (TryBuildConnectedCycle(body, model, authored, used, candidate))+ {+ return candidate;+ }+ }+ }++ // Keep the exact authored sequence when no geometrically closed traversal+ // exists. Export preflight will then reject the body rather than disguising it.+ return authored;+ }++ private static bool TryBuildConnectedCycle(+ BrepBody body,+ TopologyModel model,+ IReadOnlyList<StepLoopUse> authored,+ bool[] used,+ List<StepLoopUse> candidate)+ {+ if (candidate.Count == authored.Count)+ {+ return VerticesCoincide(body, EndVertex(model, candidate[^1]), StartVertex(model, candidate[0]));+ }++ var requiredStart = EndVertex(model, candidate[^1]);+ for (var index = 0; index < authored.Count; index++)+ {+ if (used[index])+ {+ continue;+ }++ foreach (var reversed in OrderedDirections(authored[index]))+ {+ var next = authored[index] with { IsReversed = reversed };+ if (!VerticesCoincide(body, requiredStart, StartVertex(model, next)))+ {+ continue;+ }++ used[index] = true;+ candidate.Add(next);+ if (TryBuildConnectedCycle(body, model, authored, used, candidate))+ {+ return true;+ }++ candidate.RemoveAt(candidate.Count - 1);+ used[index] = false;+ }+ }++ return false;+ }++ private static IEnumerable<bool> OrderedDirections(StepLoopUse use)+ {+ yield return use.IsReversed;+ yield return !use.IsReversed;+ }++ private static bool IsConnectedCycle(BrepBody body, TopologyModel model, IReadOnlyList<StepLoopUse> uses)+ {+ for (var index = 0; index < uses.Count; index++)+ {+ if (!VerticesCoincide(body, EndVertex(model, uses[index]), StartVertex(model, uses[(index + 1) % uses.Count])))+ {+ return false;+ }+ }++ return true;+ }++ private static VertexId StartVertex(TopologyModel model, StepLoopUse use)+ {+ var edge = model.GetEdge(use.Coedge.EdgeId);+ return use.IsReversed ? edge.EndVertexId : edge.StartVertexId;+ }++ private static VertexId EndVertex(TopologyModel model, StepLoopUse use)+ {+ var edge = model.GetEdge(use.Coedge.EdgeId);+ return use.IsReversed ? edge.StartVertexId : edge.EndVertexId;+ }++ private static bool VerticesCoincide(BrepBody body, VertexId left, VertexId right)+ {+ if (left == right)+ {+ return true;+ }++ return body.TryGetVertexPoint(left, out var a)+ && body.TryGetVertexPoint(right, out var b)+ && (a - b).Length <= 1e-9d;+ }++ private sealed record StepLoopUse(Coedge Coedge, bool IsReversed);+private static void EmitSemanticPmi(Step242TextWriter writer,string shapeId,diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.csindex feeed600..fb204575 100644--- a/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs@@ -1,5 +1,6 @@using Aetheris.Kernel.Firmament.FirmamentV2;using Aetheris.Kernel.Core.Step242;+using Aetheris.Kernel.Core.Brep.Verification;namespace Aetheris.Kernel.Firmament.Tests;@@ -102,6 +103,28 @@ public sealed class FirmamentV2CanonicalGrammarTests}}+ [Fact]+ public void CanonicalCounterbore_ReimportsAsAnEnclosedManifold()+ {+ var output = Path.Combine(Path.GetTempPath(), $"aetheris-canonical-counterbore-{Guid.NewGuid():N}.step");+ try+ {+ var build = FirmamentBuildAndExport.Run(Fixture("counterbore-hole.firmament"), output);+ Assert.True(build.IsSuccess, string.Join(Environment.NewLine, build.Diagnostics.Select(d => d.Message)));++ var imported = Step242Importer.ImportBody(File.ReadAllText(output));+ Assert.True(imported.IsSuccess, string.Join(Environment.NewLine, imported.Diagnostics.Select(d => d.Message)));++ var mass = BrepMassProperties.Evaluate(imported.Value);+ Assert.True(mass.IsEnclosed, string.Join(Environment.NewLine, mass.Diagnostics));+ Assert.True(mass.IsOrientationConsistent, string.Join(Environment.NewLine, mass.Diagnostics));+ }+ finally+ {+ if (File.Exists(output)) File.Delete(output);+ }+ }+[Fact]public void CanonicalPoint2_RejectsTheLegacyBracketLiteralWithASpecificDiagnostic(){diff --git a/docs/public/firmament/geometry.md b/docs/public/firmament/geometry.mdindex 28a77d3a..2e2fccb2 100644--- a/docs/public/firmament/geometry.md+++ b/docs/public/firmament/geometry.md@@ -2,6 +2,10 @@Preview 3 supports bounded production routes, not an unrestricted general-purpose CAD kernel. Public native examples cover Box, Cylinder, Frustum, RoundedBox, line/arc profile extrusion and composition, semantic shaft/counterbore/countersink holes, slots, patterns, selected chamfer/fillet routes, hollow bodies, and a bounded cubic lattice. Consult the [support matrix](../reference/supported-features.md) before relying on a combination.+The V2 compiler also qualifies parser-backed analytic single-solid source using `model` / `solid`: `Sphere`, `Cone` (including a pointed zero-radius end), and `Torus`. Those forms round-trip as analytic AP242 surfaces, but they do not imply arbitrary boolean or profile-composition support. Use the qualified [sphere](../../../fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmament), [pointed cone](../../../fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmament), and [torus](../../../fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmament) sources as the boundary examples.+Use named features and selectors, never raw internal B-rep IDs in native authoring. [`box-holes-pmi-chamfer.firmament`](../../../fixtures/FirmamentV2/Canonical/valid/box-holes-pmi-chamfer.firmament) demonstrates two holes, an outer-boundary chamfer, and PMI surviving the same AP242 build. [`profile-compose-l-bracket-counterbore-pmi.firmament`](../../../fixtures/FirmamentV2/Canonical/valid/profile-compose-l-bracket-counterbore-pmi.firmament) demonstrates a profile-composed part, pattern holes, a counterbore, a chamfer, and shaft-diameter PMI.`HoleDiameter` on a `Hole<Counterbore>` targets the shaft `Diameter`; `CounterboreDiameter` remains a distinct feature field and has no separate public PMI record kind in Preview 3. Pattern generation supports geometry as a semantic whole; authored names for generated instances are not a stable public instance-selector family in Preview 3.++Profile `Compose` supplies the bounded raised-pad and shallow-pocket routes. It is the current V2 answer for those prismatic cases, not a general-purpose Boss/Pocket command or arbitrary solid boolean. Sheet Metal has its own `Hole Name` syntax for planar circular openings; countersink and counterbore forms are Model-domain features and deliberately fail in Sheet Metal rather than being ignored.diff --git a/docs/public/reference/supported-features.md b/docs/public/reference/supported-features.mdindex c5563e34..d86c0e0d 100644--- a/docs/public/reference/supported-features.md+++ b/docs/public/reference/supported-features.md@@ -4,14 +4,16 @@| Area | Status | Preview 3 boundary ||---|---|---|-| Firmament V2 primitives/profiles | Bounded | Named Box/Cylinder/Frustum/RoundedBox and admitted line/arc profile construction/composition |+| Firmament V2 native primitives/profiles | Bounded | Named Box/Cylinder/Frustum/RoundedBox and admitted line/arc profile construction/composition |+| Firmament V2 analytic `model` / `solid` primitives | Bounded | Parser-backed single-solid Sphere, Cone (including zero-radius pointed end), and Torus routes round-trip through AP242; this is not a general boolean/composition promise |+| Profile-composed pads and pockets | Bounded | Admitted prismatic `Compose` `Add`/`Remove` profile operations; no universal named Boss/Pocket feature or arbitrary solid boolean || Semantic holes, slots, patterns | Bounded | Qualified shaft/counterbore/countersink and finite static pattern routes; no stable generated-instance selector || Edge finishes/hollow/lattice | Bounded | Documented admitted chamfer/fillet, hollow, and cubic-truss routes; not arbitrary topology || Templates/Records/Static/Tables | Supported | Typed compile-time specialization, finite data, `with`, and `Require` || STEP AP242 export | Bounded | Deterministic single-body routes plus semantic PMI; unsupported intent fails loudly || STEP import / inlineSTEP | Bounded | Canonical single-body topology and recognized identities; arbitrary containment and multi-root bodies are not native-part promises || PMI authoring | Bounded | Plane Datum and toleranced shaft HoleDiameter AP242 export; broader PMI families are deferred |-| Sheet Metal authoring | Bounded | Base/flanges/bends/holes/cuts, formed STEP, flat STEP/SVG, K-factor, DFM, semantic regions |+| Sheet Metal authoring | Bounded | Base/flanges/bends and planar circular holes/cuts, formed STEP, flat STEP/SVG, K-factor, DFM, semantic regions; Model `Hole<Counterbore>` / `Hole<Countersink>` syntax is rejected || Sheet Metal reconstruction | Experimental | Bounded recognition/recovery with explicit partial status and evidence || Materials | Supported | Four deployed Standard Library catalog entries || FEA | Bounded | LinearElasticIsotropic cut-cell/vector-lattice, Fixed, total-resultant Force, four result families; no nonlinear/contact/dynamics |@@ -21,3 +23,4 @@| Platform qualification | Supported | Windows x64 bundle; NativeAOT Forge Host on `win-x64` || Linux/macOS release binaries | Not in Preview 3 | Framework logic tests do not constitute binary qualification || New geometry/PMI/FEA/Forge families | Not in Preview 3 | Feature-frozen until after Preview 3 |+| General loft, helix, and freeform surface features | Not in Preview 3 | No public native V2 authoring and qualification route |diff --git a/docs/release/PREVIEW3-HARDEN-A3.md b/docs/release/PREVIEW3-HARDEN-A3.mdnew file mode 100644index 00000000..fb073827--- /dev/null+++ b/docs/release/PREVIEW3-HARDEN-A3.md@@ -0,0 +1,91 @@+# PREVIEW3-HARDEN-A3 — Normal CAD friction test and geometry/STEP qualification++> Development hardening report. This is release evidence, not the user manual. The public contract is [the Preview 3 support matrix](../public/reference/supported-features.md) and [Firmament V2 geometry guide](../public/firmament/geometry.md).++## Outcome++A3 reached Success for the bounded Firmament **V2** CAD surface. The investigation intentionally excludes the sunset V1 FrictionLab authoring surface. Fresh V2 sources built through the public CLI, emitted AP242, and reimported as enclosed manifolds for analytic primitives, normal holes, a practical mounting plate, and formed/flat sheet metal.++This is a qualified bounded CAD workflow, not an unrestricted general CAD claim. In particular, V2 has no general loft/helix/freeform route, no arbitrary boolean promise, and Sheet Metal accepts its own planar `Hole Name` form rather than Model counterbore/countersink syntax.++## Execution discipline++The sources below were authored as new A3 witnesses, then run with `aetheris build --json`, `aetheris analyze --json`, and where appropriate `aetheris verify --json` and `aetheris sheetmetal flatten --json`. Artifacts are generated under ignored `artifacts/a3`; the checked-in source fixtures are the reproducible corpus.++| Fresh V2 witness | Intent | Result |+|---|---|---|+| [`a3-sphere-step-qualified.firmament`](../../fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmament) | 7.5 mm analytic sphere | one sphere face, enclosed manifold, bounds ±7.5 mm |+| [`a3-pointed-cone-step-qualified.firmament`](../../fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmament) | 6 mm radius, 18 mm pointed cone | plane + cone, enclosed manifold, apex retained |+| [`a3-torus-step-qualified.firmament`](../../fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmament) | 12/3 mm major/minor-radius torus | one torus face, enclosed manifold, bounds x/z ±15 mm and y ±3 mm |+| [`a3-blind-shaft-hole.firmament`](../../fixtures/FirmamentV2/Canonical/valid/a3-blind-shaft-hole.firmament) | blind 8 mm shaft hole in 60 × 40 × 20 mm block | one cylindrical shaft face; enclosed, orientation-consistent reimport |+| [`a3-counterbore-hole.firmament`](../../fixtures/FirmamentV2/Canonical/valid/a3-counterbore-hole.firmament) | through 6 mm shaft with 12 × 5 mm counterbore | two cylinders, nine faces, enclosed manifold |+| [`a3-countersink-hole.firmament`](../../fixtures/FirmamentV2/Canonical/valid/a3-countersink-hole.firmament) | through 6 mm shaft with 14 mm, 90° countersink | cylinder + cone, eight faces, enclosed manifold |+| [`a3-mounting-plate.firmament`](../../fixtures/FirmamentV2/Canonical/valid/a3-mounting-plate.firmament) | four through holes, boundary chamfer, datum and diameter PMI | `CombinedHoleEdgeFinish`, 14 faces/4 cylinders, AP242 PMI evidence, reimported manifold |+| [`a3-two-hole-l-bracket.firmament`](../../fixtures/FirmamentV2/SheetMetal/a3-two-hole-l-bracket.firmament) | two-hole L bracket | formed STEP: 3 regions, 1 bend, 2 cuts; flat STEP/SVG: valid exact contours and DFM pass |++The negative companion [`a3-countersink-wrong-domain.invalid.firmfixture`](../../fixtures/FirmamentV2/SheetMetal/invalid/a3-countersink-wrong-domain.invalid.firmfixture) fails with `sheetmetal-hole-domain-syntax`, directing the author to canonical Sheet Metal `Hole Name` syntax. There is no silent feature loss.++## Geometry and feature matrix++| Requested normal-CAD case | V2 result | Classification | Qualification boundary |+|---|---|---|---|+| Box / cylinder / frustum | clean | Supported | documented native V2 primitives |+| Sphere | clean | Bounded | parser-backed analytic single solid; exact sphere AP242 face |+| Pointed cone | clean | Bounded | `Cone` with one zero radius; exact cone + plane AP242 faces |+| Normal torus | clean | Bounded | parser-backed analytic single solid; exact torus AP242 face and corrected full-period bounds |+| Raised pad / boss | clean for prismatic profile composition | Bounded | `Compose Add` profile route; no universal named boss or arbitrary union |+| Pocket | clean for prismatic profile composition and semantic slot | Bounded | `Compose Remove` and admitted slot routes; no arbitrary pocket topology |+| Through and blind shaft holes | clean | Supported | semantic `Hole<Shaft>` on admitted Model host faces |+| Counterbore / countersink | clean in Model domain | Bounded | semantic through-hole stack routes; reimported manifold evidence |+| Chamfer / fillet | clean for admitted named selections | Bounded | boundary chamfer and qualified convex profile fillet; not arbitrary topology |+| Sheet-metal circular opening | clean | Bounded | canonical Sheet Metal `Hole Name` produces formed and flat exact-contour evidence |+| Sheet-metal countersink / counterbore | rejected loudly | DeferredFeature | no Sheet Metal feature family; Model-domain form is explicitly diagnosed |+| Hemispherical recessed feature | no native V2 route | DeferredPostPreview3 | lacks an admitted spherical subtraction/composition path |+| Loft / helix / freeform surface | no native V2 route | DeferredPostPreview3 | no public parser, materializer, or AP242 qualification path |++## Combination matrix++| Combination | Status | Evidence |+|---|---|---|+| Four holes + outer chamfer + PMI | Clean | A3 mounting plate reports four hole feature witnesses, one chamfer descendant, one datum and one diameter PMI record; STEP reimport succeeds. |+| Counterbore stack | Clean after fix | Fresh A3 witness reports counterbore + shaft, two cylinders, and an enclosed 9-face reimport. |+| Countersink stack | Clean | Fresh A3 witness reports cone + shaft, one cone/one cylinder, and an enclosed 8-face reimport. |+| Profile fillet and semantic capsule slot | Clean | Existing V2 canonical bounded witnesses build to STEP through real CLI routes. |+| L bracket + two circular openings + flatten | Clean | Fresh A3 witness reports 1 bend/2 cuts; flatten writes valid exact-contour STEP and SVG, DFM Pass. |++## Findings and disposition++| Finding | Classification | Resolution |+|---|---|---|+| V2 counterbore emitted disconnected STEP `EDGE_LOOP` ordering even though build reported a reimport | ReleaseBlocker | `Step242Exporter` now preserves coherent authored order and otherwise deterministically reconnects a small seam-equivalent cycle. If no cycle exists, preflight remains authoritative and rejects it. The public canonical counterbore has a reimported-manifold regression. |+| Full periodic torus inspection used seam vertices as its bounds | MustFix | `StepAnalyzer` now contributes exact full-torus analytic extents; regression asserts the true 26 × 6 × 26 mm bounds for the qualified torus orientation. |+| Public V2 geometry page omitted working parser-backed analytic V2 primitives | DocsFix | Public support and geometry pages now state the bounded `model` / `solid` Sphere, pointed-Cone, and Torus route and link fresh fixtures. |+| Sheet Metal counterbore/countersink could be confused with Model holes | DocumentForPreview | The explicit V2 diagnostic and public matrix now state that only planar Sheet Metal `Hole Name` openings are admitted. |++The loop repair is intentionally bounded to 16 coedges only after authored order is found disconnected. That makes the repair deterministic and avoids factorial recovery work on malformed large loops; unsupported topology continues to fail instead of being cosmetically exported.++## Result semantics++`build` success is not considered sufficient evidence here. Each positive geometry witness has a real AP242 artifact and `analyze` reports one body, one shell, `enclosed-manifold`, and the expected analytic surface family. `verify` additionally reported enclosed and orientation-consistent mass topology for sphere, torus, blind shaft, counterbore, countersink, mounting plate, and sheet-metal formed output. No external CAD assistant was requested; this report claims kernel STEP reimport, not third-party CAD certification.++## Regression coverage++- `FirmamentV2CanonicalGrammarTests.CanonicalCounterbore_ReimportsAsAnEnclosedManifold` guards the public canonical counterbore path.+- `StepAnalyzerTorusBoundsTests` creates, exports, imports, and verifies full analytic torus bounds.+- Updated surgery STEP golden hashes prove deterministic repaired-loop output for orthogonal-union and cylinder-keyway routes, and now require enclosed, orientation-consistent reimport for both.+- The fresh A3 source corpus preserves user-intent cases instead of retaining generated STEP output.+- The negative Sheet Metal fixture preserves the countersink wrong-domain diagnostic.++## Validation++Focused validation completed before the final full suite:++- `dotnet build Aetheris.CLI/Aetheris.CLI.csproj -c Release --no-restore`+- focused CLI and kernel tests for the new counterbore reimport and torus bounds+- real CLI build/analyze/verify matrix for the fresh corpus, plus Sheet Metal flatten to STEP and SVG+- deterministic rerun comparison for the counterbore artifact++- Release build: `dotnet build Aetheris.slnx -c Release --no-restore` passed with 0 warnings and 0 errors.+- Full serial .NET suite (`Category!=SlowCorpus`): 2,972 passed, 0 failed across the discoverable test assemblies. The sunset FrictionLab test project has no matching tests in that default filter.+- Counterbore deterministic rerun: both AP242 artifacts had SHA-256 `A3CD89525DFB88B7E79450431FA965AE7428CF9D6F78825F150D82A7F13215A7`.+- `git diff --check`: passed.diff --git a/fixtures/FirmamentV2/Canonical/valid/a3-blind-shaft-hole.firmament b/fixtures/FirmamentV2/Canonical/valid/a3-blind-shaft-hole.firmamentnew file mode 100644index 00000000..fbf32e20--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/valid/a3-blind-shaft-hole.firmament@@ -0,0 +1,16 @@+Model A3BlindShaftHole {+ Units: mm++ Box Base {+ Size: [60mm, 40mm, 20mm]+ }++ Modify Base {+ Hole<Shaft> BlindMount {+ On: +Z+ Center: Point2(0mm, 0mm)+ Diameter: 8mm+ End: Blind 10mm+ }+ }+}diff --git a/fixtures/FirmamentV2/Canonical/valid/a3-counterbore-hole.firmament b/fixtures/FirmamentV2/Canonical/valid/a3-counterbore-hole.firmamentnew file mode 100644index 00000000..86a5187a--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/valid/a3-counterbore-hole.firmament@@ -0,0 +1,16 @@+Model A3CounterboreHole {+ Units: mm++ Box Base { Size: [70mm, 45mm, 18mm] }++ Modify Base {+ Hole<Counterbore> Mount {+ On: +Z+ Center: Point2(0mm, 0mm)+ Diameter: 6mm+ CounterboreDiameter: 12mm+ CounterboreDepth: 5mm+ End: ThroughAll+ }+ }+}diff --git a/fixtures/FirmamentV2/Canonical/valid/a3-countersink-hole.firmament b/fixtures/FirmamentV2/Canonical/valid/a3-countersink-hole.firmamentnew file mode 100644index 00000000..01a1a612--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/valid/a3-countersink-hole.firmament@@ -0,0 +1,16 @@+Model A3CountersinkHole {+ Units: mm++ Box Base { Size: [70mm, 45mm, 18mm] }++ Modify Base {+ Hole<Countersink> Mount {+ On: +Z+ Center: Point2(0mm, 0mm)+ Diameter: 6mm+ CountersinkDiameter: 14mm+ CountersinkAngle: 90deg+ End: ThroughAll+ }+ }+}diff --git a/fixtures/FirmamentV2/Canonical/valid/a3-mounting-plate.firmament b/fixtures/FirmamentV2/Canonical/valid/a3-mounting-plate.firmamentnew file mode 100644index 00000000..ddb0db33--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/valid/a3-mounting-plate.firmament@@ -0,0 +1,23 @@+Model A3MountingPlate {+ Units: mm++ Box Plate { Size: [100mm, 70mm, 10mm] }++ Modify Plate {+ Hole<Shaft> MountNorthWest { On: +Z Center: Point2(-35mm, 20mm) Diameter: 8mm End: ThroughAll }+ Hole<Shaft> MountNorthEast { On: +Z Center: Point2(35mm, 20mm) Diameter: 8mm End: ThroughAll }+ Hole<Shaft> MountSouthWest { On: +Z Center: Point2(-35mm, -20mm) Diameter: 8mm End: ThroughAll }+ Hole<Shaft> MountSouthEast { On: +Z Center: Point2(35mm, -20mm) Diameter: 8mm End: ThroughAll }+ EdgeFinish TopBreak { Face: +Z Target: Boundary Kind: Chamfer Distance: 1mm }+ }++ Pmi {+ Datum A { Target: face(+Z) }+ HoleDiameter MountNorthWestDiameter {+ Target: MountNorthWest+ Value: 8mm+ Tolerance: PlusMinus(0.10mm, 0.00mm)+ DatumRefs: [A]+ }+ }+}diff --git a/fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmament b/fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmamentnew file mode 100644index 00000000..79a60127--- /dev/null+++ b/fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmament@@ -0,0 +1,9 @@+model A3PointedCone {+ units mm++ solid body: Cone {+ bottomRadius: 6mm+ topRadius: 0mm+ height: 18mm+ }+}diff --git a/fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmament b/fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmamentnew file mode 100644index 00000000..177b9923--- /dev/null+++ b/fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmament@@ -0,0 +1,7 @@+model A3Sphere {+ units mm++ solid body: Sphere {+ radius: 7.5mm+ }+}diff --git a/fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmament b/fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmamentnew file mode 100644index 00000000..324f8e9b--- /dev/null+++ b/fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmament@@ -0,0 +1,8 @@+model A3Torus {+ units mm++ solid body: Torus {+ majorRadius: 12mm+ minorRadius: 3mm+ }+}diff --git a/fixtures/FirmamentV2/SheetMetal/a3-two-hole-l-bracket.firmament b/fixtures/FirmamentV2/SheetMetal/a3-two-hole-l-bracket.firmamentnew file mode 100644index 00000000..131c6db3--- /dev/null+++ b/fixtures/FirmamentV2/SheetMetal/a3-two-hole-l-bracket.firmament@@ -0,0 +1,27 @@+SheetMetal A3TwoHoleLBracket {+ Thickness: 1.5mm;+ Material: "5052-H32 Aluminum";+ KFactor: 0.42;++ Base: Rectangle(100mm, 60mm);++ Flange Upright {+ From: Base.Rear;+ Length: 35mm;+ Angle: 90deg;+ InsideRadius: 2mm;+ Direction: Up;+ }++ Hole MountLeft {+ On: Base;+ Center: (25mm, 25mm);+ Diameter: 8mm;+ }++ Hole MountRight {+ On: Base;+ Center: (75mm, 25mm);+ Diameter: 8mm;+ }+}diff --git a/fixtures/FirmamentV2/SheetMetal/invalid/a3-countersink-wrong-domain.invalid.firmfixture b/fixtures/FirmamentV2/SheetMetal/invalid/a3-countersink-wrong-domain.invalid.firmfixturenew file mode 100644index 00000000..bccdd6fb--- /dev/null+++ b/fixtures/FirmamentV2/SheetMetal/invalid/a3-countersink-wrong-domain.invalid.firmfixture@@ -0,0 +1,25 @@+// fixture-id: a3-sheetmetal-countersink-wrong-domain+// case: preview3-a3-sheetmetal-countersink-rejected+// category: SheetMetal+// syntax-version: FirmamentV2+// validity: invalid+// implementation: rejected+// expected: invalid+// expected-stage: rejected+// expected-diagnostic: sheetmetal-hole-domain-syntax++SheetMetal A3UnsupportedCountersink {+ Thickness: 1.5mm;+ Material: "5052-H32 Aluminum";+ KFactor: 0.42;+ Base: Rectangle(80mm, 50mm);++ Hole<Countersink> Mount {+ On: Base;+ Center: (40mm, 25mm);+ Diameter: 6mm;+ CountersinkDiameter: 12mm;+ CountersinkAngle: 90deg;+ End: ThroughAll;+ }+}