Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add exact volume support for straight Profile fillets
Yuechen Lie8dc6e80a493
diff --git a/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs b/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.csindex 428961f3..26f08f91 100644--- a/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs+++ b/Aetheris.Kernel.Core/Brep/Verification/BrepMassProperties.cs@@ -102,6 +102,17 @@ public static class BrepMassPropertiesreturn CompleteExactPrismResult(body, effective, exact);}+ // A finite straight Profile fillet on an otherwise axis-aligned box is+ // a second exact bounded family. The materializer emits the retained+ // box corners, one exact quarter-cylinder, and two circular end trims.+ // Generic display triangulation is deliberately too coarse to verify a+ // tight analytic Assert Volume here, so recognize this topology from+ // the emitted B-rep (never from Firmament construction metadata).+ if (TryEvaluateExactAxisAlignedBoxQuarterCylinderFillet(body, effective, topology, out exact))+ {+ return exact;+ }+var coarse = EvaluateAtResolution(body, effective, refinement: 1);if (coarse.Error is not null){@@ -416,6 +427,112 @@ public static class BrepMassProperties}}+ private static bool TryEvaluateExactAxisAlignedBoxQuarterCylinderFillet(+ BrepBody body,+ BrepMassPropertiesOptions options,+ BrepMassPropertiesTopologyDiagnostics topology,+ out BrepMassPropertiesResult result)+ {+ result = default!;+ var faces = body.Topology.Faces.ToArray();+ if (faces.Length != 9)+ {+ return false;+ }++ var cylinders = faces+ .Select(face => body.TryGetFaceSurfaceGeometry(face.Id, out var surface) ? surface : null)+ .Where(surface => surface?.Kind == SurfaceGeometryKind.Cylinder && surface.Cylinder.HasValue)+ .Select(surface => surface!.Cylinder!.Value)+ .ToArray();+ if (cylinders.Length != 1 || faces.Any(face => !body.TryGetFaceSurfaceGeometry(face.Id, out var surface) || surface is null || surface.Kind is not (SurfaceGeometryKind.Plane or SurfaceGeometryKind.Cylinder)))+ {+ return false;+ }++ var vertices = body.Topology.Vertices+ .Select(vertex => body.TryGetVertexPoint(vertex.Id, out var point) ? (Point3D?)point : (Point3D?)null)+ .ToArray();+ if (vertices.Any(point => point is null))+ {+ return false;+ }++ var points = vertices.Select(point => point!.Value).ToArray();+ var minX = points.Min(point => point.X); var maxX = points.Max(point => point.X);+ var minY = points.Min(point => point.Y); var maxY = points.Max(point => point.Y);+ var minZ = points.Min(point => point.Z); var maxZ = points.Max(point => point.Z);+ var tolerance = options.LinearTolerance;+ var sizeX = maxX - minX; var sizeY = maxY - minY; var sizeZ = maxZ - minZ;+ if (sizeX <= tolerance || sizeY <= tolerance || sizeZ <= tolerance || !HasAllBoxCorners(points, minX, maxX, minY, maxY, minZ, maxZ, tolerance))+ {+ return false;+ }++ var cylinder = cylinders[0];+ var axis = cylinder.Axis.ToVector();+ var axisIsX = System.Math.Abs(System.Math.Abs(axis.X) - 1d) <= 1e-8 && System.Math.Abs(axis.Y) <= 1e-8 && System.Math.Abs(axis.Z) <= 1e-8;+ var axisIsY = System.Math.Abs(System.Math.Abs(axis.Y) - 1d) <= 1e-8 && System.Math.Abs(axis.X) <= 1e-8 && System.Math.Abs(axis.Z) <= 1e-8;+ if (!axisIsX && !axisIsY)+ {+ return false;+ }++ var endpointCircles = body.Bindings.EdgeBindings+ .Select(binding => body.Geometry.TryGetCurve(binding.CurveGeometryId, out var curve) ? curve : null)+ .Where(curve => curve?.Kind == CurveGeometryKind.Circle3 && curve.Circle3.HasValue)+ .Select(curve => curve!.Circle3!.Value)+ .Distinct()+ .ToArray();+ if (endpointCircles.Length != 2 || endpointCircles.Any(circle => System.Math.Abs(circle.Radius - cylinder.Radius) > tolerance))+ {+ return false;+ }++ var span = (endpointCircles[1].Center - endpointCircles[0].Center).Length;+ if (span <= tolerance)+ {+ return false;+ }++ var boxVolume = sizeX * sizeY * sizeZ;+ var removedVolume = span * cylinder.Radius * cylinder.Radius * (1d - (System.Math.PI / 4d));+ var exactVolume = boxVolume - removedVolume;+ if (exactVolume <= 0d)+ {+ return false;+ }++ var boundary = EvaluateAtResolution(body, options, refinement: 2);+ if (boundary.Error is not null)+ {+ return false;+ }++ var sign = boundary.SignedVolume < 0d ? -1d : 1d;+ Point3D? centroid = System.Math.Abs(boundary.SignedVolume) > 1e-18d+ ? new Point3D(boundary.CentroidNumerator.X / boundary.SignedVolume, boundary.CentroidNumerator.Y / boundary.SignedVolume, boundary.CentroidNumerator.Z / boundary.SignedVolume)+ : null;+ result = new BrepMassPropertiesResult(+ BrepMassPropertiesStatus.NumericalConverged,+ sign * exactVolume,+ exactVolume,+ boundary.SurfaceArea,+ centroid,+ topology.IsEnclosed,+ topology.IsOrientationConsistent,+ boundary.Contributions,+ "ExactAxisAlignedBoxQuarterCylinderFillet",+ 0d,+ options,+ topology,+ ["Exact axis-aligned box volume minus finite quarter-cylinder removal was recovered from emitted B-rep topology, analytic cylinder radius, and exact circular end trims."]);+ return true;++ static bool HasAllBoxCorners(IReadOnlyList<Point3D> points, double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double tolerance)+ => new[] { minX, maxX }.All(x => new[] { minY, maxY }.All(y => new[] { minZ, maxZ }.All(z => points.Any(point => System.Math.Abs(point.X - x) <= tolerance && System.Math.Abs(point.Y - y) <= tolerance && System.Math.Abs(point.Z - z) <= tolerance))));+ }+private static bool TryEvaluateExactSphereCylinderSeamBody(BrepBody body,BrepMassPropertiesOptions options,diff --git a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferFixtureTests.cs b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferFixtureTests.csindex 0135853b..8bb7aac7 100644--- a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferFixtureTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferFixtureTests.cs@@ -24,6 +24,14 @@ public sealed class ProfileBoundaryChamferFixtureTestsAssert.True(first.IsSuccess, string.Join(Environment.NewLine, first.Diagnostics.Select(x => x.Message)));Assert.True(second.IsSuccess, string.Join(Environment.NewLine, second.Diagnostics.Select(x => x.Message)));+ if (string.Equals(fixtureName, "profile-straight-edge-fillet-top.firmament", StringComparison.Ordinal))+ {+ var assertion = Assert.Single(first.Value.Export.Assertions!);+ Assert.True(assertion.Passed);+ Assert.Equal("ExactAxisAlignedBoxQuarterCylinderFillet", assertion.MeasurementMethod);+ Assert.NotNull(assertion.AbsoluteDeltaMm3);+ Assert.InRange(assertion.AbsoluteDeltaMm3!.Value, 0d, 1e-9d);+ }Assert.Equal(first.Value.Export.StepText, second.Value.Export.StepText);var imported = Step242Importer.ImportBody(first.Value.Export.StepText);Assert.True(imported.IsSuccess, string.Join(Environment.NewLine, imported.Diagnostics.Select(x => x.Message)));@@ -191,6 +199,8 @@ public sealed class ProfileBoundaryChamferFixtureTests[InlineData("profile-chamfer-reflex-inset-collapse.firmament", "ProfileBoundaryChamferInsetCollapse")][InlineData("profile-fillet-reflex-junction-not-materialized.firmament", "ProfileBoundaryFilletReflexRadiusTooLarge")][InlineData("profile-straight-edge-fillet-shaft-collision.firmament", "ProfileBoundaryFilletIntersectsShaft")]+ [InlineData("profile-edgefinish-convex-small-chamfer-invalid.firmament", "ProfileBoundaryChamferConvexArcRadiusTooSmall")]+ [InlineData("profile-edgefinish-convex-small-fillet-invalid.firmament", "ProfileBoundaryFilletConvexArcSpindleUnsupported")]public void InvalidFixture_ProducesTypedProfileBoundaryDiagnostic(string fixtureName, string diagnostic){var source = FirmamentCorpusHarness.ResolveFixtureFullPath($"fixtures/FirmamentV2/Canonical/invalid/{fixtureName}");diff --git a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferTests.cs b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferTests.csindex 3754e5d8..c0e05034 100644--- a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferTests.cs+++ b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileBoundaryChamferTests.cs@@ -205,13 +205,13 @@ public sealed class ProfileBoundaryChamferTestsAssert.True(ProfileBoundaryChamferSourceBinder.TryBind(chamfer, CurvedProfile(), "Bracket", out var chamferTarget, out var distance, out var chamferDiagnostic), chamferDiagnostic);var chamferPlan = ProfileBoundaryChamferPlanner.TryPlan(CurvedProfile(), chamferTarget!, distance);Assert.False(chamferPlan.Succeeded);- Assert.StartsWith("ProfileBoundaryChamferArcSegmentPlannerRequired:station=ReflexSmall:scope=Target:segment=ReflexSmallArc:sourceFamily=Arc:material=Reflex:sourceRadius=2:finishDistance=4:radiusRelation=LessThan:missingPlanner=ChamferArcDerivedExtrusionEdge", Assert.Single(chamferPlan.Diagnostics));+ Assert.StartsWith("ProfileBoundaryChamferArcMaterializationNotImplemented:station=ReflexSmall:scope=Target:segment=ReflexSmallArc:sourceFamily=Arc:material=Reflex:sourceRadius=2:finishDistance=4:radiusRelation=LessThan:planner=ArcChamferConePlan:surfaceFamily=Cone:regularity=Regular:admission=Supported", Assert.Single(chamferPlan.Diagnostics));const string fillet = "Modify Body { EdgeFinish TopRound { Target: Bracket.Outer On: Top Kind: Fillet Radius: 4mm } }";Assert.True(ProfileBoundaryChamferSourceBinder.TryBindFillet(fillet, CurvedProfile(), "Bracket", out var filletTarget, out var radius, out var clearance, out var filletDiagnostic), filletDiagnostic);var filletPlan = ProfileFilletShellPlanner.TryPlan(CurvedProfile(), filletTarget!, radius, clearance);Assert.False(filletPlan.Succeeded);- Assert.StartsWith("ProfileBoundaryFilletArcSegmentPlannerRequired:station=ReflexSmall:scope=Target:segment=ReflexSmallArc:sourceFamily=Arc:material=Reflex:sourceRadius=2:finishRadius=4:radiusRelation=LessThan:missingPlanner=FilletArcDerivedExtrusionEdge", Assert.Single(filletPlan.Diagnostics));+ Assert.StartsWith("ProfileBoundaryFilletArcMaterializationNotImplemented:station=ReflexSmall:scope=Target:segment=ReflexSmallArc:sourceFamily=Arc:material=Reflex:sourceRadius=2:finishRadius=4:radiusRelation=LessThan:planner=ArcFilletTorusPlan:surfaceFamily=Torus:regularity=Regular:admission=Supported", Assert.Single(filletPlan.Diagnostics));}[Fact]diff --git a/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishAnalyticPolicyTests.cs b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishAnalyticPolicyTests.csnew file mode 100644index 00000000..d8873449--- /dev/null+++ b/Aetheris.Kernel.Firmament.Tests/Integration/ProfileEdgeFinishAnalyticPolicyTests.cs@@ -0,0 +1,77 @@+using Aetheris.Kernel.Firmament.Materializer;++namespace Aetheris.Kernel.Firmament.Tests.Integration;++public sealed class ProfileEdgeFinishAnalyticPolicyTests+{+ public static IEnumerable<object[]> ChamferRows()+ {+ yield return Row("ConvexSharp", ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Convex, 0d, "LineChamferPlan", ProfileEdgeFinishSurfaceFamily.Plane, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ConvexSmall", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 2d, "ArcChamferCollapsedOffsetRejected", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Invalid, ProfileEdgeFinishAdmission.UnsupportedWithTypedDiagnostic);+ yield return Row("ConvexMedium", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 4d, "ArcChamferApexPlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.BoundedDegenerate, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy);+ yield return Row("ConvexLarge", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 8d, "ArcChamferConePlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexSharp", ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Reflex, 0d, "LineChamferPlan", ProfileEdgeFinishSurfaceFamily.Plane, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexSmall", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 2d, "ArcChamferConePlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexMedium", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 4d, "ArcChamferConePlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexLarge", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 8d, "ArcChamferConePlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ }++ public static IEnumerable<object[]> FilletRows()+ {+ yield return Row("ConvexSharp", ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Convex, 0d, "ConvexSharpSphereJunctionPlan", ProfileEdgeFinishSurfaceFamily.Sphere, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ConvexSmall", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 2d, "ArcFilletSpindleRejected", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Invalid, ProfileEdgeFinishAdmission.UnsupportedWithTypedDiagnostic);+ yield return Row("ConvexMedium", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 4d, "ArcFilletSphereLimitPlan", ProfileEdgeFinishSurfaceFamily.Sphere, ProfileEdgeFinishRegularity.BoundedDegenerate, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy);+ yield return Row("ConvexLarge", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 8d, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.InteropSensitive, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy);+ yield return Row("ReflexSharp", ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Reflex, 0d, "ReflexSharpExactRollingPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.InteropSensitive, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy);+ yield return Row("ReflexSmall", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 2d, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexMedium", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 4d, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ yield return Row("ReflexLarge", ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex, 8d, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported);+ }++ [Theory]+ [MemberData(nameof(ChamferRows))]+ public void ChamferMatrixIsExplicit(string station, ProfileEdgeFinishSourceFamily source, ProfileEdgeFinishMaterialSide material, double radius, string planner, ProfileEdgeFinishSurfaceFamily surface, ProfileEdgeFinishRegularity regularity, ProfileEdgeFinishAdmission admission)+ => AssertPolicy(new(station, ProfileEdgeFinishKind.Chamfer, source, material, radius, 4d), planner, surface, regularity, admission);++ [Theory]+ [MemberData(nameof(FilletRows))]+ public void FilletMatrixIsExplicit(string station, ProfileEdgeFinishSourceFamily source, ProfileEdgeFinishMaterialSide material, double radius, string planner, ProfileEdgeFinishSurfaceFamily surface, ProfileEdgeFinishRegularity regularity, ProfileEdgeFinishAdmission admission)+ => AssertPolicy(new(station, ProfileEdgeFinishKind.Fillet, source, material, radius, 4d), planner, surface, regularity, admission);++ [Fact]+ public void TorusAndSphereLimitsAreTypedRatherThanAccidental()+ {+ var sphere = ProfileEdgeFinishAnalyticPolicy.Classify(new("ConvexMedium", ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 4d, 4d));+ var horn = ProfileEdgeFinishAnalyticPolicy.Classify(new("ConvexLarge", ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 8d, 4d));+ var spindle = ProfileEdgeFinishAnalyticPolicy.Classify(new("ConvexSmall", ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex, 2d, 4d));++ Assert.Equal(ProfileEdgeFinishSurfaceFamily.Sphere, sphere.SurfaceFamily);+ Assert.Equal(ProfileEdgeFinishTorusRegime.Horn, horn.TorusRegime);+ Assert.Equal(4d, horn.TorusMajorRadius);+ Assert.Equal(ProfileEdgeFinishTorusRegime.Spindle, spindle.TorusRegime);+ Assert.Equal("ProfileBoundaryFilletSpindlePatchInvalid", spindle.ExpectedDiagnostic);+ }++ [Fact]+ public void SharpReflexCompatibilityIsAnExplicitAlternativeToExactRolling()+ {+ var compatibility = ProfileEdgeFinishAnalyticPolicy.Classify(new("ReflexSharp", ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Reflex, 0d, 4d, ProfileReflexJunctionStyle.SphereSeamCompatibility));++ Assert.Equal("ReflexSharpSphereSeamCompatibilityPlan", compatibility.PlannerKind);+ Assert.Equal(ProfileEdgeFinishSurfaceFamily.Sphere, compatibility.SurfaceFamily);+ Assert.Equal("SphereSeamCompatibility", compatibility.CompatibilityOverride);+ }++ private static object[] Row(string station, ProfileEdgeFinishSourceFamily source, ProfileEdgeFinishMaterialSide material, double radius, string planner, ProfileEdgeFinishSurfaceFamily surface, ProfileEdgeFinishRegularity regularity, ProfileEdgeFinishAdmission admission)+ => [station, source, material, radius, planner, surface, regularity, admission];++ private static void AssertPolicy(ProfileEdgeFinishStationContext context, string planner, ProfileEdgeFinishSurfaceFamily surface, ProfileEdgeFinishRegularity regularity, ProfileEdgeFinishAdmission admission)+ {+ var policy = ProfileEdgeFinishAnalyticPolicy.Classify(context);+ Assert.Equal(planner, policy.PlannerKind);+ Assert.Equal(surface, policy.SurfaceFamily);+ Assert.Equal(regularity, policy.Regularity);+ Assert.Equal(admission, policy.Admission);+ Assert.NotEmpty(policy.RejectedCandidates);+ }+}diff --git a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.csindex 4b9c3593..a7251e43 100644--- a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs+++ b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs@@ -512,12 +512,31 @@ public static class ProfileBoundaryCurvedFinishDiagnosticvar winding = SignedArea(loop);var materialSide = loop.IsOuter ? Math.Sign(winding) : -Math.Sign(winding);var material = Math.Sign(arc.SweepAngleRadians) * materialSide >= 0d ? "Convex" : "Reflex";- var relation = arc.Radius < finishSize - Tolerance ? "LessThan"- : arc.Radius > finishSize + Tolerance ? "GreaterThan"- : "Equal";var station = sourceScope == "Target" ? StationName(pair.segment.Name) : TargetStationName(target) ?? StationName(pair.segment.Name);var amount = finishKind == "Chamfer" ? "finishDistance" : "finishRadius";- return $"ProfileBoundary{finishKind}ArcSegmentPlannerRequired:station={station}:scope={sourceScope}:segment={pair.segment.Name}:sourceFamily=Arc:material={material}:sourceRadius={arc.Radius.ToString("R", CultureInfo.InvariantCulture)}:{amount}={finishSize.ToString("R", CultureInfo.InvariantCulture)}:radiusRelation={relation}:missingPlanner={finishKind}ArcDerivedExtrusionEdge";+ var policy = ProfileEdgeFinishAnalyticPolicy.Classify(new(+ station,+ Enum.Parse<ProfileEdgeFinishKind>(finishKind),+ ProfileEdgeFinishSourceFamily.ArcDerived,+ Enum.Parse<ProfileEdgeFinishMaterialSide>(material),+ arc.Radius,+ finishSize,+ target.ReflexJunctionStyle));+ if (policy.Admission == ProfileEdgeFinishAdmission.UnsupportedWithTypedDiagnostic)+ {+ if (finishKind == "Chamfer")+ {+ var offset = arc.Radius - finishSize;+ return $"ProfileBoundaryChamferConvexArcRadiusTooSmall:station={station}:segment={pair.segment.Name}:sourceFamily=Arc:material=Convex:sourceRadius={arc.Radius.ToString("R", CultureInfo.InvariantCulture)}:chamferDistance={finishSize.ToString("R", CultureInfo.InvariantCulture)}:radiusRelation=LessThan:derivedOffsetRadius={offset.ToString("R", CultureInfo.InvariantCulture)}:regularity=Invalid:reason=inward-offset-crosses-source-arc-axis;no-admitted-source-preserving-manifold-chamfer-exists-under-Preview-1-policy:guidance=reduce-Chamfer-Distance-below-source-radius|increase-source-corner-radius|leave-corner-unfinished";+ }++ var majorLocus = finishSize - arc.Radius;+ return $"ProfileBoundaryFilletConvexArcSpindleUnsupported:station={station}:segment={pair.segment.Name}:sourceFamily=Arc:material=Convex:sourceRadius={arc.Radius.ToString("R", CultureInfo.InvariantCulture)}:filletRadius={finishSize.ToString("R", CultureInfo.InvariantCulture)}:radiusRelation=LessThan:rollingMajorLocusMagnitude={majorLocus.ToString("R", CultureInfo.InvariantCulture)}:torusRegime=Spindle:regularity=Invalid:reason=exact-constant-radius-rolling-construction-self-intersects-and-is-not-admitted:guidance=reduce-Fillet-Radius-below-source-radius|increase-source-corner-radius|leave-corner-sharp-unmodified";+ }+ // This is deliberately emitted before the materializer touches topology. The+ // selected exact family is therefore inspectable even while X2's composed+ // line/arc shell emitter is being completed.+ return $"ProfileBoundary{finishKind}ArcMaterializationNotImplemented:station={station}:scope={sourceScope}:segment={pair.segment.Name}:sourceFamily=Arc:material={material}:sourceRadius={arc.Radius.ToString("R", CultureInfo.InvariantCulture)}:{amount}={finishSize.ToString("R", CultureInfo.InvariantCulture)}:radiusRelation={policy.RadiusRelation}:planner={policy.PlannerKind}:surfaceFamily={policy.SurfaceFamily}:regularity={policy.Regularity}:admission={policy.Admission}:diagnostic={policy.ExpectedDiagnostic ?? "ArcDerivedCompositionPending"}";}private static string StationName(string segmentName)diff --git a/Aetheris.Kernel.Firmament/Materializer/ProfileEdgeFinishAnalyticPolicy.cs b/Aetheris.Kernel.Firmament/Materializer/ProfileEdgeFinishAnalyticPolicy.csnew file mode 100644index 00000000..08d7b813--- /dev/null+++ b/Aetheris.Kernel.Firmament/Materializer/ProfileEdgeFinishAnalyticPolicy.cs@@ -0,0 +1,138 @@+using Aetheris.Kernel.Core.Judgment;++namespace Aetheris.Kernel.Firmament.Materializer;++/// <summary>+/// The finite analytic-policy card for source-bound Profile EdgeFinish. This is+/// intentionally evaluated before topology emission: it selects a known exact+/// family or gives the source-preserving reason why no such patch is admitted.+/// It does not infer anonymous BRep edges and it has no spline fallback.+/// </summary>+public enum ProfileEdgeFinishKind { Chamfer, Fillet }+public enum ProfileEdgeFinishSourceFamily { SharpLineLine, ArcDerived }+public enum ProfileEdgeFinishMaterialSide { Convex, Reflex }+public enum ProfileEdgeFinishRadiusRelation { Zero, LessThan, Equal, GreaterThan }+public enum ProfileEdgeFinishSurfaceFamily { Plane, Cone, Cylinder, Sphere, Torus }+public enum ProfileEdgeFinishRegularity { Regular, BoundedDegenerate, InteropSensitive, Invalid }+public enum ProfileEdgeFinishAdmission { Supported, SupportedWithExplicitPolicy, UnsupportedWithTypedDiagnostic }+public enum ProfileEdgeFinishTorusRegime { None, Ring, Horn, Spindle }++public sealed record ProfileEdgeFinishStationContext(+ string Station,+ ProfileEdgeFinishKind FinishKind,+ ProfileEdgeFinishSourceFamily SourceFamily,+ ProfileEdgeFinishMaterialSide MaterialSide,+ double SourceRadius,+ double FinishSize,+ ProfileReflexJunctionStyle ReflexJunctionStyle = ProfileReflexJunctionStyle.ToroidalRolling);++public sealed record ProfileEdgeFinishPlannerPolicy(+ string Station,+ ProfileEdgeFinishKind FinishKind,+ ProfileEdgeFinishSourceFamily SourceFamily,+ ProfileEdgeFinishMaterialSide MaterialSide,+ double SourceRadius,+ double FinishSize,+ ProfileEdgeFinishRadiusRelation RadiusRelation,+ string PlannerKind,+ ProfileEdgeFinishSurfaceFamily SurfaceFamily,+ ProfileEdgeFinishRegularity Regularity,+ ProfileEdgeFinishAdmission Admission,+ ProfileEdgeFinishTorusRegime TorusRegime,+ double? TorusMajorRadius,+ double? TorusMinorRadius,+ string? CompatibilityOverride,+ string? ExpectedDiagnostic,+ double UtilityScore,+ IReadOnlyList<string> RejectedCandidates);++public static class ProfileEdgeFinishAnalyticPolicy+{+ private const double Tolerance = 1e-8;++ public static ProfileEdgeFinishPlannerPolicy Classify(ProfileEdgeFinishStationContext context)+ {+ Validate(context);+ var relation = Relation(context.SourceRadius, context.FinishSize, context.SourceFamily);+ var candidates = Candidates();+ var judgment = new JudgmentEngine<ProfileEdgeFinishStationContext>().Evaluate(context, candidates);+ if (!judgment.IsSuccess || !judgment.Selection.HasValue)+ throw new InvalidOperationException("Profile EdgeFinish policy has no bounded candidate for a valid classification context.");++ var candidate = judgment.Selection.Value;+ // JudgmentResult retains rejection details on all-rejected outcomes. A+ // policy card needs them for successful selection as well, so preserve+ // the candidate predicates that did not admit this context explicitly.+ var rejected = candidates+ .Where(item => !item.IsAdmissible(context))+ .Select(item => $"{item.Name}:{item.RejectionReason?.Invoke(context) ?? "Candidate predicates were not satisfied."}")+ .ToArray();+ return Create(context, relation, candidate.Candidate.Name, candidate.Score, rejected);+ }++ private static IReadOnlyList<JudgmentCandidate<ProfileEdgeFinishStationContext>> Candidates() =>+ [+ new("ChamferSharpPlane", c => c.FinishKind == ProfileEdgeFinishKind.Chamfer && c.SourceFamily == ProfileEdgeFinishSourceFamily.SharpLineLine,+ _ => 100d, _ => "Requires a sharp line-line chamfer station."),+ new("ChamferConvexCollapsedOffset", c => Is(c, ProfileEdgeFinishKind.Chamfer, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && c.SourceRadius < c.FinishSize - Tolerance,+ _ => 10d, _ => "Requires Convex ArcDerived Rs < F."),+ new("ChamferConvexApex", c => Is(c, ProfileEdgeFinishKind.Chamfer, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && NearlyEqual(c.SourceRadius, c.FinishSize),+ _ => 90d, _ => "Requires Convex ArcDerived Rs = F."),+ new("ChamferConvexCone", c => Is(c, ProfileEdgeFinishKind.Chamfer, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && c.SourceRadius > c.FinishSize + Tolerance,+ _ => 100d, _ => "Requires Convex ArcDerived Rs > F."),+ new("ChamferReflexCone", c => Is(c, ProfileEdgeFinishKind.Chamfer, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex),+ _ => 100d, _ => "Requires Reflex ArcDerived station."),+ new("FilletConvexSharpSphere", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Convex),+ _ => 100d, _ => "Requires sharp convex station."),+ new("FilletReflexSharpSphereCompatibility", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Reflex) && c.ReflexJunctionStyle == ProfileReflexJunctionStyle.SphereSeamCompatibility,+ _ => 95d, _ => "Requires sharp reflex SphereSeamCompatibility override."),+ new("FilletReflexSharpExactRolling", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.SharpLineLine, ProfileEdgeFinishMaterialSide.Reflex) && c.ReflexJunctionStyle == ProfileReflexJunctionStyle.ToroidalRolling,+ _ => 100d, _ => "Requires sharp reflex ExactRolling policy."),+ new("FilletConvexSpindle", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && c.SourceRadius < c.FinishSize - Tolerance,+ _ => 10d, _ => "Requires Convex ArcDerived Rs < F."),+ new("FilletConvexSphereLimit", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && NearlyEqual(c.SourceRadius, c.FinishSize),+ _ => 90d, _ => "Requires Convex ArcDerived Rs = F."),+ new("FilletConvexHorn", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Convex) && c.SourceRadius > c.FinishSize + Tolerance,+ _ => 80d, _ => "Requires Convex ArcDerived Rs > F."),+ new("FilletReflexRing", c => Is(c, ProfileEdgeFinishKind.Fillet, ProfileEdgeFinishSourceFamily.ArcDerived, ProfileEdgeFinishMaterialSide.Reflex),+ _ => 100d, _ => "Requires Reflex ArcDerived station.")+ ];++ private static ProfileEdgeFinishPlannerPolicy Create(ProfileEdgeFinishStationContext c, ProfileEdgeFinishRadiusRelation relation, string candidate, double utility, IReadOnlyList<string> rejected) => candidate switch+ {+ "ChamferSharpPlane" => Policy(c, relation, "LineChamferPlan", ProfileEdgeFinishSurfaceFamily.Plane, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported, utility, rejected),+ "ChamferConvexCollapsedOffset" => Policy(c, relation, "ArcChamferCollapsedOffsetRejected", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Invalid, ProfileEdgeFinishAdmission.UnsupportedWithTypedDiagnostic, utility, rejected, diagnostic: "ProfileBoundaryChamferCollapsedOffsetInvalid"),+ "ChamferConvexApex" => Policy(c, relation, "ArcChamferApexPlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.BoundedDegenerate, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy, utility, rejected),+ "ChamferConvexCone" or "ChamferReflexCone" => Policy(c, relation, "ArcChamferConePlan", ProfileEdgeFinishSurfaceFamily.Cone, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported, utility, rejected),+ "FilletConvexSharpSphere" => Policy(c, relation, "ConvexSharpSphereJunctionPlan", ProfileEdgeFinishSurfaceFamily.Sphere, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported, utility, rejected),+ "FilletReflexSharpSphereCompatibility" => Policy(c, relation, "ReflexSharpSphereSeamCompatibilityPlan", ProfileEdgeFinishSurfaceFamily.Sphere, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy, utility, rejected, compatibility: "SphereSeamCompatibility"),+ "FilletReflexSharpExactRolling" => Policy(c, relation, "ReflexSharpExactRollingPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.InteropSensitive, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy, utility, rejected, torus: ProfileEdgeFinishTorusRegime.Horn, major: c.FinishSize, minor: c.FinishSize, compatibility: "SphereSeamCompatibility"),+ "FilletConvexSpindle" => Policy(c, relation, "ArcFilletSpindleRejected", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Invalid, ProfileEdgeFinishAdmission.UnsupportedWithTypedDiagnostic, utility, rejected, torus: ProfileEdgeFinishTorusRegime.Spindle, major: c.FinishSize - c.SourceRadius, minor: c.FinishSize, diagnostic: "ProfileBoundaryFilletSpindlePatchInvalid"),+ "FilletConvexSphereLimit" => Policy(c, relation, "ArcFilletSphereLimitPlan", ProfileEdgeFinishSurfaceFamily.Sphere, ProfileEdgeFinishRegularity.BoundedDegenerate, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy, utility, rejected),+ "FilletConvexHorn" => Policy(c, relation, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.InteropSensitive, ProfileEdgeFinishAdmission.SupportedWithExplicitPolicy, utility, rejected, torus: ProfileEdgeFinishTorusRegime.Horn, major: c.SourceRadius - c.FinishSize, minor: c.FinishSize),+ "FilletReflexRing" => Policy(c, relation, "ArcFilletTorusPlan", ProfileEdgeFinishSurfaceFamily.Torus, ProfileEdgeFinishRegularity.Regular, ProfileEdgeFinishAdmission.Supported, utility, rejected, torus: ProfileEdgeFinishTorusRegime.Ring, major: c.SourceRadius + c.FinishSize, minor: c.FinishSize),+ _ => throw new InvalidOperationException($"Unmapped Profile EdgeFinish policy candidate '{candidate}'.")+ };++ private static ProfileEdgeFinishPlannerPolicy Policy(ProfileEdgeFinishStationContext c, ProfileEdgeFinishRadiusRelation relation, string planner, ProfileEdgeFinishSurfaceFamily surface, ProfileEdgeFinishRegularity regularity, ProfileEdgeFinishAdmission admission, double utility, IReadOnlyList<string> rejected, ProfileEdgeFinishTorusRegime torus = ProfileEdgeFinishTorusRegime.None, double? major = null, double? minor = null, string? compatibility = null, string? diagnostic = null)+ => new(c.Station, c.FinishKind, c.SourceFamily, c.MaterialSide, c.SourceRadius, c.FinishSize, relation, planner, surface, regularity, admission, torus, major, minor, compatibility, diagnostic, utility, rejected);++ private static bool Is(ProfileEdgeFinishStationContext c, ProfileEdgeFinishKind finish, ProfileEdgeFinishSourceFamily source, ProfileEdgeFinishMaterialSide material)+ => c.FinishKind == finish && c.SourceFamily == source && c.MaterialSide == material;++ private static ProfileEdgeFinishRadiusRelation Relation(double sourceRadius, double finishSize, ProfileEdgeFinishSourceFamily source)+ => source == ProfileEdgeFinishSourceFamily.SharpLineLine ? ProfileEdgeFinishRadiusRelation.Zero+ : sourceRadius < finishSize - Tolerance ? ProfileEdgeFinishRadiusRelation.LessThan+ : sourceRadius > finishSize + Tolerance ? ProfileEdgeFinishRadiusRelation.GreaterThan+ : ProfileEdgeFinishRadiusRelation.Equal;++ private static bool NearlyEqual(double a, double b) => Math.Abs(a - b) <= Tolerance;++ private static void Validate(ProfileEdgeFinishStationContext c)+ {+ if (string.IsNullOrWhiteSpace(c.Station) || !double.IsFinite(c.FinishSize) || c.FinishSize <= 0d || !double.IsFinite(c.SourceRadius) || c.SourceRadius < 0d)+ throw new ArgumentOutOfRangeException(nameof(c), "Profile EdgeFinish policy requires a station and finite non-negative source radius plus positive finish size.");+ if (c.SourceFamily == ProfileEdgeFinishSourceFamily.SharpLineLine && c.SourceRadius != 0d)+ throw new ArgumentException("SharpLineLine policy contexts must use source radius zero.", nameof(c));+ }+}diff --git a/docs/firmament/assert-volume-m1.md b/docs/firmament/assert-volume-m1.mdindex a5699966..3d292fbb 100644--- a/docs/firmament/assert-volume-m1.md+++ b/docs/firmament/assert-volume-m1.md@@ -6,7 +6,7 @@ a calculator language.```firmamentAssert Volume Body {Expected: 1587.982297150257mm^3- Tolerance: 5mm^3+ Tolerance: 0.01mm^3Note: "Finite-span quarter-cylinder straight Profile edge fillet"}```diff --git a/docs/firmament/profile-boundary-chamfer-m1.md b/docs/firmament/profile-boundary-chamfer-m1.mdindex 914c355d..d9560adf 100644--- a/docs/firmament/profile-boundary-chamfer-m1.md+++ b/docs/firmament/profile-boundary-chamfer-m1.md@@ -24,6 +24,11 @@ Modify Body { EdgeFinish Break { Target: BreakChain On: Top Kind: Chamfer DistanThe current materialized contract is one outer line-only Profile loop, a positive equal distance below the extrusion thickness, and one segment/connected chain/whole loop. Curves are source-bound but not silently coerced: a selected circular arc now reports `ProfileBoundaryChamferArcSegmentPlannerRequired` with station/segment, convex-or-reflex material side, source radius, finish distance, radius relation, and the exact missing `ChamferArcDerivedExtrusionEdge` planner. The X1 chimera card documents the required conical section-transition routes. Inner loops, disconnected or duplicate chains, and legacy `Face: +Z / Target: Boundary` requests receive typed rejection diagnostics.+X2 replaces the generic arc-planner boundary with an explicit pre-emission+policy result (`ArcChamferConePlan`, `ArcChamferApexPlan`, or the typed collapsed+offset rejection). The mixed line/arc cone emitter remains pending; see+`profile-edgefinish-chimera-closure-x2.md`.+Junction polarity is classified from resolved Profile semantics, never BRep edge direction: predecessor/successor tangents give the signed turn; loop winding and outer/inner role determine the material side. A positive material-side turn is a `ConvexProfileJunction`; a negative one is a `ReflexProfileJunction`. Thus an orthogonal outer CCW L notch has a `-90°` signed turn and a `270°` material interior angle. The planar inset construction intersects the two inward line supports at either class; it does not use a distinct rolling-surface patch. `profile-chamfer-reflex-junction-top.firmament`, the Bottom counterpart, and the mixed L-loop fixture make those guarantees explicit.Compose now admits a Top whole-outer-loop chamfer with disjoint Shaft or Counterbore cavities. Admission conservatively rejects touching/intersecting circular cavity footprints in the transition corridor with `ProfileBoundaryChamferIntersectsShaft` or `ProfileBoundaryChamferIntersectsCounterbore`. Bottom Compose, open-chain Compose, inner-loop chamfers, and non-line source segments remain outside this bounded route.diff --git a/docs/firmament/profile-edgefinish-chimera-closure-x2.md b/docs/firmament/profile-edgefinish-chimera-closure-x2.mdnew file mode 100644index 00000000..fd66ac76--- /dev/null+++ b/docs/firmament/profile-edgefinish-chimera-closure-x2.md@@ -0,0 +1,76 @@+# Profile EdgeFinish chimera closure X2 — analytic policy card++X2 supersedes the *derived rounded-source surface matrix* in X1. Its historical+source card is now superseded by X3's release card; see+`profile-edgefinish-chimera-release-closure-x3.md`. The source remains+source-bound: no anonymous+BRep-edge selection, Boolean repair, NURBS, or sampled finish is admissible.++`ProfileEdgeFinishAnalyticPolicy` is the code-level conformance table. It uses+the JudgmentEngine to choose one bounded candidate deterministically and retains+the rejected candidate reasons. The policy is evaluated before BRep emission.+`Regular` is smooth within its trimmed domain; `BoundedDegenerate` requires+explicit finite topology (an apex/contact); `InteropSensitive` is exact but+requires downstream-kernel smoke; and `Invalid` has no source-order-preserving,+manifold patch under the current policy.++## Chamfer matrix (F = 4 mm)++| Station | Source | Side | Rs | Relation | Planner | Family | Regularity | Admission |+| --- | --- | --- | ---: | --- | --- | --- | --- | --- |+| ConvexSharp | SharpLineLine | Convex | 0 | Zero | LineChamferPlan | Plane | Regular | Supported |+| ConvexSmall | ArcDerived | Convex | 2 | LessThan | ArcChamferCollapsedOffsetRejected | Cone | Invalid | UnsupportedWithTypedDiagnostic |+| ConvexMedium | ArcDerived | Convex | 4 | Equal | ArcChamferApexPlan | Cone | BoundedDegenerate | SupportedWithExplicitPolicy |+| ConvexLarge | ArcDerived | Convex | 8 | GreaterThan | ArcChamferConePlan | Cone | Regular | Supported |+| ReflexSharp | SharpLineLine | Reflex | 0 | Zero | LineChamferPlan | Plane | Regular | Supported |+| ReflexSmall | ArcDerived | Reflex | 2 | LessThan | ArcChamferConePlan | Cone | Regular | Supported |+| ReflexMedium | ArcDerived | Reflex | 4 | Equal | ArcChamferConePlan | Cone | Regular | Supported |+| ReflexLarge | ArcDerived | Reflex | 8 | GreaterThan | ArcChamferConePlan | Cone | Regular | Supported |++For a source circular side face, take the section at `z = top - F` on the+authored cylinder and its material offset at `z = top`. The ruled locus is the+right circular cone between radii `Rs - F` for convex material and `Rs + F` for+reflex material. Tangent Line→Arc and Arc→Line source joins produce direct+plane/cone seams; an extra blend would be non-policy. `Rs = F` terminates at one+explicit apex vertex, never a zero-radius edge. `Rs < F` crosses the source axis;+X2 rejects it as `ProfileBoundaryChamferCollapsedOffsetInvalid` pending a proof+of a useful manifold split topology.++## Fillet matrix (F = 4 mm)++| Station | Source | Side | Rs | Relation | Planner | Family | R/r regime | Regularity | Admission |+| --- | --- | --- | ---: | --- | --- | --- | --- | --- | --- |+| ConvexSharp | SharpLineLine | Convex | 0 | Zero | ConvexSharpSphereJunctionPlan | Sphere | — | Regular | Supported |+| ConvexSmall | ArcDerived | Convex | 2 | LessThan | ArcFilletSpindleRejected | Torus | R=2,r=4 Spindle | Invalid | UnsupportedWithTypedDiagnostic |+| ConvexMedium | ArcDerived | Convex | 4 | Equal | ArcFilletSphereLimitPlan | Sphere | R=0,r=4 limit | BoundedDegenerate | SupportedWithExplicitPolicy |+| ConvexLarge | ArcDerived | Convex | 8 | GreaterThan | ArcFilletTorusPlan | Torus | R=4,r=4 Horn | InteropSensitive | SupportedWithExplicitPolicy |+| ReflexSharp | SharpLineLine | Reflex | 0 | Zero | ReflexSharpExactRollingPlan | Torus | R=4,r=4 Horn | InteropSensitive | SupportedWithExplicitPolicy |+| ReflexSmall | ArcDerived | Reflex | 2 | LessThan | ArcFilletTorusPlan | Torus | R=6,r=4 Ring | Regular | Supported |+| ReflexMedium | ArcDerived | Reflex | 4 | Equal | ArcFilletTorusPlan | Torus | R=8,r=4 Ring | Regular | Supported |+| ReflexLarge | ArcDerived | Reflex | 8 | GreaterThan | ArcFilletTorusPlan | Torus | R=12,r=4 Ring | Regular | Supported |++The signed rolling locus is `Rs - F` on convex material and `Rs + F` on reflex+material. Its absolute torus major radius is used only after preserving this+material-side sign. A zero convex locus is a true sphere limit, not a degenerate+torus. The convex spindle patch is rejected as+`ProfileBoundaryFilletSpindlePatchInvalid`; it is not silently split or+self-intersected. The sharp reflex default remains ExactRolling horn-torus.+`ReflexJunction: SphereSeamCompatibility` remains an opt-in, geometry-plan+alternative only for that sharp junction; it selects a sphere and never replaces+the default.++## Current materialization boundary++This repository revision completes the classified policy card and focused tests,+but does **not** claim the mixed line/arc BRep composer or finished artifacts.+Until it exists, curved requests fail before topology with+`ProfileBoundary*ArcMaterializationNotImplemented`, including station, Rs/F+relation, selected exact planner/family, regularity, admission, and the typed+invalid diagnostic where applicable. Thus no Cone/Sphere/Torus is misreported as+emitted. Existing sharp line-line materializers, their STEP orientation+regression, and the base artifacts remain unchanged.++The next bounded implementation is the direct line/cone and cylinder/torus-or-+sphere seam materializer, followed by apex/horn external-kernel smoke. Only then+may whole-loop Chamfer/Fillet STEP files, Assert Volume literals, hashes, and a+Preview-1 readiness claim be added.diff --git a/docs/firmament/profile-edgefinish-chimera-release-closure-x3.md b/docs/firmament/profile-edgefinish-chimera-release-closure-x3.mdnew file mode 100644index 00000000..360f5729--- /dev/null+++ b/docs/firmament/profile-edgefinish-chimera-release-closure-x3.md@@ -0,0 +1,51 @@+# Profile EdgeFinish chimera release closure X3 — seven-station card++X3 separates language policy from valid release geometry. The conceptual matrix+remains eight rows in `ProfileEdgeFinishAnalyticPolicy`, but `ConvexSmall` is+not present in the release Profile: with `Rs = 2 mm` and `F = 4 mm`, it is+invalid for both analytic routes. The release card therefore contains+ConvexSharp, ConvexMedium, ConvexLarge, ReflexSharp, ReflexSmall, ReflexMedium,+and ReflexLarge only. Its outer source loop has 18 segments and independent+area/volume evidence `(38240 + 4 - π) mm² × 24 mm = 917780.601776314 mm³`.++The two discoverable canonical invalid cases are:++- `fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-chamfer-invalid.firmament`+- `fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-fillet-invalid.firmament`++Their precise diagnostics are respectively+`ProfileBoundaryChamferConvexArcRadiusTooSmall` and+`ProfileBoundaryFilletConvexArcSpindleUnsupported`. Both name the station,+source/finish radii, `Rs < F`, convex material side, derived negative offset or+spindle locus, exact reason, and actionable correction. They do not say+`PlannerRequired` and do not offer a NURBS escape hatch.++The M1 straight-fillet assertion is reconciled in this revision. The exact+removed volume for span `S` and radius `r` is `S*r²*(1 - π/4)`; for the 20 × 10+× 8 fixture, `1600 - 14*4*(1 - π/4) = 1587.982297150257 mm³`. The prior generic+tessellated estimate undercounted the quarter-cylinder removal. The mass+evaluator now recognizes the emitted axis-aligned-box/finite-quarter-cylinder+BRep pattern directly, giving the analytic result after STEP reimport with a+`0.01 mm³` assertion tolerance.++The code-backed matrix remains authoritative and unchanged:++| Finish | ConvexSmall | ConvexMedium | ConvexLarge | Reflex rounded arcs |+| --- | --- | --- | --- | --- |+| Chamfer | Invalid collapsed offset | Cone apex / BoundedDegenerate | Cone frustum / Regular | Cone frusta / Regular |+| Fillet | Invalid spindle | Sphere limit / BoundedDegenerate | Horn torus / InteropSensitive | Ring tori / Regular |++Sharp convex remains the sphere-junction route. Sharp reflex remains exact+horn-torus rolling by default, with `SphereSeamCompatibility` as an intentional+opt-in plan. No NURBS policy exists.++## Remaining closure boundary++The release card is a valid base artifact, but the authoritative mixed+line/arc Plane/Cone and Cylinder/Torus-or-Sphere composer is not yet emitted.+Whole-loop Chamfer/Fillet intentionally stop before topology with a policy-rich+`ProfileBoundary*ArcMaterializationNotImplemented` diagnostic. Therefore this+document does not claim completed finish STEP artifacts, external-kernel smoke,+or Preview-1 readiness. The next implementation must create direct analytic+seams and finite apex/sphere/horn topology; it may not replace that work with a+spline or Boolean fallback.diff --git a/docs/firmament/profile-edgefinish-chimera-x1.md b/docs/firmament/profile-edgefinish-chimera-x1.mdindex 4940e6e1..fd50d25b 100644--- a/docs/firmament/profile-edgefinish-chimera-x1.md+++ b/docs/firmament/profile-edgefinish-chimera-x1.md@@ -1,4 +1,8 @@-# Profile EdgeFinish chimera X1 — source-card and planner boundary+# Profile EdgeFinish chimera X1 — source-card and planner boundary (superseded by X2 policy card)++> This is historical X1 evidence. The current valid source card is the X3+> seven-station release card; ConvexSmall moved to canonical-invalid fixtures.+> Its policy matrix is superseded by [the X2 policy card](profile-edgefinish-chimera-closure-x2.md) and [the X3 release note](profile-edgefinish-chimera-release-closure-x3.md).X1 introduces the permanent *source* conformance card for Profile edge finishes:`fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-base.firmament`.diff --git a/docs/firmament/profile-fillet-common-cases-x2.md b/docs/firmament/profile-fillet-common-cases-x2.mdindex cdc3c313..85eb229a 100644--- a/docs/firmament/profile-fillet-common-cases-x2.md+++ b/docs/firmament/profile-fillet-common-cases-x2.md@@ -63,13 +63,12 @@ faces or by generic B-rep edge editing.## Rounded source boundaryCircular Profile source segments are bound as source semantics but are not yet-materialized by this line-only shell route. Their rejection is intentionally-specific: `ProfileBoundaryFilletArcSegmentPlannerRequired` identifies the-station, source arc, material side, source radius, requested radius, relation,-and missing `FilletArcDerivedExtrusionEdge` planner. The X1 chimera card-derives the required toroidal family: convex rolling has signed major locus-`Rs - F` (spindle / sphere-limit / horn boundaries); reflex rolling has-`Rs + F` (regular ring torus for positive `Rs`).+materialized by this line-only shell route. X2 classifies them before topology+emission and reports the selected exact planner, family, regularity, and typed+invalid reason through `ProfileBoundaryFilletArcMaterializationNotImplemented`.+Convex rolling has signed major locus `Rs - F` (spindle / sphere-limit / horn+boundaries); reflex rolling has `Rs + F` (regular ring torus for positive+`Rs`). The full code-backed table is in `profile-edgefinish-chimera-closure-x2.md`.# Profile fillet common casesTwo adjacent outer straight segments at a supported 90-degree reflex vertexdiff --git a/docs/firmament/v2-canonical-authoring.md b/docs/firmament/v2-canonical-authoring.mdindex 7dfab2e1..35aa6519 100644--- a/docs/firmament/v2-canonical-authoring.md+++ b/docs/firmament/v2-canonical-authoring.md@@ -275,3 +275,13 @@ segment, or a named source-chain selection). Current materialized Chamfer andFillet routes cover line-only source loops; circular source segments bind andreport a station-specific missing exact planner rather than falling back toanonymous BRep edge inference. See `profile-edgefinish-chimera-x1.md`.++Rounded-source EdgeFinish policy is explicitly classified before BRep emission:+chamfers use only Plane/Cone and fillets only Cylinder/Sphere/Torus. See+`profile-edgefinish-chimera-closure-x2.md` for the current bounded support card+and typed unsupported spindle/collapsed-offset regimes.++For a convex rounded source corner, the current exact Profile EdgeFinish policy+rejects `source radius < finish size`. Reduce the requested Chamfer/Fillet,+increase the authored corner radius, or leave that corner sharp; no spline+compatibility blend is substituted.diff --git a/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-chamfer-invalid.firmament b/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-chamfer-invalid.firmamentnew file mode 100644index 00000000..5c135264--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-chamfer-invalid.firmament@@ -0,0 +1,17 @@+Model ProfileEdgeFinishConvexSmallChamferInvalid {+ Units: mm+ Concept Path Outline {+ Start: Point2(0mm, 0mm)+ Heading: 0deg+ Line Bottom { Length: 60mm }+ Line Right { Turn: 90deg; Length: 40mm }+ Line TopLead { Turn: 90deg; Length: 30mm }+ Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }+ Line Return { Length: 38mm }+ Close Left+ }+ Profile Bracket From Outline+ Struct Body { Extrude Bracket { Profile: Bracket; From: 0mm; To: 12mm } }+ Selection ConvexSmallStation { Target: TopBoundary Source: Bracket.ProfileSegments([TopLead, ConvexSmallArc, Return]) Require: ConnectedChain }+ Modify Body { EdgeFinish RejectSmall { Target: ConvexSmallStation On: Top Kind: Chamfer Distance: 4mm } }+}diff --git a/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-fillet-invalid.firmament b/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-fillet-invalid.firmamentnew file mode 100644index 00000000..7d3f1a1b--- /dev/null+++ b/fixtures/FirmamentV2/Canonical/invalid/profile-edgefinish-convex-small-fillet-invalid.firmament@@ -0,0 +1,17 @@+Model ProfileEdgeFinishConvexSmallFilletInvalid {+ Units: mm+ Concept Path Outline {+ Start: Point2(0mm, 0mm)+ Heading: 0deg+ Line Bottom { Length: 60mm }+ Line Right { Turn: 90deg; Length: 40mm }+ Line TopLead { Turn: 90deg; Length: 30mm }+ Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }+ Line Return { Length: 38mm }+ Close Left+ }+ Profile Bracket From Outline+ Struct Body { Extrude Bracket { Profile: Bracket; From: 0mm; To: 12mm } }+ Selection ConvexSmallStation { Target: TopBoundary Source: Bracket.ProfileSegments([TopLead, ConvexSmallArc, Return]) Require: ConnectedChain }+ Modify Body { EdgeFinish RejectSmall { Target: ConvexSmallStation On: Top Kind: Fillet Radius: 4mm } }+}diff --git a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-base.firmament b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-base.firmamentindex a4f4c250..7dcf96e5 100644--- a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-base.firmament+++ b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-base.firmament@@ -10,9 +10,10 @@ Model ProfileEdgeFinishChimeraBase {Line ConvexSharpDrop { Turn: 90deg; Length: 40mm }Line ReflexSharpRun { Turn: -90deg; Length: 40mm }Arc ReflexSmallArc { Turn: -90deg; Radius: 2mm }- Line ReflexSmallRise { Length: 36mm }- Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }- Line BetweenSmallMedium { Length: 40mm }+ Line ReflexSmallRise { Length: 38mm }+ // ConvexSmall (Rs < F) is intentionally a canonical-invalid policy case.+ // This release card keeps only admitted stations.+ Line BetweenSmallMedium { Turn: 90deg; Length: 42mm }Arc ConvexMediumArc { Turn: 90deg; Radius: 4mm }Line MediumDrop { Length: 32mm }Arc ReflexMediumArc { Turn: -90deg; Radius: 4mm }@@ -28,7 +29,6 @@ Model ProfileEdgeFinishChimeraBase {// A station is a source-bound chain; no BRep edge discovery is involved.Selection ConvexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([TopLead, ConvexSharpDrop]) Require: ConnectedChain }- Selection ConvexSmallStation { Target: TopBoundary Source: Chimera.ProfileSegments([ReflexSmallRise, ConvexSmallArc, BetweenSmallMedium]) Require: ConnectedChain }Selection ConvexMediumStation { Target: TopBoundary Source: Chimera.ProfileSegments([BetweenSmallMedium, ConvexMediumArc, MediumDrop]) Require: ConnectedChain }Selection ConvexLargeStation { Target: TopBoundary Source: Chimera.ProfileSegments([LargeRise, ConvexLargeArc, TopReturn]) Require: ConnectedChain }Selection ReflexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([ConvexSharpDrop, ReflexSharpRun]) Require: ConnectedChain }@@ -37,8 +37,8 @@ Model ProfileEdgeFinishChimeraBase {Selection ReflexLargeStation { Target: TopBoundary Source: Chimera.ProfileSegments([BetweenMediumLarge, ReflexLargeArc, LargeRise]) Require: ConnectedChain }Assert Volume Body {- Expected: 917760mm^3+ Expected: 917780.601776314mm^3Tolerance: 0.01mm^3- Note: "Independent Green-theorem area 38240 mm^2 times 24 mm extrusion."+ Note: "Independent Green-theorem area (38240 + 4 - π) mm^2 times 24 mm extrusion."}}diff --git a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-chamfer.firmament b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-chamfer.firmamentindex 14f2e3bd..da732ae1 100644--- a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-chamfer.firmament+++ b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-chamfer.firmament@@ -10,9 +10,8 @@ Model ProfileEdgeFinishChimeraChamfer {Line ConvexSharpDrop { Turn: 90deg; Length: 40mm }Line ReflexSharpRun { Turn: -90deg; Length: 40mm }Arc ReflexSmallArc { Turn: -90deg; Radius: 2mm }- Line ReflexSmallRise { Length: 36mm }- Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }- Line BetweenSmallMedium { Length: 40mm }+ Line ReflexSmallRise { Length: 38mm }+ Line BetweenSmallMedium { Turn: 90deg; Length: 42mm }Arc ConvexMediumArc { Turn: 90deg; Radius: 4mm }Line MediumDrop { Length: 32mm }Arc ReflexMediumArc { Turn: -90deg; Radius: 4mm }@@ -26,7 +25,6 @@ Model ProfileEdgeFinishChimeraChamfer {Profile Chimera From ChimeraOutlineStruct Body { Extrude Chimera { Profile: Chimera; From: 0mm; To: 24mm } }Selection ConvexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([TopLead, ConvexSharpDrop]) Require: ConnectedChain }- Selection ConvexSmallStation { Target: TopBoundary Source: Chimera.ProfileSegments([ReflexSmallRise, ConvexSmallArc, BetweenSmallMedium]) Require: ConnectedChain }Selection ConvexMediumStation { Target: TopBoundary Source: Chimera.ProfileSegments([BetweenSmallMedium, ConvexMediumArc, MediumDrop]) Require: ConnectedChain }Selection ConvexLargeStation { Target: TopBoundary Source: Chimera.ProfileSegments([LargeRise, ConvexLargeArc, TopReturn]) Require: ConnectedChain }Selection ReflexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([ConvexSharpDrop, ReflexSharpRun]) Require: ConnectedChain }diff --git a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-fillet.firmament b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-fillet.firmamentindex 0ce17cd0..b60075f0 100644--- a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-fillet.firmament+++ b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-fillet.firmament@@ -10,9 +10,8 @@ Model ProfileEdgeFinishChimeraFillet {Line ConvexSharpDrop { Turn: 90deg; Length: 40mm }Line ReflexSharpRun { Turn: -90deg; Length: 40mm }Arc ReflexSmallArc { Turn: -90deg; Radius: 2mm }- Line ReflexSmallRise { Length: 36mm }- Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }- Line BetweenSmallMedium { Length: 40mm }+ Line ReflexSmallRise { Length: 38mm }+ Line BetweenSmallMedium { Turn: 90deg; Length: 42mm }Arc ConvexMediumArc { Turn: 90deg; Radius: 4mm }Line MediumDrop { Length: 32mm }Arc ReflexMediumArc { Turn: -90deg; Radius: 4mm }@@ -26,7 +25,6 @@ Model ProfileEdgeFinishChimeraFillet {Profile Chimera From ChimeraOutlineStruct Body { Extrude Chimera { Profile: Chimera; From: 0mm; To: 24mm } }Selection ConvexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([TopLead, ConvexSharpDrop]) Require: ConnectedChain }- Selection ConvexSmallStation { Target: TopBoundary Source: Chimera.ProfileSegments([ReflexSmallRise, ConvexSmallArc, BetweenSmallMedium]) Require: ConnectedChain }Selection ConvexMediumStation { Target: TopBoundary Source: Chimera.ProfileSegments([BetweenSmallMedium, ConvexMediumArc, MediumDrop]) Require: ConnectedChain }Selection ConvexLargeStation { Target: TopBoundary Source: Chimera.ProfileSegments([LargeRise, ConvexLargeArc, TopReturn]) Require: ConnectedChain }Selection ReflexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([ConvexSharpDrop, ReflexSharpRun]) Require: ConnectedChain }diff --git a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-reflex-sphere-compat.firmament b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-reflex-sphere-compat.firmamentindex 40dd9540..4b07432c 100644--- a/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-reflex-sphere-compat.firmament+++ b/fixtures/FirmamentV2/Canonical/valid/profile-edgefinish-chimera-reflex-sphere-compat.firmament@@ -10,9 +10,8 @@ Model ProfileEdgeFinishChimeraReflexSphereCompatibility {Line ConvexSharpDrop { Turn: 90deg; Length: 40mm }Line ReflexSharpRun { Turn: -90deg; Length: 40mm }Arc ReflexSmallArc { Turn: -90deg; Radius: 2mm }- Line ReflexSmallRise { Length: 36mm }- Arc ConvexSmallArc { Turn: 90deg; Radius: 2mm }- Line BetweenSmallMedium { Length: 40mm }+ Line ReflexSmallRise { Length: 38mm }+ Line BetweenSmallMedium { Turn: 90deg; Length: 42mm }Arc ConvexMediumArc { Turn: 90deg; Radius: 4mm }Line MediumDrop { Length: 32mm }Arc ReflexMediumArc { Turn: -90deg; Radius: 4mm }@@ -26,7 +25,6 @@ Model ProfileEdgeFinishChimeraReflexSphereCompatibility {Profile Chimera From ChimeraOutlineStruct Body { Extrude Chimera { Profile: Chimera; From: 0mm; To: 24mm } }Selection ConvexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([TopLead, ConvexSharpDrop]) Require: ConnectedChain }- Selection ConvexSmallStation { Target: TopBoundary Source: Chimera.ProfileSegments([ReflexSmallRise, ConvexSmallArc, BetweenSmallMedium]) Require: ConnectedChain }Selection ConvexMediumStation { Target: TopBoundary Source: Chimera.ProfileSegments([BetweenSmallMedium, ConvexMediumArc, MediumDrop]) Require: ConnectedChain }Selection ConvexLargeStation { Target: TopBoundary Source: Chimera.ProfileSegments([LargeRise, ConvexLargeArc, TopReturn]) Require: ConnectedChain }Selection ReflexSharpStation { Target: TopBoundary Source: Chimera.ProfileSegments([ConvexSharpDrop, ReflexSharpRun]) Require: ConnectedChain }diff --git a/fixtures/FirmamentV2/Canonical/valid/profile-straight-edge-fillet-top.firmament b/fixtures/FirmamentV2/Canonical/valid/profile-straight-edge-fillet-top.firmamentindex 5386edcb..8b1df33d 100644--- a/fixtures/FirmamentV2/Canonical/valid/profile-straight-edge-fillet-top.firmament+++ b/fixtures/FirmamentV2/Canonical/valid/profile-straight-edge-fillet-top.firmament@@ -14,7 +14,7 @@ Struct Body { Extrude Bracket { Profile: Bracket; From: 0mm; To: 8mm } }Modify Body { EdgeFinish SouthTopRound { Target: Bracket.Outer.South On: Top Kind: Fillet Radius: 2mm EndClearance: 3mm } }Assert Volume Body {Expected: 1587.982297150257mm^3- Tolerance: 5mm^3- Note: "Finite-span quarter-cylinder straight Profile edge fillet"+ Tolerance: 0.01mm^3+ Note: "Independent box-minus-finite-quarter-cylinder analytic volume."}}