Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Emit flat ended revolutions and preserve authored section arcs
Yuechen Liba0be596fdda
diff --git a/Aetheris.Kernel.Core/Brep/Features/RevolvedProfileStackEmitter.cs b/Aetheris.Kernel.Core/Brep/Features/RevolvedProfileStackEmitter.csindex e0d9083c..aae990b5 100644--- a/Aetheris.Kernel.Core/Brep/Features/RevolvedProfileStackEmitter.cs+++ b/Aetheris.Kernel.Core/Brep/Features/RevolvedProfileStackEmitter.cs@@ -29,6 +29,9 @@ internal sealed record RevolvedProfileStackResult(IReadOnlyList<string> Diagnostics){public bool Succeeded => Body is not null;+ public IReadOnlyList<FaceId> SideFaces { get; init; } = [];+ public FaceId BottomFace { get; init; }+ public FaceId TopFace { get; init; }}/// <summary>@@ -154,7 +157,7 @@ internal static class RevolvedProfileStackEmitter"revolved-profile-authoritative-topology-plan-consumed","revolved-profile-analytic-cylinder-and-cone-surfaces-emitted","revolved-profile-section-splits-preserved",- ]);+ ]) { SideFaces = sideFaces, BottomFace = bottomFace, TopFace = topFace };}private static List<KernelDiagnostic> Validate(diff --git a/Aetheris.Kernel.Firmament.Tests/CodeNativeAssemblyRehearsalTests.cs b/Aetheris.Kernel.Firmament.Tests/CodeNativeAssemblyRehearsalTests.csnew file mode 100644index 00000000..9349e095--- /dev/null+++ b/Aetheris.Kernel.Firmament.Tests/CodeNativeAssemblyRehearsalTests.cs@@ -0,0 +1,281 @@+using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Core.Brep.Verification;+using Aetheris.Kernel.Core.Geometry;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Core.Step242;+using Aetheris.Kernel.Firmament.Assembly;+using Aetheris.Kernel.Firmament.FirmamentV2;+using Aetheris.Kernel.Firmament.Materializer;+using Aetheris.Surfacing;++namespace Aetheris.Kernel.Firmament.Tests;++public sealed class CodeNativeAssemblyRehearsalTests+{+ private const string Root = "fixtures/Regression/CodeNativeAssembly/";++ [Fact]+ public void FastenerHasExactLeadInShaftAndCountersunkHead()+ => AssertFastenerShape(BuildBody("fastener.firmament"), 2, 1);++ [Fact]+ public void SectionChainWitnessKeepsItsExistingGeometry()+ {+ var chain = SectionChainAuthoringParser.CompileFile(PathOf("fastener-sections.firmament"));+ Assert.True(chain.IsSuccess, string.Join("\n", chain.Diagnostics));+ Assert.All(chain.Chain!.Sections, section => Assert.Equal(4, section.Profile.Spans.Count));+ AssertFastenerShape(chain.Materialization!.Body!, 8, 4);+ }++ [Theory]+ [InlineData("full")]+ [InlineData("-360deg")]+ public void AxisTouchingRevolveBuildsTheSameFlatEndedSolid(string angle)+ {+ var source = File.ReadAllText(PathOf("solid-fastener-revolve.firmament")).Replace("angle: full", "angle: " + angle, StringComparison.Ordinal);+ var built = FirmamentBuildAndExport.CompileSource(source);+ Assert.True(built.IsSuccess, string.Join("\n", built.Diagnostics));+ AssertFastenerShape(Step242Importer.ImportBody(built.Value.StepText).Value, 2, 1);+ Assert.Equal(5, built.Value.Revolve!.SurfaceRoles.Count);+ }++ [Fact]+ public void AxisClosedStackUsesItsAuthoredWorldFrame()+ {+ var source = File.ReadAllText(PathOf("solid-fastener-revolve.firmament"))+ .Replace("direction: [0, 0, 1]", "direction: [0, 1, 0]", StringComparison.Ordinal)+ .Replace("on XZ", "on XY", StringComparison.Ordinal);+ var built = FirmamentBuildAndExport.CompileSource(source);+ Assert.True(built.IsSuccess, string.Join("\n", built.Diagnostics));+ var body = Step242Importer.ImportBody(built.Value.StepText).Value;+ Assert.Contains(body.Geometry.Curves.Select(c => c.Value), c => c.Circle3 is { } circle && Near(circle.Radius, 6)+ && Near(circle.Center.Y, 16) && Near(circle.Center.X, 0) && Near(circle.Center.Z, 0));+ Assert.All(body.Geometry.Surfaces.Select(s => s.Value).Where(s => s.Cylinder is not null),+ s => Assert.True(Near(Math.Abs(s.Cylinder!.Value.Axis.ToVector().Y), 1)));+ Assert.True(BrepExportPreflight.Validate(body).IsValid);+ }++ [Theory]+ [InlineData("5.7deg")]+ [InlineData("5.7mm tol 0.1mm")]+ public void PrimitiveCompositionCannotEraseWrongTypesOrUnsupportedTolerances(string replacement)+ {+ var source = File.ReadAllText(PathOf("fastener-library.firmament")) + "\n" + File.ReadAllText(PathOf("fastener.firmament"))+ .Replace("include \"fastener-library.firmament\";", "", StringComparison.Ordinal);+ source = source.Replace("shaftDiameter: 5.7mm", "shaftDiameter: " + replacement, StringComparison.Ordinal);+ var built = FirmamentBuildAndExport.CompileSource(source);+ Assert.False(built.IsSuccess);+ Assert.NotEmpty(built.Diagnostics);+ }++ private static void AssertFastenerShape(BrepBody body, int cones, int cylinders)+ {+ var supports = body.Geometry.Surfaces.Select(s => s.Value).ToArray();+ Assert.Equal(cones, supports.Count(s => s.Kind == SurfaceGeometryKind.Cone));+ Assert.Equal(cylinders, supports.Count(s => s.Kind == SurfaceGeometryKind.Cylinder));+ Assert.Equal(2, supports.Count(s => s.Kind == SurfaceGeometryKind.Plane));+ Assert.All(supports.Where(s => s.Cone is not null), s => Assert.Equal(Math.PI / 4, s.Cone!.Value.SemiAngleRadians, 10));+ var circles = body.Geometry.Curves.Select(c => c.Value).Where(c => c.Circle3 is not null).Select(c => c.Circle3!.Value).ToArray();+ Assert.Contains(circles, c => Near(c.Radius, 2.35) && Near(c.Center.Z, 0));+ Assert.Contains(circles, c => Near(c.Radius, 2.85) && Near(c.Center.Z, .5));+ Assert.Contains(circles, c => Near(c.Radius, 2.85) && Near(c.Center.Z, 12.85));+ Assert.Contains(circles, c => Near(c.Radius, 6) && Near(c.Center.Z, 16));+ var expected = Math.PI * (.5 / 3 * (2.35 * 2.35 + 2.35 * 2.85 + 2.85 * 2.85)+ + 12.35 * 2.85 * 2.85 + 3.15 / 3 * (2.85 * 2.85 + 2.85 * 6 + 36));+ var mass = BrepMassProperties.Evaluate(body, new(.001, Math.PI / 128, .001, 64, 128));+ Assert.True(mass.IsEnclosed && mass.IsOrientationConsistent);+ Assert.NotNull(mass.ErrorBound);+ Assert.InRange(mass.ErrorBound.Value, 0, expected * .005);+ Assert.InRange(Math.Abs(mass.AbsoluteVolume - expected), 0, mass.ErrorBound.Value);+ Assert.True(BrepExportPreflight.Validate(body).IsValid);+ }++ [Theory]+ [InlineData("5.7deg")]+ [InlineData("5.7mm tol 0.1mm")]+ public void SectionChainRejectsWrongDimensionsAndUnprojectedTolerance(string replacement)+ {+ var source = File.ReadAllText(PathOf("fastener-sections.firmament")).Replace("= 5.7mm", "= " + replacement, StringComparison.Ordinal);+ var result = SectionChainAuthoringParser.Compile(source);+ Assert.False(result.IsSuccess);+ Assert.NotEmpty(result.Diagnostics);+ }++ [Theory]+ [InlineData(3, 3, SurfaceGeometryKind.Cylinder)]+ [InlineData(3, 6, SurfaceGeometryKind.Cone)]+ public void AlignedCircularArcSpansRetainTheirExactAnalyticCarrier(double a, double b, SurfaceGeometryKind expected)+ {+ var patch = ArcPatch(a, b, 0, Math.PI / 2);+ Assert.Equal(expected, patch.ExactSurface.Kind);+ for (var i = 0; i <= 8; i++)+ {+ var point = patch.Evaluate(i / 8d, .4);+ Assert.Equal(a + (b - a) * .4, Math.Sqrt(point.X * point.X + point.Y * point.Y), 10);+ Assert.Equal(4, point.Z, 10);+ }+ }++ [Fact]+ public void DifferentArcPhaseOrSweepCannotBeClaimedAsAnExactCone()+ {+ Assert.NotEqual(SurfaceGeometryKind.Cone, ArcPatch(3, 6, .1, Math.PI / 2).ExactSurface.Kind);+ Assert.NotEqual(SurfaceGeometryKind.Cone, ArcPatch(3, 6, 0, Math.PI / 3).ExactSurface.Kind);+ }++ [Fact]+ public void HoleRelocationMovesOnlyTheFastenerPlacementAndPreservesAssemblyRoundTrip()+ {+ var baseline = Compile("assembly.firmasm");+ var moved = Compile("relocated.firmasm");+ Assert.Equal(2, baseline.Geometry!.Artifact.Definitions.Count);+ Assert.Equal(3, baseline.Ir!.Instances.Count);+ var fastener = baseline.Ir.Instances.Single(i => i.Path.ToString() == "MountedBracket.Fastener");+ var next = moved.Ir!.Instances.Single(i => i.Path.ToString() == fastener.Path.ToString());+ Assert.Equal(fastener.StableId, next.StableId);+ Assert.Equal(new[] { 76d, 10d, -4d }, fastener.ResolvedTransform!.Matrix.Skip(12).Take(3));+ Assert.Equal(new[] { 60d, 10d, -4d }, next.ResolvedTransform!.Matrix.Skip(12).Take(3));+ Assert.Equal(baseline.Geometry.Artifact.Definitions.Single(d => d.DefinitionIdentity.StartsWith("Fastener<")).StepSha256,+ moved.Geometry!.Artifact.Definitions.Single(d => d.DefinitionIdentity.StartsWith("Fastener<")).StepSha256);++ // Inspect the world-space conical carriers, not just the mate residual.+ var fastBody = baseline.Geometry.InstanceBodies[fastener.StableId];+ var hostId = baseline.Ir.Instances.Single(i => i.Path.ToString() == "MountedBracket.Bracket").StableId;+ var hostBody = baseline.Geometry.InstanceBodies[hostId];+ var headCones = fastBody.Geometry.Surfaces.Select(s => s.Value).Where(s => s.Cone is not null && Near(s.Cone.Value.Apex.Z, 6)).ToArray();+ Assert.Single(headCones);+ Assert.All(headCones,+ s => Assert.True(Near(s.Cone!.Value.Apex.X, 76) && Near(s.Cone.Value.Apex.Y, 10)));+ Assert.Contains(hostBody.Geometry.Surfaces.Select(s => s.Value), s => s.Cone is { } cone && Near(cone.Apex.X, 76) && Near(cone.Apex.Y, 10) && Near(cone.Apex.Z, 6) && Near(cone.SemiAngleRadians, Math.PI / 4));+ Assert.Contains(hostBody.Geometry.Surfaces.Select(s => s.Value), s => s.Cylinder is { } cylinder && Near(cylinder.Radius, 3));+ foreach (var height in new[] { 0d, 8.85, 9, 12 })+ {+ var opening = height <= 9 ? 3 : height - 6;+ var fastenerRadius = height <= 8.85 ? 2.85 : height - 6;+ Assert.True(opening - fastenerRadius >= -1e-9);+ }+ var exported = AssemblyIrAp242Exporter.Export(baseline);+ Assert.True(exported.IsSuccess, string.Join("\n", exported.Diagnostics));+ var imported = Step242AssemblyImporter.Import(exported.Value);+ Assert.True(imported.IsSuccess, string.Join("\n", imported.Diagnostics));+ Assert.Equal("SourceAssembly", imported.Value.Provenance);+ Assert.Equal(2, imported.Value.Definitions.Count(d => d.Geometry is not null));+ Assert.Equal(2, imported.Value.Occurrences.Count);+ Assert.Contains(imported.Value.Occurrences, o => o.Name == "Fastener" && Near(o.LocalTransform[12], 76) && Near(o.LocalTransform[14], -4));+ }++ [Fact]+ public void AssemblyExportsOnlyItsOwnExplicitPmiAndKeepsPartGeometry()+ {+ var baseline = Compile("assembly.firmasm");+ var original = AssemblyIrAp242Exporter.Export(baseline);+ var noInheritedPmi = Step242SemanticPmiInspector.Inspect(original.Value);+ Assert.True(noInheritedPmi.Success);+ Assert.Empty(noInheritedPmi.Items); // Bracket declares Datum A and shaftSize in its Part.+ var source = File.ReadAllText(PathOf("assembly.firmasm")).Replace("anchor: MountedBracket.Bracket;",+ "Pmi { Note Seating { Target: MountedBracket.Fastener; Text: \"Nominal countersunk seat; threadless demonstrator.\"; } }\n anchor: MountedBracket.Bracket;", StringComparison.Ordinal);+ var explicitPmi = new AssemblyM1Pipeline().Compile(source, PathOf("assembly.firmasm"));+ Assert.True(explicitPmi.IsSuccess, string.Join("\n", explicitPmi.Diagnostics));+ Assert.Equal(baseline.Geometry!.Artifact.DeterministicSha256, explicitPmi.Geometry!.Artifact.DeterministicSha256);+ var exported = AssemblyIrAp242Exporter.Export(explicitPmi);+ Assert.True(exported.IsSuccess, string.Join("\n", exported.Diagnostics));+ var inspection = Step242SemanticPmiInspector.Inspect(exported.Value);+ Assert.True(inspection.Success, string.Join("\n", inspection.Diagnostics));+ var note = Assert.Single(inspection.Items);+ Assert.Equal("Seating", note.Name);+ Assert.Equal("MountedBracket.Fastener", note.Target);+ Assert.Equal(0, inspection.DatumCount);+ Assert.Equal(0, inspection.DimensionCount);+ }++ [Theory]+ [InlineData("height: 10mm", "heigth: 10mm")]+ [InlineData("on: shaft.Top", "on: shaft.Bottom")]+ [InlineData("bottomRadius: 3mm", "bottomRadius: 4mm")]+ [InlineData("distance: 0.5mm", "distance: 3mm")]+ [InlineData("on: shaft.Bottom", "on: head.Bottom")]+ [InlineData("EdgeFinish<Chamfer>", "EdgeFinish<Fillet>")]+ [InlineData("Cylinder shaft", "Box shaft")]+ [InlineData("target: Boundary", "target: AllEdges")]+ public void UnsupportedCoaxialIntentRejectsInValidateAndBuild(string before, string after)+ {+ var source = CoaxialSource.Replace(before, after, StringComparison.Ordinal);+ Assert.NotEqual(CoaxialSource, source);+ Assert.False(FirmamentBuildAndExport.CompileSource(source).IsSuccess);+ var parsed = FirmamentV2Parser.Parse(source);+ var admitted = FirmamentBuildAdmissionValidation.Admit(FirmamentV2ValidationReportBuilder.Build(parsed), source);+ Assert.Equal("invalid", admitted.Status);+ Assert.Contains(admitted.Diagnostics, d => d.Severity is "fatal" or "error");+ }++ [Theory]+ [InlineData("Boss ignored { profile: Missing; height: 1mm }")]+ [InlineData("Pmi { Datum ignored { target: face(+Z) } }")]+ public void CoaxialCompositionRejectsUnconsumedRootOperations(string statement)+ {+ var source = CoaxialSource.Replace("units: mm", "units: mm\n" + statement, StringComparison.Ordinal);+ var parsed = FirmamentV2Parser.Parse(source);+ Assert.False(parsed.IsSuccess);+ Assert.Contains(parsed.Diagnostics, d => d == "firmament-compose-coaxial-consumer-unsupported");+ Assert.False(FirmamentBuildAndExport.CompileSource(source).IsSuccess);+ }++ [Fact]+ public void CoaxialRequirementsUseTheCommonCompileTimeBinder()+ {+ var source = CoaxialSource.Replace("units: mm", "units: mm\nRequire checked => true", StringComparison.Ordinal);+ var accepted = FirmamentBuildAndExport.CompileSource(source);+ Assert.True(accepted.IsSuccess, string.Join("\n", accepted.Diagnostics));+ var rejected = FirmamentBuildAndExport.CompileSource(source.Replace("=> true", "=> false", StringComparison.Ordinal));+ Assert.False(rejected.IsSuccess);+ Assert.Contains(rejected.Diagnostics, d => d.Message.Contains("requirement-failed", StringComparison.Ordinal) || d.Message.Contains("static-require-failed", StringComparison.Ordinal));+ }++ [Theory]+ [InlineData("half", "[2.85mm, 12.85mm]")]+ [InlineData("full", "[2.85mm, 0.25mm]")]+ public void AxisTouchingPartialAndNonmonotoneProfilesRemainRejected(string angle, string station)+ {+ var source = File.ReadAllText(PathOf("solid-fastener-revolve.firmament"))+ .Replace("angle: full", "angle: " + angle, StringComparison.Ordinal)+ .Replace("[2.85mm, 12.85mm]", station, StringComparison.Ordinal);+ var built = FirmamentBuildAndExport.CompileSource(source);+ Assert.False(built.IsSuccess);+ Assert.Contains(built.Diagnostics, d => d.Message.StartsWith("firmament-revolve-axis-touch-materialization-not-supported", StringComparison.Ordinal));+ }++ private const string CoaxialSource = """+ Model Coaxial {+ units: mm+ Compose Body {+ Cylinder shaft { radius: 3mm; height: 10mm }+ Frustum head { on: shaft.Top; bottomRadius: 3mm; topRadius: 6mm; height: 3mm }+ }+ Modify Body { EdgeFinish<Chamfer> tip { on: shaft.Bottom; target: Boundary; distance: 0.5mm } }+ }+ """;++ private static RuledSurfacePatch ArcPatch(double radiusA, double radiusB, double phaseB, double sweepB)+ {+ var a = new RuledBoundary.Arc("a", new(0, 0, 0), Direction3D.Create(new Vector3D(0, 0, 1)), radiusA, Direction3D.Create(new Vector3D(1, 0, 0)), 0, Math.PI / 2);+ var b = new RuledBoundary.Arc("b", new(0, 0, 10), a.Normal, radiusB, a.ReferenceAxis, phaseB, sweepB);+ return RuledSurfaceLowering.Lower(new("test", RuledConstructionKind.RuledSurface, a, b,+ new("a", "test", "boundary-a"), new("b", "test", "boundary-b"))).Patch!;+ }+ private static bool Near(double a, double b) => Math.Abs(a - b) < 1e-8;+ private static BrepBody BuildBody(string file)+ {+ var built = FirmamentBuildAndExport.CompileSource(File.ReadAllText(PathOf(file)), Path.GetDirectoryName(PathOf(file)));+ Assert.True(built.IsSuccess, string.Join("\n", built.Diagnostics));+ var imported = Step242Importer.ImportBody(built.Value.StepText);+ Assert.True(imported.IsSuccess, string.Join("\n", imported.Diagnostics));+ return imported.Value;+ }+ private static string PathOf(string file) => FirmamentCorpusHarness.ResolveFixtureFullPath(Root + file);+ private static AssemblyM1CompilationResult Compile(string file)+ {+ var compiled = new AssemblyM1Pipeline().CompileFile(PathOf(file));+ Assert.True(compiled.IsSuccess, string.Join("\n", compiled.Diagnostics));+ return compiled;+ }+}diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.csindex ec1816ee..86851d4a 100644--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs@@ -343,6 +343,22 @@ public static partial class FirmamentBuildAndExportif (!v2Parse.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(v2Parse.Diagnostics.Select(SchemaDiagnostic).ToArray());return PlateauAuthoring.Compile(materializerSource, v2Parse.BoundPlateau, v2Parse.BoundProfile, v2Parse.ExtrusionHeight);}+ if (v2Parse.BoundCoaxialComposition is { } coaxial)+ {+ var built = Kernel.Core.Brep.Features.RevolvedProfileStackEmitter.Emit(coaxial.Topology);+ if (!built.Succeeded || built.Body is null)+ return KernelResult<FirmamentStepExportResult>.Failure(built.Diagnostics.Select(SchemaDiagnostic).ToArray());+ var step = Step242Exporter.ExportBody(built.Body, new Step242ExportOptions { ProductName = coaxial.Name, BrepExportPreflightMode = BrepExportPreflightMode.Enforce });+ if (!step.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(step.Diagnostics);+ return KernelResult<FirmamentStepExportResult>.Success(new(step.Value, v2Parse.Document!.ModelName, 0, "coaxial-primitive-compose", "compose",+ EngineeringFeatures: coaxial.Spans.Select(span => new FirmamentEngineeringFeatureReport(span.Name, span.Kind,+ "compose:" + coaxial.Name + "." + span.Name, coaxial.Name, null, null, span.To - span.From, "Height", "Add",+ MaterializationRoute: "RevolvedProfileStack"))+ .Concat(coaxial.Chamfers.Select(chamfer => new FirmamentEngineeringFeatureReport(chamfer.Name, "Chamfer",+ "compose:" + coaxial.Name + "." + chamfer.Name, coaxial.Name, chamfer.On, null, chamfer.Distance, "Distance", "Remove",+ MaterializationRoute: "RevolvedProfileStack"))).ToArray())+ { RuntimeBody = built.Body, RuntimeBodySourceName = coaxial.Name });+ }if (v2Parse.BoundRevolve is { } boundRevolve){var authored = boundRevolve;diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.csindex fbc48c81..17aa3042 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs@@ -368,6 +368,7 @@ public sealed record FirmamentV2ParseResult(// Bound engineering inputs are retained for execution; a successful AST admission// cannot be replaced by a different whole-document parser in the build path.internal PrismaticProfileCompositionParseResult? BoundComposition { get; init; }+ internal CoaxialPrimitiveComposition? BoundCoaxialComposition { get; init; }internal FirmamentPlateauRequest? BoundPlateau { get; init; }internal bool OwnsUnifiedAdmission { get; init; }internal SectionChainAuthoringResult? BoundSectionChain { get; init; }diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2CoaxialComposition.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2CoaxialComposition.csnew file mode 100644index 00000000..0f3926f2--- /dev/null+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2CoaxialComposition.cs@@ -0,0 +1,132 @@+using Aetheris.Kernel.Core.Brep.Features;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Firmament.FirmamentV2.Syntax;++namespace Aetheris.Kernel.Firmament.FirmamentV2;++internal sealed record CoaxialPrimitiveSpan(string Name, string Kind, double BottomRadius, double TopRadius,+ double From, double To, FirmamentV2SourceSpan SourceSpan);+internal sealed record CoaxialRimChamfer(string Name, string On, double Distance, FirmamentV2SourceSpan SourceSpan);+internal sealed record CoaxialPrimitiveComposition(string Name, IReadOnlyList<CoaxialPrimitiveSpan> Spans,+ IReadOnlyList<CoaxialRimChamfer> Chamfers, RevolvedProfileTopologyPlan Topology);++public static partial class FirmamentV2Parser+{+ // A production of the ordinary Compose owner, selected by its child AST nodes.+ // No source rewrite, Boolean union or separate whole-document grammar.+ private static bool IsCoaxialComposition(DeclarationSyntax? compose) => compose?.Type.Name.Text == "Compose"+ && compose.Body?.Statements.OfType<DeclarationSyntax>().Any(d => d.Type.Name.Text is "Cylinder" or "Frustum") == true;++ private static FirmamentV2ParseResult BindCoaxialComposition(DeclarationSyntax model, DeclarationSyntax compose,+ string source, List<string> diagnostics, IReadOnlyList<FirmamentV2BoundLet> values)+ {+ var located = new List<FirmamentV2ValidationDiagnostic>();+ void Error(string code, string message, FirmamentV2SourceSpan span)+ {+ diagnostics.Add(code);+ located.Add(new(code, "error", message) { SourceSpan = span, Stage = "Capability" });+ }+ const string prefix = "firmament-compose-coaxial-";+ var units = model.Body!.Statements.OfType<FieldSyntax>().Where(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Units")).ToArray();+ if (model.Type.Name.Text == "Model" && units.Length == 0 || units.Any(f => FirmamentSyntaxValues.Reference(f.Value) != "mm"))+ diagnostics.Add(CanonicalUnitsInvalid);+ if (values.Any(v => v.Tolerance is not null))+ Error(prefix + "tolerance-consumer-unsupported", "Coaxial primitive Compose does not yet project typed tolerances; nominal substitution cannot discard them.", compose.Span);+ var members = compose.Body?.Statements.OfType<DeclarationSyntax>().ToArray() ?? [];+ var fields = new FirmamentSyntaxFields(compose, diagnostics);+ fields.Complete(members.ToHashSet<StatementSyntax>());+ if (compose.Name is null || compose.Type.Arguments.Count > 0 || compose.Modifiers.Count > 0) diagnostics.Add(CanonicalPrimitiveMalformed);+ var spans = new List<CoaxialPrimitiveSpan>();+ var names = new HashSet<string>(StringComparer.Ordinal);+ foreach (var member in members)+ {+ if (member.Type.Name.Text is not ("Cylinder" or "Frustum"))+ { Error(prefix + "operation-unsupported", $"Coaxial Compose requires Cylinder/Frustum spans; '{member.Type.Name.Text}' is not consumed.", member.Span); continue; }+ var f = new FirmamentSyntaxFields(member, diagnostics);+ var on = f.Reference("On");+ var primitive = BindMechanicalPrimitive(f, diagnostics);+ f.Complete();+ if (member.Name is null || !names.Add(member.Name.Text) || member.Type.Arguments.Count > 0 || member.Modifiers.Count > 0)+ { diagnostics.Add(DuplicateName); continue; }+ var (r0, r1, height) = primitive switch+ {+ FirmamentV2CylinderRecord c => (c.Radius, c.Radius, c.Height),+ FirmamentV2FrustumRecord c => (c.BottomRadius, c.TopRadius, c.Height),+ _ => (double.NaN, double.NaN, double.NaN)+ };+ if (!double.IsFinite(r0 + r1 + height) || !(r0 > 0 && r1 > 0 && height > 0))+ { Error(prefix + "dimensions-invalid", "Use finite positive radii and height. A Frustum also requires unequal end radii; use Cylinder for equal radii.", member.Span); continue; }+ var previous = spans.LastOrDefault();+ if (previous is null ? on is not null : on != previous.Name + ".Top")+ Error(prefix + "support-invalid", previous is null ? "The first span starts at the local origin; omit on."+ : $"Attach this span with on: {previous.Name}.Top. Arbitrary placement and out-of-order attachments are unsupported.", member.Span);+ if (previous is not null && Math.Abs(previous.TopRadius - r0) > 1e-9)+ Error(prefix + "junction-radius-mismatch", "Adjacent spans must share the same rim radius. Radial shoulders, overlaps and gaps are not admitted by this stack.", member.Span);+ var from = previous?.To ?? 0;+ spans.Add(new(member.Name.Text, member.Type.Name.Text, r0, r1, from, from + height, member.Span));+ }+ var declarations = MechanicalDeclarations(model.Body.Statements).ToArray();+ var modifies = declarations.Where(d => d.Type.Name.Text == "Modify").ToArray();+ var remainder = declarations.Where(d => d != compose && !modifies.Contains(d) && d.Type.Name.Text != "Static"+ && !(d.Type.Name.Text == "Struct" && !d.Modifiers.Any(m => m.Name.Text == "Concept"))).Cast<StatementSyntax>().ToArray();+ BindMaterialDomainScope(new("inline", remainder, [], model.Span), "Compose", diagnostics);+ foreach (var unsupported in declarations.Where(d => d.Type.Name.Text is "Pmi" or "Selection" or "Thread" or "Assert"+ or "Boss" or "Pocket" or "AddOffset" or "RemoveOffset" or "Recognize" or "Replace" or "Remove" or "Pattern"+ || d.Modifiers.Any(m => m.Name.Text == "Assert")))+ Error(prefix + "consumer-unsupported", $"Coaxial Compose does not yet consume '{unsupported.Type.Name.Text}'; remove it or use a qualified owner.", unsupported.Span);+ var chamfers = new List<CoaxialRimChamfer>();+ var ends = new HashSet<string>(StringComparer.Ordinal);+ foreach (var modify in modifies)+ {+ var finishes = modify.Body?.Statements.OfType<DeclarationSyntax>().ToArray() ?? [];+ new FirmamentSyntaxFields(modify, diagnostics).Complete(finishes.ToHashSet<StatementSyntax>());+ if (modify.Name?.Text != compose.Name?.Text || modify.Type.Arguments.Count > 0 || modify.Modifiers.Count > 0)+ diagnostics.Add(ModifyTargetUnresolved);+ foreach (var finish in finishes)+ {+ if (finish.Type.Name.Text != "EdgeFinish")+ { Error(prefix + "finish-unsupported", $"'{finish.Type.Name.Text}' is not an admitted coaxial rim finish.", finish.Span); continue; }+ var f = new FirmamentSyntaxFields(finish, diagnostics);+ var kind = MechanicalFinishKind(f, diagnostics);+ var on = f.Reference("On");+ var target = f.Reference("Target");+ var distance = f.Number("Distance", "mm");+ f.Complete();+ var span = spans.FirstOrDefault(s => on == s.Name + ".Bottom" && s == spans.FirstOrDefault()+ || on == s.Name + ".Top" && s == spans.LastOrDefault());+ if (kind != "Chamfer" || target != "Boundary" || span?.Kind != "Cylinder" || finish.Name is null || !names.Add(finish.Name.Text)+ || finish.Modifiers.Count > 0 || !(distance > 0 && distance < span.BottomRadius && distance < span.To - span.From)+ || !ends.Add(on!))+ { Error(prefix + "chamfer-unsupported", "Use EdgeFinish<Chamfer> on an exposed terminal Cylinder rim: on: shaft.Bottom (or shaft.Top); target: Boundary; distance: a positive length smaller than radius and height. One finish per terminal is supported.", finish.Span); continue; }+ chamfers.Add(new(finish.Name.Text, on!, distance, finish.Span));+ }+ }+ if (spans.Count == 0 || diagnostics.Any(IsFatalDiagnosticCode)) return Failure();+ var points = new List<ProfilePoint2D> { new(spans[0].BottomRadius, spans[0].From) };+ points.AddRange(spans.Select(s => new ProfilePoint2D(s.TopRadius, s.To)));+ foreach (var chamfer in chamfers)+ {+ if (chamfer.On.EndsWith(".Bottom", StringComparison.Ordinal))+ {+ var first = points[0]; points[0] = new(first.X - chamfer.Distance, first.Y);+ points.Insert(1, new(first.X, first.Y + chamfer.Distance));+ }+ else+ {+ var last = points[^1]; points[^1] = new(last.X - chamfer.Distance, last.Y);+ points.Insert(points.Count - 1, new(last.X, last.Y - chamfer.Distance));+ }+ }+ var axis = new Vector3D(0, 0, 1);+ var topology = RevolvedProfileStackEmitter.Plan(points, new(new(0, 0, 0), Direction3D.Create(axis), Direction3D.Create(new Vector3D(1, 0, 0))), new(new(0, 0, 0), axis));+ if (!topology.IsSuccess)+ { Error(prefix + "stack-invalid", string.Join("; ", topology.Diagnostics.Select(d => d.Message)), compose.Span); return Failure(); }+ var composition = new CoaxialPrimitiveComposition(compose.Name!.Text, spans, chamfers, topology.Value);+ var document = new FirmamentV2Document(model.Name!.Text, "mm", [new(compose.Name.Text, "Compose", new FirmamentV2AdvancedMaterialRecord("Compose"))],+ Composes: [new(compose.Name.Text, spans.Select(s => s.Name).Concat(chamfers.Select(c => c.Name)).ToArray(), compose.Span)]);+ return FirmamentV2ParseResult.Success(document, diagnostics.Append("firmament-v2-parse-succeeded").ToArray())+ with { BoundCoaxialComposition = composition, BoundSource = source };++ FirmamentV2ParseResult Failure() => CanonicalFailure(diagnostics, CanonicalDocumentMalformed) with { SyntaxDiagnostics = located };+ }+}diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.csindex e37b4295..2dd86418 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs@@ -95,7 +95,9 @@ public static partial class FirmamentV2Parser{// The construction adapter consumes serialized bound AST fields. An// unused Static is data, never a reason to reject a material owner.- var construction = BindMechanicalConstruction(source, model, diagnostics, templateInstantiations, compileTime);+ var construction = constructions.Length == 1 && IsCoaxialComposition(constructions[0])+ ? BindCoaxialComposition(model, constructions[0], source, diagnostics, staticValues.Values)+ : BindMechanicalConstruction(source, model, diagnostics, templateInstantiations, compileTime);return construction.Document is null ? construction : construction with{Document = construction.Document with { Lets = staticValues.Declarations, BoundLets = staticValues.Values },diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.csindex 4a4e968a..472b825f 100644--- a/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs+++ b/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs@@ -60,13 +60,34 @@ public static class SectionChainAuthoringParserif (LoftAuthoringParser.IsLoftSource(source))return LoftAuthoringParser.Compile(source, materialize);var diagnostics = new List<string>();- var boundaries = ClosedBoundary2Authoring.Expand(source, diagnostics);+ var values = new FirmamentCompileTimeValues(source);+ values.BindExpandedScalars(source, diagnostics);+ // Resolve named boundary sets while their declarations are still present.+ // Static/Pattern expansion consumes them; inline Section profile recipes+ // must in turn be exposed before Template specialization below.+ var boundaries = ClosedBoundary2Authoring.Expand(source, diagnostics, values);if (boundaries is null || diagnostics.Count > 0) return new(false, null, null, diagnostics);source = boundaries.Source;- var staticSource = CanonicalStaticAuthoring.Expand(source, diagnostics);+ var staticSource = CanonicalStaticAuthoring.Expand(source, diagnostics, values);if (staticSource is null || diagnostics.Count > 0) return new(false, null, null, diagnostics);- source = ExpandSectionValues(staticSource.Source, diagnostics);- var templates = FirmamentV2TemplateExpansion.Expand(source, diagnostics);+ var inputs = values.MaterialInputs(staticSource.Source);+ if (inputs.Any(v => v.Tolerance is not null))+ diagnostics.Add("section-chain-tolerance-consumer-unsupported: Manufacturing tolerances are not admitted by this domain; nominal values cannot silently erase them.");+ diagnostics.AddRange(values.Diagnostics.Where(d => d.Severity is "error" or "fatal").Select(d => d.Code + ": " + d.Message));+ if (diagnostics.Count > 0) return new(false, null, null, diagnostics);+ source = ExpandSectionValues(FirmamentValueSubstitution.Apply(staticSource.Source,+ inputs.ToDictionary(v => v.Name, v => values.NominalExpression(v.Name), StringComparer.Ordinal)), diagnostics);+ // These declarations have been checked and projected by the shared value+ // binder. Legacy geometry readers must not re-admit them as unknown scope+ // statements. Preserve line positions and leave every unbound declaration.+ var boundNames = inputs.Select(v => v.Name).ToHashSet(StringComparer.Ordinal);+ var projection = source.ToCharArray();+ foreach (var scalar in FirmamentSyntaxTraversal.Declarations(FirmamentSyntaxParser.Parse(source).Document)+ .Where(d => d.Type.Name.Text == "Static" && d.Name is not null && boundNames.Contains(d.Name.Text)))+ for (var index = scalar.Span.Start; index < scalar.Span.Start + scalar.Span.Length; index++)+ if (projection[index] is not ('\r' or '\n')) projection[index] = ' ';+ source = new string(projection);+ var templates = FirmamentV2TemplateExpansion.Expand(source, diagnostics, values);if (templates is null || diagnostics.Count > 0) return new(false, null, null, diagnostics);source = templates.Source;var syntax = FirmamentSyntaxParser.Parse(source);@@ -122,7 +143,7 @@ public static class SectionChainAuthoringParserderivations.Add(new(authored.Name!.Text, profile.Name, provenance.ConceptStableId,provenance.TracedFrom ?? "", provenance.Derivation, profile.PlaneFrame));if (profile.Loops.Count != 1) diagnostics.Add($"section-chain-profile-loop-count-invalid:{authored.Name!.Text}");- var spans = outer.Segments.Select(segment => Convert(segment, diagnostics, authored.Name!.Text)).Where(item => item is not null).Cast<SectionProfileSpan>().ToArray();+ var spans = outer.Segments.SelectMany(segment => ConvertSpans(segment, diagnostics, authored.Name!.Text)).ToArray();var seamId = seam ?? spans.FirstOrDefault()?.SpanId ?? string.Empty;sections.Add(new(authored.Name!.Text, new(plane.Origin, plane.AxisX, plane.AxisY, plane.AxisZ), new(profile.Name, spans, seamId)));}@@ -199,6 +220,22 @@ public static class SectionChainAuthoringParserstring Slice(FirmamentV2SourceSpan span) => source.Substring(span.Start, span.Length);}+ private static IEnumerable<SectionProfileSpan> ConvertSpans(ResolvedProfileSegment2D segment, List<string> diagnostics, string section)+ {+ // One closed circle has four deterministic semantic quadrants. Feed exact+ // arcs to the existing ruled materializer; do not approximate the circle or+ // make corresponding sections depend on their source declaration names.+ if (segment.Geometry is LineArcFullCircle2D circle)+ {+ for (var quadrant = 0; quadrant < 4; quadrant++)+ yield return new("CircleQuadrant" + quadrant, new SectionProfileCurve.Arc(+ new(circle.Center.X, circle.Center.Y), circle.Radius, quadrant * Math.PI / 2, Math.PI / 2));+ yield break;+ }+ var span = Convert(segment, diagnostics, section);+ if (span is not null) yield return span;+ }+private static SectionProfileSpan? Convert(ResolvedProfileSegment2D segment, List<string> diagnostics, string section) => segment.Geometry switch{LineArcCubicBezier2D cubic => new(segment.Name, new SectionProfileCurve.PolynomialBSpline(3, [new(cubic.Start.X, cubic.Start.Y), new(cubic.Control1.X, cubic.Control1.Y), new(cubic.Control2.X, cubic.Control2.Y), new(cubic.End.X, cubic.End.Y)], [4, 4], [0, 1])),diff --git a/Aetheris.Kernel.Firmament/Materializer/ResolvedProfileRevolveEmitter.cs b/Aetheris.Kernel.Firmament/Materializer/ResolvedProfileRevolveEmitter.csindex 97807f72..eb648bb5 100644--- a/Aetheris.Kernel.Firmament/Materializer/ResolvedProfileRevolveEmitter.cs+++ b/Aetheris.Kernel.Firmament/Materializer/ResolvedProfileRevolveEmitter.cs@@ -1,6 +1,7 @@using System.Security.Cryptography;using System.Text;using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Core.Brep.Features;using Aetheris.Kernel.Core.Geometry;using Aetheris.Kernel.Core.Geometry.Curves;using Aetheris.Kernel.Core.Geometry.Surfaces;@@ -74,11 +75,53 @@ public static class ResolvedProfileRevolveEmitter["revolve-profile-authoritative", "revolve-axis-explicit", isFull ? "revolve-periodic-seam" : "revolve-semantic-radial-caps"]);if (isFull && TryEmitSphere(revolve, plan, localAxisOrigin, localDx, localDy, out var sphere)) return sphere;+ if (isFull && TryEmitAxisClosedStack(revolve, plan, localAxisOrigin, localDx, localDy, sideSign, out var stack)) return stack;return EmitGeneral(revolve, plan, localAxisOrigin, localDx, localDy, sideSign, sweepMagnitude);double Radius((double X, double Y) point) => localDx * (point.Y - localAxisOrigin.Y) - localDy * (point.X - localAxisOrigin.X);}+ // A flat-ended solid of revolution is the same analytic stack already used+ // by circular rim chamfers. Erase only the non-material axis closure; keep+ // both radial cap identities and every strictly monotone outer span.+ private static bool TryEmitAxisClosedStack(ResolvedRevolve revolve, RevolveBRepPlan plan,+ (double X, double Y, double Z) origin, double dx, double dy, int sideSign,+ out ResolvedProfileRevolveResult result)+ {+ result = default!;+ var segments = revolve.Profile.Loops[0].Segments;+ if (segments.Count < 4 || segments.Any(s => s.Geometry is not LineArcLineSegment2D)) return false;+ double Radius((double X, double Y) p) => sideSign * (dx * (p.Y - origin.Y) - dy * (p.X - origin.X));+ double Axial((double X, double Y) p) => dx * (p.X - origin.X) + dy * (p.Y - origin.Y);+ var axis = segments.Select((s, i) => (Line: (LineArcLineSegment2D)s.Geometry, Index: i))+ .Where(s => Math.Abs(Radius(s.Line.Start)) <= Tol && Math.Abs(Radius(s.Line.End)) <= Tol).ToArray();+ if (axis.Length != 1) return false;+ var ordered = Enumerable.Range(1, segments.Count - 1).Select(i => segments[(axis[0].Index + i) % segments.Count]).ToArray();+ var first = (LineArcLineSegment2D)ordered[0].Geometry;+ var last = (LineArcLineSegment2D)ordered[^1].Geometry;+ if (Math.Abs(Axial(first.Start) - Axial(first.End)) > Tol || Math.Abs(Axial(last.Start) - Axial(last.End)) > Tol) return false;+ var outer = ordered.Skip(1).SkipLast(1).ToArray();+ var points = new[] { first.End }.Concat(outer.Select(s => ((LineArcLineSegment2D)s.Geometry).End))+ .Select(p => new ProfilePoint2D(Radius(p), Axial(p))).ToArray();+ if (points.Any(p => p.X <= Tol)) return false;+ var ascending = points[^1].Y > points[0].Y;+ if (!ascending) { Array.Reverse(points); Array.Reverse(outer); }+ if (points.Zip(points.Skip(1)).Any(p => p.Second.Y <= p.First.Y + Tol)) return false;+ var frame = new ExtrudeFrame3D(plan.AxisOrigin, plan.AxisDirection, plan.RadialDirection);+ var topology = RevolvedProfileStackEmitter.Plan(points, frame, new(plan.AxisOrigin, plan.AxisDirection.ToVector()));+ if (!topology.IsSuccess) return false;+ var emitted = RevolvedProfileStackEmitter.Emit(topology.Value);+ if (!emitted.Succeeded)+ { result = new(null, plan, emitted.Diagnostics); return true; }+ var faces = outer.Select((s, i) => (Name: "RevolvedSpan:" + s.Name, Face: emitted.SideFaces[i]))+ .ToDictionary(p => p.Name, p => p.Face, StringComparer.Ordinal);+ faces["RevolvedSpan:" + ordered[0].Name] = ascending ? emitted.BottomFace : emitted.TopFace;+ faces["RevolvedSpan:" + ordered[^1].Name] = ascending ? emitted.TopFace : emitted.BottomFace;+ result = new(emitted.Body, plan with { SurfaceRoles = faces.Keys.ToArray() },+ plan.Diagnostics.Concat(emitted.Diagnostics).Append("revolve-axis-closure-erased:flat-ended-monotone-line-stack").ToArray(), faces);+ return true;+ }+private static ResolvedProfileRevolveResult EmitGeneral(ResolvedRevolve revolve, RevolveBRepPlan plan,(double X, double Y, double Z) localAxisOrigin, double localDx, double localDy, int sideSign, double sweep){diff --git a/Aetheris.Surfacing/RuledSurfaceLowering.cs b/Aetheris.Surfacing/RuledSurfaceLowering.csindex ed44e02f..9e0b89a7 100644--- a/Aetheris.Surfacing/RuledSurfaceLowering.cs+++ b/Aetheris.Surfacing/RuledSurfaceLowering.cs@@ -38,7 +38,20 @@ public static class RuledSurfaceLoweringvar surface = Bilinear(a.Start, a.End, b.Start, b.End);return Success(ir, SurfaceGeometry.FromBSplineSurfaceWithKnots(surface), Evaluate,developability,SurfaceMaterializationKind.ExactPolynomialBSpline,null);}- if (ir.BoundaryA is RuledBoundary.Circle c0 && ir.BoundaryB is RuledBoundary.Circle c1+ var circularA = ir.BoundaryA as RuledBoundary.Circle;+ var circularB = ir.BoundaryB as RuledBoundary.Circle;+ if (ir.BoundaryA is RuledBoundary.Arc arcA && ir.BoundaryB is RuledBoundary.Arc arcB+ && double.Abs(arcA.StartAngleRadians - arcB.StartAngleRadians) <= 1e-12+ && double.Abs(arcA.SweepAngleRadians - arcB.SweepAngleRadians) <= 1e-12+ && arcA.Normal.ToVector().Dot(arcB.Normal.ToVector()) > 0)+ {+ // Matching circular spans have the same analytic carrier as full+ // circles. Keep the authored arc evaluators and trims; only reuse+ // the existing coaxial cylinder/cone recognition below.+ circularA = new(arcA.StableId, arcA.Center, arcA.Normal, arcA.Radius, arcA.ReferenceAxis);+ circularB = new(arcB.StableId, arcB.Center, arcB.Normal, arcB.Radius, arcB.ReferenceAxis);+ }+ if (circularA is { } c0 && circularB is { } c1&& c0.Normal.ToVector().Cross(c1.Normal.ToVector()).Length <= 1e-10&& c0.Normal.ToVector().Cross(c1.Center-c0.Center).Length <= 1e-10&& double.Abs((c1.Center-c0.Center).Dot(c0.Normal.ToVector())) > 1e-12diff --git a/docs/development/reports/2026-10/code-native-assembly-primitives-and-revolve.md b/docs/development/reports/2026-10/code-native-assembly-primitives-and-revolve.mdnew file mode 100644index 00000000..c8962a8b--- /dev/null+++ b/docs/development/reports/2026-10/code-native-assembly-primitives-and-revolve.md@@ -0,0 +1,53 @@+# Code-native assembly: primitive construction and bounded solid Revolve++2026-10-23. Follow-up to the [initial rehearsal](code-native-assembly-rehearsal.md), on base `5e4c90b3` plus the local changes. No demo-repository push or PR is included.++## What changed++The showcase fastener now follows the direct construction strategy used for the McMaster bolt: compose named analytic masses, then finish an edge. [`fastener-library.firmament`](../../../../fixtures/Regression/CodeNativeAssembly/fastener-library.firmament) declares a reusable Record/Template with a Cylinder shaft, a Frustum attached to `shaft.Top`, and a 0.5 mm equal-distance Chamfer on `shaft.Bottom`. No authored Profile, Revolve or SectionChain is needed. The shared assembly still places the fastener through exposed Concept frames and the named Mate.++The nominal geometry is unchanged: Ø5.7 shaft, Ø12 × 90° head, 16 mm overall length, flat tip Ø4.7, 0.5 mm × 45° lead-in. The fastener has five analytic faces (two cones, one cylinder, two planes), seven edges and four vertices. The former four-quadrant SectionChain representation has fourteen faces; this is an intentional representation simplification, not a nominal shape change. The old source remains as `fastener-sections.firmament` for parity evidence.++The existing public Compose owner previously supported Profile operations only. It now binds a bounded Cylinder/Frustum production over the unified AST, reuses the existing primitive field binders and checked scalar values, and carries a typed admitted construction to execution. Spans are connected in order by explicit named top supports and equal joining radii. Terminal Cylinder chamfers rewrite only that span's end. The existing `RevolvedProfileStackEmitter` constructs the result directly; no source-to-source sketch rewrite, Boolean union or new whole-document parser route is involved. Validation remains `Built` / `UnifiedMechanical` through the normal CLI.++The same emitter closes the solid-axis Revolve gap for one safe family: full turns of flat-ended, strictly monotone piecewise-linear meridians with positive outer radii, one axis closure and two radial cap segments. The axis closure emits no material face. Caps and outer spans preserve source-semantic face associations. Both sweep signs and different authored world frames are tested. The former rejected source is now `fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmament` and builds a solid, not a hollow approximation.++## PMI ownership decision++Part PMI is **not inherited or promoted** by assembly export. This is intended document ownership, not a missing exporter behavior. Declare assembly-owned PMI explicitly in the root `.firmasm`; release metadata is likewise explicitly selected there. Mates express placement, not inferred manufacturing tolerances or a second constraint solver.++The public PMI and assembly guides, fixture README and initial report now say this accurately. Regression coverage verifies that the bracket's Part Datum and diameter are absent from assembly-owned PMI, while an explicitly authored assembly Note survives AP242 and leaves the geometry hash unchanged. The assembly's current admitted annotation forms are Notes and release metadata; this pass does not claim new assembly dimension/GD&T support or annotation reconstruction on package import.++## Qualification++The repeatable CLI rehearsal is `python fixtures/Regression/CodeNativeAssembly/rehearse.py --preview`; previews require numpy/matplotlib. Evidence is ignored under `artifacts/local/code-native-assembly/primitive-rehearsal/`, with build/test logs in its parent.++- Normal validate/build admits the primitive fastener through unified mechanical admission.+- Primitive Compose, solid Revolve and retained SectionChain satisfy the same independent checks of actual circular stations, cone angles, cylinder radii, enclosure, export preflight and bounded numerical mass against the analytic cylinder/frusta formula.+- The bracket's actual bore radius and countersink angle/apex are checked against the fastener's world carriers. Its head remains nominally flush and shaft clearance remains 0.3 mm diametral. Strength, retention and manufacturing angular/location stacks are not qualified; the model remains a threadless fastener blank without a drive recess.+- Moving the hole 16 mm in X moves the fastener through the Mate and retains its definition STEP hash. Both assemblies remain two-definition/two-occurrence AP242 and GLB products.+- STEP import/reexport qualifies topology, component counts, transforms and bounds. GLB preview checks the actual exported component bounds before drawing.+- Unsupported joining radii, placements, unknown fields, internal-rim finishes, oversized chamfers and Fillet reject in validate and build. Wrong dimensions and unsupported typed tolerances cannot disappear into nominal geometry. Unconsumed root material/PMI operations reject; ordinary `Require` remains owned by the shared compile-time binder.++| Gate | Result |+| --- | --- |+| Serial Release solution build, shared compilation disabled | Passed; 0 errors, 29 warnings |+| Focused composition, Revolve, SectionChain/guitar and PMI tests | 83 passed |+| Core fast lane (`Category!=SlowCorpus`) | 1,088 passed |+| Complete solution suite, serial, including SlowCorpus | **5,949 passed; 0 failed; 0 skipped** |+| Real CLI rehearsal and GLB visual review | Passed |+| `git diff --check` | Passed |++Full qualification includes 3,177 Firmament tests, 1,243 Core tests, 641 CLI tests and seven editable V8 tests. `Aetheris.FrictionLab.Tests` has no discoverable tests and is not counted as coverage. The warnings are existing compiler/analyzer/WebAssembly SQLite warnings; no zero-warning claim is made. No .NET test, compiler or MSBuild hosts remained after completion. Detailed logs are `revision-solution-build.log`, `revision-focused-tests.log`, `revision-fast-tests.log`, `revision-full-tests.log` and `revision-rehearsal-run.log` under the evidence parent directory.++## Boundaries and review++Coaxial Compose admits positive-radius Cylinder/Frustum spans along local +Z with matching shared rims. It rejects arbitrary placements, radial shoulders, mixed Profile operations, holes, internal-rim finishes and unsupported Part PMI/tolerance consumers. Solid-axis Revolve still rejects partial turns, pointed zero-radius tips, nonmonotone chains, radial shoulders and curved outer spans outside the existing sphere case. Inner loops and arbitrary Booleans remain outside this pass.++Code review found no new global diagnostic allowlist, whole-document regex dispatch, mutable parser state, solver or shadow execution path. Existing primitive field metadata and the existing analytic materializer remain the owners. The stack emitter's added face handles are metadata only for existing consumers. STEP preflight is enforced for the new Compose production. Public docs describe current admitted syntax and its limits.++The next showcase PR should use the primitive Template and pin a published Aetheris commit containing the repairs. Existing standalone bracket PDF and its drawing checks remain separate artifacts. This pass stays local.++## Verdict++**Success.** The motivating fastener is now authored as connected primitives and a real named chamfer, with preserved nominal geometry and semantic assembly placement. The bounded solid-axis Revolve case works through the existing analytic kernel path, and more complex cases remain explicit rejections. Assembly PMI stays explicitly owned by its assembly source. Full local regression and artifact qualification pass; no hosted CI or independent CAD qualification is claimed.diff --git a/docs/development/reports/2026-10/code-native-assembly-rehearsal.md b/docs/development/reports/2026-10/code-native-assembly-rehearsal.mdnew file mode 100644index 00000000..38badde5--- /dev/null+++ b/docs/development/reports/2026-10/code-native-assembly-rehearsal.md@@ -0,0 +1,83 @@+# Code Native Design: local bracket assembly rehearsal++This records the **initial** SectionChain rehearsal. The [primitive composition and Revolve follow-up](code-native-assembly-primitives-and-revolve.md) supersedes its authoring choice and Revolve limitation. Assembly PMI noninheritance is intentional document ownership, not an exporter defect.++Date: 2026-10-23. Base: `5e4c90b3`, with the local changes in this pass. No demo-repository changes, push, showcase PR or hosted CI run are included.++## Demonstrated workflow++The [fixture README](../../../../fixtures/Regression/CodeNativeAssembly/README.md) contains the commands and scope. Firmament source declares a reusable L-bracket Template and a separate circular SectionChain fastener. A named `Interface<Fixed>` / `Mate InstallFastener` binds their exposed semantic seating frames. No hand-authored fastener Placement is present.++The nominal bracket is 96 × 60 × 12 mm with 20 mm legs, a Ø6 through bore, and a Ø12 × 90° countersink. Its hole center is (76, 10) mm. The separate fastener has a Ø5.7 shaft, Ø12 × 90° head, 16 mm overall length and **0.5 mm × 45° tip chamfer**. The flat tip diameter is 4.7 mm. It is intentionally threadless and has no drive recess; the artifact is a fastener blank, not a released screw specification.++The second source changes only the hole X coordinate from 76 to 60 mm. The fastener follows from translation (76, 10, -4) to (60, 10, -4) mm. Its occurrence identity and definition STEP hash remain unchanged. Both Mate position and angular residuals are zero for the nominal cases.++## Engineering checks++The tests inspect actual materialized circle, cone and cylinder supports rather than relying only on the Mate residual:++- Fastener stations are (radius, local Z) = (2.35, 0), (2.85, 0.5), (2.85, 12.85), (6, 16) mm.+- Both tip and head conical carriers have a 45° semi-angle. The tip chamfer is a real conical face, not a display bevel.+- The world-space head cone and host countersink share apex (76, 10, 6) mm. The head top is flush at Z=12 mm and the tip extends to Z=-4 mm.+- Nominal shaft radial clearance is 0.15 mm. Piecewise-linear radius checks at the critical axial stations verify nominal coaxial noninterference and the intended conical contact.+- Independent proposed ±0.1 mm shaft/bore size limits yield 0.1–0.5 mm diametral clearance. They do **not** qualify angular/location stacks or conical seating under manufacturing variation. Retention, strength and a driving feature are outside this rehearsal.+- The solid is enclosed, orientation-consistent and export-preflight valid. A refined numerical mass estimate is checked against the analytic cylinder-plus-frusta volume within its reported bound; numerical mass is not labeled exact.++The fastener has 14 faces, 28 edges and 16 vertices: eight conical quadrant faces, four cylindrical quadrant faces, and two planar caps. The bracket has 22 faces, 50 edges and 30 vertices. The assembly bounds are (0, 0, -4) through (96, 60, 12) mm.++Both cases export AP242 and GLB. The AP242 importer qualifies two geometry definitions and two occurrences. Importing to a local component package and reexporting retains component count, world transforms, topology and local/world bounds. The imported package retains interchange-owned placements; it does not reconstruct the source's semantic Mate.++The optional PNG renderer consumes the actual GLB node matrices and mesh data, checks each component's world bounds, and shows a seated top view, exploded view and fastener detail. Explosion is presentation only. It is not a drawing or geometry authority.++## Gaps found and local repairs++1. **Checked dimensions did not reach SectionChain consumers.** The SectionChain owner now shares the existing compile-time value binder with boundary, Static and Template expansion, projects bound nominal scalars into the existing consumers and masks only their checked declaration spans for legacy readers. Unsupported manufacturing-tolerance consumers still reject explicitly.+2. **A full Circle2 profile could not enter the SectionChain span adapter.** It now becomes four exact deterministic circular quadrant spans. Explicitly segmented existing profiles retain their identities. This is not polygonal approximation.+3. **Ruled analytic recognition handled full circles but missed corresponding circular arcs.** Matching phase/sweep, coaxial arc spans now reuse the existing analytic cylinder/cone recognizer. Original arc evaluators and trims remain authoritative. Different phase/sweep must not claim exact conical representation.++The first attempt reordered expansion too broadly and broke guitar profile recipes / named polygon sets. The full suite exposed this. That attempt was stopped and its failure log retained. The final ordering binds scalar values, resolves boundaries while named sets still exist, expands Static/Section values, then specializes Template profiles. Existing guitar section-family tests pass again. No test expectations or legacy fixture geometry were loosened to obtain that result.++## Explicit remaining limits++- The initial run rejected the solid axis-touching Revolve meridian with `firmament-revolve-axis-touch-materialization-not-supported`. The follow-up now admits that bounded flat-ended full-turn case; its preserved specimen has moved to `fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmament`. More general Revolve repair remains separate work.+- SectionChain's Concept plane resolver accepts field-shaped plane values (`tip: Plane { ... }`). A declaration-shaped `Plane tip { ... }` did not resolve through that consumer. The fixture and public SectionChain documentation use the admitted form; this pass does not claim global reconciliation of plane productions.+- Assembly AP242 export intentionally does **not** promote the bracket Template's part-level PMI into assembly requirements. An empty PMI set is correct because this assembly declares none. Assembly PMI must be explicit in the root assembly document; it is not inferred from parts or Mates.+- No new assembly manufacturing PDF was generated. The existing standalone bracket drawing belongs to the preceding single-part demo. A future showcase PR should retain it as a separate bracket artifact and distinguish it from assembly geometry.+- Qualification is local Windows/.NET evidence. Hosted Linux CI and independent third-party CAD import are not claimed here. The showcase must pin a published Aetheris commit containing these repairs, not the older demo pin or an uncommitted working tree.++## Evidence and gates++Generated evidence is ignored under `artifacts/local/code-native-assembly/`:++- `rehearsal/qualification.json`: CLI qualification and source/definition hashes.+- `rehearsal/assembly.step`, `assembly.glb`, and `relocated.*`: real exports.+- `rehearsal/*-analysis.json`, `*-roundtrip-analysis.json`, `*-roundtrip-inspection.json`: product structure and geometry metrics before/after import and reexport.+- `rehearsal/fastener-validation.json`: normal validation reports `Built`, `UnifiedSectionChain`, valid.+- `rehearsal/solid-revolve-rejection.json`: preserved truthful unsupported alternative.+- `rehearsal/preview.png`: actual GLB visual review.+- `solution-build.log`, `focused-tests.log`, `fast-tests.log`, `full-tests.log`: qualification gates.+- `full-tests-initial-ordering-regression.log`: rejected intermediate expansion ordering, not acceptance evidence.++Final gates:++| Gate | Result |+| --- | --- |+| Release solution build, serial, shared compilation disabled | Passed; 0 errors, 11 warnings |+| Focused fastener, SectionChain and guitar Section-family tests | 37 passed |+| Core fast lane (`Category!=SlowCorpus`) | 1,088 passed |+| Complete solution suite, serial, including SlowCorpus | **5,929 passed, 0 failed, 0 skipped** |+| Local CLI rehearsal, both source cases and import/reexport | Passed |+| GLB component bounds and rendered visual review | Passed |+| `git diff --check` | Passed |++The full suite includes 3,157 Firmament tests, 1,243 Core tests, 641 CLI tests and seven editable V8 tests. `Aetheris.FrictionLab.Tests` reports no discoverable tests; it is not counted as coverage. No .NET test, compiler or MSBuild hosts remained after qualification. The solution build warnings include existing WebAssembly SQLite varargs and compiler warnings; a zero-warning build is not claimed.++## Code review++Changes stay in the SectionChain consumer and existing ruled-surface recognition owner. No new parser route, regex dispatch, geometry fallback, solver, service or runtime state was added. Circle subdivision is analytic and deterministic. Scalar projection uses existing value substitution and AST declaration boundaries; unbound declarations remain subject to normal admission. Public SectionChain documentation describes the accepted syntax and tolerance boundary.++## Verdict++**Success for the local rehearsal.** The separate chamfered fastener is semantically placed, moving the hole carries it without manual bookkeeping, and the product-structured exports survive Aetheris import/reexport with the tested geometry and placement intact. Existing regression suites pass after restoring the correct expansion ordering. This is bounded corpus and artifact evidence, not a claim of byte-identical output for every possible legacy input.++The next showcase PR should use the follow-up's primitive Compose source after the Aetheris repairs have a published commit to pin. Keep the prior standalone bracket PDF and its drawing checks as separate artifacts; document explicit assembly PMI ownership. That PR and its hosted CI remain outside this local run.diff --git a/docs/public/firmament/assembly-authoring-foundation.md b/docs/public/firmament/assembly-authoring-foundation.mdindex 7abcdcde..3bd90b3f 100644--- a/docs/public/firmament/assembly-authoring-foundation.md+++ b/docs/public/firmament/assembly-authoring-foundation.md@@ -31,7 +31,7 @@ parent origin, and `World` the current assembly root. Relative ports resolve onthe current occurrence, then its parent; qualified paths obey public boundaries.Named transforms are referenced as `Name.Frame`.-Translations require finite mm lengths; checked scalar Static/Record fields can supply translation and dimensionless basis components. Rotation requires X/Y/Z and finite deg. Manufacturing tolerances belong to the owning Part and explicit PMI, rather than Assembly frame values.+Translations require finite mm lengths; checked scalar Static/Record fields can supply translation and dimensionless basis components. Rotation requires X/Y/Z and finite deg. Manufacturing requirements belong to their declaring Part or Assembly and explicit PMI, rather than Assembly frame values. Part PMI is not inherited by assembly export: declare assembly PMI explicitly in the root `.firmasm`. Mates do not infer tolerance requirements. See [PMI ownership and assembly notes](pmi.md#assembly-release-records-and-design-notes).Optional paired Normal/Up vectors are dimensionless and expressed in the targetframe. Normal supplies Z, projected Up supplies Y, and Y cross Z supplies X.Zero/parallel vectors fail. Rotation applies in that constructed basis,diff --git a/docs/public/firmament/pmi.md b/docs/public/firmament/pmi.mdindex 356fad4f..ac6c007e 100644--- a/docs/public/firmament/pmi.md+++ b/docs/public/firmament/pmi.md@@ -104,6 +104,15 @@ Pattern-generated geometry may coexist with PMI, but the native lane does not ye## Assembly release records and design notes+PMI is owned by the document that declares it. A Part's `Pmi` describes that+Part; assembling it does not copy, promote or reinterpret those requirements as+assembly requirements. An assembly exported without its own `Pmi` or `Provenance` declaration has no+assembly-owned PMI, even when its component sources contain PMI. This is+intentional. Declare assembly requirements explicitly in the root `.firmasm`+file, using the admitted assembly PMI forms below. The standalone Part export+retains its own supported PMI. Mates determine placement; they do not infer+manufacturing requirements or propagate tolerances.+The assembly lane supports root-owned product annotations and a selected typedrelease Record. These lower through the existing semantic PMI note emitter toAP242 `SHAPE_ASPECT` and `PROPERTY_DEFINITION` entities, and are recovered bydiff --git a/docs/public/firmament/revolve.md b/docs/public/firmament/revolve.mdindex b9326b4e..8cd0a12f 100644--- a/docs/public/firmament/revolve.md+++ b/docs/public/firmament/revolve.md@@ -68,6 +68,10 @@ The safe domain is `0 < |Angle| <= full`. A negative angle reverses direction. ZRevolve materializes a standalone base solid from one validated outer line/arc loop. A one-sided line/arc Profile may produce exact plane, cylinder, cone, sphere, or torus carriers. Full revolutions use periodic seams; partial revolutions have stable `Start` and `End` closure faces. Segment descendants use `RevolvedSpan:<segment>` identity in the construction plan.-Profiles that cross the axis are rejected. A semicircle closed by its diameter is the admitted axis-touching sphere case. Other axis-touching loops and Profile inner loops are explicitly deferred rather than sent to degenerate topology. Add/Remove composition, multi-turn revolve, skew-axis projection, sheet/surface revolve, Thread, helix, and arbitrary Boolean operations are not X1 capabilities.+Profiles that cross the axis are rejected. A semicircle closed by its diameter produces an exact sphere. A full turn also admits a flat-ended, piecewise-linear solid meridian: exactly one straight axis closure, two radial cap segments, and a strictly axially monotone outer chain with positive radii. Its axis closure creates no material face; the radial segments become planar disk caps, and the outer segments become exact cylinders or cones. The [solid fastener meridian](../../../fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmament) is a complete example. Negative full turns produce the same solid.++Axis-touching partial turns, pointed tips with zero terminal radius, curved outer spans outside the sphere case, radial shoulders, nonmonotone outer chains and Profile inner loops remain unsupported. They reject before export instead of creating degenerate topology. Add/Remove composition of Revolve products, multi-turn revolve, skew-axis projection, sheet/surface revolve, Thread, helix and arbitrary Boolean operations are not supported.++For a part naturally described by cylindrical and conical masses, prefer [primitive Compose](../reference/language/solids-and-features.md#coaxial-primitive-compose) and a named edge finish. Revolve is available when an authored meridian is the clearest design description; it is not a requirement for making a shaft or fastener.Use `aetheris inspect part.firmament --json` to read `sweepRadians`, `sweepDegrees`, authored alias, direction, full/partial classification, axis, and Profile frame.diff --git a/docs/public/firmament/section-chains.md b/docs/public/firmament/section-chains.mdindex 0f783550..c089a06e 100644--- a/docs/public/firmament/section-chains.md+++ b/docs/public/firmament/section-chains.md@@ -4,6 +4,31 @@ A SectionChain builds a surface or closed body from an ordered sequence of frameFor two framed circle or ellipse profiles, [`Loft` and `Loft<Hollow>`](loft.md) provide concise ruled authoring with explicit point correspondence and optional twist. They lower into the same SectionChain path.+## Circular stations and checked dimensions++Use a capped `SectionChain` when framed profiles and their correspondence express the design. The complete [circular-station witness](../../../fixtures/Regression/CodeNativeAssembly/fastener-sections.firmament) uses named `Static` lengths, `Circle2` guides, traced Profiles and four named Sections. For a shaft built from cylindrical and conical masses, [primitive Compose](../reference/language/solids-and-features.md#coaxial-primitive-compose) and a named edge finish express that intent more directly. Build the SectionChain witness through the normal command:++```powershell+aetheris build fixtures/Regression/CodeNativeAssembly/fastener-sections.firmament --out artifacts/local/fastener-sections.step --json+```++The shared compile-time binder checks scalar `Static` values before their nominal dimensions reach profiles and station frames. Manufacturing tolerances on those values are currently rejected with `section-chain-tolerance-consumer-unsupported`; this domain does not project them into PMI.++Declare Concept plane values as fields when tracing them into construction frames:++```firmament+Concept Struct stations {+ tip: Plane { origin: [0mm, 0mm, 0mm]; normal: [0, 0, 1]; up: [0, 1, 0] }+}+Construction Plane tipFrame { trace: stations.tip }+```++A full circular profile gets four exact arc spans named `CircleQuadrant0` through `CircleQuadrant3`, starting at local +X and progressing counterclockwise. Corresponding circles share these span identities even when their guide names differ. In the `G0`/`Ruled` lane, coaxial matching arc spans produce exact cylindrical or conical supports. Rotated phase, different sweeps or noncoaxial stations do not qualify for that analytic recognition. Existing explicitly segmented profiles retain their authored span names.++For assembly placement, expose a terminal frame such as `Body.Section.Head.Frame` and bind it through an Interface and Mate. The [bracket and fastener assembly](../../../fixtures/Regression/CodeNativeAssembly/assembly.firmasm) uses primitive Compose with an explicit design-owned seating frame instead. A mathematical seating frame identifies placement; it does not itself assert planar material at the frame origin.++## Sections and correspondence+```textSection0 -> Section1 -> Section2 -> Section3```diff --git a/docs/public/reference/language/solids-and-features.md b/docs/public/reference/language/solids-and-features.mdindex 55ba4a8c..fd1d0182 100644--- a/docs/public/reference/language/solids-and-features.md+++ b/docs/public/reference/language/solids-and-features.md@@ -60,6 +60,27 @@ A Pocket always leaves a floor. Its required floor comes fromdefault, and the build fails when the floor would be thinner. Do not mix `depth`or a floor requirement with `end: ThroughAll`.+### Coaxial primitive Compose++A coaxial `Compose` can join positive-radius `Cylinder` and `Frustum` spans without sketches or Boolean union. The first span starts at the local origin along +Z; each later span names the previous span's top support, and their joining radii must match. For example:++```firmament+Model CountersunkFastener {+ units: mm+ Compose body {+ Cylinder shaft { radius: 2.85mm; height: 12.85mm }+ Frustum head { on: shaft.Top; bottomRadius: 2.85mm; topRadius: 6mm; height: 3.15mm }+ }+ Modify body {+ EdgeFinish<Chamfer> tip { on: shaft.Bottom; target: Boundary; distance: 0.5mm }+ }+}+```++This produces exact cylindrical, conical and planar supports. A chamfer on an exposed terminal Cylinder rim removes equal axial and radial distance, giving a 45° lead-in. Its distance must be smaller than both cylinder radius and height. One chamfer per exposed end is admitted. For a reusable Record/Template and assembly seat, see the [fastener library](../../../../fixtures/Regression/CodeNativeAssembly/fastener-library.firmament).++This bounded stack rejects arbitrary placements, mismatched joining radii, radial shoulders, overlapping or disjoint spans, mixed Profile/primitive operations, internal-rim finishes, Fillet, holes and part PMI on this Compose family. It also rejects typed tolerances that it cannot project. Other Compose families retain their own admitted operations.+## Holes| Variant | Fields |diff --git a/fixtures/Regression/CodeNativeAssembly/README.md b/fixtures/Regression/CodeNativeAssembly/README.mdnew file mode 100644index 00000000..95097cd4--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/README.md@@ -0,0 +1,32 @@+# Local code-native assembly rehearsal++This fixture extends the parametric L-bracket demo with a separate threadless countersunk fastener. It uses actual analytic BRep, a named `Mate`, and AP242 product structure. It does not publish to the showcase repository.++- `bracket.firmament`: reusable bracket Record and Template. The two Rect2 guides establish a six-edge profile; Compose extrudes it and Hole<Countersink> cuts the seat.+- `fastener-library.firmament`: reusable Fastener Record/Template; Compose joins a Cylinder shaft and Frustum head, then EdgeFinish<Chamfer> cuts the **0.5 mm × 45° tip chamfer**. Shaft Ø5.7, head Ø12 × 90°, overall length 16 mm.+- `fastener.firmament`: standalone instance of that same Template.+- `assembly.firmasm`: bracket hole at (76, 10) mm; `InstallFastener` mates exposed seating frames.+- `relocated.firmasm`: only hole X changes to 60 mm. The fastener follows without a manual Placement, and its definition geometry remains unchanged.+- `solid-fastener-revolve.firmament`: the formerly rejected solid-axis meridian now builds the same solid through the bounded flat-ended monotone full-turn lane.+- `fastener-sections.firmament`: retains the previous circular SectionChain version as geometry-parity/regression evidence; it is not the preferred fastener authoring recipe.++Build the CLI, then run the repeatable rehearsal from the repository root:++```powershell+dotnet build Aetheris.CLI -c Release -m:1 -nr:false -p:UseSharedCompilation=false+python fixtures/Regression/CodeNativeAssembly/rehearse.py+# Optional visual review of the actual GLB (requires numpy and matplotlib):+python fixtures/Regression/CodeNativeAssembly/rehearse.py --preview+```++The script writes JSON evidence, STEP and GLB to ignored `artifacts/local/code-native-assembly/primitive-rehearsal/`. It checks normal validate/build admission, named Mate satisfaction, moved placement, unchanged fastener definition, separate assembly components and STEP import/reexport qualification, transforms, topology and bounds. It also checks the admitted full-turn solid Revolve and truthful rejection of an unsupported partial axis-touching turn. The optional preview checks exported mesh bounds before rendering; its exploded view never changes the engineering artifact. A failed run exits nonzero and does not retain a previous successful qualification summary.++`CodeNativeAssemblyRehearsalTests` independently checks actual cone/cylinder carriers, circle radii and stations, enclosure, export preflight, bounded numerical volume versus the analytic frustum formula, and the nominal coaxial seat. Primitive Compose, full Revolve and the retained SectionChain witness meet the same shape checks. Unsupported placements, mismatched joining radii, fields and finishes reject in both validate and build. Assembly PMI tests prove that Part PMI is not inherited and that an explicit assembly Note changes annotations without changing geometry.++## Engineering scope++The nominal head is flush at bracket Z=12 mm. The tip extends to Z=-4 mm. The Ø5.7 shaft in a Ø6 bore gives 0.3 mm diametral clearance; independently proposed ±0.1 mm size limits give 0.1–0.5 mm diametral clearance. Those size limits alone do not qualify angular/location tolerance stacks, conical contact under manufacturing variation, strength or retention. There are no threads or drive recess: this is a fastener blank for an assembly demonstration, not a released screw specification.++PMI ownership is intentional: the bracket Template's part-level PMI stays with that Part and is not promoted into assembly requirements. Declare assembly PMI explicitly in the root `.firmasm`; the admitted assembly lane currently supports notes/release metadata, not inferred GD&T or tolerance constraints. The fixture has no assembly PMI declaration and therefore exports none. The existing standalone bracket drawing is separate; this rehearsal does not generate an assembly manufacturing drawing.++Coaxial primitive Compose admits matching-radius positive-height stacks and exposed terminal Cylinder chamfers. It rejects arbitrary placements, shoulders, internal-rim finishes, Fillet, holes and unsupported PMI/tolerance consumers. Solid axis-touching Revolve admits full turns with one axis closure, radial flat caps and a strictly monotone positive-radius line chain. Pointed tips, radial shoulders, curved outer chains outside the existing sphere case, nonmonotone profiles and axis-touching partial turns remain rejected.diff --git a/fixtures/Regression/CodeNativeAssembly/assembly.firmasm b/fixtures/Regression/CodeNativeAssembly/assembly.firmasmnew file mode 100644index 00000000..5dc9774d--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/assembly.firmasm@@ -0,0 +1,23 @@+include "bracket.firmament";+include "fastener-library.firmament";++Static bracketSpec: BracketSpec = BracketSpec {+ width: 96mm; height: 60mm; legWidth: 20mm; legHeight: 20mm; thickness: 12mm+ holeX: 76mm; holeY: 10mm; shaftDiameter: 6mm; entryDiameter: 12mm+}++Interface<Fixed> CountersunkSeat { }+Static fastenerSpec: FastenerSpec = FastenerSpec {+ shaftDiameter: 5.7mm; headDiameter: 12mm; length: 16mm; tipChamfer: 0.5mm+}+Assembly MountedBracket {+ <Assembly MountedBracket>+ <Part Bracket = Bracket<spec: bracketSpec>></Part>+ <Part Fastener = Fastener<spec: fastenerSpec>></Part>+ </Assembly>+ anchor: MountedBracket.Bracket;+ Mate InstallFastener: CountersunkSeat {+ A: MountedBracket.Bracket.FastenerSeat;+ B: MountedBracket.Fastener.HeadSeat;+ }+}diff --git a/fixtures/Regression/CodeNativeAssembly/bracket.firmament b/fixtures/Regression/CodeNativeAssembly/bracket.firmamentnew file mode 100644index 00000000..96570df6--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/bracket.firmament@@ -0,0 +1,46 @@+Record BracketSpec {+ width: Length+ height: Length+ legWidth: Length+ legHeight: Length+ thickness: Length+ holeX: Length+ holeY: Length+ shaftDiameter: Length+ entryDiameter: Length+}++Template<spec: BracketSpec> Struct Bracket {+ Require positive => spec.width > spec.legWidth && spec.height > spec.legHeight && spec.legWidth > 0mm && spec.legHeight > 0mm && spec.thickness > 0mm+ Concept Struct layout on XY {+ Rect2 horizontal { center: [spec.width / 2, spec.legHeight / 2]; size: [spec.width, spec.legHeight] }+ Rect2 vertical { center: [spec.legWidth / 2, spec.height / 2]; size: [spec.legWidth, spec.height] }+ Point2 notch { position: [spec.legWidth, spec.legHeight] }+ }+ Profile outline using layout { Loop Outer {+ horizontal.Bottom as south+ |> horizontal.Right as east+ |> horizontal.Top to notch as inner+ |> vertical.Right to vertical.TopRight as upright+ |> vertical.Top as north+ |> vertical.Left to horizontal.BottomLeft as west+ |> Close+ } }+ Compose body { Base stock { profile: outline; from: 0mm; to: spec.thickness; role: Stock } }+ Modify body { Hole<Countersink> mount {+ on: +Z+ center: Point2(spec.holeX, spec.holeY)+ diameter: spec.shaftDiameter+ countersinkDiameter: spec.entryDiameter+ countersinkAngle: 90deg+ end: ThroughAll+ } }+ Pmi {+ Datum A { target: face(+Z) }+ HoleDiameter shaftSize { target: mount; value: spec.shaftDiameter; tolerance: PlusMinus(0.1mm) }+ }+ expose {+ // Mathematical seating datum, not a claim of planar material at the hole center.+ Semantic FastenerSeat { DatumFrame Frame = [spec.holeX, spec.holeY, spec.thickness] x [1,0,0] y [0,1,0] z [0,0,1]; }+ }+}diff --git a/fixtures/Regression/CodeNativeAssembly/fastener-library.firmament b/fixtures/Regression/CodeNativeAssembly/fastener-library.firmamentnew file mode 100644index 00000000..653e9ee5--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/fastener-library.firmament@@ -0,0 +1,28 @@+Record FastenerSpec {+ shaftDiameter: Length+ headDiameter: Length+ length: Length+ tipChamfer: Length+}++Template<spec: FastenerSpec> Struct Fastener {+ Require positive => spec.shaftDiameter > 0mm && spec.headDiameter > spec.shaftDiameter && spec.tipChamfer > 0mm && spec.tipChamfer < spec.shaftDiameter / 2 && spec.length > (spec.headDiameter - spec.shaftDiameter) / 2 + spec.tipChamfer+ Compose Body {+ Cylinder shaft {+ radius: spec.shaftDiameter / 2+ height: spec.length - (spec.headDiameter - spec.shaftDiameter) / 2+ }+ Frustum head {+ on: shaft.Top+ bottomRadius: spec.shaftDiameter / 2+ topRadius: spec.headDiameter / 2+ height: (spec.headDiameter - spec.shaftDiameter) / 2+ }+ }+ Modify Body {+ EdgeFinish<Chamfer> tip { on: shaft.Bottom; target: Boundary; distance: spec.tipChamfer }+ }+ expose {+ Semantic HeadSeat { DatumFrame Frame = [0mm, 0mm, spec.length] x [1,0,0] y [0,1,0] z [0,0,1]; }+ }+}diff --git a/fixtures/Regression/CodeNativeAssembly/fastener-sections.firmament b/fixtures/Regression/CodeNativeAssembly/fastener-sections.firmamentnew file mode 100644index 00000000..6922612e--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/fastener-sections.firmament@@ -0,0 +1,40 @@+schema SectionChain+Model Fastener {+ units: mm+ Static shaftDiameter: Length = 5.7mm+ Static headDiameter: Length = 12mm+ Static length: Length = 16mm+ Static tipChamfer: Length = 0.5mm++ Concept Struct stations {+ tip: Plane { origin: [0mm, 0mm, 0mm]; normal: [0,0,1]; up: [0,1,0] }+ leadIn: Plane { origin: [0mm, 0mm, tipChamfer]; normal: [0,0,1]; up: [0,1,0] }+ neck: Plane { origin: [0mm, 0mm, length - (headDiameter - shaftDiameter) / 2]; normal: [0,0,1]; up: [0,1,0] }+ head: Plane { origin: [0mm, 0mm, length]; normal: [0,0,1]; up: [0,1,0] }+ }+ Construction Plane tipFrame { trace: stations.tip }+ Construction Plane leadInFrame { trace: stations.leadIn }+ Construction Plane neckFrame { trace: stations.neck }+ Construction Plane headFrame { trace: stations.head }++ Circle2 tipCircle { center: [0mm, 0mm]; radius: shaftDiameter / 2 - tipChamfer }+ Circle2 shaftCircle { center: [0mm, 0mm]; radius: shaftDiameter / 2 }+ Circle2 headCircle { center: [0mm, 0mm]; radius: headDiameter / 2 }+ Profile tipOutline { Loop Outer { tipCircle |> TraceLoop } }+ Profile shaftOutline { Loop Outer { shaftCircle |> TraceLoop } }+ Profile headOutline { Loop Outer { headCircle |> TraceLoop } }++ SectionChain Body {+ continuity: G0+ transition: Ruled+ Section Tip { frame: tipFrame; profile: tipOutline }+ Section LeadIn { frame: leadInFrame; profile: shaftOutline }+ Section Neck { frame: neckFrame; profile: shaftOutline }+ Section Head { frame: headFrame; profile: headOutline }+ start: Cap+ end: Cap+ }+ expose {+ Semantic HeadSeat { DatumFrame Frame = Body.Section.Head.Frame; }+ }+}diff --git a/fixtures/Regression/CodeNativeAssembly/fastener.firmament b/fixtures/Regression/CodeNativeAssembly/fastener.firmamentnew file mode 100644index 00000000..2709fe9d--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/fastener.firmament@@ -0,0 +1,9 @@+include "fastener-library.firmament";++Model FastenerPart {+ units: mm+ Static fastenerSpec: FastenerSpec = FastenerSpec {+ shaftDiameter: 5.7mm; headDiameter: 12mm; length: 16mm; tipChamfer: 0.5mm+ }+ Struct fastener = Fastener<spec: fastenerSpec>+}diff --git a/fixtures/Regression/CodeNativeAssembly/rehearse.py b/fixtures/Regression/CodeNativeAssembly/rehearse.pynew file mode 100644index 00000000..51f5160b--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/rehearse.py@@ -0,0 +1,206 @@+"""Rehearse the two-component showcase through the real CLI; no hosted actions.++Build Aetheris.CLI in Release first. Python 3 alone runs qualification;+--preview additionally uses numpy and matplotlib to render the exported GLB.+"""+import argparse+import hashlib+import json+from pathlib import Path+import struct+import subprocess+++def require(condition, message):+ if not condition:+ raise RuntimeError(message)+++def near(actual, expected):+ return len(actual) == len(expected) and all(abs(a - b) < 1e-8 for a, b in zip(actual, expected))+++def preview(glb, output):+ # Read the artifact, including its actual component and unit transforms.+ # Exploding the right-hand view is a display operation only.+ import numpy as np+ import matplotlib+ matplotlib.use("Agg")+ import matplotlib.pyplot as plt+ from mpl_toolkits.mplot3d.art3d import Poly3DCollection++ data = glb.read_bytes()+ magic, version, size = struct.unpack_from("<4sII", data)+ require((magic, version, size) == (b"glTF", 2, len(data)), "Invalid GLB header")+ chunks, offset = {}, 12+ while offset < len(data):+ length, kind = struct.unpack_from("<II", data, offset)+ chunks[kind] = data[offset + 8:offset + 8 + length]+ offset += length + 8+ document = json.loads(chunks[0x4E4F534A])+ binary = chunks[0x004E4942]++ def accessor(index):+ a = document["accessors"][index]+ v = document["bufferViews"][a["bufferView"]]+ dtype = {5126: "<f4", 5125: "<u4", 5123: "<u2", 5121: "u1"}[a["componentType"]]+ count = {"VEC3": 3, "SCALAR": 1}[a["type"]]+ element = np.dtype(dtype).itemsize+ return np.ndarray((a["count"], count), dtype=dtype, buffer=binary,+ offset=v.get("byteOffset", 0) + a.get("byteOffset", 0),+ strides=(v.get("byteStride", element * count), element)).copy()++ components = {}++ def visit(index, parent):+ node = document["nodes"][index]+ require("rotation" not in node and "scale" not in node and "translation" not in node,+ "Preview expects the exporter's explicit node matrices")+ world = parent @ np.array(node.get("matrix", np.eye(4).flatten()), dtype=float).reshape((4, 4), order="F")+ if "mesh" in node:+ faces = []+ for primitive in document["meshes"][node["mesh"]]["primitives"]:+ require(primitive.get("mode", 4) == 4, "Preview requires triangle primitives")+ positions = accessor(primitive["attributes"]["POSITION"])+ transformed = (world @ np.column_stack([positions, np.ones(len(positions))]).T).T[:, :3]+ mm = transformed[:, [0, 2, 1]] * [1000, -1000, 1000]+ indices = accessor(primitive["indices"]).reshape((-1, 3))+ faces.append(mm[indices])+ components[node["name"].split(".")[-1]] = np.concatenate(faces)+ for child in node.get("children", []):+ visit(child, world)++ for root in document["scenes"][document.get("scene", 0)]["nodes"]:+ visit(root, np.eye(4))+ require(set(components) == {"Bracket", "Fastener"}, "GLB lost separate component names")+ for name, low, high in [("Bracket", [0, 0, 0], [96, 60, 12]),+ ("Fastener", [70, 4, -4], [82, 16, 12])]:+ vertices = components[name].reshape((-1, 3))+ require(np.allclose(vertices.min(0), low, atol=1e-4, rtol=0) and+ np.allclose(vertices.max(0), high, atol=1e-4, rtol=0), "Rendered bounds disagree: " + name)++ fig = plt.figure(figsize=(15, 6), facecolor="white", layout="constrained")+ def front_faces(triangles, elevation, azimuth):+ elevation, azimuth = np.radians([elevation, azimuth])+ view = [np.cos(elevation) * np.cos(azimuth), np.cos(elevation) * np.sin(azimuth), np.sin(elevation)]+ normals = np.cross(triangles[:, 1] - triangles[:, 0], triangles[:, 2] - triangles[:, 0])+ return triangles[normals @ view > 0]++ for index, exploded in [(1, False), (2, True)]:+ ax = fig.add_subplot(1, 3, index, projection="3d")+ elevation, azimuth = (27, -65) if exploded else (90, -90)+ all_faces, colors = [], []+ for name, triangles in components.items():+ displayed = triangles.copy()+ if exploded and name == "Fastener":+ displayed[:, :, 2] += 24+ displayed = front_faces(displayed, elevation, azimuth)+ all_faces.extend(displayed)+ colors.extend(["#cf9e49" if name == "Fastener" else "#7c98aa"] * len(displayed))+ # One collection sorts triangles across both components, so a seated head+ # isn't incorrectly hidden by a whole-object painter's ordering.+ ax.add_collection3d(Poly3DCollection(all_faces, facecolors=colors, edgecolor="none", linewidth=0, antialiased=False, shade=True,+ lightsource=matplotlib.colors.LightSource(140, 40)))+ ax.set(xlim=(-3, 100), ylim=(-3, 64), zlim=(-6, 40), title="Exploded view · display only" if exploded else "Seated · top view · head flush")+ ax.set_box_aspect((103, 67, 46))+ ax.view_init(elevation, azimuth)+ ax.set_axis_off()+ ax = fig.add_subplot(1, 3, 3, projection="3d")+ triangles = components["Fastener"] - [76, 10, -4]+ triangles = front_faces(triangles, 8, -78)+ ax.add_collection3d(Poly3DCollection(triangles, facecolors="#cf9e49", edgecolor="none", linewidth=0, antialiased=False, shade=True,+ lightsource=matplotlib.colors.LightSource(140, 40)))+ ax.set(xlim=(-6.5, 6.5), ylim=(-6.5, 6.5), zlim=(-1, 17), title="Threadless countersunk fastener")+ ax.set_box_aspect((13, 13, 18))+ ax.view_init(8, -78)+ ax.set_axis_off()+ ax.text2D(.08, .08, "Tip: 0.5 mm × 45° chamfer\nShaft Ø5.7 · head Ø12 × 90° · length 16 mm", transform=ax.transAxes, fontsize=10)+ fig.suptitle("Local assembly rehearsal · nominal geometry preview, not a manufacturing drawing", fontsize=14)+ fig.savefig(output, dpi=160)+ plt.close(fig)+++def main():+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--out", type=Path, default=Path("artifacts/local/code-native-assembly/primitive-rehearsal"))+ parser.add_argument("--preview", action="store_true")+ args = parser.parse_args()+ root = Path(__file__).resolve().parents[3]+ source = Path(__file__).resolve().parent+ output = (root / args.out).resolve()+ output.mkdir(parents=True, exist_ok=True)+ (output / "qualification.json").unlink(missing_ok=True)+ cli = root / "Aetheris.CLI/bin/Release/net10.0/aetheris.dll"+ require(cli.is_file(), "Build Aetheris.CLI in Release first")++ def run(name, *arguments, accepted=True):+ result = subprocess.run(["dotnet", str(cli), *map(str, arguments), "--json"],+ cwd=root, capture_output=True, text=True, encoding="utf-8")+ (output / (name + ".json")).write_text(result.stdout, encoding="utf-8")+ if result.stderr:+ (output / (name + ".stderr.txt")).write_text(result.stderr, encoding="utf-8")+ require((result.returncode == 0) == accepted, name + " unexpected exit: " + result.stdout[:1500] + result.stderr[:500])+ return json.loads(result.stdout)++ validation = run("fastener-validation", "validate", source / "fastener.firmament")+ require(validation["firmamentV2Validation"]["validationLevel"] == "Built", "Fastener wasn't admitted through build")+ require(validation["firmamentV2Validation"]["parserRoute"] == "UnifiedMechanical", "Primitive Compose left unified mechanical admission")+ run("fastener-build", "build", source / "fastener.firmament", "--out", output / "fastener.step")+ run("fastener-verification", "verify", output / "fastener.step", "--evidence-dir", output / "verification")+ run("solid-revolve-validation", "validate", source / "solid-fastener-revolve.firmament")+ run("solid-revolve-build", "build", source / "solid-fastener-revolve.firmament", "--out", output / "solid-fastener-revolve.step")+ unsupported = output / "unsupported-partial-revolve.firmament"+ unsupported.write_text((source / "solid-fastener-revolve.firmament").read_text().replace("angle: full", "angle: half"), encoding="utf-8")+ rejected = run("partial-solid-revolve-rejection", "validate", unsupported, accepted=False)+ require("firmament-revolve-axis-touch-materialization-not-supported" in json.dumps(rejected), "Partial Revolve limitation changed; review fixture")++ inspections = []+ for name, x in [("assembly", 76), ("relocated", 60)]:+ inspection = run(name + "-inspection", "asm", "inspect", source / (name + ".firmasm"))+ require(inspection["success"], name + " was rejected")+ geometry = inspection["geometryArtifact"]+ require(len(geometry["definitions"]) == 2, "Definitions were merged")+ require(all(r["passed"] for r in geometry["mateResiduals"]) and len(geometry["mateResiduals"]) == 1, "Mate was not satisfied")+ fastener = next(i for i in inspection["assemblyIr"]["instances"] if i["path"]["segments"][-1] == "Fastener")+ require(near(fastener["resolvedTransform"]["matrix"][12:15], [x, 10, -4]), "Semantic placement did not follow the hole")+ run(name + "-step-export", "asm", "export-ap242", source / (name + ".firmasm"), "--out", output / (name + ".step"))+ run(name + "-glb-export", "asm", "export-glb", source / (name + ".firmasm"), output / (name + ".glb"))+ analysis = run(name + "-analysis", "analyze", "assembly", output / (name + ".step"))+ require(analysis["importStatus"] == "Qualified" and analysis["definitionCount"] == analysis["occurrenceCount"] == analysis["bodyCount"] == 2,+ "STEP assembly failed product-structure qualification")+ require(near(analysis["assemblyBoundingBox"]["minimum"], [0, 0, -4]) and+ near(analysis["assemblyBoundingBox"]["maximum"], [96, 60, 12]), "Unexpected assembly bounds")+ imported = run(name + "-import", "asm", "import-step", output / (name + ".step"), "--out", output / (name + "-roundtrip"))+ run(name + "-roundtrip-export", "asm", "export-ap242", imported["firmasmPath"], "--out", output / (name + "-roundtrip.step"))+ roundtrip = run(name + "-roundtrip-analysis", "analyze", "assembly", output / (name + "-roundtrip.step"))+ require(roundtrip["definitionCount"] == roundtrip["occurrenceCount"] == roundtrip["bodyCount"] == 2 and+ roundtrip["importStatus"] == "Qualified", "STEP roundtrip lost components")+ # Imported occurrence identifiers are interchange-owned; compare transforms and geometry, not spelling.+ before = sorted(tuple(o["worldTransform"]) for o in analysis["occurrences"])+ after = sorted(tuple(o["worldTransform"]) for o in roundtrip["occurrences"])+ require(all(near(a, b) for a, b in zip(before, after)), "Roundtrip placement changed")+ require(roundtrip["assemblyBoundingBox"] == analysis["assemblyBoundingBox"], "Roundtrip bounds changed")+ replay = run(name + "-roundtrip-inspection", "asm", "inspect", imported["firmasmPath"])+ def metrics(artifact):+ return sorted(json.dumps(d["metrics"], sort_keys=True) for d in artifact["geometryArtifact"]["definitions"])+ require(metrics(replay) == metrics(inspection), "Roundtrip changed component topology or local bounds")+ inspections.append(inspection)+ hashes = [next(d["stepSha256"] for d in i["geometryArtifact"]["definitions"] if d["definitionIdentity"].startswith("Fastener<")) for i in inspections]+ require(hashes[0] == hashes[1], "Hole relocation changed the fastener definition")+ if args.preview:+ preview(output / "assembly.glb", output / "preview.png")+ summary = {"status": "passed", "sourceHead": subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True).strip(),+ "workingTreeChanges": subprocess.check_output(["git", "status", "--porcelain"], cwd=root, text=True).splitlines(),+ "sourceHashes": {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in source.glob("*.firma*")},+ "fastenerDefinitionSha256": hashes[0], "components": 2, "mateResidualMm": 0,+ "tipChamferMm": .5, "tipChamferDegrees": 45,+ "diametralClearanceMm": {"nominal": .3, "minimumWithIndependentPlusMinus0_1mmSizes": .1, "maximum": .5},+ "limits": ["Nominal seat checked; angular/location tolerance stacks, retention and strength unqualified.",+ "Part PMI stays part-owned by design. Assembly PMI requires an explicit assembly declaration; no assembly manufacturing drawing generated.",+ "Solid axis-touching Revolve admits full turns of flat-ended monotone line stacks; other axis-touching shapes remain unsupported."]}+ (output / "qualification.json").write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8")+ print(json.dumps(summary, indent=2))+++if __name__ == "__main__":+ main()diff --git a/fixtures/Regression/CodeNativeAssembly/relocated.firmasm b/fixtures/Regression/CodeNativeAssembly/relocated.firmasmnew file mode 100644index 00000000..fb1d5b8b--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/relocated.firmasm@@ -0,0 +1,23 @@+include "bracket.firmament";+include "fastener-library.firmament";++Static bracketSpec: BracketSpec = BracketSpec {+ width: 96mm; height: 60mm; legWidth: 20mm; legHeight: 20mm; thickness: 12mm+ holeX: 60mm; holeY: 10mm; shaftDiameter: 6mm; entryDiameter: 12mm+}++Interface<Fixed> CountersunkSeat { }+Static fastenerSpec: FastenerSpec = FastenerSpec {+ shaftDiameter: 5.7mm; headDiameter: 12mm; length: 16mm; tipChamfer: 0.5mm+}+Assembly MountedBracket {+ <Assembly MountedBracket>+ <Part Bracket = Bracket<spec: bracketSpec>></Part>+ <Part Fastener = Fastener<spec: fastenerSpec>></Part>+ </Assembly>+ anchor: MountedBracket.Bracket;+ Mate InstallFastener: CountersunkSeat {+ A: MountedBracket.Bracket.FastenerSeat;+ B: MountedBracket.Fastener.HeadSeat;+ }+}diff --git a/fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmament b/fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmamentnew file mode 100644index 00000000..2f6d4a25--- /dev/null+++ b/fixtures/Regression/CodeNativeAssembly/solid-fastener-revolve.firmament@@ -0,0 +1,10 @@+// Regression for the formerly rejected flat-ended axis-touching solid meridian.+Model ChamferedFastener {+ units: mm+ Axis spindle { origin: [0mm, 0mm, 0mm]; direction: [0, 0, 1] }+ Concept Struct meridian on XZ {+ Polygon2 section { points: [[0mm, 0mm], [2.35mm, 0mm], [2.85mm, 0.5mm], [2.85mm, 12.85mm], [6mm, 16mm], [0mm, 16mm]] }+ }+ Profile outline using meridian { Loop Outer { section |> TraceLoop } }+ Revolve body { profile: outline; about: spindle; angle: full }+}