Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Refactor project structure and simplify implementations

Yuechen Li4d22ab03a167
diff --git a/.gitignore b/.gitignore
index f8aa12be..258ba750 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,8 @@ demo-output/
# be added deliberately with `git add -f <path>` after a size/content review.
docs/continuum/artifacts/*.json
docs/continuum/artifacts/**/*.json
+!docs/continuum/artifacts/m4b/
+!docs/continuum/artifacts/m4b/*.json
docs/preview2/evidence/**/*.json
docs/reports/artifacts/**/*.json
Aetheris.Firmament.FrictionLab/Reports/*.json
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveCalibrationTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveCalibrationTests.cs
index 7521c63c..75512142 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveCalibrationTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveCalibrationTests.cs
@@ -3,7 +3,7 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Continuum.Tests.Backends.Sdf;
-public sealed record CirAdaptiveCalibrationPolicy(string Name, CirAdaptiveVolumeOptions AdaptiveOptions, int DenseResolution);
+public sealed record CirAdaptiveCalibrationPolicy(string Name, SdfAdaptiveVolumeOptions AdaptiveOptions, int DenseResolution);
public sealed record CirAdaptiveCalibrationMetrics(
string ShapeName,
@@ -27,7 +27,7 @@ public sealed record CirAdaptiveCalibrationMetrics(
int MaxDepthReached,
IReadOnlyDictionary<CirRegionPlanAction, int> ActionCounts,
IReadOnlyDictionary<string, int> CandidateCounts,
- IReadOnlyList<CirAdaptiveTraceEvent> TraceHead);
+ IReadOnlyList<SdfAdaptiveTraceEvent> TraceHead);
public sealed record CirAdaptiveCalibrationCase(
string ShapeName,
@@ -39,17 +39,17 @@ public sealed record CirAdaptiveCalibrationReport(IReadOnlyList<CirAdaptiveCalib
internal static class CirAdaptiveCalibrationHarness
{
- public static CirAdaptiveCalibrationReport Run(IEnumerable<(string ShapeName, CirNode Node, double? ExpectedVolume)> shapes, IEnumerable<CirAdaptiveCalibrationPolicy> policies)
+ public static CirAdaptiveCalibrationReport Run(IEnumerable<(string ShapeName, SdfNode Node, double? ExpectedVolume)> shapes, IEnumerable<CirAdaptiveCalibrationPolicy> policies)
{
var cases = new List<CirAdaptiveCalibrationCase>();
foreach (var (shapeName, node, expectedVolume) in shapes)
{
- var tape = CirTapeLowerer.Lower(node);
+ var tape = SdfTapeLowerer.Lower(node);
foreach (var policy in policies)
{
- var dense = CirVolumeEstimator.EstimateVolume(node, policy.DenseResolution);
- var adaptive = CirAdaptiveVolumeEstimator.EstimateVolume(tape, node.Bounds, policy.AdaptiveOptions);
+ var dense = SdfVolumeEstimator.EstimateVolume(node, policy.DenseResolution);
+ var adaptive = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, node.Bounds, policy.AdaptiveOptions);
var denseSamples = policy.DenseResolution * policy.DenseResolution * policy.DenseResolution;
var adaptiveSamplePoints = adaptive.RegionsSampledDirectly * policy.AdaptiveOptions.DirectSampleGrid * policy.AdaptiveOptions.DirectSampleGrid * policy.AdaptiveOptions.DirectSampleGrid;
@@ -103,7 +103,7 @@ public sealed class CirAdaptiveCalibrationTests
[Fact]
public void AdaptiveCalibration_Box_ReportIsDeterministic()
{
- var shape = ("box", (CirNode)new CirBoxNode(6d, 4d, 2d), 48d as double?);
+ var shape = ("box", (SdfNode)new SdfBoxNode(6d, 4d, 2d), 48d as double?);
var policy = ConservativePolicy();
var first = CirAdaptiveCalibrationHarness.Run([shape], [policy]);
@@ -182,26 +182,26 @@ public sealed class CirAdaptiveCalibrationTests
Assert.NotEmpty(metrics.CandidateCounts);
}
- private static IEnumerable<(string ShapeName, CirNode Node, double? ExpectedVolume)> BuildShapes()
+ private static IEnumerable<(string ShapeName, SdfNode Node, double? ExpectedVolume)> BuildShapes()
{
- yield return ("box", new CirBoxNode(6d, 4d, 2d), 48d);
+ yield return ("box", new SdfBoxNode(6d, 4d, 2d), 48d);
yield return BuildBoxMinusCylinder();
- yield return ("sphere", new CirSphereNode(2d), (4d / 3d) * System.Math.PI * 8d);
- var transformedSphere = new CirTransformNode(new CirSphereNode(2d), Transform3D.CreateTranslation(new Vector3D(3d, -1d, 2d)));
+ yield return ("sphere", new SdfSphereNode(2d), (4d / 3d) * System.Math.PI * 8d);
+ var transformedSphere = new SdfTransformNode(new SdfSphereNode(2d), Transform3D.CreateTranslation(new Vector3D(3d, -1d, 2d)));
yield return ("transformed_sphere", transformedSphere, (4d / 3d) * System.Math.PI * 8d);
}
- private static (string ShapeName, CirNode Node, double? ExpectedVolume) BuildBoxMinusCylinder()
+ private static (string ShapeName, SdfNode Node, double? ExpectedVolume) BuildBoxMinusCylinder()
{
- var box = new CirBoxNode(8d, 8d, 8d);
- var cut = new CirSubtractNode(box, new CirCylinderNode(2d, 8d));
+ var box = new SdfBoxNode(8d, 8d, 8d);
+ var cut = new SdfSubtractNode(box, new SdfCylinderNode(2d, 8d));
var expected = (8d * 8d * 8d) - (System.Math.PI * 4d * 8d);
return ("box_minus_cylinder", cut, expected);
}
private static CirAdaptiveCalibrationPolicy ConservativePolicy()
- => new("conservative", new CirAdaptiveVolumeOptions(MaxDepth: 8, DirectSampleGrid: 2, MaxTraceEvents: 80, MinimumRegionExtent: 0.04d), DenseResolution: 32);
+ => new("conservative", new SdfAdaptiveVolumeOptions(MaxDepth: 8, DirectSampleGrid: 2, MaxTraceEvents: 80, MinimumRegionExtent: 0.04d), DenseResolution: 32);
private static CirAdaptiveCalibrationPolicy CoarsePolicy()
- => new("coarse", new CirAdaptiveVolumeOptions(MaxDepth: 4, DirectSampleGrid: 3, MaxTraceEvents: 80, MinimumRegionExtent: 0.08d), DenseResolution: 32);
+ => new("coarse", new SdfAdaptiveVolumeOptions(MaxDepth: 4, DirectSampleGrid: 3, MaxTraceEvents: 80, MinimumRegionExtent: 0.08d), DenseResolution: 32);
}
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveVolumeEstimatorTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveVolumeEstimatorTests.cs
index 23f84682..e0559111 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveVolumeEstimatorTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirAdaptiveVolumeEstimatorTests.cs
@@ -3,15 +3,15 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Continuum.Tests.Backends.Sdf;
-public sealed class CirAdaptiveVolumeEstimatorTests
+public sealed class SdfAdaptiveVolumeEstimatorTests
{
[Fact]
public void AdaptiveVolume_Box_IsReasonable()
{
- var box = new CirBoxNode(6d, 4d, 2d);
- var tape = CirTapeLowerer.Lower(box);
+ var box = new SdfBoxNode(6d, 4d, 2d);
+ var tape = SdfTapeLowerer.Lower(box);
- var result = CirAdaptiveVolumeEstimator.EstimateVolume(tape, box.Bounds, new CirAdaptiveVolumeOptions(MaxDepth: 5, DirectSampleGrid: 2));
+ var result = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, box.Bounds, new SdfAdaptiveVolumeOptions(MaxDepth: 5, DirectSampleGrid: 2));
Assert.InRange(result.EstimatedVolume, 47.5d, 48.5d);
}
@@ -19,12 +19,12 @@ public sealed class CirAdaptiveVolumeEstimatorTests
[Fact]
public void AdaptiveVolume_BoxMinusCylinder_IsReasonable()
{
- var box = new CirBoxNode(8d, 8d, 8d);
- var cut = new CirSubtractNode(box, new CirCylinderNode(2d, 8d));
- var tape = CirTapeLowerer.Lower(cut);
+ var box = new SdfBoxNode(8d, 8d, 8d);
+ var cut = new SdfSubtractNode(box, new SdfCylinderNode(2d, 8d));
+ var tape = SdfTapeLowerer.Lower(cut);
var expected = (8d * 8d * 8d) - (System.Math.PI * 4d * 8d);
- var result = CirAdaptiveVolumeEstimator.EstimateVolume(tape, box.Bounds, new CirAdaptiveVolumeOptions(MaxDepth: 7, DirectSampleGrid: 2));
+ var result = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, box.Bounds, new SdfAdaptiveVolumeOptions(MaxDepth: 7, DirectSampleGrid: 2));
Assert.InRange(result.EstimatedVolume, expected - 15d, expected + 15d);
}
@@ -32,17 +32,17 @@ public sealed class CirAdaptiveVolumeEstimatorTests
[Fact]
public void AdaptiveVolume_UsesPlannerCounters()
{
- var box = new CirBoxNode(8d, 8d, 8d);
- var tape = CirTapeLowerer.Lower(box);
- var options = new CirAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2);
+ var box = new SdfBoxNode(8d, 8d, 8d);
+ var tape = SdfTapeLowerer.Lower(box);
+ var options = new SdfAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2);
- var insideRegion = new CirBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
- var outsideRegion = new CirBounds(new Point3D(10d, 10d, 10d), new Point3D(12d, 12d, 12d));
- var mixedRegion = new CirBounds(new Point3D(-6d, -6d, -6d), new Point3D(6d, 6d, 6d));
+ var insideRegion = new SdfBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
+ var outsideRegion = new SdfBounds(new Point3D(10d, 10d, 10d), new Point3D(12d, 12d, 12d));
+ var mixedRegion = new SdfBounds(new Point3D(-6d, -6d, -6d), new Point3D(6d, 6d, 6d));
- var insideResult = CirAdaptiveVolumeEstimator.EstimateVolume(tape, insideRegion, options);
- var outsideResult = CirAdaptiveVolumeEstimator.EstimateVolume(tape, outsideRegion, options);
- var mixedResult = CirAdaptiveVolumeEstimator.EstimateVolume(tape, mixedRegion, options);
+ var insideResult = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, insideRegion, options);
+ var outsideResult = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, outsideRegion, options);
+ var mixedResult = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, mixedRegion, options);
Assert.True(insideResult.RegionsClassifiedInside > 0);
Assert.True(outsideResult.RegionsClassifiedOutside > 0);
@@ -52,12 +52,12 @@ public sealed class CirAdaptiveVolumeEstimatorTests
[Fact]
public void AdaptiveVolume_Deterministic()
{
- var cut = new CirSubtractNode(new CirBoxNode(8d, 8d, 8d), new CirCylinderNode(2d, 8d));
- var tape = CirTapeLowerer.Lower(cut);
- var options = new CirAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 24);
+ var cut = new SdfSubtractNode(new SdfBoxNode(8d, 8d, 8d), new SdfCylinderNode(2d, 8d));
+ var tape = SdfTapeLowerer.Lower(cut);
+ var options = new SdfAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 24);
- var first = CirAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, options);
- var second = CirAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, options);
+ var first = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, options);
+ var second = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, options);
Assert.Equal(first.EstimatedVolume, second.EstimatedVolume);
Assert.Equal(first.TotalRegionsVisited, second.TotalRegionsVisited);
@@ -69,10 +69,10 @@ public sealed class CirAdaptiveVolumeEstimatorTests
[Fact]
public void AdaptiveVolume_TraceIncludesPlannerDecision()
{
- var cut = new CirSubtractNode(new CirBoxNode(8d, 8d, 8d), new CirCylinderNode(2d, 8d));
- var tape = CirTapeLowerer.Lower(cut);
+ var cut = new SdfSubtractNode(new SdfBoxNode(8d, 8d, 8d), new SdfCylinderNode(2d, 8d));
+ var tape = SdfTapeLowerer.Lower(cut);
- var result = CirAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, new CirAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 32));
+ var result = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, new SdfAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 32));
Assert.NotEmpty(result.TraceEvents);
Assert.Contains(result.TraceEvents, e => !string.IsNullOrWhiteSpace(e.Candidate));
@@ -82,11 +82,11 @@ public sealed class CirAdaptiveVolumeEstimatorTests
[Fact]
public void NaiveVolumeComparison()
{
- var cut = new CirSubtractNode(new CirBoxNode(8d, 8d, 8d), new CirCylinderNode(2d, 8d));
- var tape = CirTapeLowerer.Lower(cut);
- var dense = CirVolumeEstimator.EstimateVolume(cut, resolution: 30);
+ var cut = new SdfSubtractNode(new SdfBoxNode(8d, 8d, 8d), new SdfCylinderNode(2d, 8d));
+ var tape = SdfTapeLowerer.Lower(cut);
+ var dense = SdfVolumeEstimator.EstimateVolume(cut, resolution: 30);
- var adaptive = CirAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, new CirAdaptiveVolumeOptions(MaxDepth: 7, DirectSampleGrid: 2));
+ var adaptive = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, cut.Bounds, new SdfAdaptiveVolumeOptions(MaxDepth: 7, DirectSampleGrid: 2));
Assert.InRange(System.Math.Abs(adaptive.EstimatedVolume - dense), 0d, 25d);
}
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirConeTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirConeTests.cs
index 628b2376..a768c542 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirConeTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirConeTests.cs
@@ -8,7 +8,7 @@ public sealed class CirConeTests
[Fact]
public void CirCone_EvaluatesInsideOutsideForFrustum()
{
- var cone = new CirConeNode(bottomRadius: 4d, topRadius: 2d, height: 8d);
+ var cone = new SdfConeNode(bottomRadius: 4d, topRadius: 2d, height: 8d);
Assert.True(cone.Evaluate(new Point3D(0d, 0d, 0d)) < 0d);
Assert.True(cone.Evaluate(new Point3D(5d, 0d, 0d)) > 0d);
@@ -18,7 +18,7 @@ public sealed class CirConeTests
[Fact]
public void CirCone_EvaluatesPointConeApexBehavior()
{
- var cone = new CirConeNode(bottomRadius: 4d, topRadius: 0d, height: 8d);
+ var cone = new SdfConeNode(bottomRadius: 4d, topRadius: 0d, height: 8d);
var apex = cone.Evaluate(new Point3D(0d, 0d, 4d));
var nearApex = cone.Evaluate(new Point3D(0.01d, 0d, 3.99d));
@@ -34,18 +34,18 @@ public sealed class CirConeTests
[Fact]
public void CirCone_RejectsInvalidParameters()
{
- Assert.Throws<ArgumentOutOfRangeException>(() => new CirConeNode(-1d, 1d, 2d));
- Assert.Throws<ArgumentOutOfRangeException>(() => new CirConeNode(1d, -1d, 2d));
- Assert.Throws<ArgumentOutOfRangeException>(() => new CirConeNode(0d, 0d, 2d));
- Assert.Throws<ArgumentOutOfRangeException>(() => new CirConeNode(1d, 1d, 0d));
+ Assert.Throws<ArgumentOutOfRangeException>(() => new SdfConeNode(-1d, 1d, 2d));
+ Assert.Throws<ArgumentOutOfRangeException>(() => new SdfConeNode(1d, -1d, 2d));
+ Assert.Throws<ArgumentOutOfRangeException>(() => new SdfConeNode(0d, 0d, 2d));
+ Assert.Throws<ArgumentOutOfRangeException>(() => new SdfConeNode(1d, 1d, 0d));
}
[Fact]
public void CirCone_TapeLowering_EvaluatesDeterministically()
{
- var node = new CirTransformNode(new CirConeNode(5d, 2d, 10d), Transform3D.CreateTranslation(new Vector3D(1d, -2d, 3d)));
- var tapeA = CirTapeLowerer.Lower(node);
- var tapeB = CirTapeLowerer.Lower(node);
+ var node = new SdfTransformNode(new SdfConeNode(5d, 2d, 10d), Transform3D.CreateTranslation(new Vector3D(1d, -2d, 3d)));
+ var tapeA = SdfTapeLowerer.Lower(node);
+ var tapeB = SdfTapeLowerer.Lower(node);
Assert.Equal(tapeA.Instructions, tapeB.Instructions);
Assert.Equal(tapeA.ConePayloads, tapeB.ConePayloads);
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirEvaluationTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirEvaluationTests.cs
index 9703fa52..5a0f981e 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirEvaluationTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirEvaluationTests.cs
@@ -8,7 +8,7 @@ public sealed class CirEvaluationTests
[Fact]
public void CIR_Box_EvaluatePoints()
{
- var box = new CirBoxNode(10d, 8d, 6d);
+ var box = new SdfBoxNode(10d, 8d, 6d);
Assert.True(box.Evaluate(new Point3D(0d, 0d, 0d)) < 0d);
Assert.True(box.Evaluate(new Point3D(6d, 0d, 0d)) > 0d);
@@ -18,7 +18,7 @@ public sealed class CirEvaluationTests
[Fact]
public void CIR_Cylinder_EvaluatePoints()
{
- var cylinder = new CirCylinderNode(3d, 10d);
+ var cylinder = new SdfCylinderNode(3d, 10d);
Assert.True(cylinder.Evaluate(new Point3D(1d, 1d, 0d)) < 0d);
Assert.True(cylinder.Evaluate(new Point3D(4d, 0d, 0d)) > 0d);
@@ -28,9 +28,9 @@ public sealed class CirEvaluationTests
[Fact]
public void CIR_BoxMinusCylinder_EvaluatePoints()
{
- var box = new CirBoxNode(20d, 20d, 20d);
- var cylinder = new CirCylinderNode(3d, 24d);
- var cut = new CirSubtractNode(box, cylinder);
+ var box = new SdfBoxNode(20d, 20d, 20d);
+ var cylinder = new SdfCylinderNode(3d, 24d);
+ var cut = new SdfSubtractNode(box, cylinder);
Assert.True(cut.Evaluate(new Point3D(8d, 0d, 0d)) < 0d);
Assert.True(cut.Evaluate(new Point3D(0d, 0d, 0d)) > 0d);
@@ -41,12 +41,12 @@ public sealed class CirEvaluationTests
[Fact]
public void CIR_BoxMinusCylinder_ApproximateVolume_IsReasonable()
{
- var box = new CirBoxNode(20d, 20d, 20d);
- var cylinder = new CirCylinderNode(3d, 24d);
- var cut = new CirSubtractNode(box, cylinder);
+ var box = new SdfBoxNode(20d, 20d, 20d);
+ var cylinder = new SdfCylinderNode(3d, 24d);
+ var cut = new SdfSubtractNode(box, cylinder);
- var boxEstimate = CirVolumeEstimator.EstimateVolume(box, resolution: 40);
- var cutEstimate = CirVolumeEstimator.EstimateVolume(cut, resolution: 40);
+ var boxEstimate = SdfVolumeEstimator.EstimateVolume(box, resolution: 40);
+ var cutEstimate = SdfVolumeEstimator.EstimateVolume(cut, resolution: 40);
var expectedBox = 20d * 20d * 20d;
var expectedCut = expectedBox - (double.Pi * 3d * 3d * 20d);
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirMapDispatchPrototypeTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirMapDispatchPrototypeTests.cs
index 5b0487d3..e79a3d58 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirMapDispatchPrototypeTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirMapDispatchPrototypeTests.cs
@@ -11,24 +11,24 @@ public sealed class CirMapDispatchPrototypeTests
private const int Cols = 19;
private const double ThicknessTolerance = 0.075d;
- public static TheoryData<string, int, CirNode, BrepBody, CirMapPrototypeView> PrimitiveViews => new()
+ public static TheoryData<string, int, SdfNode, BrepBody, CirMapPrototypeView> PrimitiveViews => new()
{
- { "box", (int)CirMirrorAtomKind.BoxPrimitive, new CirBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Top },
- { "box", (int)CirMirrorAtomKind.BoxPrimitive, new CirBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Front },
- { "cylinder", (int)CirMirrorAtomKind.CylinderPrimitive, new CirCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Top },
- { "cylinder", (int)CirMirrorAtomKind.CylinderPrimitive, new CirCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Front },
- { "sphere", (int)CirMirrorAtomKind.SpherePrimitive, new CirSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Top },
- { "sphere", (int)CirMirrorAtomKind.SpherePrimitive, new CirSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Front },
+ { "box", (int)CirMirrorAtomKind.BoxPrimitive, new SdfBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Top },
+ { "box", (int)CirMirrorAtomKind.BoxPrimitive, new SdfBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Front },
+ { "cylinder", (int)CirMirrorAtomKind.CylinderPrimitive, new SdfCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Top },
+ { "cylinder", (int)CirMirrorAtomKind.CylinderPrimitive, new SdfCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Front },
+ { "sphere", (int)CirMirrorAtomKind.SpherePrimitive, new SdfSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Top },
+ { "sphere", (int)CirMirrorAtomKind.SpherePrimitive, new SdfSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Front },
};
[Theory]
[MemberData(nameof(PrimitiveViews))]
- public void CirMapX2_PrimitiveMapOccupancy_SelectsCirTapeAndComparesBrepBaseline(string source, int atomKindValue, CirNode node, BrepBody body, CirMapPrototypeView view)
+ public void CirMapX2_PrimitiveMapOccupancy_SelectsSdfTapeAndComparesBrepBaseline(string source, int atomKindValue, SdfNode node, BrepBody body, CirMapPrototypeView view)
{
var request = new CirMapPrototypeRequest(view, Rows, Cols, node.Bounds, SamplesPerRay: 384, RootRefinementIterations: 32, Tolerance: 1e-7d);
var dispatch = CirMapDispatchPrototype.Dispatch(CreateRequest(source, (CirMirrorAtomKind)atomKindValue, CirMapAnalyzerUse.MapOccupancy), CirMapAnalyzerUse.MapOccupancy, node, request, body, ThicknessTolerance);
- Assert.Equal(CirMapBackendKind.CirTape, dispatch.SelectedBackend);
+ Assert.Equal(CirMapBackendKind.SdfTape, dispatch.SelectedBackend);
Assert.Equal(CirMirrorStatus.MirrorAdmittedExact, dispatch.MirrorAdmission.Status);
Assert.Equal("cir-map-dispatch-ready-for-primitive-lab", dispatch.Recommendation);
Assert.NotNull(dispatch.MapResult);
@@ -51,7 +51,7 @@ public sealed class CirMapDispatchPrototypeTests
[Fact]
public void CirMapX2_BoxFaceIdentityRequest_RejectsCirAsLossy()
{
- var node = new CirBoxNode(10d, 6d, 4d);
+ var node = new SdfBoxNode(10d, 6d, 4d);
var request = new CirMapPrototypeRequest(CirMapPrototypeView.Top, Rows, Cols, node.Bounds, SamplesPerRay: 128, RootRefinementIterations: 24, Tolerance: 1e-7d);
var dispatch = CirMapDispatchPrototype.Dispatch(CreateRequest("box", CirMirrorAtomKind.BoxPrimitive, CirMapAnalyzerUse.FaceIdentity), CirMapAnalyzerUse.FaceIdentity, node, request);
@@ -67,7 +67,7 @@ public sealed class CirMapDispatchPrototypeTests
[Fact]
public void CirMapX2_BoxTopologyParityRequest_RejectsCirAsLossy()
{
- var node = new CirBoxNode(10d, 6d, 4d);
+ var node = new SdfBoxNode(10d, 6d, 4d);
var request = new CirMapPrototypeRequest(CirMapPrototypeView.Top, Rows, Cols, node.Bounds, SamplesPerRay: 128, RootRefinementIterations: 24, Tolerance: 1e-7d);
var dispatch = CirMapDispatchPrototype.Dispatch(CreateRequest("box", CirMirrorAtomKind.BoxPrimitive, CirMapAnalyzerUse.TopologyParity), CirMapAnalyzerUse.TopologyParity, node, request);
@@ -85,7 +85,7 @@ public sealed class CirMapDispatchPrototypeTests
[InlineData("profile-authored-chamfer", (int)CirMirrorAtomKind.ProfileAuthoredVerticalChamfer, (int)CirMirrorStatus.MirrorUnavailable)]
public void CirMapX2_UnavailableSources_DoNotSelectCir(string source, int atomKindValue, int expectedStatusValue)
{
- var bounds = new CirBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
+ var bounds = new SdfBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
var request = new CirMapPrototypeRequest(CirMapPrototypeView.Top, Rows, Cols, bounds, SamplesPerRay: 128, RootRefinementIterations: 24, Tolerance: 1e-7d);
var dispatch = CirMapDispatchPrototype.Dispatch(CreateRequest(source, (CirMirrorAtomKind)atomKindValue, CirMapAnalyzerUse.MapOccupancy), CirMapAnalyzerUse.MapOccupancy, node: null, request);
@@ -102,7 +102,7 @@ public sealed class CirMapDispatchPrototypeTests
[Fact]
public void CirMapX2_RepeatedDispatchesProduceStableProjection()
{
- var node = new CirSphereNode(3d);
+ var node = new SdfSphereNode(3d);
var request = new CirMapPrototypeRequest(CirMapPrototypeView.Front, Rows, Cols, node.Bounds, SamplesPerRay: 384, RootRefinementIterations: 32, Tolerance: 1e-7d);
var first = CirMapDispatchPrototype.Dispatch(CreateRequest("sphere", CirMirrorAtomKind.SpherePrimitive, CirMapAnalyzerUse.MapOccupancy), CirMapAnalyzerUse.MapOccupancy, node, request, BrepPrimitives.CreateSphere(3d).Value, ThicknessTolerance);
@@ -132,8 +132,8 @@ internal enum CirMapAnalyzerUse
internal enum CirMapBackendKind
{
- CirTape,
- CirNode,
+ SdfTape,
+ SdfNode,
BrepRaycastBaseline,
Unsupported,
}
@@ -173,7 +173,7 @@ internal static class CirMapDispatchPrototype
public static CirMapDispatchResult Dispatch(
CirMirrorAdmission mirrorRequest,
CirMapAnalyzerUse requestedUse,
- CirNode? node,
+ SdfNode? node,
CirMapPrototypeRequest mapRequest,
BrepBody? brepBaselineBody = null,
double summaryTolerance = 0.075d)
@@ -197,7 +197,7 @@ internal static class CirMapDispatchPrototype
return new CirMapDispatchResult(
CirMapBackendKind.Unsupported,
admission,
- [new CirMapBackendCandidate(CirMapBackendKind.CirTape, false, "lossy-request-rejected")],
+ [new CirMapBackendCandidate(CirMapBackendKind.SdfTape, false, "lossy-request-rejected")],
null,
null,
diagnostics,
@@ -208,7 +208,7 @@ internal static class CirMapDispatchPrototype
{
diagnostics.Add($"cir-map-x2-mirror-admitted-exact:{source}");
diagnostics.Add("cir-map-x2-backend-selected:cir-tape");
- var map = CirMapPrototype.Evaluate(CirTapeLowerer.Lower(node), node.Bounds, source, mapRequest);
+ var map = CirMapPrototype.Evaluate(SdfTapeLowerer.Lower(node), node.Bounds, source, mapRequest);
CirMapBaselineComparison? comparison = null;
var recommendation = "cir-map-dispatch-ready-for-primitive-lab";
@@ -231,9 +231,9 @@ internal static class CirMapDispatchPrototype
diagnostics.Add("cir-map-x2-no-prismatic-mirror-used");
diagnostics.Add("cir-map-x2-no-production-analyzer-behavior-changed");
return new CirMapDispatchResult(
- CirMapBackendKind.CirTape,
+ CirMapBackendKind.SdfTape,
admission,
- [new CirMapBackendCandidate(CirMapBackendKind.CirTape, true, "mirror-admitted-exact-map-occupancy")],
+ [new CirMapBackendCandidate(CirMapBackendKind.SdfTape, true, "mirror-admitted-exact-map-occupancy")],
map,
comparison,
diagnostics,
@@ -247,7 +247,7 @@ internal static class CirMapDispatchPrototype
return new CirMapDispatchResult(
CirMapBackendKind.Unsupported,
admission,
- [new CirMapBackendCandidate(CirMapBackendKind.CirTape, false, admission.StatusText)],
+ [new CirMapBackendCandidate(CirMapBackendKind.SdfTape, false, admission.StatusText)],
null,
null,
diagnostics,
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirMapPrototypeTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirMapPrototypeTests.cs
index 192ddde0..a4ff98c5 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirMapPrototypeTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirMapPrototypeTests.cs
@@ -11,24 +11,24 @@ public sealed class CirMapPrototypeTests
private const int Cols = 19;
private const double ThicknessTolerance = 0.075d;
- public static TheoryData<string, CirNode, BrepBody, CirMapPrototypeView> PrimitiveViews => new()
+ public static TheoryData<string, SdfNode, BrepBody, CirMapPrototypeView> PrimitiveViews => new()
{
- { "box", new CirBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Top },
- { "box", new CirBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Front },
- { "cylinder", new CirCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Top },
- { "cylinder", new CirCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Front },
- { "sphere", new CirSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Top },
- { "sphere", new CirSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Front },
+ { "box", new SdfBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Top },
+ { "box", new SdfBoxNode(10d, 6d, 4d), BrepPrimitives.CreateBox(10d, 6d, 4d).Value, CirMapPrototypeView.Front },
+ { "cylinder", new SdfCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Top },
+ { "cylinder", new SdfCylinderNode(3d, 8d), BrepPrimitives.CreateCylinder(3d, 8d).Value, CirMapPrototypeView.Front },
+ { "sphere", new SdfSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Top },
+ { "sphere", new SdfSphereNode(3d), BrepPrimitives.CreateSphere(3d).Value, CirMapPrototypeView.Front },
};
[Theory]
[MemberData(nameof(PrimitiveViews))]
- public void CirMapX1_PrimitiveMirrors_CompareAgainstBrepRaycastBaseline(string primitive, CirNode node, BrepBody body, CirMapPrototypeView view)
+ public void CirMapX1_PrimitiveMirrors_CompareAgainstBrepRaycastBaseline(string primitive, SdfNode node, BrepBody body, CirMapPrototypeView view)
{
var request = new CirMapPrototypeRequest(view, Rows, Cols, node.Bounds, SamplesPerRay: 384, RootRefinementIterations: 32, Tolerance: 1e-7d);
var first = CirMapPrototype.Evaluate(node, primitive, request);
- var second = CirMapPrototype.Evaluate(CirTapeLowerer.Lower(node), node.Bounds, primitive, request);
+ var second = CirMapPrototype.Evaluate(SdfTapeLowerer.Lower(node), node.Bounds, primitive, request);
var baseline = CirMapPrototype.EvaluateBrepBaseline(body, primitive, request);
Assert.Equal(first.Grid.Select(row => string.Concat(row.Select(sample => sample.Hit ? '#' : '.'))),
@@ -60,7 +60,7 @@ public sealed class CirMapPrototypeTests
[Fact]
public void CirMapX1_BoxTop_ProducesFullOccupancyMask()
{
- var node = new CirBoxNode(10d, 6d, 4d);
+ var node = new SdfBoxNode(10d, 6d, 4d);
var request = new CirMapPrototypeRequest(CirMapPrototypeView.Top, 6, 8, node.Bounds, SamplesPerRay: 128, RootRefinementIterations: 24, Tolerance: 1e-7d);
var result = CirMapPrototype.Evaluate(node, "box", request);
@@ -96,7 +96,7 @@ internal sealed record CirMapPrototypeRequest(
CirMapPrototypeView View,
int Rows,
int Cols,
- CirBounds Bounds,
+ SdfBounds Bounds,
int SamplesPerRay,
int RootRefinementIterations,
double Tolerance);
@@ -122,10 +122,10 @@ internal sealed record CirMapPrototypeResult(
internal static class CirMapPrototype
{
- public static CirMapPrototypeResult Evaluate(CirNode node, string primitiveName, CirMapPrototypeRequest request) =>
- Evaluate(CirTapeLowerer.Lower(node), node.Bounds, primitiveName, request);
+ public static CirMapPrototypeResult Evaluate(SdfNode node, string primitiveName, CirMapPrototypeRequest request) =>
+ Evaluate(SdfTapeLowerer.Lower(node), node.Bounds, primitiveName, request);
- public static CirMapPrototypeResult Evaluate(CirTape tape, CirBounds bounds, string primitiveName, CirMapPrototypeRequest request)
+ public static CirMapPrototypeResult Evaluate(SdfTape tape, SdfBounds bounds, string primitiveName, CirMapPrototypeRequest request)
{
var diagnostics = BaseDiagnostics(primitiveName);
diagnostics.Add("cir-map-x1-backend-selected:cir-tape");
@@ -311,7 +311,7 @@ internal readonly record struct CirMapPrototypeFrame(
public double RangeU => MaxU - MinU;
public double RangeV => MaxV - MinV;
- public static CirMapPrototypeFrame Resolve(CirMapPrototypeView view, CirBounds bounds) => view switch
+ public static CirMapPrototypeFrame Resolve(CirMapPrototypeView view, SdfBounds bounds) => view switch
{
CirMapPrototypeView.Top => new(new Point3D(0d, 0d, bounds.Max.Z), new Vector3D(1d, 0d, 0d), new Vector3D(0d, 1d, 0d), new Vector3D(0d, 0d, -1d), bounds.Min.X, bounds.Max.X, bounds.Min.Y, bounds.Max.Y, bounds.SizeZ),
CirMapPrototypeView.Bottom => new(new Point3D(0d, 0d, bounds.Min.Z), new Vector3D(1d, 0d, 0d), new Vector3D(0d, 1d, 0d), new Vector3D(0d, 0d, 1d), bounds.Min.X, bounds.Max.X, bounds.Min.Y, bounds.Max.Y, bounds.SizeZ),
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirRegionPlannerTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirRegionPlannerTests.cs
index 7fd92309..37a298c4 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirRegionPlannerTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirRegionPlannerTests.cs
@@ -12,7 +12,7 @@ public sealed class CirRegionPlannerTests
public void Planner_ClassifiesInsideRegion()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(-2d, -0.1d), CirRegionClassification.Inside, depth: 0, maxDepth: 4);
+ var context = BuildMixedContext(new FieldInterval(-2d, -0.1d), SdfRegionClassification.Inside, depth: 0, maxDepth: 4);
var plan = planner.Plan(context);
@@ -24,7 +24,7 @@ public sealed class CirRegionPlannerTests
public void Planner_ClassifiesOutsideRegion()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(0.1d, 2d), CirRegionClassification.Outside, depth: 0, maxDepth: 4);
+ var context = BuildMixedContext(new FieldInterval(0.1d, 2d), SdfRegionClassification.Outside, depth: 0, maxDepth: 4);
var plan = planner.Plan(context);
@@ -36,7 +36,7 @@ public sealed class CirRegionPlannerTests
public void Planner_SubdividesMixedRegion_WhenDepthAllows()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), CirRegionClassification.Mixed, depth: 1, maxDepth: 4);
+ var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), SdfRegionClassification.Mixed, depth: 1, maxDepth: 4);
var plan = planner.Plan(context);
@@ -48,7 +48,7 @@ public sealed class CirRegionPlannerTests
public void Planner_SamplesMixedRegion_AtDepthLimit()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), CirRegionClassification.Mixed, depth: 3, maxDepth: 3);
+ var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), SdfRegionClassification.Mixed, depth: 3, maxDepth: 3);
var plan = planner.Plan(context);
@@ -60,7 +60,7 @@ public sealed class CirRegionPlannerTests
public void Planner_TraceIncludesRejectedCandidates()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), CirRegionClassification.Mixed, depth: 3, maxDepth: 3);
+ var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), SdfRegionClassification.Mixed, depth: 3, maxDepth: 3);
var plan = planner.Plan(context);
@@ -73,7 +73,7 @@ public sealed class CirRegionPlannerTests
public void Planner_DeterministicSelection()
{
var planner = new CirRegionPlanner();
- var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), CirRegionClassification.Mixed, depth: 0, maxDepth: 4);
+ var context = BuildMixedContext(new FieldInterval(-0.25d, 0.25d), SdfRegionClassification.Mixed, depth: 0, maxDepth: 4);
var first = planner.Plan(context);
var second = planner.Plan(context);
@@ -86,23 +86,23 @@ public sealed class CirRegionPlannerTests
[Fact]
public void Planner_UsesRealTapeInterval()
{
- var node = new CirSubtractNode(new CirBoxNode(8d, 8d, 8d), new CirCylinderNode(2d, 10d));
- var tape = CirTapeLowerer.Lower(node);
- var region = new CirBounds(new Point3D(1.8d, -0.3d, -1d), new Point3D(2.2d, 0.3d, 1d));
+ var node = new SdfSubtractNode(new SdfBoxNode(8d, 8d, 8d), new SdfCylinderNode(2d, 10d));
+ var tape = SdfTapeLowerer.Lower(node);
+ var region = new SdfBounds(new Point3D(1.8d, -0.3d, -1d), new Point3D(2.2d, 0.3d, 1d));
var options = new CirRegionPlannerOptions(MaxDepth: 4, DirectSampleThreshold: 32, MinimumRegionExtent: 0.1d);
var planner = new CirRegionPlanner();
var plan = planner.Plan(tape, region, depth: 1, options, Tolerance);
Assert.Equal(CirRegionPlanAction.Subdivide, plan.Action);
- Assert.Equal(CirRegionClassification.Mixed, plan.Classification);
+ Assert.Equal(SdfRegionClassification.Mixed, plan.Classification);
Assert.True(plan.Interval.MinValue <= 0d && plan.Interval.MaxValue >= 0d);
}
- private static CirRegionPlanContext BuildMixedContext(FieldInterval interval, CirRegionClassification classification, int depth, int maxDepth)
+ private static CirRegionPlanContext BuildMixedContext(FieldInterval interval, SdfRegionClassification classification, int depth, int maxDepth)
{
var options = new CirRegionPlannerOptions(MaxDepth: maxDepth, DirectSampleThreshold: 32, MinimumRegionExtent: 0.1d);
- var region = new CirBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
+ var region = new SdfBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d));
return CirRegionPlanner.BuildContext(region, interval, classification, depth, options, Tolerance);
}
}
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeEvaluationTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeEvaluationTests.cs
index 97f71055..c96bc796 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeEvaluationTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeEvaluationTests.cs
@@ -4,15 +4,15 @@ using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Continuum.Tests.Backends.Sdf;
-public sealed class CirTapeEvaluationTests
+public sealed class SdfTapeEvaluationTests
{
[Fact]
public void Tape_Transform_NoRecursiveChildEvaluation()
{
- var node = new CirTransformNode(new CirBoxNode(4d, 2d, 6d), Transform3D.CreateTranslation(new Vector3D(2d, -1d, 3d)));
- var tape = CirTapeLowerer.Lower(node);
+ var node = new SdfTransformNode(new SdfBoxNode(4d, 2d, 6d), Transform3D.CreateTranslation(new Vector3D(2d, -1d, 3d)));
+ var tape = SdfTapeLowerer.Lower(node);
- Assert.DoesNotContain(tape.Instructions, i => i.SourceKind == CirNodeKind.Transform);
+ Assert.DoesNotContain(tape.Instructions, i => i.SourceKind == SdfNodeKind.Transform);
Assert.All(tape.BoxPayloads, payload => Assert.NotEqual(Transform3D.Identity, payload.InverseTransform));
}
@@ -20,16 +20,16 @@ public sealed class CirTapeEvaluationTests
public void Tape_Transform_MatchesRecursiveEvaluate()
{
var transform = Transform3D.CreateTranslation(new Vector3D(2d, -1d, 3d)) * Transform3D.CreateRotationZ(double.Pi / 6d);
- var node = new CirTransformNode(new CirBoxNode(4d, 2d, 6d), transform);
+ var node = new SdfTransformNode(new SdfBoxNode(4d, 2d, 6d), transform);
AssertTapeMatches(node, new Point3D(2d, -1d, 3d), new Point3D(7d, -1d, 3d), new Point3D(4d, 0d, 3d));
}
[Fact]
public void Tape_NestedTransform_MatchesRecursiveEvaluate()
{
- var node = new CirTransformNode(
- new CirTransformNode(
- new CirSphereNode(2.5d),
+ var node = new SdfTransformNode(
+ new SdfTransformNode(
+ new SdfSphereNode(2.5d),
Transform3D.CreateRotationY(double.Pi / 4d) * Transform3D.CreateTranslation(new Vector3D(0.5d, 0d, 1d))),
Transform3D.CreateTranslation(new Vector3D(3d, -1d, 2d)) * Transform3D.CreateRotationX(double.Pi / 3d));
@@ -39,8 +39,8 @@ public sealed class CirTapeEvaluationTests
[Fact]
public void Tape_BooleanUnderTransform_MatchesRecursiveEvaluate()
{
- var booleanNode = new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirCylinderNode(2d, 10d));
- var node = new CirTransformNode(booleanNode, Transform3D.CreateTranslation(new Vector3D(1d, 2d, -1d)) * Transform3D.CreateRotationZ(double.Pi / 8d));
+ var booleanNode = new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfCylinderNode(2d, 10d));
+ var node = new SdfTransformNode(booleanNode, Transform3D.CreateTranslation(new Vector3D(1d, 2d, -1d)) * Transform3D.CreateRotationZ(double.Pi / 8d));
AssertTapeMatches(node, new Point3D(1d, 2d, -1d), new Point3D(5d, 2d, -1d), new Point3D(1d, 5d, -1d));
}
@@ -48,12 +48,12 @@ public sealed class CirTapeEvaluationTests
[Fact]
public void Tape_AllCurrentNodes_MatchRecursiveEvaluate()
{
- var transformedCylinder = new CirTransformNode(
- new CirCylinderNode(1.5d, 9d),
+ var transformedCylinder = new SdfTransformNode(
+ new SdfCylinderNode(1.5d, 9d),
Transform3D.CreateTranslation(new Vector3D(-2d, 0.5d, 1d)) * Transform3D.CreateRotationY(double.Pi / 5d));
- var union = new CirUnionNode(new CirSphereNode(3d), transformedCylinder);
- var subtract = new CirSubtractNode(union, new CirBoxNode(2.5d, 7d, 2d));
- var node = new CirIntersectNode(subtract, new CirTransformNode(new CirBoxNode(10d, 10d, 10d), Transform3D.CreateTranslation(new Vector3D(0.5d, -0.5d, 0d))));
+ var union = new SdfUnionNode(new SdfSphereNode(3d), transformedCylinder);
+ var subtract = new SdfSubtractNode(union, new SdfBoxNode(2.5d, 7d, 2d));
+ var node = new SdfIntersectNode(subtract, new SdfTransformNode(new SdfBoxNode(10d, 10d, 10d), Transform3D.CreateTranslation(new Vector3D(0.5d, -0.5d, 0d))));
AssertTapeMatches(node,
new Point3D(0d, 0d, 0d),
@@ -66,12 +66,12 @@ public sealed class CirTapeEvaluationTests
[Fact]
public void Tape_DeterministicLowering()
{
- var node = new CirSubtractNode(
- new CirUnionNode(new CirBoxNode(8d, 8d, 8d), new CirSphereNode(6d)),
- new CirTransformNode(new CirCylinderNode(2d, 12d), Transform3D.CreateTranslation(new Vector3D(1d, 2d, 0d))));
+ var node = new SdfSubtractNode(
+ new SdfUnionNode(new SdfBoxNode(8d, 8d, 8d), new SdfSphereNode(6d)),
+ new SdfTransformNode(new SdfCylinderNode(2d, 12d), Transform3D.CreateTranslation(new Vector3D(1d, 2d, 0d))));
- var first = CirTapeLowerer.Lower(node);
- var second = CirTapeLowerer.Lower(node);
+ var first = SdfTapeLowerer.Lower(node);
+ var second = SdfTapeLowerer.Lower(node);
Assert.Equal(first.OutputSlot, second.OutputSlot);
Assert.Equal(first.SlotCount, second.SlotCount);
@@ -88,13 +88,13 @@ public sealed class CirTapeEvaluationTests
[Fact]
public void Tape_Torus_MatchesRecursiveEvaluate()
{
- var node = new CirTransformNode(new CirTorusNode(6d, 2d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, 0.5d)));
+ var node = new SdfTransformNode(new SdfTorusNode(6d, 2d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, 0.5d)));
AssertTapeMatches(node, new Point3D(7d, 0d, 0.5d), new Point3D(1d, 0d, 0.5d), new Point3D(1d, 0d, 2.5d));
}
- private static void AssertTapeMatches(CirNode node, params Point3D[] points)
+ private static void AssertTapeMatches(SdfNode node, params Point3D[] points)
{
- var tape = CirTapeLowerer.Lower(node);
+ var tape = SdfTapeLowerer.Lower(node);
foreach (var point in points)
{
var expected = node.Evaluate(point);
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeIntervalEvaluationTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeIntervalEvaluationTests.cs
index b6ef93fd..dc727fbd 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeIntervalEvaluationTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/CirTapeIntervalEvaluationTests.cs
@@ -4,70 +4,70 @@ using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Continuum.Tests.Backends.Sdf;
-public sealed class CirTapeIntervalEvaluationTests
+public sealed class SdfTapeIntervalEvaluationTests
{
[Fact]
public void Interval_Box_ContainsSampledEvaluations()
{
- AssertIntervalContainsSamples(new CirBoxNode(6d, 4d, 8d), new CirBounds(new Point3D(-4d, -3d, -5d), new Point3D(4d, 3d, 5d)));
+ AssertIntervalContainsSamples(new SdfBoxNode(6d, 4d, 8d), new SdfBounds(new Point3D(-4d, -3d, -5d), new Point3D(4d, 3d, 5d)));
}
[Fact]
public void Interval_Cylinder_ContainsSampledEvaluations()
{
- AssertIntervalContainsSamples(new CirCylinderNode(3d, 7d), new CirBounds(new Point3D(-4d, -4d, -4d), new Point3D(4d, 4d, 4d)));
+ AssertIntervalContainsSamples(new SdfCylinderNode(3d, 7d), new SdfBounds(new Point3D(-4d, -4d, -4d), new Point3D(4d, 4d, 4d)));
}
[Fact]
public void Interval_Sphere_ContainsSampledEvaluations()
{
- AssertIntervalContainsSamples(new CirSphereNode(2.5d), new CirBounds(new Point3D(-3d, -3d, -3d), new Point3D(3d, 3d, 3d)));
+ AssertIntervalContainsSamples(new SdfSphereNode(2.5d), new SdfBounds(new Point3D(-3d, -3d, -3d), new Point3D(3d, 3d, 3d)));
}
[Fact]
public void Interval_BoxMinusCylinder_ContainsSampledEvaluations()
{
- var node = new CirSubtractNode(new CirBoxNode(8d, 8d, 8d), new CirCylinderNode(2d, 10d));
- AssertIntervalContainsSamples(node, new CirBounds(new Point3D(-5d, -5d, -5d), new Point3D(5d, 5d, 5d)));
+ var node = new SdfSubtractNode(new SdfBoxNode(8d, 8d, 8d), new SdfCylinderNode(2d, 10d));
+ AssertIntervalContainsSamples(node, new SdfBounds(new Point3D(-5d, -5d, -5d), new Point3D(5d, 5d, 5d)));
}
[Fact]
public void Interval_ClassifiesFullyInsideRegion()
{
- var tape = CirTapeLowerer.Lower(new CirBoxNode(10d, 10d, 10d));
- var classification = tape.ClassifyRegion(new CirBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d)), ToleranceContext.Default);
- Assert.Equal(CirRegionClassification.Inside, classification);
+ var tape = SdfTapeLowerer.Lower(new SdfBoxNode(10d, 10d, 10d));
+ var classification = tape.ClassifyRegion(new SdfBounds(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d)), ToleranceContext.Default);
+ Assert.Equal(SdfRegionClassification.Inside, classification);
}
[Fact]
public void Interval_ClassifiesFullyOutsideRegion()
{
- var tape = CirTapeLowerer.Lower(new CirBoxNode(2d, 2d, 2d));
- var classification = tape.ClassifyRegion(new CirBounds(new Point3D(3d, 3d, 3d), new Point3D(4d, 4d, 4d)), ToleranceContext.Default);
- Assert.Equal(CirRegionClassification.Outside, classification);
+ var tape = SdfTapeLowerer.Lower(new SdfBoxNode(2d, 2d, 2d));
+ var classification = tape.ClassifyRegion(new SdfBounds(new Point3D(3d, 3d, 3d), new Point3D(4d, 4d, 4d)), ToleranceContext.Default);
+ Assert.Equal(SdfRegionClassification.Outside, classification);
}
[Fact]
public void Interval_ClassifiesMixedRegion()
{
- var tape = CirTapeLowerer.Lower(new CirBoxNode(4d, 4d, 4d));
- var classification = tape.ClassifyRegion(new CirBounds(new Point3D(1d, -0.5d, -0.5d), new Point3D(3d, 0.5d, 0.5d)), ToleranceContext.Default);
- Assert.Equal(CirRegionClassification.Mixed, classification);
+ var tape = SdfTapeLowerer.Lower(new SdfBoxNode(4d, 4d, 4d));
+ var classification = tape.ClassifyRegion(new SdfBounds(new Point3D(1d, -0.5d, -0.5d), new Point3D(3d, 0.5d, 0.5d)), ToleranceContext.Default);
+ Assert.Equal(SdfRegionClassification.Mixed, classification);
}
[Fact]
public void Interval_TransformedPrimitive_IsConservative()
{
- var transformed = new CirTransformNode(
- new CirCylinderNode(1.75d, 6d),
+ var transformed = new SdfTransformNode(
+ new SdfCylinderNode(1.75d, 6d),
Transform3D.CreateTranslation(new Vector3D(1d, -2d, 0.5d)) * Transform3D.CreateRotationY(double.Pi / 7d) * Transform3D.CreateRotationX(double.Pi / 9d));
- AssertIntervalContainsSamples(transformed, new CirBounds(new Point3D(-3d, -5d, -4d), new Point3D(5d, 2d, 4d)));
+ AssertIntervalContainsSamples(transformed, new SdfBounds(new Point3D(-3d, -5d, -4d), new Point3D(5d, 2d, 4d)));
}
- private static void AssertIntervalContainsSamples(CirNode node, CirBounds region)
+ private static void AssertIntervalContainsSamples(SdfNode node, SdfBounds region)
{
- var tape = CirTapeLowerer.Lower(node);
+ var tape = SdfTapeLowerer.Lower(node);
var interval = tape.EvaluateInterval(region);
foreach (var sample in SamplePoints(region))
@@ -78,7 +78,7 @@ public sealed class CirTapeIntervalEvaluationTests
}
}
- private static IEnumerable<Point3D> SamplePoints(CirBounds region)
+ private static IEnumerable<Point3D> SamplePoints(SdfBounds region)
{
var xs = BuildSamples(region.Min.X, region.Max.X);
var ys = BuildSamples(region.Min.Y, region.Max.Y);
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/PrismaticHybridMapDispatchPrototypeTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/PrismaticHybridMapDispatchPrototypeTests.cs
index 3f83013c..a9dd459e 100644
--- a/Aetheris.Continuum.Tests/Backends/Sdf/PrismaticHybridMapDispatchPrototypeTests.cs
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/PrismaticHybridMapDispatchPrototypeTests.cs
@@ -69,14 +69,14 @@ public sealed class PrismaticHybridMapDispatchPrototypeTests
}
[Fact]
- public void EdgePrismaticX8_PrimitiveBoxDispatch_ReusesCirTapeAndComparesBrepBaseline()
+ public void EdgePrismaticX8_PrimitiveBoxDispatch_ReusesSdfTapeAndComparesBrepBaseline()
{
- var node = new CirBoxNode(10d, 6d, 4d);
+ var node = new SdfBoxNode(10d, 6d, 4d);
var mapRequest = new CirMapPrototypeRequest(CirMapPrototypeView.Top, Rows, Cols, node.Bounds, SamplesPerRay: 384, RootRefinementIterations: 32, Tolerance: 1e-7d);
var dispatch = PrismaticHybridMapDispatchLab.DispatchPrimitiveBox(node, mapRequest, BrepPrimitives.CreateBox(10d, 6d, 4d).Value);
- Assert.Equal(HybridMapBackendKind.CirTape, dispatch.SelectedBackend);
+ Assert.Equal(HybridMapBackendKind.SdfTape, dispatch.SelectedBackend);
Assert.Equal(CirMirrorStatus.MirrorAdmittedExact, dispatch.MirrorAdmission.Status);
Assert.NotNull(dispatch.MapSummary);
Assert.Equal("cir-tape", dispatch.MapSummary.BackendSelected);
@@ -152,7 +152,7 @@ public sealed class PrismaticHybridMapDispatchPrototypeTests
internal enum HybridMapBackendKind
{
CirConvexPolyhedron,
- CirTape,
+ SdfTape,
BrepRaycast,
Unsupported,
}
@@ -174,7 +174,7 @@ internal sealed record HybridMapSummary(
double? ThicknessMin,
double? ThicknessMax,
double? ThicknessAverage,
- CirBounds Bounds,
+ SdfBounds Bounds,
IReadOnlyList<string> Diagnostics,
IReadOnlyList<string> KnownLosses);
@@ -312,7 +312,7 @@ internal static class PrismaticHybridMapDispatchLab
"prismatic-hybrid-map-mirror-unavailable");
}
- public static HybridMapDispatchResult DispatchPrimitiveBox(CirBoxNode node, CirMapPrototypeRequest request, BrepBody? brepBaseline = null)
+ public static HybridMapDispatchResult DispatchPrimitiveBox(SdfBoxNode node, CirMapPrototypeRequest request, BrepBody? brepBaseline = null)
{
var diagnostics = StartDiagnostics();
diagnostics.Add("edge-prismatic-x8-cir-mirror-admission-requested:box");
@@ -356,7 +356,7 @@ internal static class PrismaticHybridMapDispatchLab
StableDiagnostics(diagnostics),
KnownLossDescriptions);
return new HybridMapDispatchResult(
- HybridMapBackendKind.CirTape,
+ HybridMapBackendKind.SdfTape,
dispatch.MirrorAdmission,
CirMapAnalyzerUse.MapOccupancy,
summary,
diff --git a/Aetheris.Continuum.Tests/Backends/Sdf/SdfCapabilityContractTests.cs b/Aetheris.Continuum.Tests/Backends/Sdf/SdfCapabilityContractTests.cs
new file mode 100644
index 00000000..07672a42
--- /dev/null
+++ b/Aetheris.Continuum.Tests/Backends/Sdf/SdfCapabilityContractTests.cs
@@ -0,0 +1,36 @@
+using Aetheris.Continuum.Backends.Sdf;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Continuum.Tests.Backends.Sdf;
+
+public sealed class SdfCapabilityContractTests
+{
+ [Fact]
+ public void PrimitiveAndRigidTransformRetainExactEuclideanDistance()
+ {
+ var primitive=new SdfSphereNode(2d);
+ var rigid=new SdfTransformNode(primitive,Transform3D.CreateRotationY(.37d)*Transform3D.CreateTranslation(new(2,3,4)));
+ Assert.True(SdfCapabilityAnalyzer.Analyze(primitive).HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
+ Assert.True(SdfCapabilityAnalyzer.Analyze(rigid).HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
+ }
+
+ [Fact]
+ public void NonRigidTransformAndCompositionDoNotAdvertiseExactDistance()
+ {
+ var scaled=new SdfTransformNode(new SdfSphereNode(1d),Transform3D.CreateScale(new Vector3D(2,1,1)));
+ var composed=new SdfUnionNode(new SdfSphereNode(1d),new SdfTransformNode(new SdfSphereNode(1d),Transform3D.CreateTranslation(new(1,0,0))));
+ Assert.False(SdfCapabilityAnalyzer.Analyze(scaled).HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
+ Assert.False(SdfCapabilityAnalyzer.Analyze(composed).HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
+ Assert.True(SdfCapabilityAnalyzer.Analyze(scaled).HasFlag(SdfFieldCapabilities.SignCorrectOccupancy));
+ Assert.True(SdfCapabilityAnalyzer.Analyze(composed).HasFlag(SdfFieldCapabilities.ConservativeIntervals));
+ }
+
+ [Fact]
+ public void IntersectionBoundsAreConservativeRatherThanClaimedTight()
+ {
+ var intersection=new SdfIntersectNode(new SdfBoxNode(2,2,2),new SdfTransformNode(new SdfBoxNode(2,2,2),Transform3D.CreateTranslation(new(10,0,0))));
+ Assert.True(intersection.Bounds.SizeX>2d);
+ Assert.True(SdfCapabilityAnalyzer.Analyze(intersection).HasFlag(SdfFieldCapabilities.ConservativeIntervals));
+ Assert.False(SdfCapabilityAnalyzer.Analyze(intersection).HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
+ }
+}
diff --git a/Aetheris.Continuum.Tests/Lattice/ContinuumM2Tests.cs b/Aetheris.Continuum.Tests/Lattice/ContinuumM2Tests.cs
index da96e510..ca7a3fc9 100644
--- a/Aetheris.Continuum.Tests/Lattice/ContinuumM2Tests.cs
+++ b/Aetheris.Continuum.Tests/Lattice/ContinuumM2Tests.cs
@@ -21,7 +21,7 @@ public sealed class ContinuumM2Tests
Assert.Equal(region.FaceId.Value.ToString(), region.BoundaryReference.ExactBrepFaceId);
Assert.Equal(SurfaceGeometryKind.Sphere, region.BrepBody.GetFaceSurface(region.FaceId).Kind);
var boundary = region.ExactQuery.Project(new Point3D(2d, 0.2d, -0.1d));
- var inward = -region.ExactQuery.OutwardNormal(boundary);
+ var inward = -region.ExactQuery.SupportNormalAt(boundary);
Assert.NotEqual(ContinuumPointClassification.Outside, region.Classify(boundary + (inward * 1e-6d)));
Assert.Equal(ContinuumPointClassification.Outside, region.Classify(boundary - (inward * 1e-6d)));
}
@@ -66,6 +66,6 @@ public sealed class ContinuumM2Tests
var roundTrip = region.ExactQuery.Evaluate(recovered.U, recovered.V);
Assert.InRange((roundTrip - point).Length, 0d, 2e-7d);
- Assert.InRange(region.ExactQuery.ExactFaceNormal(u, v).Length, 0.999999d, 1.000001d);
+ Assert.InRange(region.ExactQuery.ExactSupportNormal(u, v).Length, 0.999999d, 1.000001d);
}
}
diff --git a/Aetheris.Continuum.Tests/Lattice/ContinuumM4BDualLoweringTests.cs b/Aetheris.Continuum.Tests/Lattice/ContinuumM4BDualLoweringTests.cs
new file mode 100644
index 00000000..aab3e6d7
--- /dev/null
+++ b/Aetheris.Continuum.Tests/Lattice/ContinuumM4BDualLoweringTests.cs
@@ -0,0 +1,58 @@
+using Aetheris.Continuum.Boundaries;
+using Aetheris.Continuum.Cir;
+using Aetheris.Continuum.Regions.Constructive;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.StandardLibrary;
+
+namespace Aetheris.Continuum.Tests.Lattice;
+
+public sealed class ContinuumM4BDualLoweringTests
+{
+ [Fact]
+ public void SameTypedPlanProducesCompleteAssociatedBrepAndCir()
+ {
+ var dual=Fixture("m4b-complete",Transform3D.Identity);
+ var association=Association(dual);
+ var shell=new WholeShellBoundaryQuery(dual.Brep.Body,association,dual.Continuum.Transform,Semantics(dual));
+ var consistency=BrepCirConsistencyChecker.Check(dual.Continuum,shell,2e-7d);
+ Assert.True(consistency.Passed,consistency.Summary+Environment.NewLine+string.Join(Environment.NewLine,consistency.Probes.Where(p=>!p.Passed)));
+ Assert.Equal(new[]{SurfaceGeometryKind.Plane,SurfaceGeometryKind.Cylinder,SurfaceGeometryKind.Cone,SurfaceGeometryKind.Torus},
+ shell.Faces.Select(f=>f.SupportKind).Distinct().Order().ToArray());
+ var composer=new WholePartCutCellComposer(dual.Continuum,shell);
+ Assert.Equal(0,composer.JudgmentCallCount);
+ Assert.All(shell.Faces,face=>Assert.Equal(MaterialSideStatus.Resolved,composer.MaterialSides[face.FaceId].Status));
+ }
+
+ [Fact]
+ public void AssociationRejectsDifferentConstructiveLineage()
+ {
+ var a=Fixture("m4b-a",Transform3D.Identity);var b=Fixture("m4b-b",Transform3D.Identity);
+ var association=Association(a) with { ConstructionSourceIdentity=b.ConstructionSourceIdentity };
+ var shell=new WholeShellBoundaryQuery(a.Brep.Body,association,a.Continuum.Transform,Semantics(a));
+ var result=BrepCirConsistencyChecker.Check(a.Continuum,shell,2e-7d);
+ Assert.False(result.Passed);Assert.Contains(result.Probes,p=>p.Kind=="lineage"&&!p.Passed);
+ }
+
+ [Fact]
+ public void ReferenceHexBoltDualLowersWithoutRepresentationMismatch()
+ {
+ var plan=HexBoltConstructionPlanner.Plan(McMasterHexBoltSpecs.Reference91180A151,"HexBolt-M4B").Value!;
+ var dual=ExactCoaxialDualMaterializer.Materialize(plan,Transform3D.Identity);
+ var shell=new WholeShellBoundaryQuery(dual.Brep.Body,Association(dual),dual.Continuum.Transform,Semantics(dual));
+ var result=BrepCirConsistencyChecker.Check(dual.Continuum,shell,2e-7d);
+ Assert.True(result.Passed,result.Summary+Environment.NewLine+string.Join(Environment.NewLine,result.Probes.Where(p=>!p.Passed)));
+ var composer=new WholePartCutCellComposer(dual.Continuum,shell);
+ Assert.All(new[]{SurfaceGeometryKind.Plane,SurfaceGeometryKind.Cylinder,SurfaceGeometryKind.Cone,SurfaceGeometryKind.Torus},
+ family=>Assert.Contains(shell.Faces,f=>f.SupportKind==family));
+ Assert.All(composer.MaterialSides.Values,e=>Assert.Equal(MaterialSideStatus.Resolved,e.Status));
+ }
+
+ private static ExactCoaxialDualLowering Fixture(string id,Transform3D transform)
+ {
+ var recipe=new ExactCoaxialPartRecipe(id,6,3d,.9d,1d,30d,.25d,1.5d,2d,.25d,1.15d,.8d,"M4B","proof");
+ return ExactCoaxialDualMaterializer.Materialize(ExactCoaxialPartBuilder.Plan(recipe).Value!,transform);
+ }
+ private static CirBrepAssociation Association(ExactCoaxialDualLowering dual)=>new(dual.Continuum.Id,dual.Plan.StableId,"outer-shell",dual.Plan.StableId,dual.ConstructionSourceIdentity);
+ private static IReadOnlyDictionary<Aetheris.Kernel.Core.Topology.FaceId,string> Semantics(ExactCoaxialDualLowering dual)=>dual.Brep.Semantics.Where(s=>s.Face.HasValue).GroupBy(s=>s.Face!.Value).ToDictionary(g=>g.Key,g=>string.Join("|",g.Select(s=>s.StableId).Order()));
+}
diff --git a/Aetheris.Continuum.Tests/Lattice/LatticeAndFixtureTests.cs b/Aetheris.Continuum.Tests/Lattice/LatticeAndFixtureTests.cs
index 4e4295ac..5e238d6e 100644
--- a/Aetheris.Continuum.Tests/Lattice/LatticeAndFixtureTests.cs
+++ b/Aetheris.Continuum.Tests/Lattice/LatticeAndFixtureTests.cs
@@ -18,16 +18,18 @@ public sealed class LatticeAndFixtureTests
new BoundingBox3D(new Point3D(-1d, -1d, -1d), new Point3D(1d, 1d, 1d)));
Assert.True(region.Contains(Point3D.Origin));
- Assert.False(region is ISignedDistanceCapability);
+ Assert.False(region is IExactEuclideanSignedDistanceCapability);
}
[Fact]
public void SdfBackend_AdaptsPreservedNodeAndTapeToCirCapabilities()
{
- IContinuumRegion region = new SdfContinuumRegion(new RegionId("sphere"), new CirSphereNode(1d));
+ var sdfRegion = new SdfContinuumRegion(new RegionId("sphere"), new SdfSphereNode(1d));
+ IContinuumRegion region = sdfRegion;
Assert.Equal(ContinuumPointClassification.Inside, region.Classify(Point3D.Origin));
- Assert.IsAssignableFrom<ISignedDistanceCapability>(region);
+ Assert.IsAssignableFrom<IImplicitFieldCapability>(region);
+ Assert.True(sdfRegion.Capabilities.HasFlag(SdfFieldCapabilities.ExactEuclideanSignedDistance));
Assert.IsAssignableFrom<IGradientCapability>(region);
Assert.IsAssignableFrom<IBoundsClassificationCapability>(region);
}
diff --git a/Aetheris.Continuum/Aetheris.Continuum.csproj b/Aetheris.Continuum/Aetheris.Continuum.csproj
index c4134034..c1a05ede 100644
--- a/Aetheris.Continuum/Aetheris.Continuum.csproj
+++ b/Aetheris.Continuum/Aetheris.Continuum.csproj
@@ -7,5 +7,6 @@
<ItemGroup>
<ProjectReference Include="..\Aetheris.Kernel.Core\Aetheris.Kernel.Core.csproj" />
+ <ProjectReference Include="..\Aetheris.Kernel.StandardLibrary\Aetheris.Kernel.StandardLibrary.csproj" />
</ItemGroup>
</Project>
diff --git a/Aetheris.Continuum/Backends/Sdf/CirAnalysis.cs b/Aetheris.Continuum/Backends/Sdf/CirAnalysis.cs
deleted file mode 100644
index c152e7cf..00000000
--- a/Aetheris.Continuum/Backends/Sdf/CirAnalysis.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Aetheris.Kernel.Core.Math;
-
-namespace Aetheris.Continuum.Backends.Sdf;
-
-public enum CirPointClassification
-{
- Inside,
- Outside,
- Boundary
-}
-
-public sealed record CirAnalyzerResult(CirPointClassification Classification, double SignedDistance);
-
-public static class CirAnalyzer
-{
- public static CirAnalyzerResult ClassifyPoint(CirNode node, Point3D point, double boundaryTolerance = 1e-6)
- {
- ArgumentNullException.ThrowIfNull(node);
- var value = node.Evaluate(point);
- var classification = double.Abs(value) <= boundaryTolerance
- ? CirPointClassification.Boundary
- : value < 0d
- ? CirPointClassification.Inside
- : CirPointClassification.Outside;
- return new CirAnalyzerResult(classification, value);
- }
-
- public static double EstimateVolume(CirNode node, int resolution) => CirVolumeEstimator.EstimateVolume(node, resolution);
-}
diff --git a/Aetheris.Continuum/Backends/Sdf/CirRegionPlanner.cs b/Aetheris.Continuum/Backends/Sdf/CirRegionPlanner.cs
index 27fec66d..744ba26c 100644
--- a/Aetheris.Continuum/Backends/Sdf/CirRegionPlanner.cs
+++ b/Aetheris.Continuum/Backends/Sdf/CirRegionPlanner.cs
@@ -22,9 +22,9 @@ public sealed record CirRegionPlannerOptions(
}
public readonly record struct CirRegionPlanContext(
- CirBounds Region,
+ SdfBounds Region,
FieldInterval Interval,
- CirRegionClassification Classification,
+ SdfRegionClassification Classification,
int Depth,
int MaxDepth,
int EstimatedSampleCount,
@@ -38,8 +38,8 @@ public sealed record CirRegionPlanResult(
CirRegionPlanAction Action,
string SelectedCandidate,
FieldInterval Interval,
- CirRegionClassification Classification,
- CirBounds Region,
+ SdfRegionClassification Classification,
+ SdfBounds Region,
double? Score,
IReadOnlyList<CirRegionPlanRejection> RejectedCandidates,
int Depth,
@@ -88,7 +88,7 @@ public sealed class CirRegionPlanner
note);
}
- public CirRegionPlanResult Plan(CirTape tape, CirBounds region, int depth, CirRegionPlannerOptions? options = null, ToleranceContext? tolerance = null)
+ public CirRegionPlanResult Plan(SdfTape tape, SdfBounds region, int depth, CirRegionPlannerOptions? options = null, ToleranceContext? tolerance = null)
{
ArgumentNullException.ThrowIfNull(tape);
@@ -101,9 +101,9 @@ public sealed class CirRegionPlanner
}
public static CirRegionPlanContext BuildContext(
- CirBounds region,
+ SdfBounds region,
FieldInterval interval,
- CirRegionClassification classification,
+ SdfRegionClassification classification,
int depth,
CirRegionPlannerOptions options,
ToleranceContext tolerance)
@@ -133,7 +133,7 @@ public sealed class CirRegionPlanner
TieBreakerPriority: 1),
new JudgmentCandidate<CirRegionPlanContext>(
"subdivide_mixed",
- IsAdmissible: context => context.Classification == CirRegionClassification.Mixed
+ IsAdmissible: context => context.Classification == SdfRegionClassification.Mixed
&& context.Depth < context.MaxDepth
&& MinExtent(context.Region) > 0d
&& MinExtent(context.Region) >= context.Tolerance.Linear,
@@ -142,7 +142,7 @@ public sealed class CirRegionPlanner
TieBreakerPriority: 2),
new JudgmentCandidate<CirRegionPlanContext>(
"sample_directly",
- IsAdmissible: context => context.Classification == CirRegionClassification.Mixed
+ IsAdmissible: context => context.Classification == SdfRegionClassification.Mixed
&& (context.Depth >= context.MaxDepth
|| MinExtent(context.Region) <= context.Tolerance.Linear
|| context.EstimatedSampleCount <= context.DirectSampleThreshold),
@@ -151,7 +151,7 @@ public sealed class CirRegionPlanner
TieBreakerPriority: 3),
];
- private static int EstimateSampleCount(CirBounds region, double minimumRegionExtent)
+ private static int EstimateSampleCount(SdfBounds region, double minimumRegionExtent)
{
var cell = double.Max(minimumRegionExtent, 1e-9d);
var x = System.Math.Max(1, (int)double.Ceiling(region.SizeX / cell));
@@ -160,11 +160,11 @@ public sealed class CirRegionPlanner
return x * y * z;
}
- private static double MinExtent(CirBounds bounds) => double.Min(bounds.SizeX, double.Min(bounds.SizeY, bounds.SizeZ));
+ private static double MinExtent(SdfBounds bounds) => double.Min(bounds.SizeX, double.Min(bounds.SizeY, bounds.SizeZ));
private static string BuildSubdivideRejection(CirRegionPlanContext context)
{
- if (context.Classification != CirRegionClassification.Mixed)
+ if (context.Classification != SdfRegionClassification.Mixed)
{
return $"Classification is {context.Classification}, subdivision reserved for mixed regions.";
}
@@ -184,7 +184,7 @@ public sealed class CirRegionPlanner
private static string BuildSampleRejection(CirRegionPlanContext context)
{
- if (context.Classification != CirRegionClassification.Mixed)
+ if (context.Classification != SdfRegionClassification.Mixed)
{
return $"Classification is {context.Classification}, direct sampling reserved for mixed regions.";
}
diff --git a/Aetheris.Continuum/Backends/Sdf/CirAdaptiveVolumeEstimator.cs b/Aetheris.Continuum/Backends/Sdf/SdfAdaptiveVolumeEstimator.cs
similarity index 79%
rename from Aetheris.Continuum/Backends/Sdf/CirAdaptiveVolumeEstimator.cs
rename to Aetheris.Continuum/Backends/Sdf/SdfAdaptiveVolumeEstimator.cs
index a592fafe..b1306b41 100644
--- a/Aetheris.Continuum/Backends/Sdf/CirAdaptiveVolumeEstimator.cs
+++ b/Aetheris.Continuum/Backends/Sdf/SdfAdaptiveVolumeEstimator.cs
@@ -3,17 +3,17 @@ using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Continuum.Backends.Sdf;
-public sealed record CirAdaptiveVolumeOptions(
+public sealed record SdfAdaptiveVolumeOptions(
int MaxDepth = 6,
int DirectSampleGrid = 2,
int MaxTraceEvents = 64,
double MinimumRegionExtent = 0.05d,
bool TreatRejectUnknownAsSample = true)
{
- public static CirAdaptiveVolumeOptions Default { get; } = new();
+ public static SdfAdaptiveVolumeOptions Default { get; } = new();
}
-public readonly record struct CirAdaptiveTraceEvent(
+public readonly record struct SdfAdaptiveTraceEvent(
int RegionId,
int? ParentRegionId,
int Depth,
@@ -22,9 +22,9 @@ public readonly record struct CirAdaptiveTraceEvent(
FieldInterval Interval,
string? Note);
-public sealed record CirAdaptiveVolumeResult(
+public sealed record SdfAdaptiveVolumeResult(
double EstimatedVolume,
- CirAdaptiveVolumeOptions Options,
+ SdfAdaptiveVolumeOptions Options,
int TotalRegionsVisited,
int RegionsClassifiedInside,
int RegionsClassifiedOutside,
@@ -32,21 +32,21 @@ public sealed record CirAdaptiveVolumeResult(
int RegionsSampledDirectly,
int UnknownOrRejectedRegions,
int MaxDepthReached,
- IReadOnlyList<CirAdaptiveTraceEvent> TraceEvents,
+ IReadOnlyList<SdfAdaptiveTraceEvent> TraceEvents,
IReadOnlyList<string> Notes);
-public static class CirAdaptiveVolumeEstimator
+public static class SdfAdaptiveVolumeEstimator
{
- public static CirAdaptiveVolumeResult EstimateVolume(CirTape tape, CirBounds bounds, CirAdaptiveVolumeOptions? options = null, ToleranceContext? tolerance = null)
+ public static SdfAdaptiveVolumeResult EstimateVolume(SdfTape tape, SdfBounds bounds, SdfAdaptiveVolumeOptions? options = null, ToleranceContext? tolerance = null)
{
ArgumentNullException.ThrowIfNull(tape);
- var effectiveOptions = options ?? CirAdaptiveVolumeOptions.Default;
+ var effectiveOptions = options ?? SdfAdaptiveVolumeOptions.Default;
var effectiveTolerance = tolerance ?? ToleranceContext.Default;
var planner = new CirRegionPlanner();
var plannerOptions = new CirRegionPlannerOptions(effectiveOptions.MaxDepth, DirectSampleThreshold: effectiveOptions.DirectSampleGrid * effectiveOptions.DirectSampleGrid * effectiveOptions.DirectSampleGrid, effectiveOptions.MinimumRegionExtent);
var queue = new Queue<RegionWorkItem>();
- var trace = new List<CirAdaptiveTraceEvent>(capacity: effectiveOptions.MaxTraceEvents);
+ var trace = new List<SdfAdaptiveTraceEvent>(capacity: effectiveOptions.MaxTraceEvents);
var notes = new List<string>();
queue.Enqueue(new RegionWorkItem(0, null, bounds, 0));
@@ -105,20 +105,20 @@ public static class CirAdaptiveVolumeEstimator
}
}
- return new CirAdaptiveVolumeResult(totalVolume, effectiveOptions, totalVisited, inside, outside, subdivided, sampled, unknown, maxDepthReached, trace, notes);
+ return new SdfAdaptiveVolumeResult(totalVolume, effectiveOptions, totalVisited, inside, outside, subdivided, sampled, unknown, maxDepthReached, trace, notes);
}
- private static void TryRecordTrace(List<CirAdaptiveTraceEvent> trace, int maxTraceEvents, RegionWorkItem item, CirRegionPlanResult plan)
+ private static void TryRecordTrace(List<SdfAdaptiveTraceEvent> trace, int maxTraceEvents, RegionWorkItem item, CirRegionPlanResult plan)
{
if (trace.Count >= maxTraceEvents)
{
return;
}
- trace.Add(new CirAdaptiveTraceEvent(item.RegionId, item.ParentRegionId, item.Depth, plan.Action, plan.SelectedCandidate, plan.Interval, plan.Note));
+ trace.Add(new SdfAdaptiveTraceEvent(item.RegionId, item.ParentRegionId, item.Depth, plan.Action, plan.SelectedCandidate, plan.Interval, plan.Note));
}
- private static double SampleRegionVolume(CirTape tape, CirBounds region, int grid)
+ private static double SampleRegionVolume(SdfTape tape, SdfBounds region, int grid)
{
var sampleGrid = int.Max(grid, 1);
var dx = region.SizeX / sampleGrid;
@@ -141,9 +141,9 @@ public static class CirAdaptiveVolumeEstimator
return RegionVolume(region) * (insideCount / (double)totalSamples);
}
- private static double RegionVolume(CirBounds region) => double.Max(region.SizeX, 0d) * double.Max(region.SizeY, 0d) * double.Max(region.SizeZ, 0d);
+ private static double RegionVolume(SdfBounds region) => double.Max(region.SizeX, 0d) * double.Max(region.SizeY, 0d) * double.Max(region.SizeZ, 0d);
- private static IReadOnlyList<CirBounds> SplitLongestAxis(CirBounds region)
+ private static IReadOnlyList<SdfBounds> SplitLongestAxis(SdfBounds region)
{
var sizeX = region.SizeX;
var sizeY = region.SizeY;
@@ -154,8 +154,8 @@ public static class CirAdaptiveVolumeEstimator
var mid = (region.Min.X + region.Max.X) * 0.5d;
return
[
- new CirBounds(region.Min, new Point3D(mid, region.Max.Y, region.Max.Z)),
- new CirBounds(new Point3D(mid, region.Min.Y, region.Min.Z), region.Max),
+ new SdfBounds(region.Min, new Point3D(mid, region.Max.Y, region.Max.Z)),
+ new SdfBounds(new Point3D(mid, region.Min.Y, region.Min.Z), region.Max),
];
}
@@ -164,18 +164,18 @@ public static class CirAdaptiveVolumeEstimator
var mid = (region.Min.Y + region.Max.Y) * 0.5d;
return
[
- new CirBounds(region.Min, new Point3D(region.Max.X, mid, region.Max.Z)),
- new CirBounds(new Point3D(region.Min.X, mid, region.Min.Z), region.Max),
+ new SdfBounds(region.Min, new Point3D(region.Max.X, mid, region.Max.Z)),
+ new SdfBounds(new Point3D(region.Min.X, mid, region.Min.Z), region.Max),
];
}
var midZ = (region.Min.Z + region.Max.Z) * 0.5d;
return
[
- new CirBounds(region.Min, new Point3D(region.Max.X, region.Max.Y, midZ)),
- new CirBounds(new Point3D(region.Min.X, region.Min.Y, midZ), region.Max),
+ new SdfBounds(region.Min, new Point3D(region.Max.X, region.Max.Y, midZ)),
+ new SdfBounds(new Point3D(region.Min.X, region.Min.Y, midZ), region.Max),
];
}
- private readonly record struct RegionWorkItem(int RegionId, int? ParentRegionId, CirBounds Region, int Depth);
+ private readonly record struct RegionWorkItem(int RegionId, int? ParentRegionId, SdfBounds Region, int Depth);
}
diff --git a/Aetheris.Continuum/Backends/Sdf/SdfAnalysis.cs b/Aetheris.Continuum/Backends/Sdf/SdfAnalysis.cs
new file mode 100644
index 00000000..c93667a9
--- /dev/null
+++ b/Aetheris.Continuum/Backends/Sdf/SdfAnalysis.cs
@@ -0,0 +1,29 @@
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Continuum.Backends.Sdf;
+
+public enum SdfPointClassification
+{
+ Inside,
+ Outside,
+ Boundary
+}
+
+public sealed record SdfAnalyzerResult(SdfPointClassification Classification, double SignedDistance);
+
+public static class SdfAnalyzer
+{
+ public static SdfAnalyzerResult ClassifyPoint(SdfNode node, Point3D point, double boundaryTolerance = 1e-6)
+ {
+ ArgumentNullException.ThrowIfNull(node);
+ var value = node.Evaluate(point);
+ var classification = double.Abs(value) <= boundaryTolerance
+ ? SdfPointClassification.Boundary
+ : value < 0d
+ ? SdfPointClassification.Inside
+ : SdfPointClassification.Outside;
+ return new SdfAnalyzerResult(classification, value);
+ }
+
+ public static double EstimateVolume(SdfNode node, int resolution) => SdfVolumeEstimator.EstimateVolume(node, resolution);
+}
diff --git a/Aetheris.Continuum/Backends/Sdf/SdfContinuumRegion.cs b/Aetheris.Continuum/Backends/Sdf/SdfContinuumRegion.cs
index 68cb8cb9..cdc0c2d3 100644
--- a/Aetheris.Continuum/Backends/Sdf/SdfContinuumRegion.cs
+++ b/Aetheris.Continuum/Backends/Sdf/SdfContinuumRegion.cs
@@ -5,27 +5,29 @@ using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Continuum.Backends.Sdf;
/// <summary>Adapts the preserved SDF node/tape runtime to the broader CIR occupancy contract.</summary>
-public sealed class SdfContinuumRegion : IContinuumRegion, ISignedDistanceCapability, IGradientCapability, IBoundsClassificationCapability
+public sealed class SdfContinuumRegion : IContinuumRegion, IImplicitFieldCapability, IGradientCapability, IBoundsClassificationCapability
{
- private readonly CirTape tape;
+ private readonly SdfTape tape;
- public SdfContinuumRegion(RegionId id, CirNode root)
+ public SdfContinuumRegion(RegionId id, SdfNode root)
{
Id = id;
Root = root ?? throw new ArgumentNullException(nameof(root));
- tape = CirTapeLowerer.Lower(root);
+ tape = SdfTapeLowerer.Lower(root);
+ Capabilities = SdfCapabilityAnalyzer.Analyze(root);
Bounds = new BoundingBox3D(root.Bounds.Min, root.Bounds.Max);
}
public RegionId Id { get; }
- public CirNode Root { get; }
+ public SdfNode Root { get; }
public BoundingBox3D Bounds { get; }
+ public SdfFieldCapabilities Capabilities { get; }
- public double SignedDistance(Point3D point) => tape.Evaluate(point);
+ public double FieldValue(Point3D point) => tape.Evaluate(point);
public ContinuumPointClassification Classify(Point3D point, double tolerance = 1e-9d)
{
- var value = SignedDistance(point);
+ var value = FieldValue(point);
return double.Abs(value) <= tolerance
? ContinuumPointClassification.Boundary
: value < 0d
@@ -35,17 +37,17 @@ public sealed class SdfContinuumRegion : IContinuumRegion, ISignedDistanceCapabi
public ContinuumBoundsClassification ClassifyBounds(BoundingBox3D bounds, double tolerance = 1e-9d)
{
- var interval = tape.EvaluateInterval(new CirBounds(bounds.Min, bounds.Max));
+ var interval = tape.EvaluateInterval(new SdfBounds(bounds.Min, bounds.Max));
var center = new Point3D(
(bounds.Min.X + bounds.Max.X) * 0.5d,
(bounds.Min.Y + bounds.Max.Y) * 0.5d,
(bounds.Min.Z + bounds.Max.Z) * 0.5d);
- if (interval.MaxValue <= tolerance && SignedDistance(center) <= 0d)
+ if (interval.MaxValue <= tolerance && FieldValue(center) <= 0d)
{
return ContinuumBoundsClassification.Inside;
}
- if (interval.MinValue >= -tolerance && SignedDistance(center) > 0d)
+ if (interval.MinValue >= -tolerance && FieldValue(center) > 0d)
{
return ContinuumBoundsClassification.Outside;
}
@@ -57,9 +59,9 @@ public sealed class SdfContinuumRegion : IContinuumRegion, ISignedDistanceCapabi
{
const double h = 1e-6d;
gradient = new Vector3D(
- (SignedDistance(new Point3D(point.X + h, point.Y, point.Z)) - SignedDistance(new Point3D(point.X - h, point.Y, point.Z))) / (2d * h),
- (SignedDistance(new Point3D(point.X, point.Y + h, point.Z)) - SignedDistance(new Point3D(point.X, point.Y - h, point.Z))) / (2d * h),
- (SignedDistance(new Point3D(point.X, point.Y, point.Z + h)) - SignedDistance(new Point3D(point.X, point.Y, point.Z - h))) / (2d * h));
+ (FieldValue(new Point3D(point.X + h, point.Y, point.Z)) - FieldValue(new Point3D(point.X - h, point.Y, point.Z))) / (2d * h),
+ (FieldValue(new Point3D(point.X, point.Y + h, point.Z)) - FieldValue(new Point3D(point.X, point.Y - h, point.Z))) / (2d * h),
+ (FieldValue(new Point3D(point.X, point.Y, point.Z + h)) - FieldValue(new Point3D(point.X, point.Y, point.Z - h))) / (2d * h));
return gradient.TryNormalize(out gradient, ToleranceContext.Default);
}
}
diff --git a/Aetheris.Continuum/Backends/Sdf/SdfFieldCapabilities.cs b/Aetheris.Continuum/Backends/Sdf/SdfFieldCapabilities.cs
new file mode 100644
index 00000000..21b16f2e
--- /dev/null
+++ b/Aetheris.Continuum/Backends/Sdf/SdfFieldCapabilities.cs
@@ -0,0 +1,37 @@
+namespace Aetheris.Continuum.Backends.Sdf;
+
+[Flags]
+public enum SdfFieldCapabilities
+{
+ None = 0,
+ SignCorrectOccupancy = 1,
+ ConservativeIntervals = 2,
+ ExactEuclideanSignedDistance = 4,
+ Gradient = 8,
+}
+
+/// <summary>Computes promises preserved by a concrete SDF expression. Bounds for intersections are conservative, never advertised as tight.</summary>
+public static class SdfCapabilityAnalyzer
+{
+ public static SdfFieldCapabilities Analyze(SdfNode node) => node switch
+ {
+ SdfBoxNode or SdfCylinderNode or SdfConeNode or SdfSphereNode or SdfTorusNode =>
+ SdfFieldCapabilities.SignCorrectOccupancy | SdfFieldCapabilities.ConservativeIntervals |
+ SdfFieldCapabilities.ExactEuclideanSignedDistance | SdfFieldCapabilities.Gradient,
+ SdfTransformNode transformed => Transform(Analyze(transformed.Child), transformed.Transform.IsRigid()),
+ SdfUnionNode union => Composition(Analyze(union.Left), Analyze(union.Right)),
+ SdfIntersectNode intersection => Composition(Analyze(intersection.Left), Analyze(intersection.Right)),
+ SdfSubtractNode subtraction => Composition(Analyze(subtraction.Left), Analyze(subtraction.Right)),
+ _ => SdfFieldCapabilities.None,
+ };
+
+ private static SdfFieldCapabilities Transform(SdfFieldCapabilities child, bool rigid) => rigid
+ ? child
+ : child & ~SdfFieldCapabilities.ExactEuclideanSignedDistance;
+
+ private static SdfFieldCapabilities Composition(SdfFieldCapabilities left, SdfFieldCapabilities right)
+ {
+ var shared = left & right;
+ return shared & ~SdfFieldCapabilities.ExactEuclideanSignedDistance;
+ }
+}
diff --git a/Aetheris.Continuum/Backends/Sdf/CirNode.cs b/Aetheris.Continuum/Backends/Sdf/SdfNode.cs
similarity index 76%
rename from Aetheris.Continuum/Backends/Sdf/CirNode.cs
rename to Aetheris.Continuum/Backends/Sdf/SdfNode.cs
index b23acfdc..740bb813 100644
--- a/Aetheris.Continuum/Backends/Sdf/CirNode.cs
+++ b/Aetheris.Continuum/Backends/Sdf/SdfNode.cs
@@ -2,7 +2,7 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Continuum.Backends.Sdf;
-public enum CirNodeKind
+public enum SdfNodeKind
{
Box,
Cylinder,
@@ -15,21 +15,21 @@ public enum CirNodeKind
Transform,
}
-public readonly record struct CirBounds(Point3D Min, Point3D Max)
+public readonly record struct SdfBounds(Point3D Min, Point3D Max)
{
public double SizeX => Max.X - Min.X;
public double SizeY => Max.Y - Min.Y;
public double SizeZ => Max.Z - Min.Z;
- public static CirBounds Union(CirBounds left, CirBounds right) =>
+ public static SdfBounds Union(SdfBounds left, SdfBounds right) =>
new(
new Point3D(double.Min(left.Min.X, right.Min.X), double.Min(left.Min.Y, right.Min.Y), double.Min(left.Min.Z, right.Min.Z)),
new Point3D(double.Max(left.Max.X, right.Max.X), double.Max(left.Max.Y, right.Max.Y), double.Max(left.Max.Z, right.Max.Z)));
}
-public abstract record CirNode(CirNodeKind Kind)
+public abstract record SdfNode(SdfNodeKind Kind)
{
- public abstract CirBounds Bounds { get; }
+ public abstract SdfBounds Bounds { get; }
/// <summary>
/// Semantic/oracle evaluator retained during the CIR-E1 transition while tape-first runtime paths mature.
diff --git a/Aetheris.Continuum/Backends/Sdf/CirNodes.cs b/Aetheris.Continuum/Backends/Sdf/SdfNodes.cs
similarity index 80%
rename from Aetheris.Continuum/Backends/Sdf/CirNodes.cs
rename to Aetheris.Continuum/Backends/Sdf/SdfNodes.cs
index e93ecca9..dd446b77 100644
--- a/Aetheris.Continuum/Backends/Sdf/CirNodes.cs
+++ b/Aetheris.Continuum/Backends/Sdf/SdfNodes.cs
@@ -3,9 +3,9 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Continuum.Backends.Sdf;
-public sealed record CirBoxNode(double Width, double Height, double Depth) : CirNode(CirNodeKind.Box)
+public sealed record SdfBoxNode(double Width, double Height, double Depth) : SdfNode(SdfNodeKind.Box)
{
- public override CirBounds Bounds => new(new Point3D(-Width * 0.5d, -Height * 0.5d, -Depth * 0.5d), new Point3D(Width * 0.5d, Height * 0.5d, Depth * 0.5d));
+ public override SdfBounds Bounds => new(new Point3D(-Width * 0.5d, -Height * 0.5d, -Depth * 0.5d), new Point3D(Width * 0.5d, Height * 0.5d, Depth * 0.5d));
public override double Evaluate(Point3D point)
{
@@ -24,9 +24,9 @@ public sealed record CirBoxNode(double Width, double Height, double Depth) : Cir
}
}
-public sealed record CirCylinderNode(double Radius, double Height) : CirNode(CirNodeKind.Cylinder)
+public sealed record SdfCylinderNode(double Radius, double Height) : SdfNode(SdfNodeKind.Cylinder)
{
- public override CirBounds Bounds => new(new Point3D(-Radius, -Radius, -Height * 0.5d), new Point3D(Radius, Radius, Height * 0.5d));
+ public override SdfBounds Bounds => new(new Point3D(-Radius, -Radius, -Height * 0.5d), new Point3D(Radius, Radius, Height * 0.5d));
public override double Evaluate(Point3D point)
{
@@ -43,9 +43,9 @@ public sealed record CirCylinderNode(double Radius, double Height) : CirNode(Cir
-public sealed record CirConeNode : CirNode
+public sealed record SdfConeNode : SdfNode
{
- public CirConeNode(double bottomRadius, double topRadius, double height) : base(CirNodeKind.Cone)
+ public SdfConeNode(double bottomRadius, double topRadius, double height) : base(SdfNodeKind.Cone)
{
if (height <= 0d || double.IsNaN(height) || double.IsInfinity(height))
{
@@ -76,13 +76,13 @@ public sealed record CirConeNode : CirNode
public double TopRadius { get; }
public double Height { get; }
- public override CirBounds Bounds
+ public override SdfBounds Bounds
{
get
{
var r = double.Max(BottomRadius, TopRadius);
var hz = Height * 0.5d;
- return new CirBounds(new Point3D(-r, -r, -hz), new Point3D(r, r, hz));
+ return new SdfBounds(new Point3D(-r, -r, -hz), new Point3D(r, r, hz));
}
}
@@ -115,16 +115,16 @@ public sealed record CirConeNode : CirNode
private static double Clamp(double value, double min, double max) => value < min ? min : value > max ? max : value;
}
-public sealed record CirSphereNode(double Radius) : CirNode(CirNodeKind.Sphere)
+public sealed record SdfSphereNode(double Radius) : SdfNode(SdfNodeKind.Sphere)
{
- public override CirBounds Bounds => new(new Point3D(-Radius, -Radius, -Radius), new Point3D(Radius, Radius, Radius));
+ public override SdfBounds Bounds => new(new Point3D(-Radius, -Radius, -Radius), new Point3D(Radius, Radius, Radius));
public override double Evaluate(Point3D point) => double.Sqrt((point.X * point.X) + (point.Y * point.Y) + (point.Z * point.Z)) - Radius;
}
-public sealed record CirTorusNode(double MajorRadius, double MinorRadius) : CirNode(CirNodeKind.Torus)
+public sealed record SdfTorusNode(double MajorRadius, double MinorRadius) : SdfNode(SdfNodeKind.Torus)
{
- public override CirBounds Bounds => new(
+ public override SdfBounds Bounds => new(
new Point3D(-(MajorRadius + MinorRadius), -(MajorRadius + MinorRadius), -MinorRadius),
new Point3D(MajorRadius + MinorRadius, MajorRadius + MinorRadius, MinorRadius));
@@ -135,27 +135,27 @@ public sealed record CirTorusNode(double MajorRadius, double MinorRadius) : CirN
}
}
-public sealed record CirUnionNode(CirNode Left, CirNode Right) : CirNode(CirNodeKind.Union)
+public sealed record SdfUnionNode(SdfNode Left, SdfNode Right) : SdfNode(SdfNodeKind.Union)
{
- public override CirBounds Bounds => CirBounds.Union(Left.Bounds, Right.Bounds);
+ public override SdfBounds Bounds => SdfBounds.Union(Left.Bounds, Right.Bounds);
public override double Evaluate(Point3D point) => double.Min(Left.Evaluate(point), Right.Evaluate(point));
}
-public sealed record CirSubtractNode(CirNode Left, CirNode Right) : CirNode(CirNodeKind.Subtract)
+public sealed record SdfSubtractNode(SdfNode Left, SdfNode Right) : SdfNode(SdfNodeKind.Subtract)
{
- public override CirBounds Bounds => Left.Bounds;
+ public override SdfBounds Bounds => Left.Bounds;
public override double Evaluate(Point3D point) => double.Max(Left.Evaluate(point), -Right.Evaluate(point));
}
-public sealed record CirIntersectNode(CirNode Left, CirNode Right) : CirNode(CirNodeKind.Intersect)
+public sealed record SdfIntersectNode(SdfNode Left, SdfNode Right) : SdfNode(SdfNodeKind.Intersect)
{
- public override CirBounds Bounds => CirBounds.Union(Left.Bounds, Right.Bounds);
+ public override SdfBounds Bounds => SdfBounds.Union(Left.Bounds, Right.Bounds);
public override double Evaluate(Point3D point) => double.Max(Left.Evaluate(point), Right.Evaluate(point));
}
-public sealed record CirTransformNode(CirNode Child, Transform3D Transform) : CirNode(CirNodeKind.Transform)
+public sealed record SdfTransformNode(SdfNode Child, Transform3D Transform) : SdfNode(SdfNodeKind.Transform)
{
- public override CirBounds Bounds
+ public override SdfBounds Bounds
{
get
{
@@ -173,7 +173,7 @@ public sealed record CirTransformNode(CirNode Child, Transform3D Transform) : Ci
};
var transformed = corners.Select(TransformPoint).ToArray();
- return new CirBounds(
+ return new SdfBounds(
new Point3D(transformed.Min(p => p.X), transformed.Min(p => p.Y), transformed.Min(p => p.Z)),
new Point3D(transformed.Max(p => p.X), transformed.Max(p => p.Y), transformed.Max(p => p.Z)));
}
@@ -188,9 +188,9 @@ public sealed record CirTransformNode(CirNode Child, Transform3D Transform) : Ci
private Point3D TransformPoint(Point3D p) => Transform.Apply(p);
}
-public static class CirVolumeEstimator
+public static class SdfVolumeEstimator
{
- public static double EstimateVolume(CirNode node, int resolution)
+ public static double EstimateVolume(SdfNode node, int resolution)
{
var bounds = node.Bounds;
var dx = bounds.SizeX / resolution;
diff --git a/Aetheris.Continuum/Backends/Sdf/CirTape.cs b/Aetheris.Continuum/Backends/Sdf/SdfTape.cs
similarity index 73%
rename from Aetheris.Continuum/Backends/Sdf/CirTape.cs
rename to Aetheris.Continuum/Backends/Sdf/SdfTape.cs
index 64deec0d..1b259538 100644
--- a/Aetheris.Continuum/Backends/Sdf/CirTape.cs
+++ b/Aetheris.Continuum/Backends/Sdf/SdfTape.cs
@@ -3,7 +3,7 @@ using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Continuum.Backends.Sdf;
-public enum CirTapeOpCode
+public enum SdfTapeOpCode
{
EvalBox,
EvalCylinder,
@@ -15,20 +15,20 @@ public enum CirTapeOpCode
Neg,
}
-public readonly record struct CirTapeInstruction(
- CirTapeOpCode OpCode,
+public readonly record struct SdfTapeInstruction(
+ SdfTapeOpCode OpCode,
int DestSlot,
int InputA,
int InputB,
int PayloadIndex,
- CirNodeKind SourceKind,
+ SdfNodeKind SourceKind,
int LoweringIndex);
-public readonly record struct CirTapeBoxPayload(double Width, double Height, double Depth, Transform3D InverseTransform);
-public readonly record struct CirTapeCylinderPayload(double Radius, double Height, Transform3D InverseTransform);
-public readonly record struct CirTapeSpherePayload(double Radius, Transform3D InverseTransform);
-public readonly record struct CirTapeTorusPayload(double MajorRadius, double MinorRadius, Transform3D InverseTransform);
-public readonly record struct CirTapeConePayload(double BottomRadius, double TopRadius, double Height, Transform3D InverseTransform);
+public readonly record struct SdfTapeBoxPayload(double Width, double Height, double Depth, Transform3D InverseTransform);
+public readonly record struct SdfTapeCylinderPayload(double Radius, double Height, Transform3D InverseTransform);
+public readonly record struct SdfTapeSpherePayload(double Radius, Transform3D InverseTransform);
+public readonly record struct SdfTapeTorusPayload(double MajorRadius, double MinorRadius, Transform3D InverseTransform);
+public readonly record struct SdfTapeConePayload(double BottomRadius, double TopRadius, double Height, Transform3D InverseTransform);
public readonly record struct FieldInterval(double MinValue, double MaxValue)
{
@@ -37,7 +37,7 @@ public readonly record struct FieldInterval(double MinValue, double MaxValue)
public bool IsMixed(ToleranceContext tolerance) => !IsDefinitelyInside(tolerance) && !IsDefinitelyOutside(tolerance);
}
-public enum CirRegionClassification
+public enum SdfRegionClassification
{
Inside,
Outside,
@@ -46,17 +46,17 @@ public enum CirRegionClassification
/// <summary>
/// Linear MIR/runtime representation for CIR point evaluation.
-/// During transition, this is the intended execution form while <see cref="CirNode"/> remains the semantic builder/oracle.
+/// During transition, this is the intended execution form while <see cref="SdfNode"/> remains the semantic builder/oracle.
/// </summary>
-public sealed class CirTape
+public sealed class SdfTape
{
- public CirTape(
- IReadOnlyList<CirTapeInstruction> instructions,
- IReadOnlyList<CirTapeBoxPayload> boxes,
- IReadOnlyList<CirTapeCylinderPayload> cylinders,
- IReadOnlyList<CirTapeSpherePayload> spheres,
- IReadOnlyList<CirTapeTorusPayload> toruses,
- IReadOnlyList<CirTapeConePayload> cones,
+ public SdfTape(
+ IReadOnlyList<SdfTapeInstruction> instructions,
+ IReadOnlyList<SdfTapeBoxPayload> boxes,
+ IReadOnlyList<SdfTapeCylinderPayload> cylinders,
+ IReadOnlyList<SdfTapeSpherePayload> spheres,
+ IReadOnlyList<SdfTapeTorusPayload> toruses,
+ IReadOnlyList<SdfTapeConePayload> cones,
int outputSlot,
int slotCount)
{
@@ -70,12 +70,12 @@ public sealed class CirTape
SlotCount = slotCount;
}
- public IReadOnlyList<CirTapeInstruction> Instructions { get; }
- public IReadOnlyList<CirTapeBoxPayload> BoxPayloads { get; }
- public IReadOnlyList<CirTapeCylinderPayload> CylinderPayloads { get; }
- public IReadOnlyList<CirTapeSpherePayload> SpherePayloads { get; }
- public IReadOnlyList<CirTapeTorusPayload> TorusPayloads { get; }
- public IReadOnlyList<CirTapeConePayload> ConePayloads { get; }
+ public IReadOnlyList<SdfTapeInstruction> Instructions { get; }
+ public IReadOnlyList<SdfTapeBoxPayload> BoxPayloads { get; }
+ public IReadOnlyList<SdfTapeCylinderPayload> CylinderPayloads { get; }
+ public IReadOnlyList<SdfTapeSpherePayload> SpherePayloads { get; }
+ public IReadOnlyList<SdfTapeTorusPayload> TorusPayloads { get; }
+ public IReadOnlyList<SdfTapeConePayload> ConePayloads { get; }
public int OutputSlot { get; }
public int SlotCount { get; }
@@ -87,43 +87,43 @@ public sealed class CirTape
{
switch (instruction.OpCode)
{
- case CirTapeOpCode.EvalBox:
+ case SdfTapeOpCode.EvalBox:
{
var payload = BoxPayloads[instruction.PayloadIndex];
slots[instruction.DestSlot] = EvaluateBox(point, payload);
break;
}
- case CirTapeOpCode.EvalCylinder:
+ case SdfTapeOpCode.EvalCylinder:
{
var payload = CylinderPayloads[instruction.PayloadIndex];
slots[instruction.DestSlot] = EvaluateCylinder(point, payload);
break;
}
- case CirTapeOpCode.EvalSphere:
+ case SdfTapeOpCode.EvalSphere:
{
var payload = SpherePayloads[instruction.PayloadIndex];
slots[instruction.DestSlot] = EvaluateSphere(point, payload);
break;
}
- case CirTapeOpCode.EvalTorus:
+ case SdfTapeOpCode.EvalTorus:
{
var payload = TorusPayloads[instruction.PayloadIndex];
slots[instruction.DestSlot] = EvaluateTorus(point, payload);
break;
}
- case CirTapeOpCode.EvalCone:
+ case SdfTapeOpCode.EvalCone:
{
var payload = ConePayloads[instruction.PayloadIndex];
slots[instruction.DestSlot] = EvaluateCone(point, payload);
break;
}
- case CirTapeOpCode.Min:
+ case SdfTapeOpCode.Min:
slots[instruction.DestSlot] = double.Min(slots[instruction.InputA], slots[instruction.InputB]);
break;
- case CirTapeOpCode.Max:
+ case SdfTapeOpCode.Max:
slots[instruction.DestSlot] = double.Max(slots[instruction.InputA], slots[instruction.InputB]);
break;
- case CirTapeOpCode.Neg:
+ case SdfTapeOpCode.Neg:
slots[instruction.DestSlot] = -slots[instruction.InputA];
break;
default:
@@ -134,7 +134,7 @@ public sealed class CirTape
return slots[OutputSlot];
}
- public FieldInterval EvaluateInterval(CirBounds region)
+ public FieldInterval EvaluateInterval(SdfBounds region)
{
var slots = new FieldInterval[SlotCount];
@@ -142,36 +142,36 @@ public sealed class CirTape
{
switch (instruction.OpCode)
{
- case CirTapeOpCode.EvalBox:
+ case SdfTapeOpCode.EvalBox:
slots[instruction.DestSlot] = EvaluateBoxInterval(region, BoxPayloads[instruction.PayloadIndex]);
break;
- case CirTapeOpCode.EvalCylinder:
+ case SdfTapeOpCode.EvalCylinder:
slots[instruction.DestSlot] = EvaluateCylinderInterval(region, CylinderPayloads[instruction.PayloadIndex]);
break;
- case CirTapeOpCode.EvalSphere:
+ case SdfTapeOpCode.EvalSphere:
slots[instruction.DestSlot] = EvaluateSphereInterval(region, SpherePayloads[instruction.PayloadIndex]);
break;
- case CirTapeOpCode.EvalTorus:
+ case SdfTapeOpCode.EvalTorus:
slots[instruction.DestSlot] = EvaluateTorusInterval(region, TorusPayloads[instruction.PayloadIndex]);
break;
- case CirTapeOpCode.EvalCone:
+ case SdfTapeOpCode.EvalCone:
slots[instruction.DestSlot] = EvaluateConeInterval(region, ConePayloads[instruction.PayloadIndex]);
break;
- case CirTapeOpCode.Min:
+ case SdfTapeOpCode.Min:
{
var a = slots[instruction.InputA];
var b = slots[instruction.InputB];
slots[instruction.DestSlot] = new FieldInterval(double.Min(a.MinValue, b.MinValue), double.Min(a.MaxValue, b.MaxValue));
break;
}
- case CirTapeOpCode.Max:
+ case SdfTapeOpCode.Max:
{
var a = slots[instruction.InputA];
var b = slots[instruction.InputB];
slots[instruction.DestSlot] = new FieldInterval(double.Max(a.MinValue, b.MinValue), double.Max(a.MaxValue, b.MaxValue));
break;
}
- case CirTapeOpCode.Neg:
+ case SdfTapeOpCode.Neg:
{
var a = slots[instruction.InputA];
slots[instruction.DestSlot] = new FieldInterval(-a.MaxValue, -a.MinValue);
@@ -185,23 +185,23 @@ public sealed class CirTape
return slots[OutputSlot];
}
- public CirRegionClassification ClassifyRegion(CirBounds region, ToleranceContext tolerance)
+ public SdfRegionClassification ClassifyRegion(SdfBounds region, ToleranceContext tolerance)
{
var interval = EvaluateInterval(region);
if (interval.IsDefinitelyInside(tolerance))
{
- return CirRegionClassification.Inside;
+ return SdfRegionClassification.Inside;
}
if (interval.IsDefinitelyOutside(tolerance))
{
- return CirRegionClassification.Outside;
+ return SdfRegionClassification.Outside;
}
- return CirRegionClassification.Mixed;
+ return SdfRegionClassification.Mixed;
}
- private static double EvaluateBox(Point3D point, CirTapeBoxPayload payload)
+ private static double EvaluateBox(Point3D point, SdfTapeBoxPayload payload)
{
point = payload.InverseTransform.Apply(point);
var hx = payload.Width * 0.5d;
@@ -218,7 +218,7 @@ public sealed class CirTape
return outside + inside;
}
- private static double EvaluateCylinder(Point3D point, CirTapeCylinderPayload payload)
+ private static double EvaluateCylinder(Point3D point, SdfTapeCylinderPayload payload)
{
point = payload.InverseTransform.Apply(point);
var radial = double.Sqrt((point.X * point.X) + (point.Y * point.Y));
@@ -231,13 +231,13 @@ public sealed class CirTape
return outside + inside;
}
- private static double EvaluateSphere(Point3D point, CirTapeSpherePayload payload)
+ private static double EvaluateSphere(Point3D point, SdfTapeSpherePayload payload)
{
point = payload.InverseTransform.Apply(point);
return double.Sqrt((point.X * point.X) + (point.Y * point.Y) + (point.Z * point.Z)) - payload.Radius;
}
- private static double EvaluateTorus(Point3D point, CirTapeTorusPayload payload)
+ private static double EvaluateTorus(Point3D point, SdfTapeTorusPayload payload)
{
point = payload.InverseTransform.Apply(point);
var radial = double.Sqrt((point.X * point.X) + (point.Y * point.Y));
@@ -245,13 +245,13 @@ public sealed class CirTape
return double.Sqrt((qx * qx) + (point.Z * point.Z)) - payload.MinorRadius;
}
- private static double EvaluateCone(Point3D point, CirTapeConePayload payload)
+ private static double EvaluateCone(Point3D point, SdfTapeConePayload payload)
{
point = payload.InverseTransform.Apply(point);
- return CirConeNode.EvaluateFiniteCone(point, payload.BottomRadius, payload.TopRadius, payload.Height);
+ return SdfConeNode.EvaluateFiniteCone(point, payload.BottomRadius, payload.TopRadius, payload.Height);
}
- private static FieldInterval EvaluateBoxInterval(CirBounds region, CirTapeBoxPayload payload)
+ private static FieldInterval EvaluateBoxInterval(SdfBounds region, SdfTapeBoxPayload payload)
{
var local = TransformBounds(region, payload.InverseTransform);
var hx = payload.Width * 0.5d;
@@ -260,7 +260,7 @@ public sealed class CirTape
return EvaluateBoundedBoxSdfInterval(local, hx, hy, hz);
}
- private static FieldInterval EvaluateCylinderInterval(CirBounds region, CirTapeCylinderPayload payload)
+ private static FieldInterval EvaluateCylinderInterval(SdfBounds region, SdfTapeCylinderPayload payload)
{
var local = TransformBounds(region, payload.InverseTransform);
var dr = RadiusInterval(local, payload.Radius);
@@ -268,7 +268,7 @@ public sealed class CirTape
return CombineExtrudedSdf(dr, dz);
}
- private static FieldInterval EvaluateSphereInterval(CirBounds region, CirTapeSpherePayload payload)
+ private static FieldInterval EvaluateSphereInterval(SdfBounds region, SdfTapeSpherePayload payload)
{
var local = TransformBounds(region, payload.InverseTransform);
var distanceMin = MinDistanceToAabbOrigin(local);
@@ -276,7 +276,7 @@ public sealed class CirTape
return new FieldInterval(distanceMin - payload.Radius, distanceMax - payload.Radius);
}
- private static FieldInterval EvaluateTorusInterval(CirBounds region, CirTapeTorusPayload payload)
+ private static FieldInterval EvaluateTorusInterval(SdfBounds region, SdfTapeTorusPayload payload)
{
var local = TransformBounds(region, payload.InverseTransform);
var radial = RadiusInterval(local, payload.MajorRadius);
@@ -289,7 +289,7 @@ public sealed class CirTape
return new FieldInterval(minD - payload.MinorRadius, maxD - payload.MinorRadius);
}
- private static FieldInterval EvaluateConeInterval(CirBounds region, CirTapeConePayload payload)
+ private static FieldInterval EvaluateConeInterval(SdfBounds region, SdfTapeConePayload payload)
{
var local = TransformBounds(region, payload.InverseTransform);
var corners = GetCorners(local);
@@ -297,7 +297,7 @@ public sealed class CirTape
var max = double.NegativeInfinity;
foreach (var c in corners)
{
- var value = CirConeNode.EvaluateFiniteCone(c, payload.BottomRadius, payload.TopRadius, payload.Height);
+ var value = SdfConeNode.EvaluateFiniteCone(c, payload.BottomRadius, payload.TopRadius, payload.Height);
min = double.Min(min, value);
max = double.Max(max, value);
}
@@ -305,16 +305,16 @@ public sealed class CirTape
return new FieldInterval(min, max);
}
- private static CirBounds TransformBounds(CirBounds bounds, Transform3D transform)
+ private static SdfBounds TransformBounds(SdfBounds bounds, Transform3D transform)
{
var corners = GetCorners(bounds);
var transformed = corners.Select(transform.Apply).ToArray();
- return new CirBounds(
+ return new SdfBounds(
new Point3D(transformed.Min(p => p.X), transformed.Min(p => p.Y), transformed.Min(p => p.Z)),
new Point3D(transformed.Max(p => p.X), transformed.Max(p => p.Y), transformed.Max(p => p.Z)));
}
- private static Point3D[] GetCorners(CirBounds b) =>
+ private static Point3D[] GetCorners(SdfBounds b) =>
[
new Point3D(b.Min.X, b.Min.Y, b.Min.Z),
new Point3D(b.Min.X, b.Min.Y, b.Max.Z),
@@ -326,7 +326,7 @@ public sealed class CirTape
new Point3D(b.Max.X, b.Max.Y, b.Max.Z),
];
- private static FieldInterval EvaluateBoundedBoxSdfInterval(CirBounds local, double hx, double hy, double hz)
+ private static FieldInterval EvaluateBoundedBoxSdfInterval(SdfBounds local, double hx, double hy, double hz)
{
var dx = AxisAbsDistanceInterval(local.Min.X, local.Max.X, hx);
var dy = AxisAbsDistanceInterval(local.Min.Y, local.Max.Y, hy);
@@ -344,7 +344,7 @@ public sealed class CirTape
return new FieldInterval(outsideMin + insideMin, outsideMax + insideMax);
}
- private static FieldInterval RadiusInterval(CirBounds bounds, double radius)
+ private static FieldInterval RadiusInterval(SdfBounds bounds, double radius)
{
var minR = MinDistanceToRectOrigin(bounds.Min.X, bounds.Max.X, bounds.Min.Y, bounds.Max.Y);
var maxR = MaxDistanceToRectOrigin(bounds.Min.X, bounds.Max.X, bounds.Min.Y, bounds.Max.Y);
@@ -364,12 +364,12 @@ public sealed class CirTape
private static double MaxAbsInInterval(double min, double max)
=> double.Max(double.Abs(min), double.Abs(max));
- private static double MinDistanceToAabbOrigin(CirBounds bounds)
+ private static double MinDistanceToAabbOrigin(SdfBounds bounds)
=> double.Sqrt((MinAbsInInterval(bounds.Min.X, bounds.Max.X) * MinAbsInInterval(bounds.Min.X, bounds.Max.X))
+ (MinAbsInInterval(bounds.Min.Y, bounds.Max.Y) * MinAbsInInterval(bounds.Min.Y, bounds.Max.Y))
+ (MinAbsInInterval(bounds.Min.Z, bounds.Max.Z) * MinAbsInInterval(bounds.Min.Z, bounds.Max.Z)));
- private static double MaxDistanceToAabbOrigin(CirBounds bounds)
+ private static double MaxDistanceToAabbOrigin(SdfBounds bounds)
=> double.Sqrt((MaxAbsInInterval(bounds.Min.X, bounds.Max.X) * MaxAbsInInterval(bounds.Min.X, bounds.Max.X))
+ (MaxAbsInInterval(bounds.Min.Y, bounds.Max.Y) * MaxAbsInInterval(bounds.Min.Y, bounds.Max.Y))
+ (MaxAbsInInterval(bounds.Min.Z, bounds.Max.Z) * MaxAbsInInterval(bounds.Min.Z, bounds.Max.Z)));
@@ -389,19 +389,19 @@ public sealed class CirTape
}
}
-public static class CirTapeLowerer
+public static class SdfTapeLowerer
{
/// <summary>
- /// Deterministically lowers semantic <see cref="CirNode"/> trees into runtime <see cref="CirTape"/>.
+ /// Deterministically lowers semantic <see cref="SdfNode"/> trees into runtime <see cref="SdfTape"/>.
/// </summary>
- public static CirTape Lower(CirNode node)
+ public static SdfTape Lower(SdfNode node)
{
ArgumentNullException.ThrowIfNull(node);
var state = new LoweringState();
var outputSlot = LowerNode(node, Transform3D.Identity, state);
- return new CirTape(
+ return new SdfTape(
state.Instructions,
state.BoxPayloads,
state.CylinderPayloads,
@@ -412,60 +412,60 @@ public static class CirTapeLowerer
state.NextSlot);
}
- private static int LowerNode(CirNode node, Transform3D accumulatedInverse, LoweringState state)
+ private static int LowerNode(SdfNode node, Transform3D accumulatedInverse, LoweringState state)
{
switch (node)
{
- case CirBoxNode box:
+ case SdfBoxNode box:
{
var payloadIndex = state.BoxPayloads.Count;
- state.BoxPayloads.Add(new CirTapeBoxPayload(box.Width, box.Height, box.Depth, accumulatedInverse));
- return state.Emit(CirTapeOpCode.EvalBox, -1, -1, payloadIndex, node.Kind);
+ state.BoxPayloads.Add(new SdfTapeBoxPayload(box.Width, box.Height, box.Depth, accumulatedInverse));
+ return state.Emit(SdfTapeOpCode.EvalBox, -1, -1, payloadIndex, node.Kind);
}
- case CirCylinderNode cylinder:
+ case SdfCylinderNode cylinder:
{
var payloadIndex = state.CylinderPayloads.Count;
- state.CylinderPayloads.Add(new CirTapeCylinderPayload(cylinder.Radius, cylinder.Height, accumulatedInverse));
- return state.Emit(CirTapeOpCode.EvalCylinder, -1, -1, payloadIndex, node.Kind);
+ state.CylinderPayloads.Add(new SdfTapeCylinderPayload(cylinder.Radius, cylinder.Height, accumulatedInverse));
+ return state.Emit(SdfTapeOpCode.EvalCylinder, -1, -1, payloadIndex, node.Kind);
}
- case CirSphereNode sphere:
+ case SdfSphereNode sphere:
{
var payloadIndex = state.SpherePayloads.Count;
- state.SpherePayloads.Add(new CirTapeSpherePayload(sphere.Radius, accumulatedInverse));
- return state.Emit(CirTapeOpCode.EvalSphere, -1, -1, payloadIndex, node.Kind);
+ state.SpherePayloads.Add(new SdfTapeSpherePayload(sphere.Radius, accumulatedInverse));
+ return state.Emit(SdfTapeOpCode.EvalSphere, -1, -1, payloadIndex, node.Kind);
}
- case CirTorusNode torus:
+ case SdfTorusNode torus:
{
var payloadIndex = state.TorusPayloads.Count;
- state.TorusPayloads.Add(new CirTapeTorusPayload(torus.MajorRadius, torus.MinorRadius, accumulatedInverse));
- return state.Emit(CirTapeOpCode.EvalTorus, -1, -1, payloadIndex, node.Kind);
+ state.TorusPayloads.Add(new SdfTapeTorusPayload(torus.MajorRadius, torus.MinorRadius, accumulatedInverse));
+ return state.Emit(SdfTapeOpCode.EvalTorus, -1, -1, payloadIndex, node.Kind);
}
- case CirConeNode cone:
+ case SdfConeNode cone:
{
var payloadIndex = state.ConePayloads.Count;
- state.ConePayloads.Add(new CirTapeConePayload(cone.BottomRadius, cone.TopRadius, cone.Height, accumulatedInverse));
- return state.Emit(CirTapeOpCode.EvalCone, -1, -1, payloadIndex, node.Kind);
+ state.ConePayloads.Add(new SdfTapeConePayload(cone.BottomRadius, cone.TopRadius, cone.Height, accumulatedInverse));
+ return state.Emit(SdfTapeOpCode.EvalCone, -1, -1, payloadIndex, node.Kind);
}
- case CirUnionNode union:
+ case SdfUnionNode union:
{
var left = LowerNode(union.Left, accumulatedInverse, state);
var right = LowerNode(union.Right, accumulatedInverse, state);
- return state.Emit(CirTapeOpCode.Min, left, right, -1, node.Kind);
+ return state.Emit(SdfTapeOpCode.Min, left, right, -1, node.Kind);
}
- case CirSubtractNode subtract:
+ case SdfSubtractNode subtract:
{
var left = LowerNode(subtract.Left, accumulatedInverse, state);
var right = LowerNode(subtract.Right, accumulatedInverse, state);
- var negRight = state.Emit(CirTapeOpCode.Neg, right, -1, -1, node.Kind);
- return state.Emit(CirTapeOpCode.Max, left, negRight, -1, node.Kind);
+ var negRight = state.Emit(SdfTapeOpCode.Neg, right, -1, -1, node.Kind);
+ return state.Emit(SdfTapeOpCode.Max, left, negRight, -1, node.Kind);
}
- case CirIntersectNode intersect:
+ case SdfIntersectNode intersect:
{
var left = LowerNode(intersect.Left, accumulatedInverse, state);
var right = LowerNode(intersect.Right, accumulatedInverse, state);
- return state.Emit(CirTapeOpCode.Max, left, right, -1, node.Kind);
+ return state.Emit(SdfTapeOpCode.Max, left, right, -1, node.Kind);
}
- case CirTransformNode transform:
+ case SdfTransformNode transform:
{
var nextAccumulatedInverse = accumulatedInverse * transform.Transform.Inverse();
return LowerNode(transform.Child, nextAccumulatedInverse, state);
@@ -477,18 +477,18 @@ public static class CirTapeLowerer
private sealed class LoweringState
{
- public List<CirTapeInstruction> Instructions { get; } = new();
- public List<CirTapeBoxPayload> BoxPayloads { get; } = new();
- public List<CirTapeCylinderPayload> CylinderPayloads { get; } = new();
- public List<CirTapeSpherePayload> SpherePayloads { get; } = new();
- public List<CirTapeTorusPayload> TorusPayloads { get; } = new();
- public List<CirTapeConePayload> ConePayloads { get; } = new();
+ public List<SdfTapeInstruction> Instructions { get; } = new();
+ public List<SdfTapeBoxPayload> BoxPayloads { get; } = new();
+ public List<SdfTapeCylinderPayload> CylinderPayloads { get; } = new();
+ public List<SdfTapeSpherePayload> SpherePayloads { get; } = new();
+ public List<SdfTapeTorusPayload> TorusPayloads { get; } = new();
+ public List<SdfTapeConePayload> ConePayloads { get; } = new();
public int NextSlot { get; private set; }
- public int Emit(CirTapeOpCode opCode, int inputA, int inputB, int payloadIndex, CirNodeKind sourceKind)
+ public int Emit(SdfTapeOpCode opCode, int inputA, int inputB, int payloadIndex, SdfNodeKind sourceKind)
{
var destSlot = NextSlot++;
- Instructions.Add(new CirTapeInstruction(opCode, destSlot, inputA, inputB, payloadIndex, sourceKind, Instructions.Count));
+ Instructions.Add(new SdfTapeInstruction(opCode, destSlot, inputA, inputB, payloadIndex, sourceKind, Instructions.Count));
return destSlot;
}
}
diff --git a/Aetheris.Continuum/Boundaries/ExactBrepBoundaryQuery.cs b/Aetheris.Continuum/Boundaries/ExactBrepBoundaryQuery.cs
index b2842afa..09edbb7e 100644
--- a/Aetheris.Continuum/Boundaries/ExactBrepBoundaryQuery.cs
+++ b/Aetheris.Continuum/Boundaries/ExactBrepBoundaryQuery.cs
@@ -61,13 +61,15 @@ public sealed class ExactBrepBoundaryQuery
public Point3D Evaluate(double u, double v) => _transform.Apply(
_sphere is { } sphere ? sphere.Evaluate(u, v) : _torus!.Value.Evaluate(u, v));
- public Vector3D ExactFaceNormal(double u, double v)
+ public Vector3D ExactSupportNormal(double u, double v)
{
var source = _sphere is { } sphere ? sphere.Normal(u, v) : _torus!.Value.Normal(u, v);
- var normal = TransformDirection(source);
- return _sameSense ? normal : -normal;
+ return TransformDirection(source);
}
+ /// <summary>Support normal adjusted only for BRep parameterization orientation; this is not a material-side answer.</summary>
+ public Vector3D ParameterizationNormal(double u,double v) => _sameSense?ExactSupportNormal(u,v):-ExactSupportNormal(u,v);
+
public BoundarySurfaceParameters RecoverParameters(Point3D point)
{
var localPoint = _inverse.Apply(point);
@@ -103,10 +105,10 @@ public sealed class ExactBrepBoundaryQuery
return Evaluate(parameters.U, parameters.V);
}
- public Vector3D OutwardNormal(Point3D boundaryPoint)
+ public Vector3D SupportNormalAt(Point3D boundaryPoint)
{
var parameters = RecoverParameters(boundaryPoint);
- return ExactFaceNormal(parameters.U, parameters.V);
+ return ExactSupportNormal(parameters.U, parameters.V);
}
public PrincipalCurvatureData PrincipalCurvatures(double u, double v)
@@ -114,7 +116,7 @@ public sealed class ExactBrepBoundaryQuery
if (_sphere is { } sphere)
{
var sphereDirectionU = TransformDirection(Direction3D.Create((-sphere.XAxis.ToVector() * double.Sin(u)) + (sphere.YAxis.ToVector() * double.Cos(u))));
- var faceNormal = ExactFaceNormal(u, v);
+ var faceNormal = ParameterizationNormal(u, v);
var sphereDirectionV = faceNormal.Cross(sphereDirectionU);
sphereDirectionV.TryNormalize(out sphereDirectionV);
var sphereSign = _sameSense ? 1d : -1d;
@@ -138,8 +140,8 @@ public sealed class ExactBrepBoundaryQuery
{
var origin = Project(nearPoint);
var parameters = RecoverParameters(origin);
- var outward = ExactFaceNormal(parameters.U, parameters.V);
- var normal = materialInside ? -outward : outward;
+ var supportNormal = ExactSupportNormal(parameters.U, parameters.V);
+ var normal = materialInside ? -supportNormal : supportNormal;
if (_sphere is { } sphere)
{
var seeds = new[] { TransformDirection(sphere.XAxis), TransformDirection(sphere.YAxis), TransformDirection(sphere.Axis) };
diff --git a/Aetheris.Continuum/Boundaries/ExactSupportMaterialSideQuery.cs b/Aetheris.Continuum/Boundaries/ExactSupportMaterialSideQuery.cs
new file mode 100644
index 00000000..69190bf7
--- /dev/null
+++ b/Aetheris.Continuum/Boundaries/ExactSupportMaterialSideQuery.cs
@@ -0,0 +1,70 @@
+using Aetheris.Continuum.Cir;
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Topology;
+
+namespace Aetheris.Continuum.Boundaries;
+
+/// <summary>Exact analytic support differential. It deliberately ignores SameSense and material occupancy.</summary>
+public static class ExactSupportBoundaryQuery
+{
+ public static Point3D ProjectToSupport(BrepBody body,FaceId faceId,Point3D worldPoint,Transform3D transform)
+ {
+ var inverse=transform.Inverse();var p=inverse.Apply(worldPoint);var support=body.GetFaceSurface(faceId);
+ var projected=support.Kind switch
+ {
+ SurfaceGeometryKind.Plane=>ProjectPlane(support.Plane!.Value,p),
+ SurfaceGeometryKind.Cylinder=>ProjectCylinder(support.Cylinder!.Value,p),
+ SurfaceGeometryKind.Cone=>ProjectCone(support.Cone!.Value,p),
+ SurfaceGeometryKind.Sphere=>ProjectSphere(support.Sphere!.Value,p),
+ SurfaceGeometryKind.Torus=>ProjectTorus(support.Torus!.Value,p),
+ _=>throw new NotSupportedException($"Exact support projection is not implemented for {support.Kind}.")
+ };return transform.Apply(projected);
+ }
+
+ public static Vector3D ExactSupportNormal(BrepBody body,FaceId faceId,Point3D worldPoint,Transform3D transform)
+ {
+ var local=transform.Inverse().Apply(worldPoint);var support=body.GetFaceSurface(faceId);
+ var normal=support.Kind switch
+ {
+ SurfaceGeometryKind.Plane=>support.Plane!.Value.Normal.ToVector(),
+ SurfaceGeometryKind.Cylinder=>CylinderNormal(support.Cylinder!.Value,local),
+ SurfaceGeometryKind.Cone=>ConeNormal(support.Cone!.Value,local),
+ SurfaceGeometryKind.Sphere=>local-support.Sphere!.Value.Center,
+ SurfaceGeometryKind.Torus=>TorusNormal(support.Torus!.Value,local),
+ _=>throw new NotSupportedException($"Exact support normal is not implemented for {support.Kind}.")
+ };
+ normal=transform.Apply(normal);if(!normal.TryNormalize(out normal))throw new InvalidOperationException("Support transform collapsed the normal.");return normal;
+ }
+
+ private static Vector3D CylinderNormal(Aetheris.Kernel.Core.Geometry.Surfaces.CylinderSurface c,Point3D p)
+ {var d=p-c.Origin;return d-(c.Axis.ToVector()*d.Dot(c.Axis.ToVector()));}
+ private static Vector3D ConeNormal(Aetheris.Kernel.Core.Geometry.Surfaces.ConeSurface c,Point3D p)
+ {var d=p-c.Apex;var axial=d.Dot(c.Axis.ToVector());var radial=d-(c.Axis.ToVector()*axial);radial.TryNormalize(out radial);return radial-(c.Axis.ToVector()*double.Tan(c.SemiAngleRadians));}
+ private static Vector3D TorusNormal(Aetheris.Kernel.Core.Geometry.Surfaces.TorusSurface t,Point3D p)
+ {var d=p-t.Center;var axial=d.Dot(t.Axis.ToVector());var radial=d-(t.Axis.ToVector()*axial);radial.TryNormalize(out radial);var center=t.Center+(radial*t.MajorRadius);return p-center;}
+ private static Point3D ProjectPlane(Aetheris.Kernel.Core.Geometry.Surfaces.PlaneSurface s,Point3D p)=>p-(s.Normal.ToVector()*(p-s.Origin).Dot(s.Normal.ToVector()));
+ private static Point3D ProjectCylinder(Aetheris.Kernel.Core.Geometry.Surfaces.CylinderSurface s,Point3D p){var d=p-s.Origin;var axial=d.Dot(s.Axis.ToVector());var radial=d-(s.Axis.ToVector()*axial);if(!radial.TryNormalize(out radial))radial=s.XAxis.ToVector();return s.Origin+(s.Axis.ToVector()*axial)+(radial*s.Radius);}
+ private static Point3D ProjectCone(Aetheris.Kernel.Core.Geometry.Surfaces.ConeSurface s,Point3D p){var d=p-s.Apex;var axial=double.Max(0d,d.Dot(s.Axis.ToVector()));var radial=d-(s.Axis.ToVector()*axial);if(!radial.TryNormalize(out radial))radial=s.ReferenceAxis.ToVector();return s.Apex+(s.Axis.ToVector()*axial)+(radial*(axial*double.Tan(s.SemiAngleRadians)));}
+ private static Point3D ProjectSphere(Aetheris.Kernel.Core.Geometry.Surfaces.SphereSurface s,Point3D p){var radial=p-s.Center;if(!radial.TryNormalize(out radial))radial=s.XAxis.ToVector();return s.Center+(radial*s.Radius);}
+ private static Point3D ProjectTorus(Aetheris.Kernel.Core.Geometry.Surfaces.TorusSurface s,Point3D p){var d=p-s.Center;var axial=d.Dot(s.Axis.ToVector());var radial=d-(s.Axis.ToVector()*axial);if(!radial.TryNormalize(out radial))radial=s.XAxis.ToVector();var tubeCenter=s.Center+(radial*s.MajorRadius);var tube=p-tubeCenter;if(!tube.TryNormalize(out tube))tube=s.Axis.ToVector();return tubeCenter+(tube*s.MinorRadius);}
+}
+
+public static class MaterialSideClassifier
+{
+ public static MaterialSideEvidence ClassifyMaterialSide(FaceId faceId,Point3D boundaryPoint,Vector3D exactSupportNormal,
+ IContinuumRegion continuumRegion,double localScale,bool sameSense)
+ {
+ var epsilon=double.Clamp(localScale*1e-6d,1e-8d,localScale*1e-3d);
+ var plus=continuumRegion.Classify(boundaryPoint+(exactSupportNormal*epsilon),epsilon*.1d);
+ var minus=continuumRegion.Classify(boundaryPoint-(exactSupportNormal*epsilon),epsilon*.1d);
+ var plusInside=plus==ContinuumPointClassification.Inside;var minusInside=minus==ContinuumPointClassification.Inside;
+ var status=plusInside^minusInside?MaterialSideStatus.Resolved:MaterialSideStatus.Inconsistent;
+ Vector3D? material=plusInside^minusInside?(plusInside?exactSupportNormal:-exactSupportNormal):null;
+ double? plusField=continuumRegion is IImplicitFieldCapability field?field.FieldValue(boundaryPoint+(exactSupportNormal*epsilon)):null;
+ double? minusField=continuumRegion is IImplicitFieldCapability field2?field2.FieldValue(boundaryPoint-(exactSupportNormal*epsilon)):null;
+ return new(faceId,boundaryPoint,exactSupportNormal,epsilon,plus,minus,plusField,minusField,material,status,
+ $"Occupied side selected exclusively from CIR probes; SameSense={sameSense} is recorded only as topology/parameterization evidence.");
+ }
+}
diff --git a/Aetheris.Continuum/Boundaries/WholePartComposition.cs b/Aetheris.Continuum/Boundaries/WholePartComposition.cs
index 7a8155cc..15ea872d 100644
--- a/Aetheris.Continuum/Boundaries/WholePartComposition.cs
+++ b/Aetheris.Continuum/Boundaries/WholePartComposition.cs
@@ -10,7 +10,8 @@ using Aetheris.Kernel.Core.Topology;
namespace Aetheris.Continuum.Boundaries;
-public sealed record CirBrepAssociation(RegionId ContinuumRegionId, string BrepBodyId, string OuterShellId, string? SemanticModelId = null);
+public sealed record CirBrepAssociation(RegionId ContinuumRegionId, string BrepBodyId, string OuterShellId,
+ string? SemanticModelId = null, string? ConstructionSourceIdentity = null);
public enum CutCellCompositionKind
{
@@ -27,7 +28,7 @@ public enum MaterialSideStatus { Resolved, Ambiguous, Inconsistent }
public sealed record MaterialSideEvidence(
FaceId FaceId,
Point3D BoundaryPoint,
- Vector3D BrepOrientedNormal,
+ Vector3D ExactSupportNormal,
double ProbeDistance,
ContinuumPointClassification PlusClassification,
ContinuumPointClassification MinusClassification,
@@ -74,7 +75,7 @@ public sealed record CutCellBoundarySet(
}
public sealed record BrepCirConsistencyProbe(string Kind, string EntityId, Point3D Point, ContinuumPointClassification Classification, bool Passed);
-public sealed record BrepCirConsistencyResult(bool Passed, IReadOnlyList<BrepCirConsistencyProbe> Probes, string Summary);
+public sealed record BrepCirConsistencyResult(bool Passed, IReadOnlyList<BrepCirConsistencyProbe> Probes, string Summary,double MaximumExtentResidual = 0d);
public static class BrepCirConsistencyChecker
{
@@ -83,14 +84,13 @@ public static class BrepCirConsistencyChecker
var probes = new List<BrepCirConsistencyProbe>();
foreach (var face in shell.Faces)
{
- var point = Centroid(face.VertexIds.Select(shell.TransformPoint));
+ var point = face.ExactBoundarySamples.FirstOrDefault(p=>region.Classify(p,tolerance)==ContinuumPointClassification.Boundary);
var c = region.Classify(point, tolerance);
probes.Add(new("face", face.FaceId.Value.ToString(), point, c, c == ContinuumPointClassification.Boundary));
}
foreach (var edge in shell.Faces.SelectMany(f => f.EdgeIds).Distinct().OrderBy(e => e.Value))
{
- var topology = shell.Body.Topology.GetEdge(edge);
- var point = Midpoint(shell.TransformPoint(topology.StartVertexId), shell.TransformPoint(topology.EndVertexId));
+ var point = shell.TransformEdgeMidpoint(edge);
var c = region.Classify(point, tolerance);
probes.Add(new("edge", edge.Value.ToString(), point, c, c == ContinuumPointClassification.Boundary));
}
@@ -104,9 +104,15 @@ public static class BrepCirConsistencyChecker
var diagonal = region.Bounds.Max - region.Bounds.Min;
var outsidePoint = region.Bounds.Max + diagonal; var outside = region.Classify(outsidePoint, tolerance);
probes.Add(new("known-exterior", "expanded-max", outsidePoint, outside, outside == ContinuumPointClassification.Outside));
+ var extentRows=new[]{("min-x",region.Bounds.Min.X,shell.Bounds.Min.X,true),("min-y",region.Bounds.Min.Y,shell.Bounds.Min.Y,true),("min-z",region.Bounds.Min.Z,shell.Bounds.Min.Z,true),("max-x",region.Bounds.Max.X,shell.Bounds.Max.X,false),("max-y",region.Bounds.Max.Y,shell.Bounds.Max.Y,false),("max-z",region.Bounds.Max.Z,shell.Bounds.Max.Z,false)};
+ foreach(var (name,a,b,isMinimum) in extentRows)
+ {var ok=isMinimum?b>=a-tolerance:b<=a+tolerance;probes.Add(new("extent-conservative-containment",name,new Point3D(a,b,0d),ok?ContinuumPointClassification.Boundary:ContinuumPointClassification.Outside,ok));}
+ if(region is IConstructiveLineageRegion lineage&&shell.Association.ConstructionSourceIdentity is { } associated)
+ {var ok=string.Equals(lineage.ConstructionSourceIdentity,associated,StringComparison.Ordinal);probes.Add(new("lineage",associated,region.Bounds.Min,ok?ContinuumPointClassification.Boundary:ContinuumPointClassification.Outside,ok));}
var passed = probes.All(p => p.Passed);
- return new(passed, probes, passed ? $"BRep/CIR agreement passed for {probes.Count} deterministic probes."
- : $"BRep/CIR disagreement in {probes.Count(p => !p.Passed)} of {probes.Count} deterministic probes.");
+ var residual=extentRows.Max(row=>double.Abs(row.Item2-row.Item3));
+ return new(passed, probes, passed ? $"BRep/CIR agreement passed for {probes.Count} deterministic probes; conservative extent residual={residual:R}."
+ : $"BRep/CIR disagreement in {probes.Count(p => !p.Passed)} of {probes.Count} deterministic probes.",residual);
}
private static Point3D Centroid(IEnumerable<Point3D> points) { var a = points.ToArray(); return new(a.Average(p => p.X), a.Average(p => p.Y), a.Average(p => p.Z)); }
@@ -137,6 +143,7 @@ public sealed class WholePartCutCellComposer
public BrepCirConsistencyResult Consistency { get; }
public int JudgmentCallCount => _judgmentCalls;
public double JudgmentRuntimeMilliseconds => _judgmentMilliseconds;
+ public IReadOnlyDictionary<FaceId,MaterialSideEvidence> MaterialSides => _materialSides;
public CutCellBoundarySet Compose(CellIndex index, BoundingBox3D bounds)
{
@@ -151,31 +158,23 @@ public sealed class WholePartCutCellComposer
c.AdjacentFaceIds, _materialSides[c.FaceId])).ToArray();
var integration = candidates.All(c => c.SupportKind == SurfaceGeometryKind.Plane)
? ConvexPlanarCellIntegrator.Integrate(bounds, _shell, _materialSides)
- : SampleFallback(bounds, 12);
+ : SampleFallback(bounds, candidates, 12);
var center = new Point3D((bounds.Min.X + bounds.Max.X) * .5d, (bounds.Min.Y + bounds.Max.Y) * .5d, (bounds.Min.Z + bounds.Max.Z) * .5d);
return new(index, _region.Id, contributors, kind, _region.Classify(center), trace, integration);
}
private MaterialSideEvidence ResolveMaterialSide(WholeShellBoundaryCandidate face)
{
- if (_shell.Body.GetFaceSurface(face.FaceId).Plane is not PlaneSurface plane)
- return new(face.FaceId, Centroid(face.VertexIds.Select(_shell.TransformPoint)), default, 0d,
- ContinuumPointClassification.Boundary, ContinuumPointClassification.Boundary, null, null, null,
- MaterialSideStatus.Ambiguous, "Non-planar support requires local exact projection; deferred to its BoundaryOffsetMap support.");
- var point = Centroid(face.VertexIds.Select(_shell.TransformPoint));
- var normal = _shell.Transform.Apply(plane.Normal).ToVector(); normal.TryNormalize(out normal);
- if (!face.SameSense) normal = -normal;
var scale = double.Max(1d, (_region.Bounds.Max - _region.Bounds.Min).Length);
- var epsilon = double.Clamp(scale * 1e-6d, 1e-8d, scale * 1e-3d);
- var plus = _region.Classify(point + normal * epsilon, epsilon * .1d);
- var minus = _region.Classify(point - normal * epsilon, epsilon * .1d);
- var plusInside = plus == ContinuumPointClassification.Inside; var minusInside = minus == ContinuumPointClassification.Inside;
- var status = plusInside ^ minusInside ? MaterialSideStatus.Resolved : MaterialSideStatus.Inconsistent;
- Vector3D? material = plusInside ^ minusInside ? (plusInside ? normal : -normal) : null;
- double? plusSdf = _region is ISignedDistanceCapability sdf ? sdf.SignedDistance(point + normal * epsilon) : null;
- double? minusSdf = _region is ISignedDistanceCapability sdf2 ? sdf2.SignedDistance(point - normal * epsilon) : null;
- return new(face.FaceId, point, normal, epsilon, plus, minus, plusSdf, minusSdf, material, status,
- "Occupied side selected exclusively from CIR probes; SameSense only orients the probe axis.");
+ foreach(var point in face.ExactBoundarySamples)
+ {
+ if(_region.Classify(point,scale*1e-7d)!=ContinuumPointClassification.Boundary)continue;
+ var normal=ExactSupportBoundaryQuery.ExactSupportNormal(_shell.Body,face.FaceId,point,_shell.Transform);
+ var evidence=MaterialSideClassifier.ClassifyMaterialSide(face.FaceId,point,normal,_region,scale,face.SameSense);
+ if(evidence.Status==MaterialSideStatus.Resolved)return evidence;
+ }
+ var fallback=face.ExactBoundarySamples[0];var fallbackNormal=ExactSupportBoundaryQuery.ExactSupportNormal(_shell.Body,face.FaceId,fallback,_shell.Transform);
+ return MaterialSideClassifier.ClassifyMaterialSide(face.FaceId,fallback,fallbackNormal,_region,scale,face.SameSense);
}
private CutCellCompositionKind Classify(IReadOnlyList<WholeShellBoundaryCandidate> faces)
@@ -204,11 +203,23 @@ public sealed class WholePartCutCellComposer
selected.ToString(), decision.Rejections, elapsed));
}
- private LocalBoundaryIntegration SampleFallback(BoundingBox3D bounds, int n)
+ private LocalBoundaryIntegration SampleFallback(BoundingBox3D bounds,IReadOnlyList<WholeShellBoundaryCandidate> candidates,int n)
{
- var inside = 0; for (var k=0;k<n;k++) for (var j=0;j<n;j++) for (var i=0;i<n;i++)
- { var p = new Point3D(Lerp(bounds.Min.X,bounds.Max.X,(i+.5)/n),Lerp(bounds.Min.Y,bounds.Max.Y,(j+.5)/n),Lerp(bounds.Min.Z,bounds.Max.Z,(k+.5)/n)); if (_region.Classify(p) != ContinuumPointClassification.Outside) inside++; }
- return new(inside/(double)(n*n*n), 0d, new Dictionary<string,double>(), "bounded-CIR-MSAA-fallback", n*n*n);
+ var occupied=new bool[n,n,n];var inside=0;
+ for (var k=0;k<n;k++) for (var j=0;j<n;j++) for (var i=0;i<n;i++)
+ {var p=new Point3D(Lerp(bounds.Min.X,bounds.Max.X,(i+.5)/n),Lerp(bounds.Min.Y,bounds.Max.Y,(j+.5)/n),Lerp(bounds.Min.Z,bounds.Max.Z,(k+.5)/n));occupied[i,j,k]=_region.Classify(p)!=ContinuumPointClassification.Outside;if(occupied[i,j,k])inside++;}
+ var dx=(bounds.Max.X-bounds.Min.X)/n;var dy=(bounds.Max.Y-bounds.Min.Y)/n;var dz=(bounds.Max.Z-bounds.Min.Z)/n;var area=0d;
+ Point3D Sample(int i,int j,int k)=>new(Lerp(bounds.Min.X,bounds.Max.X,(i+.5)/n),Lerp(bounds.Min.Y,bounds.Max.Y,(j+.5)/n),Lerp(bounds.Min.Z,bounds.Max.Z,(k+.5)/n));
+ double Correct(Point3D p)
+ {
+ if(_region is not IImplicitFieldCapability field)return 2d/3d;var h=double.Min(dx,double.Min(dy,dz))*.25d;
+ var g=new Vector3D((field.FieldValue(p+new Vector3D(h,0,0))-field.FieldValue(p-new Vector3D(h,0,0)))/(2*h),(field.FieldValue(p+new Vector3D(0,h,0))-field.FieldValue(p-new Vector3D(0,h,0)))/(2*h),(field.FieldValue(p+new Vector3D(0,0,h))-field.FieldValue(p-new Vector3D(0,0,h)))/(2*h));
+ if(!g.TryNormalize(out g))return 2d/3d;return 1d/double.Max(1d,double.Abs(g.X)+double.Abs(g.Y)+double.Abs(g.Z));
+ }
+ for(var k=0;k<n;k++)for(var j=0;j<n;j++)for(var i=0;i<n;i++)
+ {var p=Sample(i,j,k);if(i+1<n&&occupied[i,j,k]!=occupied[i+1,j,k])area+=dy*dz*Correct(new Point3D(p.X+dx*.5,p.Y,p.Z));if(j+1<n&&occupied[i,j,k]!=occupied[i,j+1,k])area+=dx*dz*Correct(new Point3D(p.X,p.Y+dy*.5,p.Z));if(k+1<n&&occupied[i,j,k]!=occupied[i,j,k+1])area+=dx*dy*Correct(new Point3D(p.X,p.Y,p.Z+dz*.5));}
+ var share=candidates.Count==0?0d:area/candidates.Count;var byFace=candidates.ToDictionary(c=>c.FaceId.Value.ToString(),_=>share);
+ return new(inside/(double)(n*n*n),area,byFace,"bounded-CIR-MSAA-volume-and-gradient-corrected-Crofton-area",n*n*n);
}
private static double Lerp(double a,double b,double t)=>a+(b-a)*t;
private static Point3D Centroid(IEnumerable<Point3D> points) { var a=points.ToArray(); return new(a.Average(p=>p.X),a.Average(p=>p.Y),a.Average(p=>p.Z)); }
diff --git a/Aetheris.Continuum/Boundaries/WholeShellBoundaryQuery.cs b/Aetheris.Continuum/Boundaries/WholeShellBoundaryQuery.cs
index dae88389..7a06028c 100644
--- a/Aetheris.Continuum/Boundaries/WholeShellBoundaryQuery.cs
+++ b/Aetheris.Continuum/Boundaries/WholeShellBoundaryQuery.cs
@@ -9,6 +9,7 @@ public sealed record WholeShellBoundaryCandidate(
FaceId FaceId,
SurfaceGeometryKind SupportKind,
BoundingBox3D Bounds,
+ IReadOnlyList<Point3D> ExactBoundarySamples,
IReadOnlyList<EdgeId> EdgeIds,
IReadOnlyList<VertexId> VertexIds,
IReadOnlyList<Point3D> OuterTrimVertices,
@@ -40,7 +41,7 @@ public sealed class WholeShellBoundaryQuery
{
var edges = faceEdges[face.Id];
var vertices = edges.SelectMany(body.GetVertices).Distinct().OrderBy(id => id.Value).ToArray();
- var points = vertices.Select(id => transform.Apply(ResolveVertex(body, id))).ToArray();
+ var points = ExactTrimSamples(body, face.Id).Select(transform.Apply).ToArray();
if (points.Length == 0) throw new InvalidOperationException($"BRep face {face.Id.Value} has no bounded trim vertices.");
var bounds = BoundsOf(points);
var adjacent = edges.SelectMany(edge => edgeFaces[edge]).Where(id => id != face.Id).Distinct().OrderBy(id => id.Value).ToArray();
@@ -51,21 +52,36 @@ public sealed class WholeShellBoundaryQuery
semanticIdentities?.TryGetValue(face.Id, out semantic);
var reference = new BoundaryReference("BRep", $"face:{face.Id.Value}", face.Id.Value.ToString(), semantic,
association.ContinuumRegionId.Value, association.BrepBodyId, association.OuterShellId);
- rows.Add(new(face.Id, surface.Kind, bounds, edges, vertices, trim, adjacent, binding.SameSense, semantic, reference));
+ var candidates=new List<Point3D>(points);
+ var centroid=new Point3D(points.Average(p=>p.X),points.Average(p=>p.Y),points.Average(p=>p.Z));
+ candidates.Add(ExactSupportBoundaryQuery.ProjectToSupport(body,face.Id,centroid,transform));
+ for(var i=0;i<points.Length;i+=int.Max(1,points.Length/8))
+ candidates.Add(ExactSupportBoundaryQuery.ProjectToSupport(body,face.Id,new Point3D((points[i].X+centroid.X)*.5d,(points[i].Y+centroid.Y)*.5d,(points[i].Z+centroid.Z)*.5d),transform));
+ rows.Add(new(face.Id, surface.Kind, bounds, candidates, edges, vertices, trim, adjacent, binding.SameSense, semantic, reference));
}
_faces = rows;
+ Bounds = BoundsOf(rows.SelectMany(row=>new[]{row.Bounds.Min,row.Bounds.Max}).ToArray());
}
public BrepBody Body { get; }
public CirBrepAssociation Association { get; }
public Transform3D Transform { get; }
public IReadOnlyList<WholeShellBoundaryCandidate> Faces => _faces;
+ public BoundingBox3D Bounds { get; }
public IReadOnlyList<WholeShellBoundaryCandidate> Query(BoundingBox3D cellBounds, double tolerance = 1e-9d) =>
_faces.Where(face => Intersects(face.Bounds, cellBounds, tolerance)
&& (face.SupportKind != SurfaceGeometryKind.Plane || ClippedPlanarTrimIsNonEmpty(face.OuterTrimVertices, cellBounds, tolerance))).ToArray();
public Point3D TransformPoint(VertexId id) => Transform.Apply(ResolveVertex(Body, id));
+ public Point3D TransformEdgeMidpoint(EdgeId edgeId)
+ {
+ if(!Body.TryGetEdgeCurveGeometry(edgeId,out var curve)||curve is null||!Body.Bindings.TryGetEdgeBinding(edgeId,out var binding))
+ {var edge=Body.Topology.GetEdge(edgeId);return new Point3D((TransformPoint(edge.StartVertexId).X+TransformPoint(edge.EndVertexId).X)*.5d,(TransformPoint(edge.StartVertexId).Y+TransformPoint(edge.EndVertexId).Y)*.5d,(TransformPoint(edge.StartVertexId).Z+TransformPoint(edge.EndVertexId).Z)*.5d);}
+ var interval=binding.TrimInterval??new ParameterInterval(0d,1d);var t=(interval.Start+interval.End)*.5d;
+ var p=curve.Kind switch{CurveGeometryKind.Line3=>curve.Line3!.Value.Evaluate(t),CurveGeometryKind.Circle3=>curve.Circle3!.Value.Evaluate(t),CurveGeometryKind.BSpline3=>curve.BSpline3!.Value.Evaluate(t),CurveGeometryKind.Ellipse3=>curve.Ellipse3!.Value.Evaluate(t),CurveGeometryKind.Hyperbola3=>curve.Hyperbola3!.Value.Evaluate(t),_=>throw new NotSupportedException($"Exact edge midpoint does not support {curve.Kind}.")};
+ return Transform.Apply(p);
+ }
private static BoundingBox3D BoundsOf(IReadOnlyList<Point3D> points) => new(
new(points.Min(p => p.X), points.Min(p => p.Y), points.Min(p => p.Z)),
@@ -88,6 +104,31 @@ public sealed class WholeShellBoundaryQuery
return points;
}
+ private static IReadOnlyList<Point3D> ExactTrimSamples(BrepBody body, FaceId faceId)
+ {
+ var values=new List<Point3D>();
+ foreach(var edgeId in body.GetEdges(faceId).Distinct())
+ {
+ if(!body.TryGetEdgeCurveGeometry(edgeId,out var curve)||curve is null||!body.Bindings.TryGetEdgeBinding(edgeId,out var binding)) continue;
+ var interval=binding.TrimInterval??new ParameterInterval(0d,1d);
+ var count=curve.Kind==CurveGeometryKind.Line3?2:33;
+ for(var i=0;i<count;i++)
+ {
+ var t=interval.Start+((interval.End-interval.Start)*i/(count-1d));
+ values.Add(curve.Kind switch
+ {
+ CurveGeometryKind.Line3=>curve.Line3!.Value.Evaluate(t),
+ CurveGeometryKind.Circle3=>curve.Circle3!.Value.Evaluate(t),
+ CurveGeometryKind.BSpline3=>curve.BSpline3!.Value.Evaluate(t),
+ CurveGeometryKind.Ellipse3=>curve.Ellipse3!.Value.Evaluate(t),
+ CurveGeometryKind.Hyperbola3=>curve.Hyperbola3!.Value.Evaluate(t),
+ _=>throw new NotSupportedException($"Exact trim sampling does not support {curve.Kind}.")
+ });
+ }
+ }
+ return values.Count>0?values:OrderedOuterTrim(body,faceId);
+ }
+
private static bool ClippedPlanarTrimIsNonEmpty(IReadOnlyList<Point3D> trim, BoundingBox3D box, double tolerance)
{
var polygon = trim.ToList();
diff --git a/Aetheris.Continuum/Cir/ContinuumRegion.cs b/Aetheris.Continuum/Cir/ContinuumRegion.cs
index d32c24cd..5ad2cecb 100644
--- a/Aetheris.Continuum/Cir/ContinuumRegion.cs
+++ b/Aetheris.Continuum/Cir/ContinuumRegion.cs
@@ -36,9 +36,22 @@ public interface IContinuumRegion
Classify(point, tolerance) != ContinuumPointClassification.Outside;
}
-public interface ISignedDistanceCapability
+/// <summary>Optional identity shared by independently lowered representations from one typed construction source.</summary>
+public interface IConstructiveLineageRegion
{
- double SignedDistance(Point3D point);
+ string ConstructionSourceIdentity { get; }
+}
+
+/// <summary>A sign-correct scalar field: negative is occupied, positive is outside. Magnitude is not promised to be distance.</summary>
+public interface IImplicitFieldCapability
+{
+ double FieldValue(Point3D point);
+}
+
+/// <summary>Optional exact Euclidean signed-distance capability. Implementers must not expose this for non-isometric transforms or general CSG composition.</summary>
+public interface IExactEuclideanSignedDistanceCapability : IImplicitFieldCapability
+{
+ double SignedDistance(Point3D point) => FieldValue(point);
}
public interface IGradientCapability
diff --git a/Aetheris.Continuum/Experiments/ContinuumM2Experiments.cs b/Aetheris.Continuum/Experiments/ContinuumM2Experiments.cs
index 9ab0222b..445a875d 100644
--- a/Aetheris.Continuum/Experiments/ContinuumM2Experiments.cs
+++ b/Aetheris.Continuum/Experiments/ContinuumM2Experiments.cs
@@ -298,7 +298,7 @@ public static class ContinuumM2Experiments
{
raw.TryNormalize(out var direction);
var boundary = region.ExactQuery.Center + (direction * region.ExactQuery.Radius);
- var materialNormal = -region.ExactQuery.OutwardNormal(boundary);
+ var materialNormal = -region.ExactQuery.SupportNormalAt(boundary);
if (region.Classify(boundary + (materialNormal * 1e-6d)) == ContinuumPointClassification.Outside
|| region.Classify(boundary - (materialNormal * 1e-6d)) != ContinuumPointClassification.Outside)
throw new InvalidOperationException($"CIR/BRep material-side disagreement on face {region.FaceId.Value}.");
diff --git a/Aetheris.Continuum/Mirrors/CirConvexPolyhedronMirror.cs b/Aetheris.Continuum/Mirrors/CirConvexPolyhedronMirror.cs
index 4504fe6b..56e5a380 100644
--- a/Aetheris.Continuum/Mirrors/CirConvexPolyhedronMirror.cs
+++ b/Aetheris.Continuum/Mirrors/CirConvexPolyhedronMirror.cs
@@ -34,7 +34,7 @@ internal sealed record CirPrismaticMirrorSummary(
double? ThicknessMin,
double? ThicknessMax,
double? ThicknessAverage,
- CirBounds Bounds,
+ SdfBounds Bounds,
IReadOnlyList<string> Diagnostics);
internal sealed record CirPrismaticMirrorResult(
@@ -54,7 +54,7 @@ internal sealed class CirConvexPolyhedronMirror
public CirConvexPolyhedronMirror(
string caseLabel,
IReadOnlyList<CirHalfSpacePlane> HalfSpaces,
- CirBounds bounds,
+ SdfBounds bounds,
CirMirrorAdmissionResult admission,
IReadOnlyList<string> diagnostics)
{
@@ -69,7 +69,7 @@ internal sealed class CirConvexPolyhedronMirror
public IReadOnlyList<CirHalfSpacePlane> HalfSpaces { get; }
- public CirBounds Bounds { get; }
+ public SdfBounds Bounds { get; }
public CirMirrorAdmissionResult Admission { get; }
@@ -399,7 +399,7 @@ internal static class CirPrismaticMirrorBuilder
private static Point3D ToPoint(PrismaticSection section, int index) =>
new(section.OuterLoop[index].X, section.OuterLoop[index].Y, section.Z);
- private static CirBounds Bounds(IReadOnlyList<Point3D> vertices) =>
+ private static SdfBounds Bounds(IReadOnlyList<Point3D> vertices) =>
new(
new Point3D(vertices.Min(point => point.X), vertices.Min(point => point.Y), vertices.Min(point => point.Z)),
new Point3D(vertices.Max(point => point.X), vertices.Max(point => point.Y), vertices.Max(point => point.Z)));
diff --git a/Aetheris.Continuum/Regions/Analytic/BrepSphereContinuumRegion.cs b/Aetheris.Continuum/Regions/Analytic/BrepSphereContinuumRegion.cs
index 7ec7f7ff..ac5ea507 100644
--- a/Aetheris.Continuum/Regions/Analytic/BrepSphereContinuumRegion.cs
+++ b/Aetheris.Continuum/Regions/Analytic/BrepSphereContinuumRegion.cs
@@ -25,7 +25,7 @@ public sealed class BrepSphereContinuumRegion : IContinuumRegion, IBoundsClassif
BrepBody = result.Value;
FaceId = BrepBody.Topology.Faces.Single().Id;
Transform = transform;
- var root = new CirTransformNode(new CirSphereNode(radius), transform);
+ var root = new SdfTransformNode(new SdfSphereNode(radius), transform);
_cir = new SdfContinuumRegion(id, root);
Bounds = _cir.Bounds;
BoundaryReference = new BoundaryReference("brep", $"{id}:sphere-face-{FaceId.Value}", FaceId.Value.ToString(), "closed-spherical-boundary");
@@ -80,7 +80,7 @@ public sealed class BrepSphereBoundarySupport : IAnalyticBoundarySupport
public ExactBrepBoundaryQuery Query { get; }
public double ExactArea => 4d * double.Pi * Query.Radius * Query.Radius;
public Point3D Project(Point3D point) => Query.Project(point);
- public Vector3D MaterialSideNormal(Point3D boundaryPoint) => -Query.OutwardNormal(boundaryPoint);
+ public Vector3D MaterialSideNormal(Point3D boundaryPoint) => -Query.SupportNormalAt(boundaryPoint);
public IBoundaryOffsetMap CreateOffsetMap(CellIndex cellIndex, BoundingBox3D cellBounds, int resolution,
BoundaryOffsetMapErrorPolicy policy, BoundaryEvaluationCache? cache = null) =>
diff --git a/Aetheris.Continuum/Regions/Analytic/BrepTorusRootFilletContinuumRegion.cs b/Aetheris.Continuum/Regions/Analytic/BrepTorusRootFilletContinuumRegion.cs
index 0fc27558..22ffa5eb 100644
--- a/Aetheris.Continuum/Regions/Analytic/BrepTorusRootFilletContinuumRegion.cs
+++ b/Aetheris.Continuum/Regions/Analytic/BrepTorusRootFilletContinuumRegion.cs
@@ -44,9 +44,7 @@ public sealed class BrepTorusRootFilletContinuumRegion : IContinuumRegion, IBoun
_supports = torusFaces.OrderBy(face => face.Value).Select(face =>
{
var reference = new BoundaryReference("brep", $"{id}:root-fillet-face-{face.Value}", face.Value.ToString(), "concave-root-fillet");
- // ConcaveFilletConstruction deliberately orients this torus support normal into material.
- return new BrepTorusBoundarySupport(reference, new ExactBrepBoundaryQuery(body, face, transform), double.Pi, 1.5d * double.Pi,
- exactFaceNormalIsMaterialSide: true);
+ return new BrepTorusBoundarySupport(reference, new ExactBrepBoundaryQuery(body, face, transform), double.Pi, 1.5d * double.Pi,this);
}).ToArray();
ContactValidation = ValidateContacts(body, torusFaces);
ValidateMaterialSide();
@@ -218,13 +216,13 @@ public sealed class BrepTorusBoundarySupport : IAnalyticBoundarySupport
private static readonly int[] AdmittedResolutions = [4, 8, 16, 24];
private readonly double _minimumMinorParameter;
private readonly double _maximumMinorParameter;
- private readonly bool _exactFaceNormalIsMaterialSide;
+ private readonly IContinuumRegion _region;
public BrepTorusBoundarySupport(BoundaryReference reference, ExactBrepBoundaryQuery query, double minimumMinorParameter, double maximumMinorParameter,
- bool exactFaceNormalIsMaterialSide)
+ IContinuumRegion region)
{
Reference = reference; Query = query; _minimumMinorParameter = minimumMinorParameter; _maximumMinorParameter = maximumMinorParameter;
- _exactFaceNormalIsMaterialSide = exactFaceNormalIsMaterialSide;
+ _region=region;
}
public BoundaryReference Reference { get; }
public ExactBrepBoundaryQuery Query { get; }
@@ -234,8 +232,11 @@ public sealed class BrepTorusBoundarySupport : IAnalyticBoundarySupport
public Vector3D MaterialSideNormal(Point3D boundaryPoint)
{
var parameters = Query.RecoverParameters(boundaryPoint);
- var faceNormal = Query.ExactFaceNormal(parameters.U, parameters.V);
- return _exactFaceNormalIsMaterialSide ? faceNormal : -faceNormal;
+ var supportNormal = Query.ExactSupportNormal(parameters.U, parameters.V);
+ var scale=double.Max(1d,(_region.Bounds.Max-_region.Bounds.Min).Length);
+ var evidence=MaterialSideClassifier.ClassifyMaterialSide(Query.FaceId,boundaryPoint,supportNormal,_region,scale,
+ Query.Body.Bindings.GetFaceBinding(Query.FaceId).SameSense);
+ return evidence.MaterialSideNormal??throw new InvalidOperationException($"CIR did not resolve material side for torus face {Query.FaceId.Value}.");
}
public IBoundaryOffsetMap CreateOffsetMap(CellIndex cellIndex, BoundingBox3D cellBounds, int resolution, BoundaryOffsetMapErrorPolicy policy, BoundaryEvaluationCache? cache = null) =>
diff --git a/Aetheris.Continuum/Regions/Analytic/ExactBrepBoxContinuumRegion.cs b/Aetheris.Continuum/Regions/Analytic/ExactBrepBoxContinuumRegion.cs
index bf82d7c8..c748b955 100644
--- a/Aetheris.Continuum/Regions/Analytic/ExactBrepBoxContinuumRegion.cs
+++ b/Aetheris.Continuum/Regions/Analytic/ExactBrepBoxContinuumRegion.cs
@@ -4,7 +4,7 @@ using Aetheris.Kernel.Core.Math;
namespace Aetheris.Continuum.Regions.Analytic;
/// <summary>An exact oriented-box CIR used with the corresponding exact BRep shell.</summary>
-public sealed class ExactBrepBoxContinuumRegion : IContinuumRegion, ISignedDistanceCapability, IBoundsClassificationCapability
+public sealed class ExactBrepBoxContinuumRegion : IContinuumRegion, IExactEuclideanSignedDistanceCapability, IBoundsClassificationCapability
{
private readonly Transform3D _inverse;
private readonly Vector3D _half;
@@ -44,6 +44,8 @@ public sealed class ExactBrepBoxContinuumRegion : IContinuumRegion, ISignedDista
return outside+double.Min(double.Max(q.X,double.Max(q.Y,q.Z)),0d);
}
+ public double FieldValue(Point3D point) => SignedDistance(point);
+
public ContinuumBoundsClassification ClassifyBounds(BoundingBox3D bounds,double tolerance=1e-9d)
{
var world=Corners(bounds); var testAxes=new List<Vector3D>{new(1,0,0),new(0,1,0),new(0,0,1)};testAxes.AddRange(_axes);
diff --git a/Aetheris.Continuum/Regions/Constructive/ExactCoaxialContinuumRegion.cs b/Aetheris.Continuum/Regions/Constructive/ExactCoaxialContinuumRegion.cs
new file mode 100644
index 00000000..3e6bf111
--- /dev/null
+++ b/Aetheris.Continuum/Regions/Constructive/ExactCoaxialContinuumRegion.cs
@@ -0,0 +1,151 @@
+using Aetheris.Continuum.Cir;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.StandardLibrary;
+
+namespace Aetheris.Continuum.Regions.Constructive;
+
+/// <summary>
+/// Complete analytic CIR lowering of the admitted exact coaxial construction plan.
+/// It is produced from the plan in parallel with BRep and never inspects tessellation or BRep topology.
+/// </summary>
+public sealed class ExactCoaxialContinuumRegion : IContinuumRegion, IImplicitFieldCapability, IConstructiveLineageRegion, IBoundsClassificationCapability
+{
+ private readonly Transform3D _inverse;
+
+ public ExactCoaxialContinuumRegion(ExactCoaxialConstructionPlan plan, Transform3D transform)
+ {
+ Plan=plan ?? throw new ArgumentNullException(nameof(plan));
+ if(!transform.IsRigid()) throw new ArgumentException("Exact coaxial CIR placement must be rigid.",nameof(transform));
+ Transform=transform; _inverse=transform.Inverse(); Id=new RegionId($"{plan.StableId}:continuum");
+ var vertices=Enumerable.Range(0,plan.Prism.SideCount).Select(i=>(plan.Prism.OrientationDegrees*double.Pi/180d)+(i*2d*double.Pi/plan.Prism.SideCount))
+ .Select(a=>(Y:plan.Prism.Circumradius*double.Cos(a),Z:plan.Prism.Circumradius*double.Sin(a))).ToArray();
+ Bounds=TransformBounds(new(new(plan.TopCap.Position,vertices.Min(v=>v.Y),vertices.Min(v=>v.Z)),new(plan.EndCap.Position,vertices.Max(v=>v.Y),vertices.Max(v=>v.Z))),transform);
+ ConstructionSourceIdentity=$"{plan.StableId}:{plan.DeterministicSignature}";
+ }
+
+ public ExactCoaxialConstructionPlan Plan { get; }
+ public Transform3D Transform { get; }
+ public RegionId Id { get; }
+ public BoundingBox3D Bounds { get; }
+ public string ConstructionSourceIdentity { get; }
+ public double AnalyticReferenceVolume => ComputeReferenceVolume();
+ public double AnalyticReferenceBoundaryArea => ComputeReferenceArea();
+
+ public ContinuumPointClassification Classify(Point3D point,double tolerance=1e-9d)
+ {
+ var local=_inverse.Apply(point);var rho=double.Sqrt((local.Y*local.Y)+(local.Z*local.Z));
+ if(double.Abs(local.X-Plan.Prism.Start)<=tolerance&&rho>=Plan.RootBlend.ShoulderRadius-tolerance
+ && RegularPolygonField(local.Y,local.Z,Plan.Prism)<=tolerance)return ContinuumPointClassification.Boundary;
+ var value=FieldValue(point);
+ return double.Abs(value)<=tolerance?ContinuumPointClassification.Boundary
+ :value<0d?ContinuumPointClassification.Inside:ContinuumPointClassification.Outside;
+ }
+
+ /// <summary>Sign-correct constructive field. Its magnitude is intentionally not advertised as Euclidean distance.</summary>
+ public double FieldValue(Point3D point)
+ {
+ var p=_inverse.Apply(point); var x=p.X; var rho=double.Sqrt((p.Y*p.Y)+(p.Z*p.Z));
+ var headX=double.Clamp(x,Plan.TopCap.Position,Plan.Prism.End);
+ var polygon=RegularPolygonField(p.Y,p.Z,Plan.Prism);
+ var coneRadius=(headX-Plan.ConePlanarTrim.Apex)*double.Tan(Plan.ConePlanarTrim.SemiAngleDegrees*double.Pi/180d);
+ var cone=double.Max(double.Max(polygon,rho-coneRadius),double.Max(Plan.TopCap.Position-x,x-Plan.Prism.End));
+ var prism=double.Max(polygon,double.Max(double.Min(Plan.Prism.Start,Plan.Prism.End)-x,x-double.Max(Plan.Prism.Start,Plan.Prism.End)));
+ var head=double.Min(cone,prism);
+ var rootX=double.Clamp(x,Plan.Prism.Start,Plan.RootBlend.End);var r=Plan.RootBlend.Radius;var dx=rootX-Plan.RootBlend.End;
+ var profile=Plan.RootBlend.ShoulderRadius-double.Sqrt(double.Max(0d,(r*r)-(dx*dx)));
+ var root=double.Max(rho-profile,double.Max(Plan.Prism.Start-x,x-Plan.RootBlend.End));
+ var cylinder=double.Max(rho-Plan.Cylinder.Radius,double.Max(Plan.Cylinder.Start-x,x-Plan.Cylinder.End));
+ var t=double.Clamp((x-Plan.EndFrustum.Start)/(Plan.EndFrustum.End-Plan.EndFrustum.Start),0d,1d);
+ var frustumRadius=Plan.EndFrustum.StartRadius+((Plan.EndFrustum.EndRadius-Plan.EndFrustum.StartRadius)*t);
+ var frustum=double.Max(rho-frustumRadius,double.Max(Plan.EndFrustum.Start-x,x-Plan.EndFrustum.End));
+ return double.Min(double.Min(head,root),double.Min(cylinder,frustum));
+ }
+
+ public ContinuumBoundsClassification ClassifyBounds(BoundingBox3D bounds,double tolerance=1e-9d)
+ {
+ if(bounds.Max.X<Bounds.Min.X||bounds.Min.X>Bounds.Max.X||bounds.Max.Y<Bounds.Min.Y||bounds.Min.Y>Bounds.Max.Y||bounds.Max.Z<Bounds.Min.Z||bounds.Min.Z>Bounds.Max.Z)return ContinuumBoundsClassification.Outside;
+ Point3D[] world=[new(bounds.Min.X,bounds.Min.Y,bounds.Min.Z),new(bounds.Max.X,bounds.Min.Y,bounds.Min.Z),new(bounds.Min.X,bounds.Max.Y,bounds.Min.Z),new(bounds.Max.X,bounds.Max.Y,bounds.Min.Z),new(bounds.Min.X,bounds.Min.Y,bounds.Max.Z),new(bounds.Max.X,bounds.Min.Y,bounds.Max.Z),new(bounds.Min.X,bounds.Max.Y,bounds.Max.Z),new(bounds.Max.X,bounds.Max.Y,bounds.Max.Z)];
+ var local=world.Select(_inverse.Apply).ToArray();var minX=local.Min(p=>p.X);var maxX=local.Max(p=>p.X);var minY=local.Min(p=>p.Y);var maxY=local.Max(p=>p.Y);var minZ=local.Min(p=>p.Z);var maxZ=local.Max(p=>p.Z);
+ var dy=minY<=0&&maxY>=0?0d:double.Min(double.Abs(minY),double.Abs(maxY));var dz=minZ<=0&&maxZ>=0?0d:double.Min(double.Abs(minZ),double.Abs(maxZ));var minRho=double.Sqrt(dy*dy+dz*dz);
+ var maxRho=local.Max(p=>double.Sqrt(p.Y*p.Y+p.Z*p.Z));var maximumProfile=0d;
+ if(maxX>=Plan.TopCap.Position&&minX<=Plan.Prism.Start)maximumProfile=double.Max(maximumProfile,Plan.Prism.Circumradius);
+ if(maxX>=Plan.RootBlend.Start&&minX<=Plan.RootBlend.End)maximumProfile=double.Max(maximumProfile,Plan.RootBlend.ShoulderRadius);
+ if(maxX>=Plan.Cylinder.Start&&minX<=Plan.Cylinder.End)maximumProfile=double.Max(maximumProfile,Plan.Cylinder.Radius);
+ if(maxX>=Plan.EndFrustum.Start&&minX<=Plan.EndFrustum.End)maximumProfile=double.Max(maximumProfile,Plan.EndFrustum.StartRadius);
+ if(maximumProfile==0d||minRho>maximumProfile+tolerance)return ContinuumBoundsClassification.Outside;
+ var polygonInside=local.All(p=>RegularPolygonField(p.Y,p.Z,Plan.Prism)<-tolerance);
+ if(minX>=double.Min(Plan.Prism.Start,Plan.Prism.End)&&maxX<=double.Max(Plan.Prism.Start,Plan.Prism.End)&&polygonInside)return ContinuumBoundsClassification.Inside;
+ if(minX>=Plan.TopCap.Position&&maxX<=Plan.Prism.End&&polygonInside&&maxRho<(minX-Plan.ConePlanarTrim.Apex)*double.Tan(Plan.ConePlanarTrim.SemiAngleDegrees*double.Pi/180d)-tolerance)return ContinuumBoundsClassification.Inside;
+ if(minX>=Plan.RootBlend.Start&&maxX<=Plan.RootBlend.End){var r=Plan.RootBlend.Radius;double Profile(double x){var dx=x-Plan.RootBlend.End;return Plan.RootBlend.ShoulderRadius-double.Sqrt(double.Max(0,(r*r)-(dx*dx)));}if(maxRho<double.Min(Profile(minX),Profile(maxX))-tolerance)return ContinuumBoundsClassification.Inside;}
+ if(minX>=Plan.Cylinder.Start&&maxX<=Plan.Cylinder.End&&maxRho<Plan.Cylinder.Radius-tolerance)return ContinuumBoundsClassification.Inside;
+ if(minX>=Plan.EndFrustum.Start&&maxX<=Plan.EndFrustum.End){var t=(maxX-Plan.EndFrustum.Start)/(Plan.EndFrustum.End-Plan.EndFrustum.Start);var radius=Plan.EndFrustum.StartRadius+((Plan.EndFrustum.EndRadius-Plan.EndFrustum.StartRadius)*t);if(maxRho<radius-tolerance)return ContinuumBoundsClassification.Inside;}
+ return ContinuumBoundsClassification.Cut;
+ }
+
+ private static double RegularPolygonField(double y,double z,RegularPrismConstruction prism)
+ {
+ var step=2d*double.Pi/prism.SideCount; var orientation=prism.OrientationDegrees*double.Pi/180d;
+ var maximum=double.NegativeInfinity;
+ for(var i=0;i<prism.SideCount;i++)
+ {
+ var angle=orientation+(step*.5d)+(i*step);
+ maximum=double.Max(maximum,(y*double.Cos(angle))+(z*double.Sin(angle))-prism.Apothem);
+ }
+ return maximum;
+ }
+
+ private double ComputeReferenceVolume()
+ {
+ var polygonArea=Plan.Prism.SideCount*Plan.Prism.Apothem*Plan.Prism.Apothem*double.Tan(double.Pi/Plan.Prism.SideCount);
+ var prism=polygonArea*double.Abs(Plan.Prism.Start-Plan.Prism.End);
+ var cone=Simpson(Plan.TopCap.Position,Plan.Prism.End,512,x=>PolarArea((x-Plan.ConePlanarTrim.Apex)*double.Tan(Plan.ConePlanarTrim.SemiAngleDegrees*double.Pi/180d)));
+ var root=Simpson(Plan.RootBlend.Start,Plan.RootBlend.End,2048,x=>{var r=Plan.RootBlend.Radius;var dx=x-Plan.RootBlend.End;var profile=Plan.RootBlend.ShoulderRadius-double.Sqrt(double.Max(0,(r*r)-(dx*dx)));return double.Pi*profile*profile;});
+ var cylinder=double.Pi*Plan.Cylinder.Radius*Plan.Cylinder.Radius*(Plan.Cylinder.End-Plan.Cylinder.Start);
+ var h=Plan.EndFrustum.End-Plan.EndFrustum.Start;var frustum=double.Pi*h*(Plan.EndFrustum.StartRadius*Plan.EndFrustum.StartRadius+Plan.EndFrustum.StartRadius*Plan.EndFrustum.EndRadius+Plan.EndFrustum.EndRadius*Plan.EndFrustum.EndRadius)/3d;
+ return prism+cone+root+cylinder+frustum;
+ }
+
+ private double ComputeReferenceArea()
+ {
+ var n=Plan.Prism.SideCount;var step=2d*double.Pi/n;var orientation=Plan.Prism.OrientationDegrees*double.Pi/180d;var prismSides=0d;
+ for(var side=0;side<n;side++)
+ {var a=orientation+(side*step);var b=a+step;prismSides+=Simpson(0,1,512,t=>{var y=Plan.Prism.Circumradius*((1-t)*double.Cos(a)+t*double.Cos(b));var z=Plan.Prism.Circumradius*((1-t)*double.Sin(a)+t*double.Sin(b));var rho=double.Sqrt(y*y+z*z);var coneX=Plan.ConePlanarTrim.Apex+rho/double.Tan(Plan.ConePlanarTrim.SemiAngleDegrees*double.Pi/180d);return double.Abs(Plan.Prism.Start-coneX)*(2d*Plan.Prism.Circumradius*double.Sin(step*.5d));});}
+ var k=double.Tan(Plan.ConePlanarTrim.SemiAngleDegrees*double.Pi/180d);var cap=Plan.TopCap.Radius;
+ var cone=Simpson(0,2d*double.Pi,4096,theta=>{var limit=PolygonRadius(theta);return .5d*double.Sqrt(1d+k*k)/k*double.Max(0d,(limit*limit)-(cap*cap));});
+ var polygonArea=n*Plan.Prism.Apothem*Plan.Prism.Apothem*double.Tan(double.Pi/n);
+ var shoulder=polygonArea-(double.Pi*Plan.RootBlend.ShoulderRadius*Plan.RootBlend.ShoulderRadius);
+ var torus=(double.Pi*double.Pi*Plan.RootBlend.ShoulderRadius*Plan.RootBlend.Radius)-(2d*double.Pi*Plan.RootBlend.Radius*Plan.RootBlend.Radius);
+ var cylinder=2d*double.Pi*Plan.Cylinder.Radius*(Plan.Cylinder.End-Plan.Cylinder.Start);
+ var h=Plan.EndFrustum.End-Plan.EndFrustum.Start;var slant=double.Sqrt(h*h+double.Pow(Plan.EndFrustum.StartRadius-Plan.EndFrustum.EndRadius,2));var frustum=double.Pi*(Plan.EndFrustum.StartRadius+Plan.EndFrustum.EndRadius)*slant;
+ return prismSides+cone+shoulder+torus+cylinder+frustum+(double.Pi*cap*cap)+(double.Pi*Plan.EndCap.Radius*Plan.EndCap.Radius);
+ }
+
+ private double PolarArea(double radius)=>.5d*Simpson(0,2d*double.Pi,2048,theta=>double.Pow(double.Min(radius,PolygonRadius(theta)),2));
+ private double PolygonRadius(double theta)
+ {var step=2d*double.Pi/Plan.Prism.SideCount;var orientation=Plan.Prism.OrientationDegrees*double.Pi/180d;var best=double.PositiveInfinity;for(var i=0;i<Plan.Prism.SideCount;i++){var normal=orientation+(step*.5d)+(i*step);var cosine=double.Cos(theta-normal);if(cosine>1e-14d)best=double.Min(best,Plan.Prism.Apothem/cosine);}return best;}
+ private static double Simpson(double a,double b,int intervals,Func<double,double> f)
+ {if((intervals&1)!=0)intervals++;var h=(b-a)/intervals;var sum=f(a)+f(b);for(var i=1;i<intervals;i++)sum+=(i%2==0?2d:4d)*f(a+(i*h));return sum*h/3d;}
+
+ private static BoundingBox3D TransformBounds(BoundingBox3D b,Transform3D t)
+ {
+ Point3D[] p=[new(b.Min.X,b.Min.Y,b.Min.Z),new(b.Max.X,b.Min.Y,b.Min.Z),new(b.Min.X,b.Max.Y,b.Min.Z),new(b.Max.X,b.Max.Y,b.Min.Z),new(b.Min.X,b.Min.Y,b.Max.Z),new(b.Max.X,b.Min.Y,b.Max.Z),new(b.Min.X,b.Max.Y,b.Max.Z),new(b.Max.X,b.Max.Y,b.Max.Z)];
+ var q=p.Select(t.Apply).ToArray();return new(new(q.Min(v=>v.X),q.Min(v=>v.Y),q.Min(v=>v.Z)),new(q.Max(v=>v.X),q.Max(v=>v.Y),q.Max(v=>v.Z)));
+ }
+}
+
+public sealed record ExactCoaxialDualLowering(
+ ExactCoaxialConstructionPlan Plan,
+ ExactConstructionResult Brep,
+ ExactCoaxialContinuumRegion Continuum,
+ string ConstructionSourceIdentity);
+
+public static class ExactCoaxialDualMaterializer
+{
+ public static ExactCoaxialDualLowering Materialize(ExactCoaxialConstructionPlan plan,Transform3D transform)
+ {
+ var brep=ExactConstructionMaterializer.Materialize(plan);
+ if(!brep.IsSuccess) throw new InvalidOperationException(string.Join("; ",brep.Diagnostics.Select(d=>d.Message)));
+ var continuum=new ExactCoaxialContinuumRegion(plan,transform);
+ return new(plan,brep.Value,continuum,continuum.ConstructionSourceIdentity);
+ }
+}
diff --git a/Aetheris.Continuum/Sampling/ContinuumSurfaceAreaEstimator.cs b/Aetheris.Continuum/Sampling/ContinuumSurfaceAreaEstimator.cs
new file mode 100644
index 00000000..465dc7db
--- /dev/null
+++ b/Aetheris.Continuum/Sampling/ContinuumSurfaceAreaEstimator.cs
@@ -0,0 +1,25 @@
+using Aetheris.Continuum.Cir;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Continuum.Sampling;
+
+/// <summary>Deterministic orientation-corrected Crofton control over CIR occupancy. This is an estimate, never boundary identity authority.</summary>
+public static class ContinuumSurfaceAreaEstimator
+{
+ public static double Estimate(IContinuumRegion region,int nx,int ny,int nz)
+ {
+ var b=region.Bounds;var dx=(b.Max.X-b.Min.X)/nx;var dy=(b.Max.Y-b.Min.Y)/ny;var dz=(b.Max.Z-b.Min.Z)/nz;
+ var occupied=new bool[nx+2,ny+2,nz+2];
+ Point3D P(int i,int j,int k)=>new(b.Min.X+((i-.5)*dx),b.Min.Y+((j-.5)*dy),b.Min.Z+((k-.5)*dz));
+ for(var k=0;k<nz+2;k++)for(var j=0;j<ny+2;j++)for(var i=0;i<nx+2;i++)occupied[i,j,k]=region.Classify(P(i,j,k))!=ContinuumPointClassification.Outside;
+ double Correction(Point3D p)
+ {
+ if(region is not IImplicitFieldCapability f)return 2d/3d;var h=double.Min(dx,double.Min(dy,dz))*.2d;
+ var g=new Vector3D((f.FieldValue(p+new Vector3D(h,0,0))-f.FieldValue(p-new Vector3D(h,0,0)))/(2*h),(f.FieldValue(p+new Vector3D(0,h,0))-f.FieldValue(p-new Vector3D(0,h,0)))/(2*h),(f.FieldValue(p+new Vector3D(0,0,h))-f.FieldValue(p-new Vector3D(0,0,h)))/(2*h));
+ return g.TryNormalize(out g)?1d/double.Max(1d,double.Abs(g.X)+double.Abs(g.Y)+double.Abs(g.Z)):2d/3d;
+ }
+ var area=0d;for(var k=0;k<nz+2;k++)for(var j=0;j<ny+2;j++)for(var i=0;i<nx+2;i++)
+ {var p=P(i,j,k);if(i+1<nx+2&&occupied[i,j,k]!=occupied[i+1,j,k])area+=dy*dz*Correction(new(p.X+dx*.5,p.Y,p.Z));if(j+1<ny+2&&occupied[i,j,k]!=occupied[i,j+1,k])area+=dx*dz*Correction(new(p.X,p.Y+dy*.5,p.Z));if(k+1<nz+2&&occupied[i,j,k]!=occupied[i,j,k+1])area+=dx*dy*Correction(new(p.X,p.Y,p.Z+dz*.5));}
+ return area;
+ }
+}
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLab.cs
index ddab4946..8eb67a87 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLab.cs
@@ -6,14 +6,14 @@ namespace Aetheris.FrictionLab;
public static class CirBoxCylinderRecognitionLab
{
- public static CirBoxCylinderRecognitionLabResult Recognize(CirNode root, bool allowTranslationWrappers = true, double? linearTolerance = null)
+ public static CirBoxCylinderRecognitionLabResult Recognize(SdfNode root, bool allowTranslationWrappers = true, double? linearTolerance = null)
{
var tol = linearTolerance ?? ToleranceContext.Default.Linear;
if (!TryUnwrap(root, allowTranslationWrappers, out var subtractNode, out _, out var reason))
{
return Fail(reason, "Expected root subtract of box and cylinder.");
}
- if (subtractNode is not CirSubtractNode subtract)
+ if (subtractNode is not SdfSubtractNode subtract)
{
return Fail(CirLabRecognitionReason.RootNotSubtract, "Expected root subtract of box and cylinder.");
}
@@ -23,9 +23,9 @@ public static class CirBoxCylinderRecognitionLab
return Fail(reason, "Subtract lhs transform normalization failed.");
}
- if (leftNode is not CirBoxNode box)
+ if (leftNode is not SdfBoxNode box)
{
- return Fail(CirLabRecognitionReason.BaseNotBox, "Subtract lhs must normalize to CirBoxNode.");
+ return Fail(CirLabRecognitionReason.BaseNotBox, "Subtract lhs must normalize to SdfBoxNode.");
}
if (!TryUnwrap(subtract.Right, allowTranslationWrappers, out var rightNode, out var rightTranslation, out reason))
@@ -33,9 +33,9 @@ public static class CirBoxCylinderRecognitionLab
return Fail(reason, "Subtract rhs transform normalization failed.");
}
- if (rightNode is not CirCylinderNode cylinder)
+ if (rightNode is not SdfCylinderNode cylinder)
{
- return Fail(CirLabRecognitionReason.ToolNotCylinder, "Subtract rhs must normalize to CirCylinderNode.");
+ return Fail(CirLabRecognitionReason.ToolNotCylinder, "Subtract rhs must normalize to SdfCylinderNode.");
}
if (box.Width <= 0d || box.Height <= 0d || box.Depth <= 0d || cylinder.Radius <= 0d || cylinder.Height <= 0d)
@@ -43,7 +43,7 @@ public static class CirBoxCylinderRecognitionLab
return Fail(CirLabRecognitionReason.InvalidDimensions, "All box/cylinder dimensions must be positive.");
}
- var axis = "Z"; // native CirCylinderNode axis convention
+ var axis = "Z"; // native SdfCylinderNode axis convention
var dz = rightTranslation.Z - leftTranslation.Z;
var through = cylinder.Height + (2d * tol) >= box.Depth &&
(rightTranslation.Z - (cylinder.Height * 0.5d)) <= (-box.Depth * 0.5d + leftTranslation.Z + tol) &&
@@ -62,16 +62,16 @@ public static class CirBoxCylinderRecognitionLab
return Fail(CirLabRecognitionReason.TangentOrOutside, "Cylinder is tangent/grazing/outside XY clearance envelope.");
}
- return new(true, CirLabRecognitionReason.None, "Recognized canonical box-cylinder through-hole subtract.", box, leftTranslation, cylinder, rightTranslation, axis, dz + cylinder.Height, new CirSubtractNode(new CirTransformNode(box, Transform3D.CreateTranslation(leftTranslation)), new CirTransformNode(cylinder, Transform3D.CreateTranslation(rightTranslation))));
+ return new(true, CirLabRecognitionReason.None, "Recognized canonical box-cylinder through-hole subtract.", box, leftTranslation, cylinder, rightTranslation, axis, dz + cylinder.Height, new SdfSubtractNode(new SdfTransformNode(box, Transform3D.CreateTranslation(leftTranslation)), new SdfTransformNode(cylinder, Transform3D.CreateTranslation(rightTranslation))));
}
- private static bool TryUnwrap(CirNode node, bool allowTranslationWrappers, out CirNode unwrapped, out Vector3D translation, out CirLabRecognitionReason reason)
+ private static bool TryUnwrap(SdfNode node, bool allowTranslationWrappers, out SdfNode unwrapped, out Vector3D translation, out CirLabRecognitionReason reason)
{
unwrapped = node;
translation = Vector3D.Zero;
reason = CirLabRecognitionReason.None;
- while (unwrapped is CirTransformNode t)
+ while (unwrapped is SdfTransformNode t)
{
if (!allowTranslationWrappers || !TryExtractPureTranslation(t.Transform, out var step))
{
@@ -83,7 +83,7 @@ public static class CirBoxCylinderRecognitionLab
unwrapped = t.Child;
}
- if (unwrapped is CirSubtractNode s)
+ if (unwrapped is SdfSubtractNode s)
{
reason = CirLabRecognitionReason.None;
unwrapped = s;
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLabResult.cs b/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLabResult.cs
index c6739fb4..8e72e1c6 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLabResult.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/CIRBoxCylinderRecognitionLabResult.cs
@@ -7,10 +7,10 @@ public sealed record CirBoxCylinderRecognitionLabResult(
bool Success,
CirLabRecognitionReason Reason,
string Diagnostic,
- CirBoxNode? Box,
+ SdfBoxNode? Box,
Vector3D BoxTranslation,
- CirCylinderNode? Cylinder,
+ SdfCylinderNode? Cylinder,
Vector3D CylinderTranslation,
string? Axis,
double ThroughLength,
- CirNode? NormalizedRoot);
+ SdfNode? NormalizedRoot);
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/CirBrepX4RecognizerSourceContractLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/CirBrepX4RecognizerSourceContractLab.cs
index f9e78cb0..13555d3b 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/CirBrepX4RecognizerSourceContractLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/CirBrepX4RecognizerSourceContractLab.cs
@@ -10,22 +10,22 @@ using Aetheris.Kernel.Firmament.Lowering;
namespace Aetheris.FrictionLab;
public sealed record CirBoxCylinderRecognizerInput(
- CirNode Root,
+ SdfNode Root,
NativeGeometryReplayLog? ReplayLog = null,
NativeGeometryState? NativeState = null,
FirmamentPrimitiveLoweringPlan? LoweringPlan = null,
FirmamentPrimitiveExecutionResult? ExecutionResult = null,
string? SourceLabel = null)
{
- public static CirBoxCylinderRecognizerInput FromNode(CirNode root, NativeGeometryReplayLog? replayLog = null, string? sourceLabel = null)
+ public static CirBoxCylinderRecognizerInput FromNode(SdfNode root, NativeGeometryReplayLog? replayLog = null, string? sourceLabel = null)
=> new(root, replayLog, null, null, null, sourceLabel);
- public static CirBoxCylinderRecognizerInput FromNativeState(NativeGeometryState nativeState, CirNode? root = null, string? sourceLabel = null)
+ public static CirBoxCylinderRecognizerInput FromNativeState(NativeGeometryState nativeState, SdfNode? root = null, string? sourceLabel = null)
{
ArgumentNullException.ThrowIfNull(nativeState);
if (root is null)
{
- throw new InvalidOperationException("NativeGeometryState does not contain a traversable CIR root; explicit CirNode root is required for geometric recognition.");
+ throw new InvalidOperationException("NativeGeometryState does not contain a traversable CIR root; explicit SdfNode root is required for geometric recognition.");
}
return new(root, nativeState.ReplayLog, nativeState, null, null, sourceLabel);
@@ -49,7 +49,7 @@ public sealed record CirBoxCylinderRecognitionWithDiagnostics(
public static class CirBrepX4RecognizerSourceContractLab
{
- public static CirRecognizerSourceInventory BuildInventory(FirmamentCompilationArtifact compile, CirNode loweredRoot)
+ public static CirRecognizerSourceInventory BuildInventory(FirmamentCompilationArtifact compile, SdfNode loweredRoot)
{
var execution = compile.PrimitiveExecutionResult;
var state = execution?.NativeGeometryState;
@@ -95,7 +95,7 @@ public static class CirBrepX4RecognizerSourceContractLab
if (!recognition.Success && boxCylinderSubtract is not null)
{
- diagnostics.Add("Replay suggests subtract+cylinder provenance, but geometry was not recognized from CirNode.");
+ diagnostics.Add("Replay suggests subtract+cylinder provenance, but geometry was not recognized from SdfNode.");
mismatch = true;
}
}
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/CirPrismaticMirrorLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/CirPrismaticMirrorLab.cs
index c88396f0..963d3282 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/CirPrismaticMirrorLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/CirPrismaticMirrorLab.cs
@@ -286,7 +286,7 @@ public static class CirPrismaticMirrorLab
return insideCount * step;
}
- private static string FormatBounds(CirBounds bounds) => FormattableString.Invariant(
+ private static string FormatBounds(SdfBounds bounds) => FormattableString.Invariant(
$"[{bounds.Min.X:0.###},{bounds.Min.Y:0.###},{bounds.Min.Z:0.###}]..[{bounds.Max.X:0.###},{bounds.Max.Y:0.###},{bounds.Max.Z:0.###}]");
private static string LossesText() => "face-identity-lost,loop-identity-lost,split-face-lineage-lost,feature-role-labels-lost,topology-parity-unavailable";
@@ -326,7 +326,7 @@ public static class CirPrismaticMirrorLab
private interface IPrismaticMirrorEvaluator
{
- CirBounds Bounds { get; }
+ SdfBounds Bounds { get; }
double SignedDistance(Point3D point);
}
@@ -340,13 +340,13 @@ public static class CirPrismaticMirrorLab
{
private readonly IReadOnlyList<Plane> _planes;
- private HalfSpacePrismaticMirror(IReadOnlyList<Plane> planes, CirBounds bounds)
+ private HalfSpacePrismaticMirror(IReadOnlyList<Plane> planes, SdfBounds bounds)
{
_planes = planes;
Bounds = bounds;
}
- public CirBounds Bounds { get; }
+ public SdfBounds Bounds { get; }
public static HalfSpacePrismaticMirror Create(IReadOnlyList<PrismaticSection> sections, double tolerance)
{
@@ -397,7 +397,7 @@ public static class CirPrismaticMirrorLab
Bounds = BoundsFor(sections);
}
- public CirBounds Bounds { get; }
+ public SdfBounds Bounds { get; }
public static SectionStackPrismaticMirror Create(IReadOnlyList<PrismaticSection> sections, double _) => new(sections);
@@ -453,7 +453,7 @@ public static class CirPrismaticMirrorLab
(a.Z * b.X) - (a.X * b.Z),
(a.X * b.Y) - (a.Y * b.X));
- private static CirBounds BoundsFor(IReadOnlyList<PrismaticSection> sections)
+ private static SdfBounds BoundsFor(IReadOnlyList<PrismaticSection> sections)
{
var xs = sections.SelectMany(s => s.OuterLoop.Select(p => p.X)).ToArray();
var ys = sections.SelectMany(s => s.OuterLoop.Select(p => p.Y)).ToArray();
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.cs
index 48ea76b6..895cd1bf 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.cs
@@ -206,7 +206,7 @@ public static class ExperimentalPrismaticMapLab
diagnostics.Add("edge-prismatic-x9-no-topology-identity-claim");
}
- private static ExperimentalPrismaticMapBounds ToBounds(CirBounds bounds) =>
+ private static ExperimentalPrismaticMapBounds ToBounds(SdfBounds bounds) =>
new(ToPoint(bounds.Min), ToPoint(bounds.Max), bounds.SizeX, bounds.SizeY, bounds.SizeZ);
private static ExperimentalPrismaticMapPoint ToPoint(Point3D point) => new(point.X, point.Y, point.Z);
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/FrepBrepRecoveryPolicyLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/FrepBrepRecoveryPolicyLab.cs
index fc1b21f1..b4b750a1 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/FrepBrepRecoveryPolicyLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/FrepBrepRecoveryPolicyLab.cs
@@ -14,7 +14,7 @@ public enum FrepBrepRecoveryCapability
}
public sealed record FrepBrepRecoveryContext(
- CirNode Root,
+ SdfNode Root,
NativeGeometryReplayLog? ReplayLog = null,
IReadOnlyList<string>? UpstreamDiagnostics = null,
bool TrimOracleAgreementAvailable = false,
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/FrepPolicyShapeDoeLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/FrepPolicyShapeDoeLab.cs
index f9ed5737..0c5cb322 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/FrepPolicyShapeDoeLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/FrepPolicyShapeDoeLab.cs
@@ -7,7 +7,7 @@ namespace Aetheris.FrictionLab;
public enum PolicyShapeCapability { ExactBRep, PlannedExact, DiagnosticOnly, CirOnly, Unsupported, ForgeOrDeferred }
public enum RecoveryPlanShape { PairSpecificPlan, ThroughHoleRecoveryPlan, CylindricalToolCutPlan, GenericBooleanRecoveryPlan, SurfaceFeaturePlan, FallbackNumericalPlan, CirOnlyPlan, UnsupportedPlan }
-public sealed record PolicyShapeScenario(string Id, string Group, string Description, CirNode? Root, string Category, bool Deferred = false);
+public sealed record PolicyShapeScenario(string Id, string Group, string Description, SdfNode? Root, string Category, bool Deferred = false);
public sealed record PolicyShapeEvaluation(
string PolicyName,
@@ -31,25 +31,25 @@ public static class FrepPolicyShapeDoeLab
{
public static IReadOnlyList<PolicyShapeScenario> BuildScenarioMatrix() =>
[
- new("A1","A","box - centered cylinder through Z", new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(2,8)), "canonical_through_hole"),
- new("A2","A","box - offset cylinder through Z with strict clearance", new CirSubtractNode(new CirBoxNode(10,8,6), new CirTransformNode(new CirCylinderNode(1.5,8), Transform3D.CreateTranslation(new(1,1,0)))), "canonical_through_hole"),
- new("A3","A","translated box - translated cylinder through Z", new CirSubtractNode(new CirTransformNode(new CirBoxNode(10,8,6), Transform3D.CreateTranslation(new(3,2,5))), new CirTransformNode(new CirCylinderNode(2,8), Transform3D.CreateTranslation(new(3.5,2.5,5)))), "canonical_through_hole"),
- new("A4","A","rectangular plate - cylinder through Z", new CirSubtractNode(new CirBoxNode(12,8,2), new CirCylinderNode(1,3)), "canonical_through_hole"),
- new("B1","B","box - blind short cylinder", new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(2,4)), "invalid_hole"),
- new("B2","B","box - tangent/grazing cylinder", new CirSubtractNode(new CirBoxNode(10,8,6), new CirTransformNode(new CirCylinderNode(2,8), Transform3D.CreateTranslation(new(3,0,0)))), "invalid_hole"),
- new("B3","B","box - cylinder outside box", new CirSubtractNode(new CirBoxNode(10,8,6), new CirTransformNode(new CirCylinderNode(2,8), Transform3D.CreateTranslation(new(7,0,0)))), "invalid_hole"),
- new("B4","B","box - oversized cylinder", new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(6,8)), "invalid_hole"),
- new("B5","B","box - rotated cylinder", new CirSubtractNode(new CirBoxNode(10,8,6), new CirTransformNode(new CirCylinderNode(2,8), Transform3D.CreateRotationX(Math.PI/4))), "invalid_hole"),
- new("C1","C","box - cylinder side notch", new CirSubtractNode(new CirBoxNode(10,8,6), new CirTransformNode(new CirCylinderNode(2,8), Transform3D.CreateTranslation(new(4,0,0)))), "cylindrical_non_through"),
- new("C2","C","box - shallow cylindrical pocket", new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(1.5,1.5)), "cylindrical_non_through"),
+ new("A1","A","box - centered cylinder through Z", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(2,8)), "canonical_through_hole"),
+ new("A2","A","box - offset cylinder through Z with strict clearance", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfTransformNode(new SdfCylinderNode(1.5,8), Transform3D.CreateTranslation(new(1,1,0)))), "canonical_through_hole"),
+ new("A3","A","translated box - translated cylinder through Z", new SdfSubtractNode(new SdfTransformNode(new SdfBoxNode(10,8,6), Transform3D.CreateTranslation(new(3,2,5))), new SdfTransformNode(new SdfCylinderNode(2,8), Transform3D.CreateTranslation(new(3.5,2.5,5)))), "canonical_through_hole"),
+ new("A4","A","rectangular plate - cylinder through Z", new SdfSubtractNode(new SdfBoxNode(12,8,2), new SdfCylinderNode(1,3)), "canonical_through_hole"),
+ new("B1","B","box - blind short cylinder", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(2,4)), "invalid_hole"),
+ new("B2","B","box - tangent/grazing cylinder", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfTransformNode(new SdfCylinderNode(2,8), Transform3D.CreateTranslation(new(3,0,0)))), "invalid_hole"),
+ new("B3","B","box - cylinder outside box", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfTransformNode(new SdfCylinderNode(2,8), Transform3D.CreateTranslation(new(7,0,0)))), "invalid_hole"),
+ new("B4","B","box - oversized cylinder", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(6,8)), "invalid_hole"),
+ new("B5","B","box - rotated cylinder", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfTransformNode(new SdfCylinderNode(2,8), Transform3D.CreateRotationX(Math.PI/4))), "invalid_hole"),
+ new("C1","C","box - cylinder side notch", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfTransformNode(new SdfCylinderNode(2,8), Transform3D.CreateTranslation(new(4,0,0)))), "cylindrical_non_through"),
+ new("C2","C","box - shallow cylindrical pocket", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(1.5,1.5)), "cylindrical_non_through"),
new("D1","D","cylindrical host - axial cylindrical hole", null, "future_variant", true),
new("D4","D","rectangular host - countersink-like through feature", null, "future_variant", true),
new("E1","E","round groove on cylinder", null, "surface_feature", true),
new("E3","E","thread on cylinder", null, "surface_feature", true),
new("F1","F","generic torus subtract", null, "unsupported", true),
- new("F2","F","box - sphere", new CirSubtractNode(new CirBoxNode(10,8,6), new CirSphereNode(2)), "unsupported"),
- new("F3","F","nested booleans", new CirSubtractNode(new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(1,8)), new CirCylinderNode(1,8)), "unsupported"),
- new("F4","F","union/intersect cases", new CirUnionNode(new CirBoxNode(1,1,1), new CirCylinderNode(1,1)), "unsupported")
+ new("F2","F","box - sphere", new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfSphereNode(2)), "unsupported"),
+ new("F3","F","nested booleans", new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(1,8)), new SdfCylinderNode(1,8)), "unsupported"),
+ new("F4","F","union/intersect cases", new SdfUnionNode(new SdfBoxNode(1,1,1), new SdfCylinderNode(1,1)), "unsupported")
];
public static IReadOnlyList<IPolicyShapeCandidate> DefaultCandidates => [new PairSpecific(), new ThroughHole(), new CylindricalToolCut(), new GenericBoolean(), new GenericNumericalContour(), new CirOnlyFallback()];
@@ -67,8 +67,8 @@ public static class FrepPolicyShapeDoeLab
private sealed class PairSpecific : IPolicyShapeCandidate { public string Name => "BoxCylinderThroughHolePolicyShape"; public int TieBreakerPriority => 0; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var ok = TryCanonical(s); return new(Name, ok, ok?92:0, ok?PolicyShapeCapability.ExactBRep:PolicyShapeCapability.Unsupported, RecoveryPlanShape.PairSpecificPlan, ok?["box-cylinder-recognizer"]:[], ok?[]:["not canonical box-cylinder through-hole"], false, s.Category=="future_variant", 9, 3, []);} }
private sealed class ThroughHole : IPolicyShapeCandidate { public string Name => "ThroughHoleRecoveryPolicyShape"; public int TieBreakerPriority=>0; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var supported = s.Category=="canonical_through_hole"||s.Category=="future_variant"; var admissible = s.Category=="canonical_through_hole"; return new(Name, admissible, admissible?95:0, admissible?PolicyShapeCapability.ExactBRep:(supported?PolicyShapeCapability.PlannedExact:PolicyShapeCapability.Unsupported), RecoveryPlanShape.ThroughHoleRecoveryPlan, ["semantic-through-hole","bounded-admissibility"], admissible?[]:["not admissible as strict through-hole"], false, false, 2, 9, []);} }
- private sealed class CylindricalToolCut : IPolicyShapeCandidate { public string Name => "CylindricalToolCutPolicyShape"; public int TieBreakerPriority=>1; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var toolCyl = s.Root is CirSubtractNode sub && (sub.Right is CirCylinderNode || sub.Right is CirTransformNode { Child: CirCylinderNode }); var over = toolCyl && s.Category=="cylindrical_non_through"; return new(Name, toolCyl, toolCyl?72:0, toolCyl?PolicyShapeCapability.DiagnosticOnly:PolicyShapeCapability.Unsupported, RecoveryPlanShape.CylindricalToolCutPlan, toolCyl?["tool-family=cylindrical"]:[], toolCyl?[]:["tool is not cylindrical subtract"], over, false, 5, 5, over?["over-admission-risk: mixes hole/notch/pocket/groove"]:[]);} }
- private sealed class GenericBoolean : IPolicyShapeCandidate { public string Name => "CirBooleanRecoveryPolicyShape"; public int TieBreakerPriority=>2; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var admissible = s.Root is CirSubtractNode or CirUnionNode or CirIntersectNode; return new(Name, admissible, admissible?40:0, admissible?PolicyShapeCapability.DiagnosticOnly:PolicyShapeCapability.Unsupported, RecoveryPlanShape.GenericBooleanRecoveryPlan, admissible?["generic-boolean"]:[], admissible?[]:["not a boolean CIR root"], admissible, false, 8, 2, admissible?["dispatcher-risk: broad boolean bucket"]:[]);} }
+ private sealed class CylindricalToolCut : IPolicyShapeCandidate { public string Name => "CylindricalToolCutPolicyShape"; public int TieBreakerPriority=>1; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var toolCyl = s.Root is SdfSubtractNode sub && (sub.Right is SdfCylinderNode || sub.Right is SdfTransformNode { Child: SdfCylinderNode }); var over = toolCyl && s.Category=="cylindrical_non_through"; return new(Name, toolCyl, toolCyl?72:0, toolCyl?PolicyShapeCapability.DiagnosticOnly:PolicyShapeCapability.Unsupported, RecoveryPlanShape.CylindricalToolCutPlan, toolCyl?["tool-family=cylindrical"]:[], toolCyl?[]:["tool is not cylindrical subtract"], over, false, 5, 5, over?["over-admission-risk: mixes hole/notch/pocket/groove"]:[]);} }
+ private sealed class GenericBoolean : IPolicyShapeCandidate { public string Name => "CirBooleanRecoveryPolicyShape"; public int TieBreakerPriority=>2; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s){ var admissible = s.Root is SdfSubtractNode or SdfUnionNode or SdfIntersectNode; return new(Name, admissible, admissible?40:0, admissible?PolicyShapeCapability.DiagnosticOnly:PolicyShapeCapability.Unsupported, RecoveryPlanShape.GenericBooleanRecoveryPlan, admissible?["generic-boolean"]:[], admissible?[]:["not a boolean CIR root"], admissible, false, 8, 2, admissible?["dispatcher-risk: broad boolean bucket"]:[]);} }
private sealed class GenericNumericalContour : IPolicyShapeCandidate { public string Name=>"GenericNumericalContourPolicy"; public int TieBreakerPriority=>3; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s)=> new(Name,true,20,PolicyShapeCapability.DiagnosticOnly,RecoveryPlanShape.FallbackNumericalPlan,["fallback=numerical"],[],false,false,1,4,[]); }
private sealed class CirOnlyFallback : IPolicyShapeCandidate { public string Name=>"CirOnlyFallbackPolicy"; public int TieBreakerPriority=>4; public PolicyShapeEvaluation Evaluate(PolicyShapeScenario s)=> new(Name,true,5,PolicyShapeCapability.CirOnly,RecoveryPlanShape.CirOnlyPlan,["fallback=cir-only"],[],false,false,1,3,[]); }
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/GenericCirBrepExecutorLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/GenericCirBrepExecutorLab.cs
index 3bbc9e5d..d916e521 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/GenericCirBrepExecutorLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/GenericCirBrepExecutorLab.cs
@@ -18,15 +18,15 @@ public static class GenericCirBrepExecutorLab
Execute("C-Counterbore", BuildCounterbore()),
Execute("D-Countersink", BuildCountersink()),
Execute("E-SteppedHole", BuildStepped()),
- Execute("F-BoxMinusSphere", new CirSubtractNode(new CirBoxNode(20,20,20), new CirSphereNode(4))),
- Execute("F-BoxMinusTorus", new CirSubtractNode(new CirBoxNode(20,20,20), new CirTorusNode(5,2))),
- Execute("F-UnsupportedTransform", new CirTransformNode(new CirBoxNode(10,10,10), Transform3D.CreateRotationZ(double.Pi/4d))),
+ Execute("F-BoxMinusSphere", new SdfSubtractNode(new SdfBoxNode(20,20,20), new SdfSphereNode(4))),
+ Execute("F-BoxMinusTorus", new SdfSubtractNode(new SdfBoxNode(20,20,20), new SdfTorusNode(5,2))),
+ Execute("F-UnsupportedTransform", new SdfTransformNode(new SdfBoxNode(10,10,10), Transform3D.CreateRotationZ(double.Pi/4d))),
};
return new GenericCirBrepScenarioReport(scenarios, ["CIR-BREP-X8 matrix executed."]);
}
- public static GenericCirBrepExecutorLabResult Execute(string scenario, CirNode node)
+ public static GenericCirBrepExecutorLabResult Execute(string scenario, SdfNode node)
{
var diagnostics = new List<string>();
var bools = new List<string>();
@@ -50,42 +50,42 @@ public static class GenericCirBrepExecutorLab
return new(scenario, GenericCirBrepLabStatus.Succeeded, result.Body, "none", diagnostics, bools, true, step.IsSuccess, markers, result.Body.SafeBooleanComposition is not null, stepText.Contains("MANIFOLD_SOLID_BREP", StringComparison.Ordinal) ? "MANIFOLD_SOLID_BREP" : "BREP_WITH_VOIDS", result.Body.Topology.Faces.Count());
}
- private static (bool IsSuccess, bool IsUnsupported, BrepBody? Body, string FailureCode) TryExecuteNode(CirNode node, List<string> diagnostics, List<string> bools)
+ private static (bool IsSuccess, bool IsUnsupported, BrepBody? Body, string FailureCode) TryExecuteNode(SdfNode node, List<string> diagnostics, List<string> bools)
{
switch (node)
{
- case CirBoxNode box:
+ case SdfBoxNode box:
var b = BrepPrimitives.CreateBox(box.Width, box.Height, box.Depth);
return b.IsSuccess ? (true, false, b.Value, "none") : (false, false, null, "primitive-box-failed");
- case CirCylinderNode cyl:
+ case SdfCylinderNode cyl:
var c = BrepPrimitives.CreateCylinder(cyl.Radius, cyl.Height);
return c.IsSuccess ? (true, false, c.Value, "none") : (false, false, null, "primitive-cylinder-failed");
- case CirConeNode cone:
+ case SdfConeNode cone:
diagnostics.Add("Cone primitive mapping unavailable via public BrepPrimitives API in lab scope.");
return (false, true, null, "primitive-cone-unsupported");
- case CirSphereNode sph:
+ case SdfSphereNode sph:
var sp = BrepPrimitives.CreateSphere(sph.Radius);
return sp.IsSuccess ? (true, false, sp.Value, "none") : (false, true, null, "primitive-sphere-unsupported");
- case CirTorusNode tor:
+ case SdfTorusNode tor:
var tr = BrepPrimitives.CreateTorus(tor.MajorRadius, tor.MinorRadius);
return tr.IsSuccess ? (true, false, tr.Value, "none") : (false, true, null, "primitive-torus-unsupported");
- case CirTransformNode tx:
+ case SdfTransformNode tx:
if (!TryExtractTranslation(tx.Transform, out var t)) return (false, true, null, "transform-non-translation-unsupported");
var child = TryExecuteNode(tx.Child, diagnostics, bools);
if (!child.IsSuccess || child.Body is null) return child;
return (true, false, t == Vector3D.Zero ? child.Body : Translate(child.Body, t), "none");
- case CirSubtractNode sub:
+ case SdfSubtractNode sub:
return ExecBool(sub.Left, sub.Right, BrepBoolean.Subtract, "Subtract", diagnostics, bools);
- case CirUnionNode un:
+ case SdfUnionNode un:
return ExecBool(un.Left, un.Right, BrepBoolean.Union, "Union", diagnostics, bools);
- case CirIntersectNode it:
+ case SdfIntersectNode it:
return ExecBool(it.Left, it.Right, BrepBoolean.Intersect, "Intersect", diagnostics, bools);
default:
return (false, true, null, "node-kind-unsupported");
}
}
- private static (bool IsSuccess, bool IsUnsupported, BrepBody? Body, string FailureCode) ExecBool(CirNode left, CirNode right, Func<BrepBody, BrepBody, Aetheris.Kernel.Core.Results.KernelResult<BrepBody>> op, string label, List<string> diagnostics, List<string> bools)
+ private static (bool IsSuccess, bool IsUnsupported, BrepBody? Body, string FailureCode) ExecBool(SdfNode left, SdfNode right, Func<BrepBody, BrepBody, Aetheris.Kernel.Core.Results.KernelResult<BrepBody>> op, string label, List<string> diagnostics, List<string> bools)
{
var l = TryExecuteNode(left, diagnostics, bools);
if (!l.IsSuccess || l.Body is null) return l;
@@ -147,11 +147,11 @@ public static class GenericCirBrepExecutorLab
return true;
}
- private static CirNode BuildThroughHole() => new CirSubtractNode(new CirBoxNode(30, 30, 20), new CirCylinderNode(4, 30));
- private static CirNode BuildBlindHole() => new CirSubtractNode(new CirBoxNode(30, 30, 20), new CirTransformNode(new CirCylinderNode(4, 8), Transform3D.CreateTranslation(new Vector3D(0,0,6))));
- private static CirNode BuildCounterbore() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(3,30)), new CirTransformNode(new CirCylinderNode(5,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
- private static CirNode BuildCountersink() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(3,30)), new CirTransformNode(new CirConeNode(5,3,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
- private static CirNode BuildStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(2,30)), new CirTransformNode(new CirCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(0,0,6)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
+ private static SdfNode BuildThroughHole() => new SdfSubtractNode(new SdfBoxNode(30, 30, 20), new SdfCylinderNode(4, 30));
+ private static SdfNode BuildBlindHole() => new SdfSubtractNode(new SdfBoxNode(30, 30, 20), new SdfTransformNode(new SdfCylinderNode(4, 8), Transform3D.CreateTranslation(new Vector3D(0,0,6))));
+ private static SdfNode BuildCounterbore() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(3,30)), new SdfTransformNode(new SdfCylinderNode(5,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
+ private static SdfNode BuildCountersink() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(3,30)), new SdfTransformNode(new SdfConeNode(5,3,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
+ private static SdfNode BuildStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(2,30)), new SdfTransformNode(new SdfCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(0,0,6)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,8))));
public static HoleRecoveryExecutionResult RunSemantic(HoleRecoveryPlan plan) => HoleRecoveryExecutor.Execute(plan);
}
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/HoleFamilyPolicyShapeLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/HoleFamilyPolicyShapeLab.cs
index 5d82b68c..d6799afa 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/HoleFamilyPolicyShapeLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/HoleFamilyPolicyShapeLab.cs
@@ -8,7 +8,7 @@ public enum HoleFamilyScenarioExpectation { ExactHoleFamily, FutureHoleFamily, D
public enum HoleFamilyArchitectureKind { SeparatePolicySet, MonolithicHolePolicy, CompositionalHolePolicy, ProfileStackPolicy }
public enum HoleFeatureKind { Through, Blind, Counterbore, Countersink, Stepped, ChamferedEntry, Threaded, Unknown }
-public sealed record HoleFamilyScenario(string Id, string Group, string Description, CirNode? Root, HoleFeatureKind FeatureKind, HoleFamilyScenarioExpectation Expectation);
+public sealed record HoleFamilyScenario(string Id, string Group, string Description, SdfNode? Root, HoleFeatureKind FeatureKind, HoleFamilyScenarioExpectation Expectation);
public sealed record HoleFamilyArchitectureScore(string Architecture, bool AdmitsScenario, bool CorrectlyRejectsScenario, int PolicyCountGrowth, int BranchComplexity, int LocalityOfChangeScore, int DiagnosticClarityScore, int FutureScalabilityScore, int RiskOfOverAdmission, int RiskOfUnderAdmission, int PlanShapeQuality, int ExecutorReusability, IReadOnlyList<string> Diagnostics);
public sealed record HoleFamilyDecision(string Winner, IReadOnlyList<HoleFamilyArchitectureScore> Scores, IReadOnlyList<string> Diagnostics);
@@ -16,10 +16,10 @@ public static class HoleFamilyPolicyShapeLab
{
public static IReadOnlyList<HoleFamilyScenario> BuildScenarioMatrix() =>
[
- new("A1","A","box + cylindrical through-hole",new CirSubtractNode(new CirBoxNode(10,8,6),new CirCylinderNode(2,8)),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
- new("A2","A","translated box + translated cylindrical through-hole",new CirSubtractNode(new CirTransformNode(new CirBoxNode(10,8,6),Transform3D.CreateTranslation(new(2,1,3))),new CirTransformNode(new CirCylinderNode(2,8),Transform3D.CreateTranslation(new(2.5,1,3)))),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
- new("A3","A","offset cylindrical through-hole",new CirSubtractNode(new CirBoxNode(10,8,6),new CirTransformNode(new CirCylinderNode(1.5,8),Transform3D.CreateTranslation(new(1,1,0)))),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
- new("B1","B","box + blind hole",new CirSubtractNode(new CirBoxNode(10,8,6),new CirCylinderNode(2,3)),HoleFeatureKind.Blind,HoleFamilyScenarioExpectation.FutureHoleFamily),
+ new("A1","A","box + cylindrical through-hole",new SdfSubtractNode(new SdfBoxNode(10,8,6),new SdfCylinderNode(2,8)),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
+ new("A2","A","translated box + translated cylindrical through-hole",new SdfSubtractNode(new SdfTransformNode(new SdfBoxNode(10,8,6),Transform3D.CreateTranslation(new(2,1,3))),new SdfTransformNode(new SdfCylinderNode(2,8),Transform3D.CreateTranslation(new(2.5,1,3)))),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
+ new("A3","A","offset cylindrical through-hole",new SdfSubtractNode(new SdfBoxNode(10,8,6),new SdfTransformNode(new SdfCylinderNode(1.5,8),Transform3D.CreateTranslation(new(1,1,0)))),HoleFeatureKind.Through,HoleFamilyScenarioExpectation.ExactHoleFamily),
+ new("B1","B","box + blind hole",new SdfSubtractNode(new SdfBoxNode(10,8,6),new SdfCylinderNode(2,3)),HoleFeatureKind.Blind,HoleFamilyScenarioExpectation.FutureHoleFamily),
new("B2","B","box + counterbore",null,HoleFeatureKind.Counterbore,HoleFamilyScenarioExpectation.FutureHoleFamily),
new("B3","B","box + countersink",null,HoleFeatureKind.Countersink,HoleFamilyScenarioExpectation.FutureHoleFamily),
new("B4","B","box + stepped through-hole",null,HoleFeatureKind.Stepped,HoleFamilyScenarioExpectation.FutureHoleFamily),
@@ -34,8 +34,8 @@ public static class HoleFamilyPolicyShapeLab
new("D4","D","freeform projected emboss/deboss",null,HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.DeferredForge),
new("E1","E","round groove",null,HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
new("E2","E","keyway/slot",null,HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
- new("E3","E","side notch",new CirSubtractNode(new CirBoxNode(10,8,6),new CirTransformNode(new CirCylinderNode(2,8),Transform3D.CreateTranslation(new(4,0,0)))),HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
- new("E4","E","box - sphere cavity",new CirSubtractNode(new CirBoxNode(10,8,6),new CirSphereNode(2)),HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
+ new("E3","E","side notch",new SdfSubtractNode(new SdfBoxNode(10,8,6),new SdfTransformNode(new SdfCylinderNode(2,8),Transform3D.CreateTranslation(new(4,0,0)))),HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
+ new("E4","E","box - sphere cavity",new SdfSubtractNode(new SdfBoxNode(10,8,6),new SdfSphereNode(2)),HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily),
new("E5","E","generic torus subtract",null,HoleFeatureKind.Unknown,HoleFamilyScenarioExpectation.NotHoleFamily)
];
diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/SteppedHoleExecutionArchitectureLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/SteppedHoleExecutionArchitectureLab.cs
index c9cfc9fc..41d6fc57 100644
--- a/Aetheris.Firmament.FrictionLab/CIRLab/SteppedHoleExecutionArchitectureLab.cs
+++ b/Aetheris.Firmament.FrictionLab/CIRLab/SteppedHoleExecutionArchitectureLab.cs
@@ -62,7 +62,7 @@ public static class SteppedHoleExecutionArchitectureLab
private static SteppedArchitectureStrategyResult ExecuteCounterboreBaseline()
{
- var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(2,30)), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))))));
+ var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(2,30)), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))))));
var exec = HoleRecoveryExecutor.Execute((HoleRecoveryPlan)eval.Plan!);
return exec.Body is null ? Failed("counterbore-baseline", "counterbore-baseline-failed", "baseline", exec.Diagnostics.ToList()) : Success("counterbore-baseline", exec.Body);
}
@@ -139,6 +139,6 @@ public static class SteppedHoleExecutionArchitectureLab
private static SteppedArchitectureStrategyResult Failed(string name, string code, string stage, IReadOnlyList<string> diagnostics)
=> new(name, SteppedArchitectureStrategyStatus.Failed, null, code, stage, diagnostics, true, true, false, false, [], false, false, false, 0, 0, 0, 0, 0, "investigate blocker");
- private static CirNode BuildCanonicalStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(2,30)), new CirTransformNode(new CirCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(0,0,-6)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))));
- private static CirNode BuildNonCoaxialStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(30,30,20), new CirCylinderNode(2,30)), new CirTransformNode(new CirCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(1,0,-6)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))));
+ private static SdfNode BuildCanonicalStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(2,30)), new SdfTransformNode(new SdfCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(0,0,-6)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))));
+ private static SdfNode BuildNonCoaxialStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(30,30,20), new SdfCylinderNode(2,30)), new SdfTransformNode(new SdfCylinderNode(3,8), Transform3D.CreateTranslation(new Vector3D(1,0,-6)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-8))));
}
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderConventionLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderConventionLabTests.cs
index 51045289..7a3bf4c0 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderConventionLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderConventionLabTests.cs
@@ -8,7 +8,7 @@ public sealed class CirBoxCylinderConventionLabTests
[Fact]
public void Box_IsCenteredOnOrigin_WithHalfExtents()
{
- var box = new CirBoxNode(10d, 6d, 4d);
+ var box = new SdfBoxNode(10d, 6d, 4d);
Assert.Equal(new Point3D(-5d, -3d, -2d), box.Bounds.Min);
Assert.Equal(new Point3D(5d, 3d, 2d), box.Bounds.Max);
Assert.True(box.Evaluate(Point3D.Origin) < 0d);
@@ -17,7 +17,7 @@ public sealed class CirBoxCylinderConventionLabTests
[Fact]
public void Cylinder_IsZAxisCenteredOnOrigin_WithHalfHeightExtents()
{
- var cylinder = new CirCylinderNode(3d, 8d);
+ var cylinder = new SdfCylinderNode(3d, 8d);
Assert.Equal(new Point3D(-3d, -3d, -4d), cylinder.Bounds.Min);
Assert.Equal(new Point3D(3d, 3d, 4d), cylinder.Bounds.Max);
Assert.True(cylinder.Evaluate(new Point3D(0d, 0d, 3d)) < 0d);
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderRecognitionLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderRecognitionLabTests.cs
index 137d2ab5..1121c834 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderRecognitionLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderRecognitionLabTests.cs
@@ -9,7 +9,7 @@ public sealed class CirBoxCylinderRecognitionLabTests
[Fact]
public void Recognizes_DirectCanonicalSubtract()
{
- var root = new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirCylinderNode(2d, 8d));
+ var root = new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfCylinderNode(2d, 8d));
var result = CirBoxCylinderRecognitionLab.Recognize(root);
Assert.True(result.Success);
Assert.Equal("Z", result.Axis);
@@ -18,9 +18,9 @@ public sealed class CirBoxCylinderRecognitionLabTests
[Fact]
public void Recognizes_TranslatedOperands()
{
- var box = new CirTransformNode(new CirBoxNode(10d, 8d, 6d), Transform3D.CreateTranslation(new Vector3D(2d, 1d, 5d)));
- var cyl = new CirTransformNode(new CirCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(2.5d, 1.5d, 5d)));
- var root = new CirSubtractNode(box, cyl);
+ var box = new SdfTransformNode(new SdfBoxNode(10d, 8d, 6d), Transform3D.CreateTranslation(new Vector3D(2d, 1d, 5d)));
+ var cyl = new SdfTransformNode(new SdfCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(2.5d, 1.5d, 5d)));
+ var root = new SdfSubtractNode(box, cyl);
var result = CirBoxCylinderRecognitionLab.Recognize(root);
Assert.True(result.Success);
}
@@ -28,8 +28,8 @@ public sealed class CirBoxCylinderRecognitionLabTests
[Fact]
public void Rejects_NonTranslationTransform()
{
- var box = new CirTransformNode(new CirBoxNode(10d, 8d, 6d), Transform3D.CreateRotationX(Math.PI / 4d));
- var root = new CirSubtractNode(box, new CirCylinderNode(2d, 8d));
+ var box = new SdfTransformNode(new SdfBoxNode(10d, 8d, 6d), Transform3D.CreateRotationX(Math.PI / 4d));
+ var root = new SdfSubtractNode(box, new SdfCylinderNode(2d, 8d));
var result = CirBoxCylinderRecognitionLab.Recognize(root);
Assert.False(result.Success);
Assert.Equal(CirLabRecognitionReason.UnsupportedTransform, result.Reason);
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderUnsupportedCasesLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderUnsupportedCasesLabTests.cs
index 09e0de49..3593b241 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderUnsupportedCasesLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/CirBoxCylinderUnsupportedCasesLabTests.cs
@@ -8,7 +8,7 @@ public sealed class CirBoxCylinderUnsupportedCasesLabTests
{
[Theory]
[MemberData(nameof(Cases))]
- public void Rejects_Unsupported(CirNode root, CirLabRecognitionReason expected)
+ public void Rejects_Unsupported(SdfNode root, CirLabRecognitionReason expected)
{
var result = CirBoxCylinderRecognitionLab.Recognize(root);
Assert.False(result.Success);
@@ -17,11 +17,11 @@ public sealed class CirBoxCylinderUnsupportedCasesLabTests
public static IEnumerable<object[]> Cases()
{
- yield return [new CirUnionNode(new CirBoxNode(10d, 8d, 6d), new CirCylinderNode(2d, 8d)), CirLabRecognitionReason.RootNotSubtract];
- yield return [new CirSubtractNode(new CirSphereNode(3d), new CirCylinderNode(2d, 8d)), CirLabRecognitionReason.BaseNotBox];
- yield return [new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirSphereNode(2d)), CirLabRecognitionReason.ToolNotCylinder];
- yield return [new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirCylinderNode(2d, 4d)), CirLabRecognitionReason.NotThrough];
- yield return [new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirTransformNode(new CirCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(3d, 0d, 0d)))), CirLabRecognitionReason.TangentOrOutside];
- yield return [new CirSubtractNode(new CirBoxNode(10d, 8d, 6d), new CirTransformNode(new CirCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(7d, 0d, 0d)))), CirLabRecognitionReason.TangentOrOutside];
+ yield return [new SdfUnionNode(new SdfBoxNode(10d, 8d, 6d), new SdfCylinderNode(2d, 8d)), CirLabRecognitionReason.RootNotSubtract];
+ yield return [new SdfSubtractNode(new SdfSphereNode(3d), new SdfCylinderNode(2d, 8d)), CirLabRecognitionReason.BaseNotBox];
+ yield return [new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfSphereNode(2d)), CirLabRecognitionReason.ToolNotCylinder];
+ yield return [new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfCylinderNode(2d, 4d)), CirLabRecognitionReason.NotThrough];
+ yield return [new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfTransformNode(new SdfCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(3d, 0d, 0d)))), CirLabRecognitionReason.TangentOrOutside];
+ yield return [new SdfSubtractNode(new SdfBoxNode(10d, 8d, 6d), new SdfTransformNode(new SdfCylinderNode(2d, 8d), Transform3D.CreateTranslation(new Vector3D(7d, 0d, 0d)))), CirLabRecognitionReason.TangentOrOutside];
}
}
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX31FirmamentLoweringEntrypointLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX31FirmamentLoweringEntrypointLabTests.cs
index 60e3e76f..d756d532 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX31FirmamentLoweringEntrypointLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX31FirmamentLoweringEntrypointLabTests.cs
@@ -28,11 +28,11 @@ public sealed class CirBrepX31FirmamentLoweringEntrypointLabTests
var compile = CompileFixture("testdata/firmament/examples/boolean_box_cylinder_hole.firmament");
var lower = LowerViaReflection(compile.PrimitiveLoweringPlan!);
- var subtract = Assert.IsType<CirSubtractNode>(lower.Root);
- var leftTx = Assert.IsType<CirTransformNode>(subtract.Left);
- var rightTx = Assert.IsType<CirTransformNode>(subtract.Right);
- Assert.IsType<CirBoxNode>(leftTx.Child);
- Assert.IsType<CirCylinderNode>(rightTx.Child);
+ var subtract = Assert.IsType<SdfSubtractNode>(lower.Root);
+ var leftTx = Assert.IsType<SdfTransformNode>(subtract.Left);
+ var rightTx = Assert.IsType<SdfTransformNode>(subtract.Right);
+ Assert.IsType<SdfBoxNode>(leftTx.Child);
+ Assert.IsType<SdfCylinderNode>(rightTx.Child);
var labRecognition = CirBoxCylinderRecognitionLab.Recognize(lower.Root);
Assert.True(labRecognition.Success, $"Expected normalization to accept real lowered shape, got {labRecognition.Reason}: {labRecognition.Diagnostic}");
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX4RecognizerSourceContractLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX4RecognizerSourceContractLabTests.cs
index 096366cc..fd72c224 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX4RecognizerSourceContractLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/CirBrepX4RecognizerSourceContractLabTests.cs
@@ -19,7 +19,7 @@ public sealed class CirBrepX4RecognizerSourceContractLabTests
var inventory = CirBrepX4RecognizerSourceContractLab.BuildInventory(compile, lowered.Root);
- Assert.True(inventory.HasRootNode, "Lowered CirNode root must be available for direct geometric recognition.");
+ Assert.True(inventory.HasRootNode, "Lowered SdfNode root must be available for direct geometric recognition.");
Assert.True(inventory.HasLoweringPlan, "Lowering plan should be available in Firmament compilation artifact.");
Assert.True(inventory.HasExecutionResult, "Execution result should be available after successful compile.");
Assert.True(inventory.HasNativeGeometryState, "NativeGeometryState should be available from execution result.");
@@ -30,8 +30,8 @@ public sealed class CirBrepX4RecognizerSourceContractLabTests
[Fact]
public void Experiment2_NodeOnlyEnvelope_RecognizesDirectAndTransformWrappedSubtract_ButLacksProvenance()
{
- var direct = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 12));
- var wrapped = new CirTransformNode(direct, Transform3D.CreateTranslation(new Vector3D(3, 0, 0)));
+ var direct = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 12));
+ var wrapped = new SdfTransformNode(direct, Transform3D.CreateTranslation(new Vector3D(3, 0, 0)));
var directResult = CirBrepX4RecognizerSourceContractLab.Recognize(CirBoxCylinderRecognizerInput.FromNode(direct));
var wrappedResult = CirBrepX4RecognizerSourceContractLab.Recognize(CirBoxCylinderRecognizerInput.FromNode(wrapped));
@@ -62,7 +62,7 @@ public sealed class CirBrepX4RecognizerSourceContractLabTests
var nativeState = compile.PrimitiveExecutionResult!.NativeGeometryState;
var ex = Assert.Throws<InvalidOperationException>(() => CirBoxCylinderRecognizerInput.FromNativeState(nativeState));
- Assert.Contains("explicit CirNode root is required", ex.Message, StringComparison.Ordinal);
+ Assert.Contains("explicit SdfNode root is required", ex.Message, StringComparison.Ordinal);
var lowered = CirBrepX4RecognizerSourceContractLab.LowerViaReflection(compile.PrimitiveLoweringPlan!);
var input = CirBoxCylinderRecognizerInput.FromNativeState(nativeState, lowered.Root);
@@ -85,7 +85,7 @@ public sealed class CirBrepX4RecognizerSourceContractLabTests
[Fact]
public void Experiment6_MismatchPolicy_NodeGeometryIsAuthoritative_ReplayIsDiagnosticOnly()
{
- var geometry = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2));
+ var geometry = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2));
var replay = new NativeGeometryReplayLog([
new NativeGeometryReplayOperation(2, "hole", "boolean:subtract", "base", "cylinder", "tool", null, default, "ref")
]);
@@ -99,7 +99,7 @@ public sealed class CirBrepX4RecognizerSourceContractLabTests
[Fact]
public void Experiment7_RecommendedInputShape_SupportsNodeOnlyAndNodePlusReplayConstruction()
{
- var nodeInput = CirBoxCylinderRecognizerInput.FromNode(new CirSubtractNode(new CirBoxNode(8, 8, 8), new CirCylinderNode(1, 10)));
+ var nodeInput = CirBoxCylinderRecognizerInput.FromNode(new SdfSubtractNode(new SdfBoxNode(8, 8, 8), new SdfCylinderNode(1, 10)));
Assert.NotNull(nodeInput.Root);
Assert.Null(nodeInput.ReplayLog);
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/FrepBrepRecoveryPolicyLabTests.cs b/Aetheris.FrictionLab.Tests/CIRLab/FrepBrepRecoveryPolicyLabTests.cs
index fdbf749b..4c6c62aa 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/FrepBrepRecoveryPolicyLabTests.cs
+++ b/Aetheris.FrictionLab.Tests/CIRLab/FrepBrepRecoveryPolicyLabTests.cs
@@ -9,7 +9,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_BoxCylinder_SelectsSemanticPolicy()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 8, 6), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 8, 6), new SdfCylinderNode(2, 8));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.Equal("BoxCylinderThroughHolePolicy", result.SelectedPolicy);
}
@@ -17,9 +17,9 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_TranslatedBoxCylinder_SelectsSemanticPolicy()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(10, 8, 6), Transform3D.CreateTranslation(new(2, 1, 5))),
- new CirTransformNode(new CirCylinderNode(2, 8), Transform3D.CreateTranslation(new(2.5, 1.5, 5))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(10, 8, 6), Transform3D.CreateTranslation(new(2, 1, 5))),
+ new SdfTransformNode(new SdfCylinderNode(2, 8), Transform3D.CreateTranslation(new(2.5, 1.5, 5))));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.Equal("BoxCylinderThroughHolePolicy", result.SelectedPolicy);
}
@@ -27,7 +27,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_BoxSphere_DoesNotSelectBoxCylinderPolicy()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 8, 6), new CirSphereNode(2));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 8, 6), new SdfSphereNode(2));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.NotEqual("BoxCylinderThroughHolePolicy", result.SelectedPolicy);
}
@@ -35,7 +35,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_BlindCylinder_RejectsSemanticPolicy()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 8, 6), new CirCylinderNode(2, 4));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 8, 6), new SdfCylinderNode(2, 4));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.Contains(result.Candidates, c => c.PolicyName == "BoxCylinderThroughHolePolicy" && !c.Admissible && c.RejectionReasons.Any(r => r.Contains("recognizer_failed")));
}
@@ -43,7 +43,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_TangentCylinder_RejectsSemanticPolicy()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 8, 6), new CirTransformNode(new CirCylinderNode(2, 8), Transform3D.CreateTranslation(new(3,0,0))));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 8, 6), new SdfTransformNode(new SdfCylinderNode(2, 8), Transform3D.CreateTranslation(new(3,0,0))));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.Contains(result.Candidates, c => c.PolicyName == "BoxCylinderThroughHolePolicy" && !c.Admissible);
}
@@ -51,7 +51,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_UnsupportedTransform_RejectsSemanticPolicy()
{
- var root = new CirSubtractNode(new CirTransformNode(new CirBoxNode(10, 8, 6), Transform3D.CreateRotationX(Math.PI/4)), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfTransformNode(new SdfBoxNode(10, 8, 6), Transform3D.CreateRotationX(Math.PI/4)), new SdfCylinderNode(2, 8));
var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(root));
Assert.Contains(result.Candidates, c => c.PolicyName == "BoxCylinderThroughHolePolicy" && !c.Admissible);
}
@@ -59,7 +59,7 @@ public sealed class FrepBrepRecoveryPolicyLabTests
[Fact]
public void RecoveryPolicy_DiagnosticsIncludeAllCandidates()
{
- var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new CirBoxNode(1,1,1)));
+ var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new SdfBoxNode(1,1,1)));
Assert.Contains("candidate:BoxCylinderThroughHolePolicy", string.Join(";", result.Diagnostics));
Assert.Contains("candidate:GenericNumericalContourPolicy", string.Join(";", result.Diagnostics));
Assert.Contains("candidate:CirOnlyFallbackPolicy", string.Join(";", result.Diagnostics));
@@ -69,14 +69,14 @@ public sealed class FrepBrepRecoveryPolicyLabTests
public void RecoveryPolicy_TieBreakIsDeterministic()
{
var policies = new IFrepBrepRecoveryPolicy[] { new SameScore("z"), new SameScore("a") };
- var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new CirBoxNode(1,1,1)), policies);
+ var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new SdfBoxNode(1,1,1)), policies);
Assert.Equal("a", result.SelectedPolicy);
}
[Fact]
public void RecoveryPolicy_ReportEvidenceShape()
{
- var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new CirSubtractNode(new CirBoxNode(10,8,6), new CirCylinderNode(2,8))));
+ var result = FrepBrepRecoveryPolicyLab.SelectBestPolicy(new(new SdfSubtractNode(new SdfBoxNode(10,8,6), new SdfCylinderNode(2,8))));
var semantic = result.Candidates.Single(c => c.PolicyName == "BoxCylinderThroughHolePolicy");
Assert.NotEmpty(semantic.Evidence);
Assert.False(string.IsNullOrWhiteSpace(semantic.RecommendedRoute));
diff --git a/Aetheris.FrictionLab.Tests/CIRLab/Reports/cir-brep-x3-box-cylinder-recognition-lab.md b/Aetheris.FrictionLab.Tests/CIRLab/Reports/cir-brep-x3-box-cylinder-recognition-lab.md
index cb02f76e..765783ee 100644
--- a/Aetheris.FrictionLab.Tests/CIRLab/Reports/cir-brep-x3-box-cylinder-recognition-lab.md
+++ b/Aetheris.FrictionLab.Tests/CIRLab/Reports/cir-brep-x3-box-cylinder-recognition-lab.md
@@ -1,110 +1,110 @@
-# CIR-BREP-X3 — FrictionLab canonical box-cylinder recognition experiments
-
-## Scope
-Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.FrictionLab.Tests/CIRLab`.
-
-## 1) Exact CIR shape
-- Hypothesis: recognize `CirSubtractNode(CirBoxNode, CirCylinderNode)` with optional pure translations.
-- Experiments: direct node + translated wrappers tests.
-- Evidence: direct and translated cases pass; non-subtract rejected.
-- Conclusion: first production recognizer should require subtract(box,cylinder) after optional translation-unwrapping.
-- Recommendation: accept only identity/pure-translation wrappers in v1.
-- Confidence: High.
-
-## 2) Box/Cylinder coordinate conventions
-- Experiments: bounds/evaluate assertions.
-- Evidence: box centered at origin with half extents; cylinder centered at origin, Z-axis, half-height in ±Z.
-- Conclusion: CIR primitive conventions are origin-centered signed-distance primitives.
-- Recommendation: normalize around these conventions, then apply extracted translations.
-- Confidence: High.
-
-## 3) Through-hole requirement
-- Experiments: short cylinder rejection, spanning cylinder acceptance.
-- Evidence: height/depth and end-cap coverage checks separate through vs blind.
-- Conclusion: v1 should require full through depth with tolerance band.
-- Recommendation: reject blind/partial/miss.
-- Confidence: High.
-
-## 4) Allowed axes
-- Evidence: `CirCylinderNode` encodes only canonical Z axis; no intrinsic arbitrary-axis field.
-- Conclusion: axis variation must come from transforms.
-- Recommendation: v1 supports only native Z-axis cases (plus translation).
-- Confidence: High.
-
-## 5) Transforms
-- Experiments: pure translation vs rotation wrappers.
-- Evidence: translation unwrap is safe; rotation wrapper rejected.
-- Conclusion: detect pure translation by transformed basis vectors.
-- Recommendation: reject rotation/nonuniform/shear in v1 with explicit reason.
-- Confidence: High.
-
-## 6) Firmament lowering shape for `boolean_box_cylinder_hole`
-- Evidence (source inspection): lowerer always emits primitive local-frame + placement via `CirTransformNode`, then boolean `CirSubtractNode`.
-- Conclusion: real path is frequently subtract of transformed operands, not always literal raw primitives.
-- Recommendation: recognizer should include wrapper normalization.
-- Confidence: Medium-High.
-
-## 7) Recognition entrypoint
-- Evidence: CIR node tree has enough for canonical v1 (shape + transforms + dimensions).
-- Conclusion: node-first recognizer is sufficient for first scope.
-- Recommendation: implement node recognizer first; add plan/replay adapter only if needed.
-- Confidence: Medium.
-
-## 8) What counts as box
-- Evidence: accepted only `CirBoxNode`; non-box lhs rejected in tests.
-- Recommendation: strict `CirBoxNode` for v1.
-- Confidence: High.
-
-## 9) What counts as cylinder
-- Evidence: accepted only `CirCylinderNode`; sphere tool rejected.
-- Recommendation: strict finite circular `CirCylinderNode` only.
-- Confidence: High.
-
-## 10) Hole position constraints
-- Experiments: centered, offset-valid, tangent, outside.
-- Evidence: strict interior clearance inequalities reject tangent/grazing/outside.
-- Recommendation: allow offsets when strict clearance holds; do not force centered-only.
-- Confidence: High.
-
-## 11) Tolerances
-- Evidence: experiments use `ToleranceContext.Default.Linear` from kernel numerics.
-- Recommendation: use shared tolerance context; classify near-boundary as tangent/unsupported conservatively.
-- Confidence: High.
-
-## 12) Recognizer return shape
-- Evidence: lab result record carries success/reason/diagnostic, normalized primitives+translations, axis, through-length.
-- Recommendation: production result should be structured, not bool.
-- Confidence: High.
-
-## 13) Recognition vs builder coupling
-- Evidence: lab recognizes and returns normalized parameters without building BRep.
-- Conclusion: separation is practical.
-- Recommendation: recognizer returns normalized params; builder consumes them.
-- Confidence: High.
-
-## 14) Unsupported variants behavior
-- Evidence: unsupported test matrix exercises stable reason codes.
-- Recommendation: no fallback/guess; return explicit unsupported reason vocabulary.
-- Confidence: High.
-
-## 15) Production test needs
-- Recommendation matrix:
- - success: direct subtract, translated subtract
- - rejects: non-subtract, lhs non-box, rhs non-cylinder, unsupported transform, blind/not-through, tangent/outside
- - tolerances: near-boundary around clearance threshold
-- Confidence: High.
-
-## Recommended production recognizer policy
-Recognize only canonical `subtract(box,cylinder)` after unwrapping identity/pure-translation transforms; require positive dimensions, Z-axis cylinder convention, strict through-hole depth coverage, and strict XY interior clearance with shared tolerance.
-
-## Recommended production recognizer result shape
-`Success`, `ReasonCode`, `Diagnostic`, normalized `Box` dimensions, normalized `Cylinder` radius/height, `BoxTranslation`, `CylinderTranslation`, `Axis`, `ThroughLength`, optional source-node references.
-
-## Recommended production test matrix
-Copy/adapt all CIRLab tests under `Aetheris.FrictionLab.Tests/CIRLab` into production recognizer suite once production implementation starts.
-
-## Known deferred cases
-- Rotated cylinders/boxes.
-- Nonuniform-scaled/sheared transforms.
-- Lowering-plan/native replay metadata adapters.
-- Multi-hole/composite boolean chains.
+# CIR-BREP-X3 — FrictionLab canonical box-cylinder recognition experiments
+
+## Scope
+Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.FrictionLab.Tests/CIRLab`.
+
+## 1) Exact CIR shape
+- Hypothesis: recognize `SdfSubtractNode(SdfBoxNode, SdfCylinderNode)` with optional pure translations.
+- Experiments: direct node + translated wrappers tests.
+- Evidence: direct and translated cases pass; non-subtract rejected.
+- Conclusion: first production recognizer should require subtract(box,cylinder) after optional translation-unwrapping.
+- Recommendation: accept only identity/pure-translation wrappers in v1.
+- Confidence: High.
+
+## 2) Box/Cylinder coordinate conventions
+- Experiments: bounds/evaluate assertions.
+- Evidence: box centered at origin with half extents; cylinder centered at origin, Z-axis, half-height in ±Z.
+- Conclusion: CIR primitive conventions are origin-centered signed-distance primitives.
+- Recommendation: normalize around these conventions, then apply extracted translations.
+- Confidence: High.
+
+## 3) Through-hole requirement
+- Experiments: short cylinder rejection, spanning cylinder acceptance.
+- Evidence: height/depth and end-cap coverage checks separate through vs blind.
+- Conclusion: v1 should require full through depth with tolerance band.
+- Recommendation: reject blind/partial/miss.
+- Confidence: High.
+
+## 4) Allowed axes
+- Evidence: `SdfCylinderNode` encodes only canonical Z axis; no intrinsic arbitrary-axis field.
+- Conclusion: axis variation must come from transforms.
+- Recommendation: v1 supports only native Z-axis cases (plus translation).
+- Confidence: High.
+
+## 5) Transforms
+- Experiments: pure translation vs rotation wrappers.
+- Evidence: translation unwrap is safe; rotation wrapper rejected.
+- Conclusion: detect pure translation by transformed basis vectors.
+- Recommendation: reject rotation/nonuniform/shear in v1 with explicit reason.
+- Confidence: High.
+
+## 6) Firmament lowering shape for `boolean_box_cylinder_hole`
+- Evidence (source inspection): lowerer always emits primitive local-frame + placement via `SdfTransformNode`, then boolean `SdfSubtractNode`.
+- Conclusion: real path is frequently subtract of transformed operands, not always literal raw primitives.
+- Recommendation: recognizer should include wrapper normalization.
+- Confidence: Medium-High.
+
+## 7) Recognition entrypoint
+- Evidence: CIR node tree has enough for canonical v1 (shape + transforms + dimensions).
+- Conclusion: node-first recognizer is sufficient for first scope.
+- Recommendation: implement node recognizer first; add plan/replay adapter only if needed.
+- Confidence: Medium.
+
+## 8) What counts as box
+- Evidence: accepted only `SdfBoxNode`; non-box lhs rejected in tests.
+- Recommendation: strict `SdfBoxNode` for v1.
+- Confidence: High.
+
+## 9) What counts as cylinder
+- Evidence: accepted only `SdfCylinderNode`; sphere tool rejected.
+- Recommendation: strict finite circular `SdfCylinderNode` only.
+- Confidence: High.
+
+## 10) Hole position constraints
+- Experiments: centered, offset-valid, tangent, outside.
+- Evidence: strict interior clearance inequalities reject tangent/grazing/outside.
+- Recommendation: allow offsets when strict clearance holds; do not force centered-only.
+- Confidence: High.
+
+## 11) Tolerances
+- Evidence: experiments use `ToleranceContext.Default.Linear` from kernel numerics.
+- Recommendation: use shared tolerance context; classify near-boundary as tangent/unsupported conservatively.
+- Confidence: High.
+
+## 12) Recognizer return shape
+- Evidence: lab result record carries success/reason/diagnostic, normalized primitives+translations, axis, through-length.
+- Recommendation: production result should be structured, not bool.
+- Confidence: High.
+
+## 13) Recognition vs builder coupling
+- Evidence: lab recognizes and returns normalized parameters without building BRep.
+- Conclusion: separation is practical.
+- Recommendation: recognizer returns normalized params; builder consumes them.
+- Confidence: High.
+
+## 14) Unsupported variants behavior
+- Evidence: unsupported test matrix exercises stable reason codes.
+- Recommendation: no fallback/guess; return explicit unsupported reason vocabulary.
+- Confidence: High.
+
+## 15) Production test needs
+- Recommendation matrix:
+ - success: direct subtract, translated subtract
+ - rejects: non-subtract, lhs non-box, rhs non-cylinder, unsupported transform, blind/not-through, tangent/outside
+ - tolerances: near-boundary around clearance threshold
+- Confidence: High.
+
+## Recommended production recognizer policy
+Recognize only canonical `subtract(box,cylinder)` after unwrapping identity/pure-translation transforms; require positive dimensions, Z-axis cylinder convention, strict through-hole depth coverage, and strict XY interior clearance with shared tolerance.
+
+## Recommended production recognizer result shape
+`Success`, `ReasonCode`, `Diagnostic`, normalized `Box` dimensions, normalized `Cylinder` radius/height, `BoxTranslation`, `CylinderTranslation`, `Axis`, `ThroughLength`, optional source-node references.
+
+## Recommended production test matrix
+Copy/adapt all CIRLab tests under `Aetheris.FrictionLab.Tests/CIRLab` into production recognizer suite once production implementation starts.
+
+## Known deferred cases
+- Rotated cylinders/boxes.
+- Nonuniform-scaled/sheared transforms.
+- Lowering-plan/native replay metadata adapters.
+- Multi-hole/composite boolean chains.
diff --git a/Aetheris.Kernel.Core.Tests/Construction/ContinuumConstructionDescriptorTests.cs b/Aetheris.Kernel.Core.Tests/Construction/ContinuumConstructionDescriptorTests.cs
new file mode 100644
index 00000000..50af479c
--- /dev/null
+++ b/Aetheris.Kernel.Core.Tests/Construction/ContinuumConstructionDescriptorTests.cs
@@ -0,0 +1,15 @@
+using Aetheris.Kernel.Core.Construction;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Tests.Construction;
+
+public sealed class ContinuumConstructionDescriptorTests
+{
+ [Fact]
+ public void DescriptorCarriesOnlyBoundedGeometryLineageAndAdmittedOperations()
+ {
+ Point3D[] a=[new(0,0,0),new(0,1,0),new(0,0,1)];Point3D[] b=[new(1,0,0),new(1,1,0),new(1,0,1)];
+ var descriptor=new ContinuumConstructionDescriptor("air:feature-7","body:region-1",[new(0,a),new(1,b)],[0,1,2],["PrismaticSectionTransition"],["generated/native AIR","recipe:v1"]);
+ Assert.Same(descriptor,descriptor.Validate());Assert.DoesNotContain(descriptor.AdmittedOperations,x=>x.Contains("BRepPlan",StringComparison.Ordinal));
+ }
+}
diff --git a/Aetheris.Kernel.Core.Tests/Math/Transform3DDoublePrecisionTests.cs b/Aetheris.Kernel.Core.Tests/Math/Transform3DDoublePrecisionTests.cs
new file mode 100644
index 00000000..83ad9f68
--- /dev/null
+++ b/Aetheris.Kernel.Core.Tests/Math/Transform3DDoublePrecisionTests.cs
@@ -0,0 +1,22 @@
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Tests.Math;
+
+public sealed class Transform3DDoublePrecisionTests
+{
+ [Fact]
+ public void RotationRoundTripIsAtDoublePrecision()
+ {
+ var transform=Transform3D.CreateRotationX(.317)*Transform3D.CreateRotationY(-.721)*Transform3D.CreateTranslation(new(.031,-.027,.019));
+ var point=new Point3D(1.234567890123,-2.345678901234,3.456789012345);
+ Assert.InRange((transform.Inverse().Apply(transform.Apply(point))-point).Length,0d,2e-15d);
+ }
+
+ [Fact]
+ public void CompositionOrderRemainsFirstThenSecond()
+ {
+ var first=Transform3D.CreateTranslation(new(1,0,0));var second=Transform3D.CreateRotationZ(double.Pi/2d);
+ var result=(first*second).Apply(Point3D.Origin);
+ Assert.InRange((result-new Point3D(0,1,0)).Length,0d,2e-15d);
+ }
+}
diff --git a/Aetheris.Kernel.Core/Construction/ContinuumConstructionDescriptor.cs b/Aetheris.Kernel.Core/Construction/ContinuumConstructionDescriptor.cs
new file mode 100644
index 00000000..c3d0afcb
--- /dev/null
+++ b/Aetheris.Kernel.Core/Construction/ContinuumConstructionDescriptor.cs
@@ -0,0 +1,28 @@
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Construction;
+
+/// <summary>
+/// Immutable, deliberately bounded construction bridge. Consumers receive section geometry and
+/// lineage, never arbitrary AIR nodes, route selectors, or BRep-plan internals.
+/// </summary>
+public sealed record ContinuumConstructionSection(double AxialPosition,IReadOnlyList<Point3D> ProfileVertices);
+
+public sealed record ContinuumConstructionDescriptor(
+ string SourceIdentity,
+ string SemanticRegionIdentity,
+ IReadOnlyList<ContinuumConstructionSection> Sections,
+ IReadOnlyList<int> Correspondence,
+ IReadOnlyList<string> AdmittedOperations,
+ IReadOnlyList<string> Provenance)
+{
+ public ContinuumConstructionDescriptor Validate()
+ {
+ if(string.IsNullOrWhiteSpace(SourceIdentity)||string.IsNullOrWhiteSpace(SemanticRegionIdentity))throw new ArgumentException("Construction identities are required.");
+ if(Sections.Count<2||Sections.Any(s=>s.ProfileVertices.Count<3))throw new ArgumentException("At least two polygonal sections are required.");
+ if(Sections.Zip(Sections.Skip(1)).Any(pair=>pair.First.AxialPosition>=pair.Second.AxialPosition))throw new ArgumentException("Sections must be strictly axially ordered.");
+ var count=Sections[0].ProfileVertices.Count;if(Sections.Any(s=>s.ProfileVertices.Count!=count)||Correspondence.Count!=count)throw new ArgumentException("Section correspondence must be complete.");
+ if(Correspondence.Distinct().Count()!=count||Correspondence.Any(i=>i<0||i>=count))throw new ArgumentException("Correspondence must be a permutation.");
+ return this;
+ }
+}
diff --git a/Aetheris.Kernel.Core/Math/Transform3D.cs b/Aetheris.Kernel.Core/Math/Transform3D.cs
index 2f22f474..51926284 100644
--- a/Aetheris.Kernel.Core/Math/Transform3D.cs
+++ b/Aetheris.Kernel.Core/Math/Transform3D.cs
@@ -1,80 +1,115 @@
-using System.Numerics;
using Aetheris.Kernel.Core.Numerics;
namespace Aetheris.Kernel.Core.Math;
+/// <summary>
+/// Deterministic double-precision affine transform using the historical
+/// System.Numerics row-vector composition convention. Therefore
+/// <c>first * second</c> applies <c>first</c>, then <c>second</c>.
+/// </summary>
public readonly struct Transform3D
{
- private readonly Matrix4x4 _matrix;
+ private readonly double _m11, _m12, _m13, _m14;
+ private readonly double _m21, _m22, _m23, _m24;
+ private readonly double _m31, _m32, _m33, _m34;
+ private readonly double _m41, _m42, _m43, _m44;
- private Transform3D(Matrix4x4 matrix)
+ private Transform3D(double[] m)
{
- _matrix = matrix;
+ _m11=m[0]; _m12=m[1]; _m13=m[2]; _m14=m[3];
+ _m21=m[4]; _m22=m[5]; _m23=m[6]; _m24=m[7];
+ _m31=m[8]; _m32=m[9]; _m33=m[10]; _m34=m[11];
+ _m41=m[12]; _m42=m[13]; _m43=m[14]; _m44=m[15];
}
- public static Transform3D Identity { get; } = new(Matrix4x4.Identity);
+ public static Transform3D Identity { get; } = new([1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]);
- public static Transform3D CreateTranslation(Vector3D translation) =>
- new(Matrix4x4.CreateTranslation((float)translation.X, (float)translation.Y, (float)translation.Z));
+ public static Transform3D CreateTranslation(Vector3D t) =>
+ new([1,0,0,0, 0,1,0,0, 0,0,1,0, t.X,t.Y,t.Z,1]);
- public static Transform3D CreateScale(double uniformScale) =>
- new(Matrix4x4.CreateScale((float)uniformScale));
+ public static Transform3D CreateScale(double scale) => CreateScale(new Vector3D(scale, scale, scale));
- public static Transform3D CreateScale(Vector3D scale) =>
- new(Matrix4x4.CreateScale((float)scale.X, (float)scale.Y, (float)scale.Z));
+ public static Transform3D CreateScale(Vector3D s) =>
+ new([s.X,0,0,0, 0,s.Y,0,0, 0,0,s.Z,0, 0,0,0,1]);
- public static Transform3D CreateRotationX(double radians) => new(Matrix4x4.CreateRotationX((float)radians));
+ public static Transform3D CreateRotationX(double radians)
+ {
+ var c=double.Cos(radians); var s=double.Sin(radians);
+ return new([1,0,0,0, 0,c,s,0, 0,-s,c,0, 0,0,0,1]);
+ }
- public static Transform3D CreateRotationY(double radians) => new(Matrix4x4.CreateRotationY((float)radians));
+ public static Transform3D CreateRotationY(double radians)
+ {
+ var c=double.Cos(radians); var s=double.Sin(radians);
+ return new([c,0,-s,0, 0,1,0,0, s,0,c,0, 0,0,0,1]);
+ }
- public static Transform3D CreateRotationZ(double radians) => new(Matrix4x4.CreateRotationZ((float)radians));
+ public static Transform3D CreateRotationZ(double radians)
+ {
+ var c=double.Cos(radians); var s=double.Sin(radians);
+ return new([c,s,0,0, -s,c,0,0, 0,0,1,0, 0,0,0,1]);
+ }
- public static Transform3D operator *(Transform3D left, Transform3D right) =>
- new(Matrix4x4.Multiply(left._matrix, right._matrix));
+ public static Transform3D operator *(Transform3D left, Transform3D right)
+ {
+ var a=left.ToArray(); var b=right.ToArray(); var result=new double[16];
+ for(var row=0;row<4;row++) for(var column=0;column<4;column++)
+ for(var k=0;k<4;k++) result[(row*4)+column]+=a[(row*4)+k]*b[(k*4)+column];
+ return new(result);
+ }
public static Transform3D Compose(Transform3D first, Transform3D second) => first * second;
public bool TryInverse(out Transform3D inverse)
{
- var success = Matrix4x4.Invert(_matrix, out var inverseMatrix);
- inverse = success ? new Transform3D(inverseMatrix) : default;
- return success;
- }
-
- public Transform3D Inverse()
- {
- if (!TryInverse(out var inverse))
+ var augmented=new double[4,8]; var source=ToArray();
+ for(var row=0;row<4;row++) for(var column=0;column<4;column++)
+ { augmented[row,column]=source[(row*4)+column]; augmented[row,column+4]=row==column?1d:0d; }
+ for(var column=0;column<4;column++)
{
- throw new InvalidOperationException("Transform is singular and cannot be inverted.");
+ var pivot=column;
+ for(var row=column+1;row<4;row++) if(double.Abs(augmented[row,column])>double.Abs(augmented[pivot,column])) pivot=row;
+ if(double.Abs(augmented[pivot,column])<=1e-300d) { inverse=default; return false; }
+ if(pivot!=column) for(var j=0;j<8;j++) (augmented[column,j],augmented[pivot,j])=(augmented[pivot,j],augmented[column,j]);
+ var divisor=augmented[column,column]; for(var j=0;j<8;j++) augmented[column,j]/=divisor;
+ for(var row=0;row<4;row++) if(row!=column)
+ { var factor=augmented[row,column]; for(var j=0;j<8;j++) augmented[row,j]-=factor*augmented[column,j]; }
}
-
- return inverse;
+ var values=new double[16]; for(var row=0;row<4;row++) for(var column=0;column<4;column++) values[(row*4)+column]=augmented[row,column+4];
+ inverse=new(values); return true;
}
- public Point3D Apply(Point3D point)
- {
- var transformed = Vector3.Transform(ToNumerics(point), _matrix);
- return new Point3D(transformed.X, transformed.Y, transformed.Z);
- }
+ public Transform3D Inverse() => TryInverse(out var inverse)
+ ? inverse : throw new InvalidOperationException("Transform is singular and cannot be inverted.");
- public Vector3D Apply(Vector3D vector)
+ public Point3D Apply(Point3D p)
{
- var transformed = Vector3.TransformNormal(ToNumerics(vector), _matrix);
- return new Vector3D(transformed.X, transformed.Y, transformed.Z);
+ var x=(p.X*_m11)+(p.Y*_m21)+(p.Z*_m31)+_m41;
+ var y=(p.X*_m12)+(p.Y*_m22)+(p.Z*_m32)+_m42;
+ var z=(p.X*_m13)+(p.Y*_m23)+(p.Z*_m33)+_m43;
+ var w=(p.X*_m14)+(p.Y*_m24)+(p.Z*_m34)+_m44;
+ return w==1d ? new(x,y,z) : new(x/w,y/w,z/w);
}
+ public Vector3D Apply(Vector3D v) => new(
+ (v.X*_m11)+(v.Y*_m21)+(v.Z*_m31),
+ (v.X*_m12)+(v.Y*_m22)+(v.Z*_m32),
+ (v.X*_m13)+(v.Y*_m23)+(v.Z*_m33));
+
public Direction3D Apply(Direction3D direction, ToleranceContext? toleranceContext = null)
{
- var transformed = Apply(direction.ToVector());
- if (!Direction3D.TryCreate(transformed, out var transformedDirection, toleranceContext))
- {
+ if (!Direction3D.TryCreate(Apply(direction.ToVector()), out var result, toleranceContext))
throw new InvalidOperationException("Transform collapses direction to near-zero length.");
- }
-
- return transformedDirection;
+ return result;
}
- private static Vector3 ToNumerics(Point3D point) => new((float)point.X, (float)point.Y, (float)point.Z);
+ /// <summary>True when the linear part preserves Euclidean lengths within the supplied tolerance.</summary>
+ public bool IsRigid(double tolerance = 1e-12d)
+ {
+ var x=Apply(new Vector3D(1,0,0)); var y=Apply(new Vector3D(0,1,0)); var z=Apply(new Vector3D(0,0,1));
+ return double.Abs(x.Length-1)<=tolerance && double.Abs(y.Length-1)<=tolerance && double.Abs(z.Length-1)<=tolerance
+ && double.Abs(x.Dot(y))<=tolerance && double.Abs(x.Dot(z))<=tolerance && double.Abs(y.Dot(z))<=tolerance;
+ }
- private static Vector3 ToNumerics(Vector3D vector) => new((float)vector.X, (float)vector.Y, (float)vector.Z);
+ private double[] ToArray() => [_m11,_m12,_m13,_m14, _m21,_m22,_m23,_m24, _m31,_m32,_m33,_m34, _m41,_m42,_m43,_m44];
}
diff --git a/Aetheris.Kernel.Firmament.Tests/AirProfileStackExtrudeTests.cs b/Aetheris.Kernel.Firmament.Tests/AirProfileStackExtrudeTests.cs
index 01205e6e..eca544cb 100644
--- a/Aetheris.Kernel.Firmament.Tests/AirProfileStackExtrudeTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/AirProfileStackExtrudeTests.cs
@@ -20,7 +20,7 @@ public sealed class AirProfileStackExtrudeTests
[Fact]
public void AirProfileStack_FromHolePlan_ThroughHole_ConvertsAndExecutes()
{
- var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)))).Plan!;
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)))).Plan!;
Assert.True(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(plan, out _, out var d));
var exec = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, exec.Status);
@@ -34,7 +34,7 @@ public sealed class AirProfileStackExtrudeTests
[Fact]
public void ThroughAndStepped_AirRoutesRemainGreen()
{
- var through = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)))).Plan!;
+ var through = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)))).Plan!;
var stepped = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped())).Plan!;
Assert.True(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(through, out _, out _));
Assert.True(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(stepped, out _, out _));
@@ -45,7 +45,7 @@ public sealed class AirProfileStackExtrudeTests
[Fact]
public void BlindHole_AirV2B_FinalRouteStatus()
{
- var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20,20,10), new CirTransformNode(new CirCylinderNode(2,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)))))).Plan!;
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfTransformNode(new SdfCylinderNode(2,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)))))).Plan!;
Assert.False(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(plan, out _, out var d));
Assert.Contains(d, x => x.Contains("air-profile-stack-v2b-blind-solid-interval-recognized", StringComparison.Ordinal));
Assert.Contains(d, x => x.Contains("air-profile-stack-v2b-blind-emitter-deferred", StringComparison.Ordinal));
@@ -58,7 +58,7 @@ public sealed class AirProfileStackExtrudeTests
[Fact]
public void Counterbore_AirV2B_FinalRouteStatus()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
Assert.True(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(plan, out _, out var d));
Assert.Contains(d, x => x.Contains("air-profile-stack-v2b-counterbore-contiguous-accepted", StringComparison.Ordinal));
@@ -70,7 +70,7 @@ public sealed class AirProfileStackExtrudeTests
[Fact]
public void ConicalRoutesRemainConical()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
Assert.False(AirProfileStackExtrudeAdapter.TryFromHoleRecoveryPlan(plan, out _, out var d));
Assert.Contains(d, x => x.Contains("air-profile-stack-v1-conical-deferred", StringComparison.Ordinal));
@@ -97,5 +97,5 @@ public sealed class AirProfileStackExtrudeTests
Assert.Contains(d, x => x.Contains("air-validation-failed-solid-interval-has-inner-loop", StringComparison.Ordinal));
}
- private static CirNode BuildStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
+ private static SdfNode BuildStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantAndExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantAndExecutorTests.cs
index 1ed312d2..4c502765 100644
--- a/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantAndExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantAndExecutorTests.cs
@@ -24,7 +24,7 @@ public sealed class BlindHoleVariantAndExecutorTests
[Fact]
public void BlindHoleVariant_RejectsThroughHole()
{
- var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))));
+ var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))));
Assert.Contains("selected-variant:ThroughHoleVariant", eval.Evidence);
Assert.DoesNotContain("selected-variant:BlindHoleVariant", eval.Evidence);
}
@@ -32,7 +32,7 @@ public sealed class BlindHoleVariantAndExecutorTests
[Fact]
public void BlindHoleVariant_RejectsMissOrOutside()
{
- var miss = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTransformNode(new CirCylinderNode(2, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, 0))));
+ var miss = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTransformNode(new SdfCylinderNode(2, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, 0))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(miss));
Assert.False(eval.Admissible);
Assert.Contains("UnsupportedMissingEntryFace", string.Join("|", eval.RejectionReasons), StringComparison.Ordinal);
@@ -76,12 +76,12 @@ public sealed class BlindHoleVariantAndExecutorTests
[Fact]
public void BlindHole_Unsupported_DoesNotFalseSucceed()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(6, 4));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(6, 4));
var result = FrepSemanticRecoveryRematerializer.TryRecover(root);
Assert.False(result.Succeeded);
Assert.Null(result.Body);
}
- private static CirNode BuildCanonicalBlindHole()
- => new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirTransformNode(new CirCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ private static SdfNode BuildCanonicalBlindHole()
+ => new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfTransformNode(new SdfCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantHardeningTests.cs b/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantHardeningTests.cs
index 8fa3968e..c747293b 100644
--- a/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantHardeningTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/BlindHoleVariantHardeningTests.cs
@@ -44,9 +44,9 @@ public sealed class BlindHoleVariantHardeningTests
[Fact]
public void BlindHole_TranslatedInput_AdmitsExecutesAndExports()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(7d, -4d, 5d))),
- new CirTransformNode(new CirCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(8d, -3d, 8d))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(7d, -4d, 5d))),
+ new SdfTransformNode(new SdfCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(8d, -3d, 8d))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.True(eval.Admissible);
@@ -64,7 +64,7 @@ public sealed class BlindHoleVariantHardeningTests
[Fact]
public void BlindHole_DoesNotStealThroughHole()
{
- var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))));
+ var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))));
Assert.Contains("selected-variant:ThroughHoleVariant", eval.Evidence);
Assert.DoesNotContain("selected-variant:BlindHoleVariant", eval.Evidence);
Assert.Contains(eval.EvaluationsFor(nameof(BlindHoleVariant)), d => d.Contains("through-hole rejected as not blind", StringComparison.OrdinalIgnoreCase));
@@ -86,7 +86,7 @@ public sealed class BlindHoleVariantHardeningTests
var boxDepth = 10d;
var cylHeight = boxDepth - (tol * 0.25d);
var cylCenterZ = (boxDepth * 0.5d) - (cylHeight * 0.5d);
- var root = new CirSubtractNode(new CirBoxNode(20d, 20d, boxDepth), new CirTransformNode(new CirCylinderNode(2d, cylHeight), Transform3D.CreateTranslation(new Vector3D(0d, 0d, cylCenterZ))));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 20d, boxDepth), new SdfTransformNode(new SdfCylinderNode(2d, cylHeight), Transform3D.CreateTranslation(new Vector3D(0d, 0d, cylCenterZ))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.False(eval.Admissible);
@@ -96,7 +96,7 @@ public sealed class BlindHoleVariantHardeningTests
[Fact]
public void BlindHole_RejectsNoEntryOpening()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 4d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 4d));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.False(eval.Admissible);
Assert.Contains("UnsupportedMissingEntryFace", string.Join("|", eval.RejectionReasons), StringComparison.Ordinal);
@@ -105,7 +105,7 @@ public sealed class BlindHoleVariantHardeningTests
[Fact]
public void BlindHole_RejectsTangentOrGrazingRadius()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirTransformNode(new CirCylinderNode(10d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfTransformNode(new SdfCylinderNode(10d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.False(eval.Admissible);
Assert.Contains("UnsupportedTangentOrOutsideClearance", string.Join("|", eval.RejectionReasons), StringComparison.Ordinal);
@@ -115,9 +115,9 @@ public sealed class BlindHoleVariantHardeningTests
[Fact]
public void BlindHole_RejectsUnsupportedTransform()
{
- var rotated = new CirSubtractNode(
- new CirBoxNode(20d, 20d, 10d),
- new CirTransformNode(new CirCylinderNode(2d, 4d), Transform3D.CreateRotationX(Math.PI / 6d) * Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ var rotated = new SdfSubtractNode(
+ new SdfBoxNode(20d, 20d, 10d),
+ new SdfTransformNode(new SdfCylinderNode(2d, 4d), Transform3D.CreateRotationX(Math.PI / 6d) * Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(rotated));
Assert.False(eval.Admissible);
@@ -126,14 +126,14 @@ public sealed class BlindHoleVariantHardeningTests
Assert.Null(remat.Body);
}
- private static CirNode BuildTopEntryBlindHole()
- => new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirTransformNode(new CirCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ private static SdfNode BuildTopEntryBlindHole()
+ => new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfTransformNode(new SdfCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
- private static CirNode BuildBottomEntryBlindHole()
- => new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirTransformNode(new CirCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
+ private static SdfNode BuildBottomEntryBlindHole()
+ => new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfTransformNode(new SdfCylinderNode(2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
- private static CirNode BuildCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/ChamferedEntryHoleVariantAndExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/ChamferedEntryHoleVariantAndExecutorTests.cs
index 8fd8a50b..a0431f95 100644
--- a/Aetheris.Kernel.Firmament.Tests/ChamferedEntryHoleVariantAndExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ChamferedEntryHoleVariantAndExecutorTests.cs
@@ -49,8 +49,8 @@ public sealed class ChamferedEntryHoleVariantAndExecutorTests
[Fact]
public void ChamferedEntryVariant_RejectsNonCoaxialConeCylinder()
{
- var cone = new CirTransformNode(new CirConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, 4.5d)));
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), cone);
+ var cone = new SdfTransformNode(new SdfConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, 4.5d)));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), cone);
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.Contains(eval.EvaluationsFor(nameof(ChamferedEntryHoleVariant)), d => d.Contains("not coaxial", StringComparison.OrdinalIgnoreCase));
}
@@ -136,8 +136,8 @@ public sealed class ChamferedEntryHoleVariantAndExecutorTests
[Fact]
public void ChamferedEntry_RejectsInvalidBottomConeOrientation()
{
- var cone = new CirTransformNode(new CirConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d)));
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 20d)), cone);
+ var cone = new SdfTransformNode(new SdfConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d)));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 20d)), cone);
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.Contains(eval.EvaluationsFor(nameof(ChamferedEntryHoleVariant)), d => d.Contains("radius ordering invalid", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain("selected-variant:ChamferedEntryHoleVariant", eval.Evidence);
@@ -146,20 +146,20 @@ public sealed class ChamferedEntryHoleVariantAndExecutorTests
[Fact]
public void ChamferedEntry_Unsupported_DoesNotFalseSucceed()
{
- var cone = new CirTransformNode(new CirConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 1.5d)));
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), cone);
+ var cone = new SdfTransformNode(new SdfConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 1.5d)));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), cone);
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.False(eval.Admissible);
}
- private static CirNode BuildChamfered()
- => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 4.5d))));
- private static CirNode BuildCountersink()
- => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
- private static CirNode BuildChamferedBottom()
- => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(2.8d, 2d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d))));
- private static CirNode BuildCountersinkBottom()
- => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(4d, 2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
+ private static SdfNode BuildChamfered()
+ => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 4.5d))));
+ private static SdfNode BuildCountersink()
+ => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ private static SdfNode BuildChamferedBottom()
+ => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(2.8d, 2d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d))));
+ private static SdfNode BuildCountersinkBottom()
+ => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(4d, 2d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
private static void AssertAllFaceLoopsAreTopologicallyClosed(Aetheris.Kernel.Core.Brep.BrepBody body)
{
diff --git a/Aetheris.Kernel.Firmament.Tests/CirAnalysisServiceTests.cs b/Aetheris.Kernel.Firmament.Tests/CirAnalysisServiceTests.cs
index 8d0d1e43..8fdcc000 100644
--- a/Aetheris.Kernel.Firmament.Tests/CirAnalysisServiceTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CirAnalysisServiceTests.cs
@@ -9,8 +9,8 @@ public sealed class CirAnalysisServiceTests
[Fact]
public void CirAnalysisService_TapeInput_VolumeAndPoints()
{
- var node = new CirBoxNode(4d, 4d, 4d);
- var tape = CirTapeLowerer.Lower(node);
+ var node = new SdfBoxNode(4d, 4d, 4d);
+ var tape = SdfTapeLowerer.Lower(node);
var result = CirNativeAnalysisService.AnalyzeTape(
tape,
@@ -20,13 +20,13 @@ public sealed class CirAnalysisServiceTests
Assert.True(result.Success);
Assert.Equal("cir", result.Backend);
- Assert.Equal(CirNativeAnalysisInputKind.CirTape, result.InputKind);
+ Assert.Equal(CirNativeAnalysisInputKind.SdfTape, result.InputKind);
Assert.Equal(CirNativeAnalysisResultKind.Approximate, result.ResultKind);
Assert.NotNull(result.Volume);
Assert.Equal(CirNativeEstimatorKind.Dense, result.Volume!.Estimator);
Assert.Equal(2, result.PointClassifications.Count);
- Assert.Contains(result.PointClassifications, p => p.Classification == CirPointClassification.Inside);
- Assert.Contains(result.PointClassifications, p => p.Classification == CirPointClassification.Outside);
+ Assert.Contains(result.PointClassifications, p => p.Classification == SdfPointClassification.Inside);
+ Assert.Contains(result.PointClassifications, p => p.Classification == SdfPointClassification.Outside);
}
[Fact]
@@ -73,7 +73,7 @@ public sealed class CirAnalysisServiceTests
public void AdaptiveVolume_MetadataPresent()
{
var plan = CompilePlan("testdata/firmament/examples/boolean_box_cylinder_hole.firmament");
- var options = new CirAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 20);
+ var options = new SdfAdaptiveVolumeOptions(MaxDepth: 6, DirectSampleGrid: 2, MaxTraceEvents: 20);
var result = CirNativeAnalysisService.AnalyzeFirmamentPlan(plan, adaptiveOptions: options);
diff --git a/Aetheris.Kernel.Firmament.Tests/CirBoxCylinderRecognizerTests.cs b/Aetheris.Kernel.Firmament.Tests/CirBoxCylinderRecognizerTests.cs
index cc92494c..a11fadbc 100644
--- a/Aetheris.Kernel.Firmament.Tests/CirBoxCylinderRecognizerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CirBoxCylinderRecognizerTests.cs
@@ -12,7 +12,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Recognizes_DirectSubtract_BoxCylinder()
{
- var input = new CirBoxCylinderRecognizerInput(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20)));
+ var input = new CirBoxCylinderRecognizerInput(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20)));
var result = CirBoxCylinderRecognizer.Recognize(input);
Assert.True(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.Recognized, result.Reason);
@@ -23,9 +23,9 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Recognizes_TranslationWrapped_Subtract_BoxCylinder()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
- new CirTransformNode(new CirCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
+ new SdfTransformNode(new SdfCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(root));
Assert.True(result.Success);
Assert.Equal(8d, result.Value!.ClearanceXPlus, 6);
@@ -34,7 +34,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_NonSubtractRoot()
{
- var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirBoxNode(2,2,2)));
+ var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfBoxNode(2,2,2)));
Assert.False(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedRootNotSubtract, result.Reason);
}
@@ -42,7 +42,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_LeftNotBox()
{
- var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(new CirSphereNode(3), new CirCylinderNode(1, 10))));
+ var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(new SdfSphereNode(3), new SdfCylinderNode(1, 10))));
Assert.False(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedLeftNotBox, result.Reason);
}
@@ -50,7 +50,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_RightNotCylinder()
{
- var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(new CirBoxNode(10,10,10), new CirSphereNode(2))));
+ var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfSphereNode(2))));
Assert.False(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedRightNotCylinder, result.Reason);
}
@@ -58,7 +58,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_UnsupportedTransform()
{
- var rotated = new CirSubtractNode(new CirBoxNode(10,10,10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateRotationX(0.2)));
+ var rotated = new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateRotationX(0.2)));
var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(rotated));
Assert.False(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedTransform, result.Reason);
@@ -67,7 +67,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_BlindCylinder()
{
- var root = new CirSubtractNode(new CirBoxNode(10,10,10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfCylinderNode(2, 8));
var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(root));
Assert.False(result.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedNotThroughHole, result.Reason);
@@ -76,11 +76,11 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Rejects_Tangent_And_Outside()
{
- var tangent = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(new CirBoxNode(10,10,10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, 0, 0))))));
+ var tangent = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, 0, 0))))));
Assert.False(tangent.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedTangentOrGrazing, tangent.Reason);
- var outside = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(new CirBoxNode(10,10,10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3.001 + ToleranceContext.Default.Linear, 0, 0))))));
+ var outside = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3.001 + ToleranceContext.Default.Linear, 0, 0))))));
Assert.False(outside.Success);
Assert.Equal(CirBoxCylinderRecognitionReason.UnsupportedCylinderOutsideBox, outside.Reason);
}
@@ -88,7 +88,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Allows_Offset_ThroughHole_WithStrictClearance()
{
- var root = new CirSubtractNode(new CirBoxNode(12, 12, 10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(1, -1, 0))));
+ var root = new SdfSubtractNode(new SdfBoxNode(12, 12, 10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(1, -1, 0))));
var result = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(root));
Assert.True(result.Success);
}
@@ -96,7 +96,7 @@ public sealed class CirBoxCylinderRecognizerTests
[Fact]
public void Replay_IsOptional_AndMismatchIsDiagnosticOnly()
{
- var root = new CirSubtractNode(new CirBoxNode(12, 12, 10), new CirCylinderNode(2, 20));
+ var root = new SdfSubtractNode(new SdfBoxNode(12, 12, 10), new SdfCylinderNode(2, 20));
var noReplay = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(root));
Assert.True(noReplay.Success);
diff --git a/Aetheris.Kernel.Firmament.Tests/CirBrepMaterializerTests.cs b/Aetheris.Kernel.Firmament.Tests/CirBrepMaterializerTests.cs
index 04910b8a..4640f61e 100644
--- a/Aetheris.Kernel.Firmament.Tests/CirBrepMaterializerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CirBrepMaterializerTests.cs
@@ -12,9 +12,9 @@ public sealed class CirBrepMaterializerTests
[Fact]
public void MaterializerRegistry_Selects_BoxMinusCylinder()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))),
- new CirTransformNode(new CirCylinderNode(3, 20), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))),
+ new SdfTransformNode(new SdfCylinderNode(3, 20), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))));
var replay = BuildReplay("cylinder");
var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(root, replay));
@@ -27,9 +27,9 @@ public sealed class CirBrepMaterializerTests
[Fact]
public void MaterializerRegistry_Selects_BoxMinusBox()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))),
- new CirTransformNode(new CirBoxNode(6, 20, 10), Transform3D.CreateTranslation(new Vector3D(7, 0, 5))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(0, 0, 5))),
+ new SdfTransformNode(new SdfBoxNode(6, 20, 10), Transform3D.CreateTranslation(new Vector3D(7, 0, 5))));
var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(root, BuildReplay("box")));
@@ -41,7 +41,7 @@ public sealed class CirBrepMaterializerTests
[Fact]
public void MaterializerRegistry_RejectionDiagnostics_ListRejectedStrategies()
{
- var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(new CirUnionNode(new CirBoxNode(1, 1, 1), new CirBoxNode(1, 1, 1)), null));
+ var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(new SdfUnionNode(new SdfBoxNode(1, 1, 1), new SdfBoxNode(1, 1, 1)), null));
Assert.False(result.IsSuccess);
Assert.Equal("no-strategy-matched", result.UnsupportedReason);
@@ -52,7 +52,7 @@ public sealed class CirBrepMaterializerTests
[Fact]
public void ReplayGuided_Mismatch_IsDiagnosed()
{
- var root = new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirBoxNode(6, 20, 10));
+ var root = new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfBoxNode(6, 20, 10));
var mismatchReplay = BuildReplay("cylinder");
var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(root, mismatchReplay));
@@ -64,7 +64,7 @@ public sealed class CirBrepMaterializerTests
[Fact]
public void CirMaterializer_BoxMinusTorus_FailsWithPreciseUnsupported()
{
- var root = new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTorusNode(8, 2));
+ var root = new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTorusNode(8, 2));
var replay = BuildReplay("torus");
var result = CirBrepMaterializer.TryMaterialize(new CirBrepMaterializer.CirBrepMaterializerContext(root, replay));
Assert.False(result.IsSuccess);
diff --git a/Aetheris.Kernel.Firmament.Tests/CombinedPatchBodyRemapperTests.cs b/Aetheris.Kernel.Firmament.Tests/CombinedPatchBodyRemapperTests.cs
index 36428998..52f03b33 100644
--- a/Aetheris.Kernel.Firmament.Tests/CombinedPatchBodyRemapperTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CombinedPatchBodyRemapperTests.cs
@@ -56,7 +56,7 @@ public sealed class CombinedPatchBodyRemapperTests
private static (PlanarSurfaceMaterializer.PlanarPatchSetMaterializationResult planar, SurfaceMaterializationResult? cyl) BuildRealPath()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var gen = FacePatchCandidateGenerator.Generate(root);
var c = gen.Candidates.SingleOrDefault(x => x.SourceSurface.Family == SurfacePatchFamily.Cylindrical && x.RetentionRole == FacePatchRetentionRole.ToolBoundaryRetainedInsideBase);
diff --git a/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryExecutorTests.cs
index 46f23dac..a34a4e85 100644
--- a/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryExecutorTests.cs
@@ -43,7 +43,7 @@ public sealed class CounterboreRecoveryExecutorTests
[Fact]
public void CounterboreExecutor_ThroughHoleStillWorks()
{
- var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(3, 20))));
+ var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(3, 20))));
var plan = Assert.IsType<HoleRecoveryPlan>(eval.Plan);
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
@@ -72,8 +72,8 @@ public sealed class CounterboreRecoveryExecutorTests
Assert.Contains(result.Diagnostics, d => d.Contains("No STEP export attempted", StringComparison.Ordinal));
}
- private static CirNode BuildCanonicalCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCanonicalCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryStepSmokeTests.cs b/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryStepSmokeTests.cs
index 912477ad..9993937f 100644
--- a/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryStepSmokeTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CounterboreRecoveryStepSmokeTests.cs
@@ -48,7 +48,7 @@ public sealed class CounterboreRecoveryStepSmokeTests
[Fact]
public void CounterboreStepSmoke_ThroughHoleRegressionStillExports()
{
- var pipeline = RecoverAndExport(new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirCylinderNode(2d, 20d)), "v7c-through-hole-regression");
+ var pipeline = RecoverAndExport(new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfCylinderNode(2d, 20d)), "v7c-through-hole-regression");
Assert.Equal(FrepMaterializerDecisionStatus.Selected, pipeline.Decision.Status);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, pipeline.Execution.Status);
@@ -79,7 +79,7 @@ public sealed class CounterboreRecoveryStepSmokeTests
Assert.Contains("CYLINDRICAL_SURFACE", pipeline.StepResult.Value, StringComparison.Ordinal);
}
- private static CounterboreRecoveryStepPipelineResult RecoverAndExport(CirNode root, string productName)
+ private static CounterboreRecoveryStepPipelineResult RecoverAndExport(SdfNode root, string productName)
{
var diagnostics = new List<string>();
var decision = FrepMaterializerPlanner.Decide(new FrepMaterializerContext(root), [Policy]);
@@ -117,22 +117,22 @@ public sealed class CounterboreRecoveryStepSmokeTests
return new(decision, plan, execution, stepResult, diagnostics);
}
- private static CirNode BuildCanonicalCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 20d)),
- new CirTransformNode(new CirCylinderNode(4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
-
- private static CirNode BuildTranslatedCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(24d, 24d, 12d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 6d))),
- new CirTransformNode(new CirCylinderNode(3d, 20d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 6d)))),
- new CirTransformNode(new CirCylinderNode(5d, 4d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 2d))));
-
- private static CirNode BuildNonCoaxialCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 20d)),
- new CirTransformNode(new CirCylinderNode(4d, 4d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, -3d))));
+ private static SdfNode BuildCanonicalCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 20d)),
+ new SdfTransformNode(new SdfCylinderNode(4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -3d))));
+
+ private static SdfNode BuildTranslatedCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(24d, 24d, 12d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 6d))),
+ new SdfTransformNode(new SdfCylinderNode(3d, 20d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 6d)))),
+ new SdfTransformNode(new SdfCylinderNode(5d, 4d), Transform3D.CreateTranslation(new Vector3D(5d, 1d, 2d))));
+
+ private static SdfNode BuildNonCoaxialCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 20d)),
+ new SdfTransformNode(new SdfCylinderNode(4d, 4d), Transform3D.CreateTranslation(new Vector3D(1d, 0d, -3d))));
private sealed record CounterboreRecoveryStepPipelineResult(
FrepMaterializerDecision Decision,
diff --git a/Aetheris.Kernel.Firmament.Tests/CounterboreVariantTests.cs b/Aetheris.Kernel.Firmament.Tests/CounterboreVariantTests.cs
index 735fc3d0..ec9dd385 100644
--- a/Aetheris.Kernel.Firmament.Tests/CounterboreVariantTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CounterboreVariantTests.cs
@@ -24,7 +24,7 @@ public sealed class CounterboreVariantTests
[Fact]
public void CounterboreVariant_RejectsSimpleThroughHole()
{
- var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))));
+ var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))));
Assert.True(eval.Admissible);
Assert.Contains("selected-variant:ThroughHoleVariant", eval.Evidence);
}
@@ -32,9 +32,9 @@ public sealed class CounterboreVariantTests
[Fact]
public void CounterboreVariant_RejectsNonCoaxialCylinders()
{
- var root = new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(1, 0, -3))));
+ var root = new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(1, 0, -3))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.DoesNotContain("selected-variant:CounterboreVariant", eval.Evidence);
Assert.Contains("coaxial", string.Join("|", eval.EvaluationsFor(nameof(CounterboreVariant))).ToLowerInvariant());
@@ -55,7 +55,7 @@ public sealed class CounterboreVariantTests
[Fact]
public void CounterboreVariant_RejectsLargeRadiusNotGreaterThanSmall()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(3, 20)), new CirTransformNode(new CirCylinderNode(3, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(3, 20)), new SdfTransformNode(new SdfCylinderNode(3, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.Contains("radius", string.Join("|", eval.EvaluationsFor(nameof(CounterboreVariant))).ToLowerInvariant());
}
@@ -63,7 +63,7 @@ public sealed class CounterboreVariantTests
[Fact]
public void CounterboreVariant_RejectsLargeCylinderThroughFullDepth()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirCylinderNode(4, 20));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfCylinderNode(4, 20));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.Contains("not a counterbore relief", string.Join("|", eval.EvaluationsFor(nameof(CounterboreVariant))).ToLowerInvariant());
}
@@ -71,15 +71,15 @@ public sealed class CounterboreVariantTests
[Fact]
public void CounterboreVariant_RejectsSmallCylinderNotThrough()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 6)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 6)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.DoesNotContain("selected-variant:CounterboreVariant", eval.Evidence);
}
- private static CirNode BuildCanonicalCounterbore()
- => new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCanonicalCounterbore()
+ => new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
}
internal static class HoleRecoveryPolicyEvalExtensions
diff --git a/Aetheris.Kernel.Firmament.Tests/CountersinkVariantAndExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/CountersinkVariantAndExecutorTests.cs
index e947bd41..16cd1da4 100644
--- a/Aetheris.Kernel.Firmament.Tests/CountersinkVariantAndExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/CountersinkVariantAndExecutorTests.cs
@@ -22,8 +22,8 @@ public sealed class CountersinkVariantAndExecutorTests
[Fact]
public void CountersinkVariant_RejectsNonCoaxialConeCylinder()
{
- var cone = new CirTransformNode(new CirConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(3d, 0d, 3d)));
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), cone);
+ var cone = new SdfTransformNode(new SdfConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(3d, 0d, 3d)));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), cone);
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root));
Assert.Contains(eval.EvaluationsFor(nameof(CountersinkVariant)), d => d.Contains("not coaxial", StringComparison.OrdinalIgnoreCase));
}
@@ -54,9 +54,9 @@ public sealed class CountersinkVariantAndExecutorTests
Assert.DoesNotContain("BREP_WITH_VOIDS", step.Value);
}
- private static CirNode BuildCanonical()
+ private static SdfNode BuildCanonical()
{
- var cone = new CirTransformNode(new CirConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d)));
- return new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 20d)), cone);
+ var cone = new SdfTransformNode(new SdfConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d)));
+ return new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 20d)), cone);
}
}
diff --git a/Aetheris.Kernel.Firmament.Tests/DuplicateEdgeCleanupPlannerTests.cs b/Aetheris.Kernel.Firmament.Tests/DuplicateEdgeCleanupPlannerTests.cs
index 2303d90f..91dc6a0e 100644
--- a/Aetheris.Kernel.Firmament.Tests/DuplicateEdgeCleanupPlannerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/DuplicateEdgeCleanupPlannerTests.cs
@@ -54,7 +54,7 @@ public sealed class DuplicateEdgeCleanupPlannerTests
[Fact]
public void PressureTest_ReportsDuplicateCleanupCandidates()
{
- var result = SurfaceFamilyBoxCylinderPressureTest.Run(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = SurfaceFamilyBoxCylinderPressureTest.Run(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
var stage = result.Stages.Single(s => s.Stage == "DuplicateEdgeCleanup");
Assert.True(stage.Counts.ContainsKey("DuplicateCleanupCandidateCount"));
Assert.Contains(stage.Diagnostics, d => d.Contains("cleanup-mutation-not-implemented", StringComparison.Ordinal));
@@ -63,13 +63,13 @@ public sealed class DuplicateEdgeCleanupPlannerTests
[Fact]
public void PressureTest_ShellStillNotClaimedAfterCleanupPlanning()
{
- var result = SurfaceFamilyBoxCylinderPressureTest.Run(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = SurfaceFamilyBoxCylinderPressureTest.Run(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.False(result.ShellClosureValidated);
}
private static (SurfaceFamilyStitchExecutionResult exec, Aetheris.Kernel.Core.Brep.BrepBody body) RunBoxCylinder()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var cylindrical = EmitCylinder(root);
var maps = planar.Entries.Where(e => e.Emitted).Select(e => e.IdentityMap ?? EmittedTopologyIdentityMap.Empty)
@@ -83,7 +83,7 @@ public sealed class DuplicateEdgeCleanupPlannerTests
return (exec, exec.Body ?? remap.CombinedBody!);
}
- private static SurfaceMaterializationResult? EmitCylinder(CirNode root)
+ private static SurfaceMaterializationResult? EmitCylinder(SdfNode root)
{
var gen = FacePatchCandidateGenerator.Generate(root);
var candidate = gen.Candidates.SingleOrDefault(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical
diff --git a/Aetheris.Kernel.Firmament.Tests/EmittedTokenPairingAnalyzerTests.cs b/Aetheris.Kernel.Firmament.Tests/EmittedTokenPairingAnalyzerTests.cs
index bf9bf5b6..739b3d84 100644
--- a/Aetheris.Kernel.Firmament.Tests/EmittedTokenPairingAnalyzerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/EmittedTokenPairingAnalyzerTests.cs
@@ -59,7 +59,7 @@ public sealed class EmittedTokenPairingAnalyzerTests
[Fact]
public void TokenPairingAnalyzer_RealBoxCylinderPath_ReportsSafeOrPreciseMissing()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var gen = FacePatchCandidateGenerator.Generate(root);
var cylCandidate = gen.Candidates.First(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical && c.RetentionRole == FacePatchRetentionRole.ToolBoundaryRetainedInsideBase);
diff --git a/Aetheris.Kernel.Firmament.Tests/FacePatchCandidateDryRunTests.cs b/Aetheris.Kernel.Firmament.Tests/FacePatchCandidateDryRunTests.cs
index 2685ee5f..430cae8b 100644
--- a/Aetheris.Kernel.Firmament.Tests/FacePatchCandidateDryRunTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FacePatchCandidateDryRunTests.cs
@@ -11,7 +11,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopGrouping_BoxMinusCylinder_GroupsBaseAndToolLoops()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -27,7 +27,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopScaffold_BoxMinusCylinder_ProducesTrimLoopDescriptors()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -45,7 +45,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopScaffold_BoxMinusSphere_ProducesCircularTrimLoopDescriptors()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -67,7 +67,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopScaffold_BoxMinusTorus_ProducesDeferredLoopDiagnostics()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -86,7 +86,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopScaffold_NonSubtract_DoesNotInventLoops()
{
- var root = new CirUnionNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2));
+ var root = new SdfUnionNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -100,7 +100,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void LoopGrouping_DeterministicOrdering()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var first = FacePatchCandidateGenerator.Generate(root);
var second = FacePatchCandidateGenerator.Generate(root);
@@ -112,18 +112,18 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void FacePatchDryRun_UsesSourceSurfaceExtractor()
{
- var root = new CirBoxNode(3, 4, 5);
+ var root = new SdfBoxNode(3, 4, 5);
var extracted = SourceSurfaceExtractor.Extract(root);
- var result = FacePatchCandidateGenerator.Generate(new CirSubtractNode(root, new CirSphereNode(1)));
+ var result = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(root, new SdfSphereNode(1)));
- Assert.Equal(extracted.Descriptors.Count, result.SourceSurfaces.Count(d => d.OwningCirNodeKind == nameof(CirBoxNode)));
+ Assert.Equal(extracted.Descriptors.Count, result.SourceSurfaces.Count(d => d.OwningSdfNodeKind == nameof(SdfBoxNode)));
}
[Fact]
public void FacePatchDryRun_DoesNotClaimTopologyAssembly()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = FacePatchCandidateGenerator.Generate(root);
@@ -134,7 +134,7 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void RetainedLoopBinding_BoxMinusCylinder_RealPipeline_BindsInnerCircle()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = FacePatchCandidateGenerator.Generate(root);
var bound = result.Candidates
@@ -151,8 +151,8 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void RetainedLoopBinding_PlanarCylinder_CreatesInnerCircleGeometry_WithCylindricalEvidence()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, null, BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-1, -1, 0), new Point3D(1, -1, 0), new Point3D(1, 1, 0), new Point3D(-1, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "source", nameof(CirBoxNode), 1, FacePatchOrientationRole.Forward);
- var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, "side", null, new CylindricalSurfaceGeometryEvidence(new Point3D(0, 0, -4), new Vector3D(0, 0, 8), 2d, 8d, new Point3D(0, 0, -4), new Point3D(0, 0, 4)), Transform3D.Identity, "tool", nameof(CirCylinderNode), 2, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, null, BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-1, -1, 0), new Point3D(1, -1, 0), new Point3D(1, 1, 0), new Point3D(-1, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "source", nameof(SdfBoxNode), 1, FacePatchOrientationRole.Forward);
+ var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, "side", null, new CylindricalSurfaceGeometryEvidence(new Point3D(0, 0, -4), new Vector3D(0, 0, 8), 2d, 8d, new Point3D(0, 0, -4), new Point3D(0, 0, 4)), Transform3D.Identity, "tool", nameof(SdfCylinderNode), 2, FacePatchOrientationRole.Forward);
var ok = RetainedLoopGeometryBinder.TryBindCircularLoop(source, opposite, TrimCurveFamily.Circle, RetainedRegionLoopStatus.SpecialCaseReady, isBase: true, out _, out var circular);
@@ -172,10 +172,10 @@ public sealed class FacePatchCandidateDryRunTests
null,
Transform3D.Identity,
"source",
- nameof(CirBoxNode),
+ nameof(SdfBoxNode),
1,
FacePatchOrientationRole.Forward);
- var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, null, null, null, Transform3D.CreateRotationX(Math.PI * 0.5d), "tool", nameof(CirCylinderNode), 2, FacePatchOrientationRole.Forward);
+ var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, null, null, null, Transform3D.CreateRotationX(Math.PI * 0.5d), "tool", nameof(SdfCylinderNode), 2, FacePatchOrientationRole.Forward);
var ok = RetainedLoopGeometryBinder.TryBindCircularLoop(source, opposite, TrimCurveFamily.Circle, RetainedRegionLoopStatus.ExactReady, isBase: true, out var diagnostic, out var circular);
@@ -187,8 +187,8 @@ public sealed class FacePatchCandidateDryRunTests
[Fact]
public void RetainedLoopBinding_DoesNotBypassReadiness()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, null, BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "source", nameof(CirBoxNode), 1, FacePatchOrientationRole.Forward);
- var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, null, null, null, Transform3D.Identity, "tool", nameof(CirCylinderNode), 2, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, null, BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "source", nameof(SdfBoxNode), 1, FacePatchOrientationRole.Forward);
+ var opposite = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, null, null, null, Transform3D.Identity, "tool", nameof(SdfCylinderNode), 2, FacePatchOrientationRole.Forward);
var ok = RetainedLoopGeometryBinder.TryBindCircularLoop(source, opposite, TrimCurveFamily.Circle, RetainedRegionLoopStatus.Deferred, isBase: true, out _, out var circular);
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentCirDifferentialAnalysisTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentCirDifferentialAnalysisTests.cs
index 8b9835b8..5a2aa383 100644
--- a/Aetheris.Kernel.Firmament.Tests/FirmamentCirDifferentialAnalysisTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentCirDifferentialAnalysisTests.cs
@@ -293,7 +293,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
};
entries[^1] = entry;
- var cirVolume = CirAnalyzer.EstimateVolume(lower.Value.Root, cirVolumeResolution);
+ var cirVolume = SdfAnalyzer.EstimateVolume(lower.Value.Root, cirVolumeResolution);
var brepVolume = EstimateBrepVolume(rootBody, brepVolumeResolution, out var unknownCount, out var sampleCount);
var unknownRatio = sampleCount == 0 ? 1d : unknownCount / (double)sampleCount;
entry = entry with
@@ -351,7 +351,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
{
probeCount++;
var resolvedPoint = ResolveProbePoint(probe.Location, cirBounds);
- var cirClass = CirAnalyzer.ClassifyPoint(lower.Value.Root, resolvedPoint).Classification;
+ var cirClass = SdfAnalyzer.ClassifyPoint(lower.Value.Root, resolvedPoint).Classification;
var brepResult = BrepSpatialQueries.ClassifyPoint(rootBody, resolvedPoint);
if (!brepResult.IsSuccess || brepResult.Value == PointContainment.Unknown)
{
@@ -369,7 +369,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
}
var brepInside = brepResult.Value == PointContainment.Inside;
- var cirInside = cirClass == CirPointClassification.Inside;
+ var cirInside = cirClass == SdfPointClassification.Inside;
if (brepInside != cirInside)
{
probeMismatches.Add(new ProbeMismatchMetric(probe.Label, resolvedPoint.ToString(), DescribeProbeLocation(probe.Location), cirClass.ToString(), brepResult.Value.ToString(), false, "primitive convention drift or boolean semantic drift or placement drift"));
@@ -426,7 +426,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
private static BrepBody ResolveComparisonBody(FirmamentPrimitiveExecutionResult execution)
=> execution.ExecutedBooleans.Count > 0 ? execution.ExecutedBooleans.MaxBy(b => b.OpIndex)!.Body : execution.ExecutedPrimitives.MaxBy(p => p.OpIndex)!.Body;
- private static string? FindBoundsMismatch(CirBrepDifferentialCase @case, CirBounds cirBounds, BoundingBox3D brepBounds)
+ private static string? FindBoundsMismatch(CirBrepDifferentialCase @case, SdfBounds cirBounds, BoundingBox3D brepBounds)
{
var cirExtent = cirBounds.Max - cirBounds.Min;
var brepExtent = brepBounds.Max - brepBounds.Min;
@@ -459,7 +459,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
return null;
}
- private static double ComputeBoundsMaxAbsDelta(CirBounds cirBounds, BoundingBox3D brepBounds)
+ private static double ComputeBoundsMaxAbsDelta(SdfBounds cirBounds, BoundingBox3D brepBounds)
{
var cirExtent = cirBounds.Max - cirBounds.Min;
var brepExtent = brepBounds.Max - brepBounds.Min;
@@ -547,7 +547,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
private sealed record DifferentialProbePoint(string Label, ProbeLocation Location, ProbeExpectation Expectation);
- private static Point3D ResolveProbePoint(ProbeLocation location, CirBounds bounds)
+ private static Point3D ResolveProbePoint(ProbeLocation location, SdfBounds bounds)
=> location switch
{
AbsoluteProbeLocation absolute => absolute.Point,
@@ -578,7 +578,7 @@ public sealed class FirmamentCirDifferentialAnalysisTests
private sealed record BoundsCentreOffsetProbeLocation(Vector3D Offset) : ProbeLocation;
- private static BoundsMetric ToBounds(CirBounds bounds) => new(new PointMetric(bounds.Min.X, bounds.Min.Y, bounds.Min.Z), new PointMetric(bounds.Max.X, bounds.Max.Y, bounds.Max.Z));
+ private static BoundsMetric ToBounds(SdfBounds bounds) => new(new PointMetric(bounds.Min.X, bounds.Min.Y, bounds.Min.Z), new PointMetric(bounds.Max.X, bounds.Max.Y, bounds.Max.Z));
private static BoundsMetric ToBounds(BoundingBox3D bounds) => new(new PointMetric(bounds.Min.X, bounds.Min.Y, bounds.Min.Z), new PointMetric(bounds.Max.X, bounds.Max.Y, bounds.Max.Z));
private enum ProbeExpectation
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentCirLoweringTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentCirLoweringTests.cs
index 7d91ba47..19a41bfb 100644
--- a/Aetheris.Kernel.Firmament.Tests/FirmamentCirLoweringTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentCirLoweringTests.cs
@@ -13,7 +13,7 @@ public sealed class FirmamentCirLoweringTests
var lower = FirmamentCirLowerer.Lower(compile.Compilation.Value.PrimitiveLoweringPlan!);
Assert.True(lower.IsSuccess);
- var estimate = CirAnalyzer.EstimateVolume(lower.Value.Root, 40);
+ var estimate = SdfAnalyzer.EstimateVolume(lower.Value.Root, 40);
Assert.InRange(estimate, 13950d, 14850d);
}
@@ -30,8 +30,8 @@ public sealed class FirmamentCirLoweringTests
(bounds.Min.Y + bounds.Max.Y) * 0.5d,
(bounds.Min.Z + bounds.Max.Z) * 0.5d);
- Assert.Equal(CirPointClassification.Inside, CirAnalyzer.ClassifyPoint(lower.Value.Root, center).Classification);
- Assert.Equal(CirPointClassification.Outside, CirAnalyzer.ClassifyPoint(lower.Value.Root, new Point3D(100d, 0d, 0d)).Classification);
+ Assert.Equal(SdfPointClassification.Inside, SdfAnalyzer.ClassifyPoint(lower.Value.Root, center).Classification);
+ Assert.Equal(SdfPointClassification.Outside, SdfAnalyzer.ClassifyPoint(lower.Value.Root, new Point3D(100d, 0d, 0d)).Classification);
}
[Fact]
@@ -41,7 +41,7 @@ public sealed class FirmamentCirLoweringTests
var lower = FirmamentCirLowerer.Lower(compile.Compilation.Value.PrimitiveLoweringPlan!);
Assert.True(lower.IsSuccess);
- var estimate = CirAnalyzer.EstimateVolume(lower.Value.Root, 48);
+ var estimate = SdfAnalyzer.EstimateVolume(lower.Value.Root, 48);
Assert.InRange(estimate, 200d, 400d);
}
diff --git a/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPlannerTests.cs b/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPlannerTests.cs
index 589e75fa..e24e06f8 100644
--- a/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPlannerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPlannerTests.cs
@@ -58,7 +58,7 @@ public sealed class FrepMaterializerPlannerTests
[Fact]
public void Context_IsNodeFirstAndReplayOptional()
{
- var root = new CirBoxNode(1, 2, 3);
+ var root = new SdfBoxNode(1, 2, 3);
var rootOnly = new FrepMaterializerContext(root);
var replay = new NativeGeometryReplayLog([]);
var withReplay = new FrepMaterializerContext(root, replay, "fixture");
@@ -84,7 +84,7 @@ public sealed class FrepMaterializerPlannerTests
Assert.Contains("Selected policy: w.", decision.Diagnostics);
}
- private static FrepMaterializerContext BuildContext() => new(new CirBoxNode(2, 2, 2));
+ private static FrepMaterializerContext BuildContext() => new(new SdfBoxNode(2, 2, 2));
private sealed class FakePolicy(string name, FrepMaterializerPolicyEvaluation evaluation) : IFrepMaterializerPolicy
{
diff --git a/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPolicyCatalogTests.cs b/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPolicyCatalogTests.cs
index 0214d59d..46ff17e6 100644
--- a/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPolicyCatalogTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FrepMaterializerPolicyCatalogTests.cs
@@ -23,7 +23,7 @@ public sealed class FrepMaterializerPolicyCatalogTests
[Fact]
public void Planner_WithDefaultCatalog_SelectsThroughHoleForBoxCylinder()
{
- var context = new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20)));
+ var context = new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20)));
var decision = FrepMaterializerPlanner.Decide(context, FrepMaterializerPolicyCatalog.Default());
Assert.Equal(FrepMaterializerDecisionStatus.Selected, decision.Status);
@@ -33,7 +33,7 @@ public sealed class FrepMaterializerPolicyCatalogTests
[Fact]
public void Planner_WithDefaultCatalog_UsesFallbackForUnsupported()
{
- var context = new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2)));
+ var context = new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2)));
var decision = FrepMaterializerPlanner.Decide(context, FrepMaterializerPolicyCatalog.Default());
Assert.Equal(FrepMaterializerDecisionStatus.Selected, decision.Status);
diff --git a/Aetheris.Kernel.Firmament.Tests/FrepSemanticRecoveryRematerializerTests.cs b/Aetheris.Kernel.Firmament.Tests/FrepSemanticRecoveryRematerializerTests.cs
index 11421836..0c09ccc2 100644
--- a/Aetheris.Kernel.Firmament.Tests/FrepSemanticRecoveryRematerializerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FrepSemanticRecoveryRematerializerTests.cs
@@ -11,7 +11,7 @@ public sealed class FrepSemanticRecoveryRematerializerTests
[Fact]
public void SemanticRecovery_BoxCylinder_ProducesBRepBody()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirCylinderNode(2d, 20d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfCylinderNode(2d, 20d));
var result = FrepSemanticRecoveryRematerializer.TryRecover(root);
Assert.True(result.Succeeded);
@@ -24,9 +24,9 @@ public sealed class FrepSemanticRecoveryRematerializerTests
[Fact]
public void SemanticRecovery_TranslatedBoxCylinder_ProducesBRepBody()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(5d, 2d, 4d))),
- new CirTransformNode(new CirCylinderNode(3d, 16d), Transform3D.CreateTranslation(new Vector3D(4d, 1d, 4d))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(5d, 2d, 4d))),
+ new SdfTransformNode(new SdfCylinderNode(3d, 16d), Transform3D.CreateTranslation(new Vector3D(4d, 1d, 4d))));
var result = FrepSemanticRecoveryRematerializer.TryRecover(root);
@@ -38,7 +38,7 @@ public sealed class FrepSemanticRecoveryRematerializerTests
[Fact]
public void SemanticRecovery_UnsupportedBoxSphere_FallsBackOrRejectsCleanly()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirSphereNode(2d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfSphereNode(2d));
var result = FrepSemanticRecoveryRematerializer.TryRecover(root);
Assert.False(result.Succeeded);
@@ -52,7 +52,7 @@ public sealed class FrepSemanticRecoveryRematerializerTests
[Fact]
public void CirOnlyFallback_DoesNotProduceBrepSuccess()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirSphereNode(2d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfSphereNode(2d));
var result = FrepSemanticRecoveryRematerializer.TryRecover(root);
Assert.False(result.Succeeded);
@@ -78,7 +78,7 @@ public sealed class FrepSemanticRecoveryRematerializerTests
[Fact]
public void SteppedHole_Rematerializer_ProducesBrepBody()
{
- var result = FrepSemanticRecoveryRematerializer.TryRecover(new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,-2)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-3)))));
+ var result = FrepSemanticRecoveryRematerializer.TryRecover(new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,-2)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-3)))));
Assert.True(result.Succeeded);
Assert.NotNull(result.Body);
Assert.Contains(result.Diagnostics, d => d.Contains("executor succeeded", StringComparison.Ordinal));
@@ -88,9 +88,9 @@ public sealed class FrepSemanticRecoveryRematerializerTests
public void ChamferedEntry_Rematerializer_ProducesBrepBody()
{
var result = FrepSemanticRecoveryRematerializer.TryRecover(
- new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5)))));
+ new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5)))));
Assert.True(result.Succeeded);
Assert.NotNull(result.Body);
}
diff --git a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryExecutorPlacementDrivenTests.cs b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryExecutorPlacementDrivenTests.cs
index 7de75a13..799bc603 100644
--- a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryExecutorPlacementDrivenTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryExecutorPlacementDrivenTests.cs
@@ -12,9 +12,9 @@ public sealed class HoleRecoveryExecutorPlacementDrivenTests
{
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy()
.Evaluate(new FrepMaterializerContext(
- new CirSubtractNode(
- new CirBoxNode(20, 20, 10),
- new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))))))
+ new SdfSubtractNode(
+ new SdfBoxNode(20, 20, 10),
+ new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))))))
.Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
@@ -29,9 +29,9 @@ public sealed class HoleRecoveryExecutorPlacementDrivenTests
{
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy()
.Evaluate(new FrepMaterializerContext(
- new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))))))
+ new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))))))
.Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
@@ -44,11 +44,11 @@ public sealed class HoleRecoveryExecutorPlacementDrivenTests
[Fact]
public void PlacementDriven_Countersink_UsesConeSegmentZSpan()
{
- var cone = new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)));
+ var cone = new SdfTransformNode(new SdfConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy()
.Evaluate(new FrepMaterializerContext(
- new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
+ new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
cone)))
.Plan!;
@@ -63,13 +63,13 @@ public sealed class HoleRecoveryExecutorPlacementDrivenTests
[Fact]
public void PlacementDriven_ChamferedEntryTopBottom_UsesConeSegmentZSpan()
{
- var top = new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5))));
+ var top = new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5))));
- var bottom = new CirSubtractNode(
- new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirConeNode(2.8, 2, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, -4.5))));
+ var bottom = new SdfSubtractNode(
+ new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfConeNode(2.8, 2, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, -4.5))));
var topResult = HoleRecoveryExecutor.Execute((HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(top)).Plan!);
var bottomResult = HoleRecoveryExecutor.Execute((HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(bottom)).Plan!);
@@ -113,13 +113,13 @@ public sealed class HoleRecoveryExecutorPlacementDrivenTests
public void PlacementDriven_SteppedPlacementValidatedAndExecutionSucceeds()
{
var eval = new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(
- new CirSubtractNode(
- new CirSubtractNode(
- new CirSubtractNode(
- new CirBoxNode(20, 20, 10),
- new CirCylinderNode(2, 20)),
- new CirTransformNode(new CirCylinderNode(3, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, -2)))),
- new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))))));
+ new SdfSubtractNode(
+ new SdfSubtractNode(
+ new SdfSubtractNode(
+ new SdfBoxNode(20, 20, 10),
+ new SdfCylinderNode(2, 20)),
+ new SdfTransformNode(new SdfCylinderNode(3, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, -2)))),
+ new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))))));
var result = HoleRecoveryExecutor.Execute((HoleRecoveryPlan)eval.Plan!);
diff --git a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPlacementSemanticsTests.cs b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPlacementSemanticsTests.cs
index 57b5c2a2..5cb8ce36 100644
--- a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPlacementSemanticsTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPlacementSemanticsTests.cs
@@ -20,7 +20,7 @@ public sealed class HoleRecoveryPlacementSemanticsTests
[Theory]
[MemberData(nameof(Cases))]
- public void PlacementSemantics_AllSupportedVariants_PopulateExplicitPlacement(string _, CirNode root, HoleKind kind)
+ public void PlacementSemantics_AllSupportedVariants_PopulateExplicitPlacement(string _, SdfNode root, HoleKind kind)
{
var plan = Assert.IsType<HoleRecoveryPlan>(new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan);
Assert.Equal(kind, plan.HoleKind);
@@ -74,12 +74,12 @@ public sealed class HoleRecoveryPlacementSemanticsTests
}
}
- private static CirNode BuildThrough() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20));
- private static CirNode BuildCounterbore() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
- private static CirNode BuildBlindTop() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
- private static CirNode BuildBlindBottom() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
- private static CirNode BuildCountersink() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d, 20d, 10d), new CirCylinderNode(2d, 20d)), new CirTransformNode(new CirConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
- private static CirNode BuildChamferTop() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 4.5d))));
- private static CirNode BuildChamferBottom() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20d,20d,10d), new CirCylinderNode(2d,20d)), new CirTransformNode(new CirConeNode(2.8d, 2d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d))));
- private static CirNode BuildStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,-2)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-3))));
+ private static SdfNode BuildThrough() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20));
+ private static SdfNode BuildCounterbore() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildBlindTop() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ private static SdfNode BuildBlindBottom() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCountersink() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d, 20d, 10d), new SdfCylinderNode(2d, 20d)), new SdfTransformNode(new SdfConeNode(2d, 4d, 4d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 3d))));
+ private static SdfNode BuildChamferTop() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(2d, 2.8d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, 4.5d))));
+ private static SdfNode BuildChamferBottom() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20d,20d,10d), new SdfCylinderNode(2d,20d)), new SdfTransformNode(new SdfConeNode(2.8d, 2d, 1d), Transform3D.CreateTranslation(new Vector3D(0d, 0d, -4.5d))));
+ private static SdfNode BuildStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,-2)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,-3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyCoverageMatrixTests.cs b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyCoverageMatrixTests.cs
index 0f280381..8a66dcd4 100644
--- a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyCoverageMatrixTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyCoverageMatrixTests.cs
@@ -9,7 +9,7 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
{
private readonly HoleRecoveryPolicy _policy = new();
- public static TheoryData<string, CirNode, string, HoleKind, HoleDepthKind, FrepMaterializerCapability> SupportedRows =>
+ public static TheoryData<string, SdfNode, string, HoleKind, HoleDepthKind, FrepMaterializerCapability> SupportedRows =>
new()
{
{ "ThroughHole", BuildThroughHole(), nameof(ThroughHoleVariant), HoleKind.Through, HoleDepthKind.Through, FrepMaterializerCapability.ExactBRep },
@@ -22,18 +22,18 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
{ "SteppedHole", BuildSteppedHole(), nameof(SteppedHoleVariant), HoleKind.Stepped, HoleDepthKind.ThroughWithEntryRelief, FrepMaterializerCapability.ExactBRep }
};
- public static TheoryData<string, CirNode> UnsupportedRows =>
+ public static TheoryData<string, SdfNode> UnsupportedRows =>
new()
{
- { "BoxSphere", new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirSphereNode(3)) },
- { "TangentCylinder", new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(10, 20), Transform3D.CreateTranslation(new Vector3D(0,0,0)))) },
- { "UnsupportedTransform", new CirSubtractNode(new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateRotationX(Math.PI / 6d)), new CirCylinderNode(2, 20)) },
- { "NonCoaxialCounterboreOrCountersink", new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(2,0,-3)))) }
+ { "BoxSphere", new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfSphereNode(3)) },
+ { "TangentCylinder", new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(10, 20), Transform3D.CreateTranslation(new Vector3D(0,0,0)))) },
+ { "UnsupportedTransform", new SdfSubtractNode(new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateRotationX(Math.PI / 6d)), new SdfCylinderNode(2, 20)) },
+ { "NonCoaxialCounterboreOrCountersink", new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(2,0,-3)))) }
};
[Theory]
[MemberData(nameof(SupportedRows))]
- public void HoleCoverageMatrix_SelectsExpectedVariantForSupportedCases(string _, CirNode root, string expectedVariant, HoleKind kind, HoleDepthKind depth, FrepMaterializerCapability capability)
+ public void HoleCoverageMatrix_SelectsExpectedVariantForSupportedCases(string _, SdfNode root, string expectedVariant, HoleKind kind, HoleDepthKind depth, FrepMaterializerCapability capability)
{
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
Assert.True(eval.Admissible);
@@ -47,7 +47,7 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
[Theory]
[MemberData(nameof(UnsupportedRows))]
- public void HoleCoverageMatrix_UnsupportedCasesFallBackOrReject(string _, CirNode root)
+ public void HoleCoverageMatrix_UnsupportedCasesFallBackOrReject(string _, SdfNode root)
{
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
Assert.False(eval.Admissible);
@@ -58,7 +58,7 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
[Theory]
[MemberData(nameof(SupportedRows))]
- public void HoleCoverageMatrix_WrongVariantsRejectSupportedCases(string rowName, CirNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
+ public void HoleCoverageMatrix_WrongVariantsRejectSupportedCases(string rowName, SdfNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
{
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
Assert.True(eval.Admissible);
@@ -97,7 +97,7 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
[Theory]
[MemberData(nameof(SupportedRows))]
- public void HoleCoverageMatrix_ExecutableVariantsProduceBRep(string rowName, CirNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
+ public void HoleCoverageMatrix_ExecutableVariantsProduceBRep(string rowName, SdfNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
{
Assert.False(string.IsNullOrWhiteSpace(rowName));
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
@@ -125,7 +125,7 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
[Theory]
[MemberData(nameof(SupportedRows))]
- public void HoleCoverageMatrix_CurrentHoleVariantsAreManifoldNotVoids(string rowName, CirNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
+ public void HoleCoverageMatrix_CurrentHoleVariantsAreManifoldNotVoids(string rowName, SdfNode root, string expectedVariant, HoleKind expectedHoleKind, HoleDepthKind expectedDepthKind, FrepMaterializerCapability expectedCapability)
{
Assert.False(string.IsNullOrWhiteSpace(rowName));
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
@@ -155,12 +155,12 @@ public sealed class HoleRecoveryPolicyCoverageMatrixTests
Assert.DoesNotContain("BREP_WITH_VOIDS", step.Value, StringComparison.Ordinal);
}
- private static CirNode BuildThroughHole() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20));
- private static CirNode BuildBlindHoleTop() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
- private static CirNode BuildBlindHoleBottom() => new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
- private static CirNode BuildCounterbore() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
- private static CirNode BuildCountersink() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
- private static CirNode BuildChamferedEntry() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5))));
- private static CirNode BuildChamferedEntryBottom() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirConeNode(2.8, 2, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, -4.5))));
- private static CirNode BuildSteppedHole() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
+ private static SdfNode BuildThroughHole() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20));
+ private static SdfNode BuildBlindHoleTop() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ private static SdfNode BuildBlindHoleBottom() => new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCounterbore() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildCountersink() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ private static SdfNode BuildChamferedEntry() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfConeNode(2, 2.8, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, 4.5))));
+ private static SdfNode BuildChamferedEntryBottom() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfConeNode(2.8, 2, 1), Transform3D.CreateTranslation(new Vector3D(0, 0, -4.5))));
+ private static SdfNode BuildSteppedHole() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyTests.cs b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyTests.cs
index 0bb63df7..08ac5a55 100644
--- a/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/HoleRecoveryPolicyTests.cs
@@ -11,7 +11,7 @@ public sealed class HoleRecoveryPolicyTests
[Fact]
public void HolePolicy_DirectBoxCylinder_SelectsThroughHoleVariant()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))));
Assert.True(eval.Admissible);
Assert.Contains("selected-variant:ThroughHoleVariant", eval.Evidence);
var plan = Assert.IsType<HoleRecoveryPlan>(eval.Plan);
@@ -23,7 +23,7 @@ public sealed class HoleRecoveryPolicyTests
[Fact]
public void HolePolicy_TranslatedBoxCylinder_SelectsThroughHoleVariant()
{
- var root = new CirSubtractNode(new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))), new CirTransformNode(new CirCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
+ var root = new SdfSubtractNode(new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))), new SdfTransformNode(new SdfCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
Assert.True(eval.Admissible);
Assert.Contains("translation-wrapper-supported", eval.Evidence);
@@ -32,7 +32,7 @@ public sealed class HoleRecoveryPolicyTests
[Fact]
public void HolePolicy_BlindCylinder_RejectedByVariant()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8))));
Assert.False(eval.Admissible);
Assert.Contains(eval.RejectionReasons, r => r.Contains("UnsupportedNotThroughHole", StringComparison.Ordinal));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/MaterializationReadinessAnalyzerTests.cs b/Aetheris.Kernel.Firmament.Tests/MaterializationReadinessAnalyzerTests.cs
index 37df97cd..808236b4 100644
--- a/Aetheris.Kernel.Firmament.Tests/MaterializationReadinessAnalyzerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/MaterializationReadinessAnalyzerTests.cs
@@ -10,7 +10,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_BoxMinusCylinder_IsEvidenceReadyOrSpecialReady()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.True(report.SourceSurfaceCount > 0);
Assert.True(report.CandidateCount > 0);
@@ -24,7 +24,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_BoxMinusSphere_NotGenericUnsupported()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3)));
Assert.Contains(report.Diagnostics, d => d.Contains("planar/spherical => circle exact", StringComparison.Ordinal));
Assert.NotEqual(EmissionReadiness.Unsupported, report.OverallReadiness);
@@ -34,7 +34,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_BoxMinusTorus_BlockedByTrimCapability()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1)));
Assert.Contains(EmissionBlockingReason.TrimCapability, report.BlockingReasons);
Assert.Contains(report.Diagnostics, d => d.Contains("planar/toroidal deferred", StringComparison.Ordinal));
@@ -44,7 +44,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_NonSubtract_NotApplicable()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirUnionNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfUnionNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2)));
Assert.Equal(EmissionReadiness.NotApplicable, report.OverallReadiness);
Assert.Contains(EmissionBlockingReason.NonSubtractNotApplicable, report.BlockingReasons);
@@ -53,7 +53,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_CountsAreDeterministic()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3));
var first = MaterializationReadinessAnalyzer.Analyze(root);
var second = MaterializationReadinessAnalyzer.Analyze(root);
@@ -71,7 +71,7 @@ public sealed class MaterializationReadinessAnalyzerTests
[Fact]
public void Readiness_DoesNotEmitBRepTopology()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.False(report.TopologyEmissionImplemented);
Assert.Contains(report.LayerSummaries, l => l.LayerName == "pairing-evidence");
diff --git a/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeExecutorTests.cs
index e3b6509d..afdbc3d9 100644
--- a/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeExecutorTests.cs
@@ -52,5 +52,5 @@ public sealed class ProfileStackExtrudeExecutorTests
Assert.DoesNotContain(result.Diagnostics, d => d.Contains("repeated-subtract", StringComparison.Ordinal));
}
- private static CirNode BuildStepped() => new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
+ private static SdfNode BuildStepped() => new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfCylinderNode(3,6), Transform3D.CreateTranslation(new Vector3D(0,0,2)))), new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3))));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs
index 3c19d061..59ccbd5f 100644
--- a/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ProfileStackExtrudeHoleFamilyMigrationTests.cs
@@ -12,7 +12,7 @@ public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
[Fact]
public void ProfileStack_ThroughHole_UsesProfileHoleExtrudeRoute()
{
- var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)))).Plan!;
+ var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)))).Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
Assert.Contains("v2-v2-profile-hole-extrude-attempted", result.Diagnostics);
@@ -41,7 +41,7 @@ public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
[Fact]
public void ProfileStack_ThroughHole_OffCenter_UsesProfileHoleExtrudeRoute()
{
- var root = new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, -2, 0))));
+ var root = new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, -2, 0))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
@@ -52,7 +52,7 @@ public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
[Fact]
public void ProfileStack_BlindHole_UsesProfileStackExecutorOrReportsPreciseBlocker()
{
- var root = new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ var root = new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
@@ -65,7 +65,7 @@ public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
[Fact]
public void ProfileStack_Counterbore_UsesProfileStackExecutor()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
@@ -76,7 +76,7 @@ public sealed class ProfileStackExtrudeHoleFamilyMigrationTests
[Fact]
public void ProfileStack_Countersink_RemainsConeBooleanRoute()
{
- var root = new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)), new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
+ var root = new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)), new SdfTransformNode(new SdfConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3))));
var plan = (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(root)).Plan!;
var result = HoleRecoveryExecutor.Execute(plan);
Assert.Equal(HoleRecoveryExecutionStatus.Succeeded, result.Status);
diff --git a/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapAnalyzerTests.cs b/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapAnalyzerTests.cs
index 0d565a3a..ec9983a7 100644
--- a/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapAnalyzerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapAnalyzerTests.cs
@@ -10,7 +10,7 @@ public sealed class RestrictedContourSnapAnalyzerTests
[Fact]
public void Snap_BoxFaceVsCylinder_ProducesCircleCandidate()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20)), 65);
var result = RestrictedContourSnapAnalyzer.Analyze(stitched, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
var candidate = Assert.Single(result.Candidates, c => c.Kind == RestrictedContourSnapKind.Circle && c.Status == RestrictedContourSnapStatus.Candidate);
var p = Assert.IsType<CircleSnapParameters2D>(candidate.Parameters);
@@ -22,7 +22,7 @@ public sealed class RestrictedContourSnapAnalyzerTests
[Fact]
public void Snap_BoxFaceVsSphere_ProducesCircleCandidate()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 65);
var result = RestrictedContourSnapAnalyzer.Analyze(stitched, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
Assert.Contains(result.Candidates, c => c.Kind == RestrictedContourSnapKind.Circle && c.Status == RestrictedContourSnapStatus.Candidate);
}
@@ -30,7 +30,7 @@ public sealed class RestrictedContourSnapAnalyzerTests
[Fact]
public void Snap_BoxFaceVsTorus_RejectsOrDefersNonCircularCandidate()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1)), 65);
var result = RestrictedContourSnapAnalyzer.Analyze(stitched, new RestrictedContourSnapOptions(0.01d, 0.01d, 8));
var circles = result.Candidates.Where(c => c.Kind == RestrictedContourSnapKind.Circle).ToArray();
Assert.True(circles.Length == 0 || circles.All(c => c.Status != RestrictedContourSnapStatus.Candidate || c.Diagnostics.Contains("snap-candidate-only:not-exact-trim")));
@@ -53,7 +53,7 @@ public sealed class RestrictedContourSnapAnalyzerTests
[Fact]
public void Snap_DeterministicResults()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 65);
var options = new RestrictedContourSnapOptions(0.06d, 0.02d, 8);
var a = RestrictedContourSnapAnalyzer.Analyze(stitched, options);
var b = RestrictedContourSnapAnalyzer.Analyze(stitched, options);
@@ -70,7 +70,7 @@ public sealed class RestrictedContourSnapAnalyzerTests
Assert.Contains(result.Candidates, c => c.Status == RestrictedContourSnapStatus.Rejected && c.Diagnostics.Any(d => d.StartsWith("snap-rejected-too-few-points:")));
}
- private static SurfaceTrimContourStitchResult BuildStitched(CirSubtractNode root, int resolution)
+ private static SurfaceTrimContourStitchResult BuildStitched(SdfSubtractNode root, int resolution)
{
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
diff --git a/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapSelectionTests.cs b/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapSelectionTests.cs
index 985b66b9..1f4ee1ee 100644
--- a/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapSelectionTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/RestrictedContourSnapSelectionTests.cs
@@ -10,7 +10,7 @@ public sealed class RestrictedContourSnapSelectionTests
[Fact]
public void SnapSelection_BoxFaceVsCylinder_SelectsCircleCandidate()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20)), 65);
var options = new RestrictedContourSnapOptions(0.06d, 0.02d, 8);
var analysis = RestrictedContourSnapAnalyzer.Analyze(stitched, options);
var selected = RestrictedContourSnapSelector.Select(stitched, analysis, options);
@@ -25,7 +25,7 @@ public sealed class RestrictedContourSnapSelectionTests
[Fact]
public void SnapSelection_BoxFaceVsSphere_SelectsCircleCandidate()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 65);
var options = new RestrictedContourSnapOptions(0.06d, 0.02d, 8);
var selected = RestrictedContourSnapSelector.Select(stitched, RestrictedContourSnapAnalyzer.Analyze(stitched, options), options);
Assert.Equal(RestrictedContourSnapRouteKind.AnalyticCircle, selected.SelectedRoute);
@@ -51,7 +51,7 @@ public sealed class RestrictedContourSnapSelectionTests
[Fact]
public void SnapSelection_Torus_DoesNotClaimGenericExactness()
{
- var stitched = BuildStitched(new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1)), 65);
+ var stitched = BuildStitched(new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1)), 65);
var options = new RestrictedContourSnapOptions(0.01d, 0.01d, 8);
var selected = RestrictedContourSnapSelector.Select(stitched, RestrictedContourSnapAnalyzer.Analyze(stitched, options), options);
Assert.Contains(selected.Diagnostics, d => d == "snap-selection-torus-generic-exactness-not-implied");
@@ -94,7 +94,7 @@ public sealed class RestrictedContourSnapSelectionTests
Assert.Contains(selected.CandidateTraces, t => !t.Admissible && !string.IsNullOrWhiteSpace(t.RejectionReason));
}
- private static SurfaceTrimContourStitchResult BuildStitched(CirSubtractNode root, int resolution)
+ private static SurfaceTrimContourStitchResult BuildStitched(SdfSubtractNode root, int resolution)
{
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
diff --git a/Aetheris.Kernel.Firmament.Tests/RetainedLoopTrimOracleIntegrationTests.cs b/Aetheris.Kernel.Firmament.Tests/RetainedLoopTrimOracleIntegrationTests.cs
index 6152a5c8..91fb53b8 100644
--- a/Aetheris.Kernel.Firmament.Tests/RetainedLoopTrimOracleIntegrationTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/RetainedLoopTrimOracleIntegrationTests.cs
@@ -10,7 +10,7 @@ public sealed class RetainedLoopTrimOracleIntegrationTests
[Fact]
public void OracleTrimSelectedField_BoxCylinder_UsesSelectedCylinderField()
{
- var result = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10,10,10), new CirCylinderNode(2,20)));
+ var result = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfCylinderNode(2,20)));
var loop = result.Candidates.SelectMany(c => c.RetainedRegionLoops).First(l => l.OracleTrimRepresentation is not null && l.OracleTrimStrongEvidence);
Assert.Equal("oracle-trim: selected-opposite-field-used", loop.OracleTrimRoutingDiagnostic);
Assert.Equal(TieredTrimRepresentationKind.AnalyticCircle, loop.OracleTrimRepresentation!.Kind);
@@ -21,7 +21,7 @@ public sealed class RetainedLoopTrimOracleIntegrationTests
[Fact]
public void OracleTrimSelectedField_CylinderMatchesBroadSimpleCase()
{
- var result = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10,10,10), new CirCylinderNode(2,20)));
+ var result = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfCylinderNode(2,20)));
var loop = result.Candidates.SelectMany(c => c.RetainedRegionLoops).First(l => l.OracleTrimStrongEvidence);
Assert.NotNull(loop.OracleTrimRepresentation?.Circle);
Assert.True(loop.OracleTrimRepresentation!.Circle!.RadiusUV > 0d);
@@ -30,7 +30,7 @@ public sealed class RetainedLoopTrimOracleIntegrationTests
[Fact]
public void OracleTrimSelectedField_BoxSphere_DefersOrUsesSelectedSphereField()
{
- var result = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10,10,10), new CirSphereNode(6)));
+ var result = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfSphereNode(6)));
Assert.Contains(result.Candidates.SelectMany(c => c.RetainedRegionLoops), l => l.OracleTrimRoutingDiagnostic.Contains("selected-opposite-field-deferred:selected-opposite-field: sphere-geometry-missing", StringComparison.Ordinal));
Assert.DoesNotContain(result.Candidates.SelectMany(c => c.RetainedRegionLoops), l => l.OracleTrimStrongEvidence && l.OppositeSurfaceFamily == SurfacePatchFamily.Spherical);
}
@@ -38,14 +38,14 @@ public sealed class RetainedLoopTrimOracleIntegrationTests
[Fact]
public void OracleTrimSelectedField_BoxTorus_DefersOrUsesSelectedTorusFieldWithoutGenericExactness()
{
- var result = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(12,12,12), new CirTorusNode(4,1)));
+ var result = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(12,12,12), new SdfTorusNode(4,1)));
Assert.Contains(result.Candidates.SelectMany(c => c.RetainedRegionLoops), l => l.OracleTrimRoutingDiagnostic.Contains("selected-opposite-field-deferred:selected-opposite-field: torus-geometry-missing", StringComparison.Ordinal));
}
[Fact]
public void OracleTrimSelectedField_MultipleOpposites_StillDefers()
{
- var root = new CirSubtractNode(new CirBoxNode(10,10,10), new CirUnionNode(new CirCylinderNode(2,20), new CirCylinderNode(2,20)));
+ var root = new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfUnionNode(new SdfCylinderNode(2,20), new SdfCylinderNode(2,20)));
var result = FacePatchCandidateGenerator.Generate(root);
Assert.Contains(result.Candidates.SelectMany(c => c.RetainedRegionLoops), l => l.OracleTrimRoutingDiagnostic == "oracle-trim: multiple-opposite-sources-deferred");
}
@@ -53,7 +53,7 @@ public sealed class RetainedLoopTrimOracleIntegrationTests
[Fact]
public void MaterializationReadiness_ReportsSelectedFieldVsDeferred()
{
- var report = MaterializationReadinessAnalyzer.Analyze(new CirSubtractNode(new CirBoxNode(10,10,10), new CirCylinderNode(2,20)));
+ var report = MaterializationReadinessAnalyzer.Analyze(new SdfSubtractNode(new SdfBoxNode(10,10,10), new SdfCylinderNode(2,20)));
var layer = report.LayerSummaries.Single(l => l.LayerName == "trim-oracle-evidence");
Assert.True(layer.Counts.ContainsKey("strong-trim-oracle"));
Assert.True(layer.Counts.ContainsKey("selected-field-deferred-trim-oracle"));
diff --git a/Aetheris.Kernel.Firmament.Tests/ShellStitchingDryRunTests.cs b/Aetheris.Kernel.Firmament.Tests/ShellStitchingDryRunTests.cs
index c4340a57..9b60a4bc 100644
--- a/Aetheris.Kernel.Firmament.Tests/ShellStitchingDryRunTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ShellStitchingDryRunTests.cs
@@ -10,7 +10,7 @@ public sealed class ShellStitchingDryRunTests
[Fact]
public void ShellStitching_BoxMinusCylinder_AccountsForCylindricalSeam()
{
- var result = ShellStitchingDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = ShellStitchingDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.Contains(result.SeamClosureEvidence, e => e.SeamKind == SeamKind.CylindricalSelfSeam || e.SeamKind == SeamKind.SeamDeferred);
Assert.True(result.SeamClosureEvidence.Any(e => e.SeamKind == SeamKind.CylindricalSelfSeam)
@@ -20,7 +20,7 @@ public sealed class ShellStitchingDryRunTests
[Fact]
public void ShellStitching_BoxMinusCylinder_ChecksOrientationCompatibility()
{
- var result = ShellStitchingDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = ShellStitchingDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.NotEmpty(result.OrientationEvidence);
Assert.All(result.OrientationEvidence, e => Assert.True(
@@ -30,7 +30,7 @@ public sealed class ShellStitchingDryRunTests
[Fact]
public void ShellStitching_BoxMinusCylinder_ReclassifiesExpectedSeamBoundaries()
{
- var result = ShellStitchingDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = ShellStitchingDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
if (result.SeamClosureEvidence.Any(e => e.SeamKind == SeamKind.CylindricalSelfSeam))
{
@@ -41,7 +41,7 @@ public sealed class ShellStitchingDryRunTests
[Fact]
public void ShellStitching_BoxMinusCylinder_ReadinessPromotionIsConservative()
{
- var result = ShellStitchingDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = ShellStitchingDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
if (result.UnpairedBoundaries.Count == 0
&& result.SeamClosureEvidence.All(e => e.Readiness != ShellClosureReadiness.Deferred)
@@ -60,7 +60,7 @@ public sealed class ShellStitchingDryRunTests
[Fact]
public void ShellStitching_DeterministicEvidenceOrdering()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var first = ShellStitchingDryRunPlanner.Generate(root);
var second = ShellStitchingDryRunPlanner.Generate(root);
diff --git a/Aetheris.Kernel.Firmament.Tests/SourceSurfaceAndTrimCapabilityTests.cs b/Aetheris.Kernel.Firmament.Tests/SourceSurfaceAndTrimCapabilityTests.cs
index 12b750b5..c4972292 100644
--- a/Aetheris.Kernel.Firmament.Tests/SourceSurfaceAndTrimCapabilityTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SourceSurfaceAndTrimCapabilityTests.cs
@@ -11,7 +11,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_Box_ProducesSixPlanarDescriptors()
{
- var result = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 20, 30));
+ var result = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 20, 30));
Assert.Equal(6, result.Descriptors.Count);
Assert.All(result.Descriptors, d => Assert.Equal(SurfacePatchFamily.Planar, d.Family));
Assert.Contains(result.Descriptors, d => d.ParameterPayloadReference == "top");
@@ -21,7 +21,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_Cylinder_ProducesSideAndCaps()
{
- var result = SourceSurfaceExtractor.Extract(new CirCylinderNode(5, 20));
+ var result = SourceSurfaceExtractor.Extract(new SdfCylinderNode(5, 20));
Assert.Single(result.Descriptors, d => d.Family == SurfacePatchFamily.Cylindrical);
Assert.Equal(2, result.Descriptors.Count(d => d.Family == SurfacePatchFamily.Planar));
}
@@ -29,7 +29,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_Sphere_ProducesSpherical()
{
- var result = SourceSurfaceExtractor.Extract(new CirSphereNode(5));
+ var result = SourceSurfaceExtractor.Extract(new SdfSphereNode(5));
var descriptor = Assert.Single(result.Descriptors);
Assert.Equal(SurfacePatchFamily.Spherical, descriptor.Family);
}
@@ -37,7 +37,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_Torus_ProducesToroidalDeferredMaterialization()
{
- var result = SourceSurfaceExtractor.Extract(new CirTorusNode(10, 2));
+ var result = SourceSurfaceExtractor.Extract(new SdfTorusNode(10, 2));
var descriptor = Assert.Single(result.Descriptors);
Assert.Equal(SurfacePatchFamily.Toroidal, descriptor.Family);
Assert.Contains(result.Diagnostics, d => d.Code == "torus-materialization-deferred");
@@ -46,7 +46,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_BooleanTree_ExtractsPrimitiveSourceSurfaces()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 10));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 10));
var result = SourceSurfaceExtractor.Extract(root);
Assert.Equal(9, result.Descriptors.Count);
Assert.Contains(result.Diagnostics, d => d.Code == "retention-deferred");
@@ -55,7 +55,7 @@ public sealed class SourceSurfaceAndTrimCapabilityTests
[Fact]
public void SourceSurfaceExtractor_Transform_ComposesIntoDescriptors()
{
- var root = new CirTransformNode(new CirSphereNode(5), Transform3D.CreateTranslation(new Vector3D(1, 2, 3)));
+ var root = new SdfTransformNode(new SdfSphereNode(5), Transform3D.CreateTranslation(new Vector3D(1, 2, 3)));
var result = SourceSurfaceExtractor.Extract(root);
var descriptor = Assert.Single(result.Descriptors);
Assert.Equal(new Point3D(1, 2, 3), descriptor.Transform.Apply(Point3D.Origin));
diff --git a/Aetheris.Kernel.Firmament.Tests/SteppedHoleCorpusHardeningTests.cs b/Aetheris.Kernel.Firmament.Tests/SteppedHoleCorpusHardeningTests.cs
index d37dfbea..47255036 100644
--- a/Aetheris.Kernel.Firmament.Tests/SteppedHoleCorpusHardeningTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SteppedHoleCorpusHardeningTests.cs
@@ -125,10 +125,10 @@ public sealed class SteppedHoleCorpusHardeningTests
public void SteppedHole_DoesNotStealCounterboreBlindThroughCountersink()
{
var policy = new HoleRecoveryPolicy();
- Assert.Contains("selected-variant:ThroughHoleVariant", policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)))).Evidence);
- Assert.Contains("selected-variant:BlindHoleVariant", policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirTransformNode(new CirCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)))))).Evidence);
- Assert.Contains("selected-variant:CounterboreVariant", policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3)))))).Evidence);
- Assert.Contains("selected-variant:CountersinkVariant", policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)))))).Evidence);
+ Assert.Contains("selected-variant:ThroughHoleVariant", policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)))).Evidence);
+ Assert.Contains("selected-variant:BlindHoleVariant", policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfTransformNode(new SdfCylinderNode(2, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)))))).Evidence);
+ Assert.Contains("selected-variant:CounterboreVariant", policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3)))))).Evidence);
+ Assert.Contains("selected-variant:CountersinkVariant", policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfConeNode(2, 4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)))))).Evidence);
}
private static HoleRecoveryPlan GetPlan() => (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped(true))).Plan!;
@@ -150,18 +150,18 @@ public sealed class SteppedHoleCorpusHardeningTests
Assert.DoesNotContain(exec.Diagnostics, d => d.Contains("Stepped subtract", StringComparison.Ordinal));
}
- private static CirNode BuildStepped(bool topEntry, Vector3D? hostTranslation = null, Vector3D? toolTranslation = null, double mediumRadius = 3, double mediumHeight = 6, double largeRadius = 4, double largeHeight = 4)
+ private static SdfNode BuildStepped(bool topEntry, Vector3D? hostTranslation = null, Vector3D? toolTranslation = null, double mediumRadius = 3, double mediumHeight = 6, double largeRadius = 4, double largeHeight = 4)
{
var ht = hostTranslation ?? Vector3D.Zero;
var tt = toolTranslation ?? ht;
- var host = new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(ht));
- var small = new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(tt));
+ var host = new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(ht));
+ var small = new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(tt));
var sign = topEntry ? 1d : -1d;
var mediumZ = tt.Z + sign * (10d - mediumHeight) * 0.5d;
var largeZ = tt.Z + sign * (10d - largeHeight) * 0.5d;
- var medium = new CirTransformNode(new CirCylinderNode(mediumRadius, mediumHeight), Transform3D.CreateTranslation(new Vector3D(tt.X, tt.Y, mediumZ)));
- var large = new CirTransformNode(new CirCylinderNode(largeRadius, largeHeight), Transform3D.CreateTranslation(new Vector3D(tt.X, tt.Y, largeZ)));
- return new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(host, small), medium), large);
+ var medium = new SdfTransformNode(new SdfCylinderNode(mediumRadius, mediumHeight), Transform3D.CreateTranslation(new Vector3D(tt.X, tt.Y, mediumZ)));
+ var large = new SdfTransformNode(new SdfCylinderNode(largeRadius, largeHeight), Transform3D.CreateTranslation(new Vector3D(tt.X, tt.Y, largeZ)));
+ return new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(host, small), medium), large);
}
}
diff --git a/Aetheris.Kernel.Firmament.Tests/SteppedHolePlacementSemanticsTests.cs b/Aetheris.Kernel.Firmament.Tests/SteppedHolePlacementSemanticsTests.cs
index 02509408..aa3e3e40 100644
--- a/Aetheris.Kernel.Firmament.Tests/SteppedHolePlacementSemanticsTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SteppedHolePlacementSemanticsTests.cs
@@ -74,12 +74,12 @@ public sealed class SteppedHolePlacementSemanticsTests
private static HoleRecoveryPlan BuildPlan()
=> (HoleRecoveryPlan)new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped())).Plan!;
- private static CirNode BuildStepped()
+ private static SdfNode BuildStepped()
{
- var host = new CirBoxNode(20, 20, 10);
- var small = new CirCylinderNode(2, 20);
- var medium = new CirTransformNode(new CirCylinderNode(3, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, 2)));
- var large = new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)));
- return new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(host, small), medium), large);
+ var host = new SdfBoxNode(20, 20, 10);
+ var small = new SdfCylinderNode(2, 20);
+ var medium = new SdfTransformNode(new SdfCylinderNode(3, 6), Transform3D.CreateTranslation(new Vector3D(0, 0, 2)));
+ var large = new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, 3)));
+ return new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(host, small), medium), large);
}
}
diff --git a/Aetheris.Kernel.Firmament.Tests/SteppedHoleVariantAndExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/SteppedHoleVariantAndExecutorTests.cs
index 9dc76447..5592d558 100644
--- a/Aetheris.Kernel.Firmament.Tests/SteppedHoleVariantAndExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SteppedHoleVariantAndExecutorTests.cs
@@ -103,18 +103,18 @@ public sealed class SteppedHoleVariantAndExecutorTests
}
[Fact] public void SteppedHoleVariant_DoesNotStealCounterbore() => Assert.Contains("selected-variant:CounterboreVariant", new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildCounterbore())).Evidence);
- [Fact] public void SteppedHoleVariant_DoesNotStealThroughOrBlind() { Assert.Contains("selected-variant:ThroughHoleVariant", new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20,20,10), new CirCylinderNode(2,20)))).Evidence); Assert.Contains("selected-variant:BlindHoleVariant", new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20,20,10), new CirTransformNode(new CirCylinderNode(2,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)))))).Evidence); }
+ [Fact] public void SteppedHoleVariant_DoesNotStealThroughOrBlind() { Assert.Contains("selected-variant:ThroughHoleVariant", new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfCylinderNode(2,20)))).Evidence); Assert.Contains("selected-variant:BlindHoleVariant", new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20,20,10), new SdfTransformNode(new SdfCylinderNode(2,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)))))).Evidence); }
[Fact] public void SteppedHoleVariant_RejectsNonCoaxialCylinders() => Assert.False(new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped(new Vector3D(1,0,-2)))).Admissible);
[Fact] public void SteppedHoleVariant_RejectsInvalidRadiusOrdering() => Assert.False(new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped(mediumRadius:5))).Admissible);
[Fact] public void SteppedHoleVariant_RejectsInvalidDepthOrdering() => Assert.False(new HoleRecoveryPolicy().Evaluate(new FrepMaterializerContext(BuildStepped(mediumHeight:2))).Admissible);
- private static CirNode BuildCounterbore() => new CirSubtractNode(new CirSubtractNode(new CirBoxNode(20, 20, 10), new CirCylinderNode(2, 20)), new CirTransformNode(new CirCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
- private static CirNode BuildStepped(Vector3D? mediumTranslation = null, double mediumRadius = 3, double mediumHeight = 6)
+ private static SdfNode BuildCounterbore() => new SdfSubtractNode(new SdfSubtractNode(new SdfBoxNode(20, 20, 10), new SdfCylinderNode(2, 20)), new SdfTransformNode(new SdfCylinderNode(4, 4), Transform3D.CreateTranslation(new Vector3D(0, 0, -3))));
+ private static SdfNode BuildStepped(Vector3D? mediumTranslation = null, double mediumRadius = 3, double mediumHeight = 6)
{
- var host = new CirBoxNode(20,20,10);
- var small = new CirCylinderNode(2,20);
- var medium = new CirTransformNode(new CirCylinderNode(mediumRadius, mediumHeight), Transform3D.CreateTranslation(mediumTranslation ?? new Vector3D(0,0,2)));
- var large = new CirTransformNode(new CirCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)));
- return new CirSubtractNode(new CirSubtractNode(new CirSubtractNode(host, small), medium), large);
+ var host = new SdfBoxNode(20,20,10);
+ var small = new SdfCylinderNode(2,20);
+ var medium = new SdfTransformNode(new SdfCylinderNode(mediumRadius, mediumHeight), Transform3D.CreateTranslation(mediumTranslation ?? new Vector3D(0,0,2)));
+ var large = new SdfTransformNode(new SdfCylinderNode(4,4), Transform3D.CreateTranslation(new Vector3D(0,0,3)));
+ return new SdfSubtractNode(new SdfSubtractNode(new SdfSubtractNode(host, small), medium), large);
}
}
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyBoxCylinderPressureTestTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyBoxCylinderPressureTestTests.cs
index cb03c1eb..9f3c085e 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyBoxCylinderPressureTestTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyBoxCylinderPressureTestTests.cs
@@ -71,11 +71,11 @@ public sealed class SurfaceFamilyBoxCylinderPressureTestTests
[Fact]
public void PressureTest_RejectsNonCanonicalInput()
{
- var r = SurfaceFamilyBoxCylinderPressureTest.Run(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirBoxNode(2, 2, 2)));
+ var r = SurfaceFamilyBoxCylinderPressureTest.Run(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfBoxNode(2, 2, 2)));
Assert.False(r.Success);
Assert.Contains(r.Blockers, b => b.Code == "unsupported-input-noncanonical");
}
private static SurfaceFamilyBoxCylinderPressureTestResult RunCanonical()
- => SurfaceFamilyBoxCylinderPressureTest.Run(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ => SurfaceFamilyBoxCylinderPressureTest.Run(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
}
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyShellAssemblerTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyShellAssemblerTests.cs
index 1c3d5370..e805cd79 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyShellAssemblerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyShellAssemblerTests.cs
@@ -10,7 +10,7 @@ public sealed class SurfaceFamilyShellAssemblerTests
[Fact]
public void SurfaceFamilyShellAssembler_BoxMinusCylinder_RejectsWhenReadinessDeferred()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
@@ -22,7 +22,7 @@ public sealed class SurfaceFamilyShellAssemblerTests
[Fact]
public void SurfaceFamilyShellAssembler_BoxMinusCylinder_ReportsReadinessBlockerForCanonicalCase()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 12));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 12));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
@@ -37,7 +37,7 @@ public sealed class SurfaceFamilyShellAssemblerTests
[Fact]
public void SurfaceFamilyShellAssembler_BoxMinusCylinder_SummaryIncludesPlanarAndCylindricalFamilies()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 12));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 12));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
@@ -48,7 +48,7 @@ public sealed class SurfaceFamilyShellAssemblerTests
[Fact]
public void ShellAssembler_SeesMatchingPlanarAndCylindricalEmittedTokens()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 12));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 12));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
Assert.Contains(result.Diagnostics, d => d.Contains("planar-inner-circle-token", StringComparison.OrdinalIgnoreCase));
Assert.Contains(result.Diagnostics, d => d.Contains("cylindrical-seam-role-tagged", StringComparison.OrdinalIgnoreCase));
@@ -60,7 +60,7 @@ public sealed class SurfaceFamilyShellAssemblerTests
[Fact]
public void EmittedIdentity_DoesNotExposeUserFacingTopologyNames()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 12));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 12));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
Assert.DoesNotContain(result.Diagnostics, d => d.Contains("firmament selector", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain(result.Diagnostics, d => d.Contains("user-facing topology names", StringComparison.OrdinalIgnoreCase));
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchCandidatePlannerTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchCandidatePlannerTests.cs
index 6b1d69c3..aa99f4b1 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchCandidatePlannerTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchCandidatePlannerTests.cs
@@ -10,7 +10,7 @@ public sealed class SurfaceFamilyStitchCandidatePlannerTests
[Fact]
public void StitchCandidate_BoxCylinder_GeneratesCandidateFromSafeTokenPair()
{
- var result = SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.True(result.Candidates.Count > 0 || result.Diagnostics.Any(d => d.Contains("missing-mate", StringComparison.OrdinalIgnoreCase) || d.Contains("ambiguous", StringComparison.OrdinalIgnoreCase) || d.Contains("incompatible", StringComparison.OrdinalIgnoreCase) || d.Contains("unmapped", StringComparison.OrdinalIgnoreCase)));
}
@@ -89,7 +89,7 @@ public sealed class SurfaceFamilyStitchCandidatePlannerTests
[Fact]
public void StitchCandidate_NoExecution()
{
- var result = SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.False(result.StitchExecutionImplemented);
}
}
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchExecutorTests.cs
index 1ae97774..5ee21af8 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceFamilyStitchExecutorTests.cs
@@ -10,7 +10,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
[Fact]
public void StitchExecutor_BoxCylinder_AppliesOneSharedEdgeRewriteOrPreciseBlocker()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var cylindrical = EmitCylinder(root);
var maps = planar.Entries.Where(e => e.Emitted).Select(e => e.IdentityMap ?? EmittedTopologyIdentityMap.Empty)
@@ -47,7 +47,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
[Fact]
public void StitchExecutor_RequiresRemappedRefs()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var candidate = new SurfaceFamilyStitchCandidate(
"c1",
@@ -78,7 +78,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
"orientation-compatible", [], "a");
var plan = new SurfaceFamilyStitchPlanResult(true, [candidate], [], [], [], false);
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = SurfaceFamilyStitchExecutor.TryExecute(plan, new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root), null);
Assert.Contains(result.Operations.SelectMany(o => o.Diagnostics), d => d.Contains("token-mismatch", StringComparison.Ordinal));
}
@@ -86,7 +86,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
[Fact]
public void StitchExecutor_DoesNotMergeVerticesYet()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = SurfaceFamilyStitchExecutor.TryExecute(
SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(root),
new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root),
@@ -98,7 +98,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
[Fact]
public void StitchExecutor_NoFullShellClaim()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = SurfaceFamilyStitchExecutor.TryExecute(
SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(root),
new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root),
@@ -110,7 +110,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
[Fact]
public void StitchExecutor_NoStepExport()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = SurfaceFamilyStitchExecutor.TryExecute(
SurfaceFamilyStitchCandidatePlanner.PlanBoxCylinder(root),
new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root),
@@ -119,7 +119,7 @@ public sealed class SurfaceFamilyStitchExecutorTests
Assert.False(result.StepExportAttempted);
}
- private static SurfaceMaterializationResult? EmitCylinder(CirNode root)
+ private static SurfaceMaterializationResult? EmitCylinder(SdfNode root)
{
var gen = FacePatchCandidateGenerator.Generate(root);
var candidate = gen.Candidates.SingleOrDefault(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfacePatchDescriptorScaffoldTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfacePatchDescriptorScaffoldTests.cs
index b925b286..a54726f7 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfacePatchDescriptorScaffoldTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfacePatchDescriptorScaffoldTests.cs
@@ -14,7 +14,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
public void SourceSurfaceDescriptor_Box_ProducesSixPlanarDescriptors()
{
var descriptors = Enumerable.Range(0, 6)
- .Select(i => new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, $"box-face-{i}", null, null, Transform3D.Identity, "cir:box", nameof(Aetheris.Continuum.Backends.Sdf.CirBoxNode), 0, FacePatchOrientationRole.Forward))
+ .Select(i => new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, $"box-face-{i}", null, null, Transform3D.Identity, "cir:box", nameof(Aetheris.Continuum.Backends.Sdf.SdfBoxNode), 0, FacePatchOrientationRole.Forward))
.ToArray();
Assert.Equal(6, descriptors.Length);
@@ -25,9 +25,9 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceDescriptor_Cylinder_ProducesCylindricalAndPlanarDescriptors()
{
- var side = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, "side", null, null, Transform3D.Identity, "cir:cylinder:side", nameof(Aetheris.Continuum.Backends.Sdf.CirCylinderNode), 1, FacePatchOrientationRole.Forward);
- var top = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "cap-top", null, null, Transform3D.Identity, "cir:cylinder:cap-top", nameof(Aetheris.Continuum.Backends.Sdf.CirCylinderNode), 1, FacePatchOrientationRole.Forward);
- var bottom = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "cap-bottom", null, null, Transform3D.Identity, "cir:cylinder:cap-bottom", nameof(Aetheris.Continuum.Backends.Sdf.CirCylinderNode), 1, FacePatchOrientationRole.Reversed);
+ var side = new SourceSurfaceDescriptor(SurfacePatchFamily.Cylindrical, "side", null, null, Transform3D.Identity, "cir:cylinder:side", nameof(Aetheris.Continuum.Backends.Sdf.SdfCylinderNode), 1, FacePatchOrientationRole.Forward);
+ var top = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "cap-top", null, null, Transform3D.Identity, "cir:cylinder:cap-top", nameof(Aetheris.Continuum.Backends.Sdf.SdfCylinderNode), 1, FacePatchOrientationRole.Forward);
+ var bottom = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "cap-bottom", null, null, Transform3D.Identity, "cir:cylinder:cap-bottom", nameof(Aetheris.Continuum.Backends.Sdf.SdfCylinderNode), 1, FacePatchOrientationRole.Reversed);
Assert.Equal(SurfacePatchFamily.Cylindrical, side.Family);
Assert.Equal(SurfacePatchFamily.Planar, top.Family);
@@ -37,14 +37,14 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceDescriptor_Sphere_ProducesSphericalDescriptor()
{
- var sphere = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(Aetheris.Continuum.Backends.Sdf.CirSphereNode), 2, FacePatchOrientationRole.Forward);
+ var sphere = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(Aetheris.Continuum.Backends.Sdf.SdfSphereNode), 2, FacePatchOrientationRole.Forward);
Assert.Equal(SurfacePatchFamily.Spherical, sphere.Family);
}
[Fact]
public void SourceSurfaceDescriptor_Torus_ProducesToroidalDescriptorUnsupportedMaterializer()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Toroidal, "torus", null, null, Transform3D.Identity, "cir:torus", nameof(Aetheris.Continuum.Backends.Sdf.CirTorusNode), 3, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Toroidal, "torus", null, null, Transform3D.Identity, "cir:torus", nameof(Aetheris.Continuum.Backends.Sdf.SdfTorusNode), 3, FacePatchOrientationRole.Forward);
var patch = new FacePatchDescriptor(source, [], [], FacePatchOrientationRole.Forward, "tool-surface", []);
var eval = SurfaceFamilyMaterializerRegistry.Evaluate(patch);
@@ -56,7 +56,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SurfaceFamilyRegistry_SelectsPlanarForPlanarPatch()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "plane", null, null, Transform3D.Identity, "cir:box", nameof(Aetheris.Continuum.Backends.Sdf.CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "plane", null, null, Transform3D.Identity, "cir:box", nameof(Aetheris.Continuum.Backends.Sdf.SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var trim = new TrimCurveDescriptor(TrimCurveFamily.Line, "edge-0", "loop:outer", 0, new ParameterInterval(0, 1), TrimCurveCapability.ExactSupported);
var patch = new FacePatchDescriptor(source, [trim], [], FacePatchOrientationRole.Forward, "outer", []);
@@ -69,7 +69,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SurfaceFamilyRegistry_RejectsWrongFamilyWithReasons()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(Aetheris.Continuum.Backends.Sdf.CirSphereNode), 4, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(Aetheris.Continuum.Backends.Sdf.SdfSphereNode), 4, FacePatchOrientationRole.Forward);
var patch = new FacePatchDescriptor(source, [], [], FacePatchOrientationRole.Forward, "outer", []);
var eval = SurfaceFamilyMaterializerRegistry.Evaluate(patch);
@@ -82,7 +82,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_UntrimmedBoxFace_EmitsPlanarTopology()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-1,-1,0;1,-1,0;1,1,0;-1,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-1,-1,0;1,-1,0;1,1,0;-1,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var patch = new FacePatchDescriptor(source, [], [], FacePatchOrientationRole.Forward, "outer", []);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -99,7 +99,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RejectsDeferredReadiness()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:0,0,0;1,0,0;1,1,0;0,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:0,0,0;1,0,0;1,1,0;0,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var patch = new FacePatchDescriptor(source, [], [], FacePatchOrientationRole.Forward, "outer", []);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.Deferred, [EmissionBlockingReason.TopologyPlanning], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -112,7 +112,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RejectsNonPlanarPatch()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(CirSphereNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(SdfSphereNode), 0, FacePatchOrientationRole.Forward);
var patch = new FacePatchDescriptor(source, [], [], FacePatchOrientationRole.Forward, "outer", []);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -124,7 +124,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RejectsTrimmedCircularPatch()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:0,0,0;1,0,0;1,1,0;0,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:0,0,0;1,0,0;1,1,0;0,1,0", null, null, Transform3D.Identity, "cir:box:face", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var trim = new TrimCurveDescriptor(TrimCurveFamily.Circle, "circle", "outer", 0, new ParameterInterval(0, 2 * double.Pi), TrimCurveCapability.ExactSupported);
var patch = new FacePatchDescriptor(source, [trim], [], FacePatchOrientationRole.Forward, "outer", []);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -149,7 +149,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_TrimmedCircularInnerLoop_RespectsPolicy()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-2,-2,0;2,-2,0;2,2,0;-2,2,0", null, null, Transform3D.Identity, "cir:box:face", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-2,-2,0;2,-2,0;2,2,0;-2,2,0", null, null, Transform3D.Identity, "cir:box:face", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var inner = new TrimCurveDescriptor(TrimCurveFamily.Circle, "inner-circle", "inner", 1, new ParameterInterval(0, 2 * double.Pi), TrimCurveCapability.ExactSupported);
var patch = new FacePatchDescriptor(source, [], [[inner]], FacePatchOrientationRole.Forward, "outer", []);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -163,7 +163,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RejectsMultipleInnerLoops()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-2,-2,0;2,-2,0;2,2,0;-2,2,0", null, null, Transform3D.Identity, "cir:box:face", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "rect3d:-2,-2,0;2,-2,0;2,2,0;-2,2,0", null, null, Transform3D.Identity, "cir:box:face", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var innerA = new TrimCurveDescriptor(TrimCurveFamily.Circle, "inner-circle-a", "inner", 1, new ParameterInterval(0, 2 * double.Pi), TrimCurveCapability.ExactSupported);
var innerB = new TrimCurveDescriptor(TrimCurveFamily.Circle, "inner-circle-b", "inner", 2, new ParameterInterval(0, 2 * double.Pi), TrimCurveCapability.ExactSupported);
var patch = new FacePatchDescriptor(source, [], [[innerA], [innerB]], FacePatchOrientationRole.Forward, "outer", []);
@@ -179,7 +179,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RectangleWithInnerCircle_FromRealBoxCylinderEvidence_EmitsTrimmedFace()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var generation = FacePatchCandidateGenerator.Generate(root);
var candidate = generation.Candidates.First(c =>
c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool
@@ -205,7 +205,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedTopologyRefs_PlanarInnerCircle_HasConcreteIds()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var generation = FacePatchCandidateGenerator.Generate(root);
var candidate = generation.Candidates.First(c => c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool
&& c.SourceSurface.BoundedPlanarGeometry is { Kind: BoundedPlanarPatchGeometryKind.Rectangle }
@@ -225,7 +225,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedTopologyRefs_PlanarPatchSet_PropagatesConcreteIds()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var entry = result.Entries
.Where(e => e.Emitted && e.IdentityMap is not null)
@@ -238,7 +238,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedTopologyRefs_CylindricalWall_BoundaryRefsPresent()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var generation = FacePatchCandidateGenerator.Generate(root);
var candidate = generation.Candidates.Single(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical && c.RetentionRole == FacePatchRetentionRole.ToolBoundaryRetainedInsideBase);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -253,7 +253,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RectangleWithInnerCircle_RejectsDeferredReadiness()
{
- var source = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
+ var source = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
var circle = new RetainedCircularLoopGeometry(new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 1d, RetainedRegionLoopOrientationPolicy.ReverseForToolCavity, "token", "diag");
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.Deferred, [EmissionBlockingReason.TopologyPlanning], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new PlanarSurfaceMaterializer().EmitRectangleWithInnerCircle(new(source, circle, null, readiness));
@@ -264,7 +264,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RectangleWithInnerCircle_RejectsMissingInnerCircleGeometry()
{
- var source = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
+ var source = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new PlanarSurfaceMaterializer().EmitRectangleWithInnerCircle(new(source, null, null, readiness));
Assert.False(result.Success);
@@ -274,7 +274,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RectangleWithInnerCircle_RejectsMultipleInnerLoops()
{
- var source = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
+ var source = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 10, 10)).Descriptors.First(d => d.BoundedPlanarGeometry?.Kind == BoundedPlanarPatchGeometryKind.Rectangle);
var circleA = new RetainedCircularLoopGeometry(new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 1d, RetainedRegionLoopOrientationPolicy.ReverseForToolCavity, "a", "diag");
var circleB = new RetainedCircularLoopGeometry(new Point3D(1, 0, 0), new Vector3D(0, 0, 1), 1d, RetainedRegionLoopOrientationPolicy.ReverseForToolCavity, "b", "diag");
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -286,7 +286,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxMinusCylinder_EmitsSupportedPlanarPatches()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.True(result.Success);
Assert.True(result.EmittedCount > 0);
@@ -298,7 +298,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxMinusCylinder_IncludesInnerCirclePatchWhenEvidenceExists()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var generation = FacePatchCandidateGenerator.Generate(root);
var hasCanonicalInnerEvidence = generation.Candidates.Any(c =>
c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool
@@ -320,7 +320,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_SkipsCylindricalToolCandidate()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.Contains(result.Entries, e =>
!e.Emitted
@@ -331,7 +331,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_DoesNotClaimShellAssembly()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.False(result.FullMaterialization);
Assert.Contains(result.Diagnostics, d => d.Contains("no shell assembly attempted", StringComparison.OrdinalIgnoreCase));
@@ -340,7 +340,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedIdentity_PlanarInnerCircle_CarriesTrimToken()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var generation = FacePatchCandidateGenerator.Generate(root);
var hasInner = generation.Candidates.Any(c =>
@@ -364,7 +364,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedIdentity_PlanarPatchSet_PropagatesInnerCircleToken()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var generation = FacePatchCandidateGenerator.Generate(root);
var hasInner = generation.Candidates.Any(c =>
@@ -380,7 +380,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxMinusCylinder_NoInnerCircleTokenWhenNoRetainedCircleEvidence()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.DoesNotContain(result.Entries.SelectMany(e => e.IdentityMap?.Entries ?? []), e => e.Role == EmittedTopologyRole.InnerCircularTrim && e.TrimIdentityToken is not null);
Assert.Contains(result.Entries, e => !e.Emitted && e.Diagnostics.Any(d => d.Contains("skipped-candidate-readiness", StringComparison.OrdinalIgnoreCase)));
@@ -389,7 +389,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void CylindricalSurfaceMaterializer_BoxMinusCylinder_ToolWall_FromRealEvidence_EmitsTopology()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var generation = FacePatchCandidateGenerator.Generate(root);
var candidate = generation.Candidates.Single(c =>
c.SourceSurface.Family == SurfacePatchFamily.Cylindrical
@@ -411,7 +411,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void CylindricalSurfaceMaterializer_RejectsDeferredReadiness()
{
- var candidate = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)))
+ var candidate = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)))
.Candidates.Single(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.Deferred, [EmissionBlockingReason.TopologyPlanning], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new CylindricalSurfaceMaterializer().EmitRetainedWall(new(candidate, readiness));
@@ -422,7 +422,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void CylindricalSurfaceMaterializer_RejectsMissingCylindricalEvidence()
{
- var candidate = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)))
+ var candidate = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)))
.Candidates.Single(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical);
candidate = candidate with { SourceSurface = candidate.SourceSurface with { CylindricalGeometryEvidence = null } };
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
@@ -434,7 +434,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void CylindricalSurfaceMaterializer_RejectsBaseSideOrNonCylindricalCandidate()
{
- var candidate = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)))
+ var candidate = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)))
.Candidates.First(c => c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new CylindricalSurfaceMaterializer().EmitRetainedWall(new(candidate, readiness));
@@ -445,7 +445,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedIdentity_CylindricalWall_CarriesBoundaryTokensOrPreciseDiagnostics()
{
- var candidate = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)))
+ var candidate = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)))
.Candidates.Single(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new CylindricalSurfaceMaterializer().EmitRetainedWall(new(candidate, readiness));
@@ -459,7 +459,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void EmittedIdentity_CylindricalSeam_IsRoleTagged()
{
- var candidate = FacePatchCandidateGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)))
+ var candidate = FacePatchCandidateGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)))
.Candidates.Single(c => c.SourceSurface.Family == SurfacePatchFamily.Cylindrical);
var readiness = new MaterializationReadinessReport(true, EmissionReadiness.EvidenceReadyForEmission, [], [], 1, 1, 1, 0, 0, 0, 0, [], false);
var result = new CylindricalSurfaceMaterializer().EmitRetainedWall(new(candidate, readiness));
@@ -469,7 +469,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPayloadBuilder_RejectsNonPlanarSource()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(CirSphereNode), 0, FacePatchOrientationRole.Forward);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, Transform3D.Identity, "cir:sphere", nameof(SdfSphereNode), 0, FacePatchOrientationRole.Forward);
var success = PlanarPatchPayloadBuilder.TryBuildRectanglePayload(source, out _, out var diagnostic);
Assert.False(success);
Assert.Contains("not planar", diagnostic, StringComparison.OrdinalIgnoreCase);
@@ -478,8 +478,8 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceExtractor_BoxFaces_HaveBoundedPlanarGeometry()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 6, 4));
- var planar = extraction.Descriptors.Where(d => d.Family == SurfacePatchFamily.Planar && d.OwningCirNodeKind == nameof(CirBoxNode)).ToArray();
+ var extraction = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 6, 4));
+ var planar = extraction.Descriptors.Where(d => d.Family == SurfacePatchFamily.Planar && d.OwningSdfNodeKind == nameof(SdfBoxNode)).ToArray();
Assert.Equal(6, planar.Length);
Assert.Equal(["top", "bottom", "left", "right", "front", "back"], planar.Select(d => Assert.IsType<string>(d.ParameterPayloadReference)).ToArray());
Assert.All(planar, d => Assert.NotNull(d.BoundedPlanarGeometry));
@@ -496,7 +496,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceExtractor_CylinderCaps_HaveCircularBoundedGeometry()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(5, 20));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(5, 20));
Assert.Single(extraction.Descriptors, d => d.Family == SurfacePatchFamily.Cylindrical);
var caps = extraction.Descriptors.Where(d => d.Family == SurfacePatchFamily.Planar && d.ParameterPayloadReference is "cap-top" or "cap-bottom").ToArray();
Assert.Equal(2, caps.Length);
@@ -516,7 +516,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceExtractor_CylinderCaps_RespectTranslationTransform()
{
- var node = new CirTransformNode(new CirCylinderNode(5, 20), Transform3D.CreateTranslation(new Vector3D(2, -3, 7)));
+ var node = new SdfTransformNode(new SdfCylinderNode(5, 20), Transform3D.CreateTranslation(new Vector3D(2, -3, 7)));
var extraction = SourceSurfaceExtractor.Extract(node);
var top = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-top");
var bottom = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-bottom");
@@ -529,7 +529,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceExtractor_CylinderSide_HasCylindricalEvidence()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(5, 20));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(5, 20));
var side = Assert.Single(extraction.Descriptors, d => d.Family == SurfacePatchFamily.Cylindrical);
var evidence = Assert.IsType<CylindricalSurfaceGeometryEvidence>(side.CylindricalGeometryEvidence!.Value);
Assert.Equal(new Point3D(0, 0, -10), evidence.AxisOrigin);
@@ -542,7 +542,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void SourceSurfaceExtractor_CylinderSide_TranslationTransform_PreservesEvidence()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirTransformNode(new CirCylinderNode(5, 20), Transform3D.CreateTranslation(new Vector3D(2, -3, 7))));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfTransformNode(new SdfCylinderNode(5, 20), Transform3D.CreateTranslation(new Vector3D(2, -3, 7))));
var side = Assert.Single(extraction.Descriptors, d => d.Family == SurfacePatchFamily.Cylindrical);
var evidence = Assert.IsType<CylindricalSurfaceGeometryEvidence>(side.CylindricalGeometryEvidence!.Value);
Assert.Equal(new Point3D(2, -3, -3), evidence.AxisOrigin);
@@ -554,7 +554,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPayloadBuilder_RejectsCircularCapGeometry()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(3, 8));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(3, 8));
var top = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-top");
var success = PlanarPatchPayloadBuilder.TryBuildRectanglePayload(top, out _, out var diagnostic);
Assert.False(success);
@@ -564,7 +564,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_CylinderTopCap_FromSourceSurface_EmitsCircularTopology()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(3, 8));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(3, 8));
var top = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-top");
var patch = new FacePatchDescriptor(top, [], [], FacePatchOrientationRole.Forward, "outer", []);
@@ -590,7 +590,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_CylinderBottomCap_FromSourceSurface_EmitsCircularTopology()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(3, 8));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(3, 8));
var bottom = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-bottom");
var patch = new FacePatchDescriptor(bottom, [], [], FacePatchOrientationRole.Reversed, "outer", []);
@@ -608,7 +608,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_RejectsCircularCap_WhenReadinessDeferred()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirCylinderNode(3, 8));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfCylinderNode(3, 8));
var top = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-top");
var patch = new FacePatchDescriptor(top, [], [], FacePatchOrientationRole.Forward, "outer", []);
@@ -625,7 +625,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
public void SourceSurfaceExtractor_DefersShearedCylinderCapCircularGeometry_AndEmitterRejectsMissingCircle()
{
var nonUniformScale = Transform3D.CreateScale(new Vector3D(2d, 1d, 1d));
- var extraction = SourceSurfaceExtractor.Extract(new CirTransformNode(new CirCylinderNode(3, 8), nonUniformScale));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfTransformNode(new SdfCylinderNode(3, 8), nonUniformScale));
var top = Assert.Single(extraction.Descriptors, c => c.ParameterPayloadReference == "cap-top");
Assert.Null(top.BoundedPlanarGeometry);
@@ -641,7 +641,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPayloadBuilder_BoxTopFace_DerivesRect3d()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 6, 4));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 6, 4));
var top = Assert.Single(extraction.Descriptors, d => d.ParameterPayloadReference == "top");
var success = PlanarPatchPayloadBuilder.TryBuildRectanglePayload(top, out _, out var diagnostic);
Assert.True(success);
@@ -651,7 +651,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarSurfaceMaterializer_BoxTopFace_FromSourceSurface_EmitsTopology()
{
- var extraction = SourceSurfaceExtractor.Extract(new CirBoxNode(10, 6, 4));
+ var extraction = SourceSurfaceExtractor.Extract(new SdfBoxNode(10, 6, 4));
var top = Assert.Single(extraction.Descriptors, d => d.ParameterPayloadReference == "top");
var ready = PlanarPatchPayloadBuilder.TryBuildRectanglePayload(top, out var payload, out var payloadDiagnostic);
Assert.True(ready);
@@ -672,7 +672,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPayloadBuilder_RejectsDescriptorWithoutBoundedGeometry()
{
- var roleOnly = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top", null, null, Transform3D.Identity, "cir:box:top", nameof(CirBoxNode), 0, FacePatchOrientationRole.Forward);
+ var roleOnly = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top", null, null, Transform3D.Identity, "cir:box:top", nameof(SdfBoxNode), 0, FacePatchOrientationRole.Forward);
var success = PlanarPatchPayloadBuilder.TryBuildRectanglePayload(roleOnly, out _, out var diagnostic);
Assert.False(success);
Assert.Contains("does not encode bounded rectangle corners", diagnostic, StringComparison.OrdinalIgnoreCase);
@@ -680,7 +680,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxMinusCylinder_EmitsInnerCircleToken_FromRealEvidence()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var emittedInnerEntries = result.Entries
@@ -698,7 +698,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxMinusCylinder_EmittedInnerCirclePatchHasTwoLoops()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var innerCircleEntry = result.Entries.First(e => e.Emitted && e.IdentityMap?.Entries.Any(x => x.Role == EmittedTopologyRole.InnerCircularTrim) == true);
@@ -711,7 +711,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void ShellAssembler_SeesMatchingPlanarAndCylindricalTokens_AfterPromotion()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = SurfaceFamilyShellAssembler.TryAssembleBoxMinusCylinder(root);
Assert.False(result.FullShellAssembled);
@@ -723,7 +723,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void RetainedLoopBinding_BaseSidePlanarCandidate_UsesCylindricalEvidence()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var candidate = FacePatchCandidateGenerator.Generate(root)
.Candidates
.First(c => c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool && c.SourceSurface.Family == SurfacePatchFamily.Planar);
@@ -736,7 +736,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void UnsafeCandidatesStillSkipPrecisely()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.Contains(result.Entries.SelectMany(e => e.Diagnostics), d => d.Contains("skipped-candidate-readiness", StringComparison.OrdinalIgnoreCase));
Assert.Contains(result.Entries.SelectMany(e => e.Candidate.Diagnostics), d => d.Contains("trim-capability-deferred", StringComparison.OrdinalIgnoreCase));
@@ -745,7 +745,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxCylinder_PrefersTieredOracleTrim_WhenAdmissible()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var emitted = result.Entries.Where(e => e.Emitted).ToArray();
@@ -767,7 +767,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void OracleTrimConsumption_RequiresStrongEvidence()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirUnionNode(new CirCylinderNode(2, 8), new CirCylinderNode(2, 8)));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfUnionNode(new SdfCylinderNode(2, 8), new SdfCylinderNode(2, 8)));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.DoesNotContain(result.Entries.SelectMany(e => e.Diagnostics), d => d.Contains("oracle-trim-analytic-circle-consumed", StringComparison.OrdinalIgnoreCase));
}
@@ -775,7 +775,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void OracleTrimConsumption_RejectsNumericalOnly()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.DoesNotContain(result.Entries.Where(e => e.Emitted).SelectMany(e => e.Diagnostics), d => d.Contains("oracle-trim-analytic-circle-consumed", StringComparison.OrdinalIgnoreCase));
}
@@ -783,7 +783,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void OracleTrimConsumption_BinderOracleAgreementDiagnosed()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var diagnostics = result.Entries.SelectMany(e => e.Diagnostics).ToArray();
Assert.True(diagnostics.Any(d => d.Contains("oracle-trim-binder-agreement", StringComparison.OrdinalIgnoreCase))
@@ -794,7 +794,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxCylinder_BinderFallbackStillWorks_WhenOracleUnavailable()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirUnionNode(new CirCylinderNode(2, 8), new CirCylinderNode(2, 8)));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfUnionNode(new SdfCylinderNode(2, 8), new SdfCylinderNode(2, 8)));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.Contains(result.Entries, e => e.Emitted && (e.Route == PlanarSurfaceMaterializer.PlanarPatchSetEmissionRoute.BinderFallback
|| e.Route == PlanarSurfaceMaterializer.PlanarPatchSetEmissionRoute.UntrimmedRectangle));
@@ -805,7 +805,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxCylinder_OracleRejectionDiagnosticsVisible()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
Assert.Contains(result.Entries.SelectMany(e => e.Diagnostics), d => d.Contains("oracle-trim-consumption-rejected", StringComparison.OrdinalIgnoreCase)
|| d.Contains("skipped-candidate-readiness", StringComparison.OrdinalIgnoreCase));
@@ -814,7 +814,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void PlanarPatchSet_BoxCylinder_IdentityMetadataPreservedForOracleRoute()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var result = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var entry = result.Entries.FirstOrDefault(e => e.Emitted && e.Route == PlanarSurfaceMaterializer.PlanarPatchSetEmissionRoute.TieredOracleTrim)
?? result.Entries.First(e => e.Emitted && e.Route == PlanarSurfaceMaterializer.PlanarPatchSetEmissionRoute.BinderFallback);
@@ -827,7 +827,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
[Fact]
public void OracleAdmissibility_BoxCylinder_ExplainsCurrentPolicy()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var candidate = FacePatchCandidateGenerator.Generate(root).Candidates
.First(c => c.RetentionRole == FacePatchRetentionRole.BaseBoundaryRetainedOutsideTool && c.SourceSurface.Family == SurfacePatchFamily.Planar);
var loop = candidate.RetainedRegionLoops.First(l => l.LoopKind == RetainedRegionLoopKind.InnerTrim && l.OracleTrimRepresentation is not null);
@@ -842,7 +842,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
{
var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-3,-3,0), new Point3D(3,-3,0), new Point3D(3,3,0), new Point3D(-3,3,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var num = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.NumericalOnly, TieredTrimExportCapability.NumericalOnlyNotExportable,
null, null, new NumericalTrimContourData(1, [], true, SurfaceTrimContourChainStatus.ClosedLoop, []),
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], 1, RestrictedContourSnapRouteKind.NumericalOnly, []), false, false, false, []);
@@ -862,7 +862,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
null,
Transform3D.Identity,
"synthetic",
- nameof(CirBoxNode),
+ nameof(SdfBoxNode),
null,
FacePatchOrientationRole.Forward);
var rep = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticCircle, TieredTrimExportCapability.ElementaryCurveCandidate,
@@ -887,7 +887,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
{
var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-3,-3,0), new Point3D(3,-3,0), new Point3D(3,3,0), new Point3D(-3,3,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var rep = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticCircle, TieredTrimExportCapability.ElementaryCurveCandidate,
new AnalyticCircleTrimData(0, 0, 1, 0, 0, 8), null, null,
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], null, RestrictedContourSnapRouteKind.AnalyticCircle, []), true, false, false, []);
@@ -902,7 +902,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
{
var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-3,-3,0), new Point3D(3,-3,0), new Point3D(3,3,0), new Point3D(-3,3,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var num = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.NumericalOnly, TieredTrimExportCapability.NumericalOnlyNotExportable,
null, null, new NumericalTrimContourData(1, [], true, SurfaceTrimContourChainStatus.ClosedLoop, []),
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], 1, RestrictedContourSnapRouteKind.NumericalOnly, []), false, false, false, []);
@@ -918,7 +918,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
{
var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-3,-3,0), new Point3D(3,-3,0), new Point3D(3,3,0), new Point3D(-3,3,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var line = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticLine, TieredTrimExportCapability.ElementaryCurveCandidate,
null, new AnalyticLineTrimData(0,0,1,0,0,0,4), null,
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], null, RestrictedContourSnapRouteKind.AnalyticLine, []), true, false, false, []);
@@ -938,7 +938,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
null,
Transform3D.Identity,
"synthetic",
- nameof(CirBoxNode),
+ nameof(SdfBoxNode),
null,
FacePatchOrientationRole.Forward);
var rep = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticCircle, TieredTrimExportCapability.ElementaryCurveCandidate,
@@ -956,7 +956,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
SurfacePatchFamily.Planar,
"top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(0,0,0), new Point3D(4,0,0), new Point3D(4,1,0), new Point3D(0,1,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var rep = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticCircle, TieredTrimExportCapability.ElementaryCurveCandidate,
new AnalyticCircleTrimData(2, 0.5, 0.25, 0, 0, 16), null, null,
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], null, RestrictedContourSnapRouteKind.AnalyticCircle, []), true, false, false, []);
@@ -971,7 +971,7 @@ public sealed class SurfacePatchDescriptorScaffoldTests
{
var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "top",
BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-3,-3,0), new Point3D(3,-3,0), new Point3D(3,3,0), new Point3D(-3,3,0), new Vector3D(0,0,1)),
- null, Transform3D.Identity, "synthetic", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ null, Transform3D.Identity, "synthetic", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var rep = new TieredTrimCurveRepresentation(TieredTrimRepresentationKind.AnalyticCircle, TieredTrimExportCapability.ElementaryCurveCandidate,
new AnalyticCircleTrimData(0, 0, 1, 0, 0, 8), null, null,
new TrimSurfaceIntersectionProvenance(null, null, null, null, [], null, RestrictedContourSnapRouteKind.AnalyticCircle, []), true, false, false, []);
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldMarchingSquaresTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldMarchingSquaresTests.cs
index 1380b7b9..690fd937 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldMarchingSquaresTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldMarchingSquaresTests.cs
@@ -10,7 +10,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
[Fact]
public void MarchingSquares_BoxFaceVsCylinder_ProducesSegments()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20)));
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20)));
var result = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
Assert.True(result.Success);
@@ -30,7 +30,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
[Fact]
public void MarchingSquares_BoxFaceVsSphere_ProducesSegments()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)));
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)));
var result = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
Assert.True(result.Success);
@@ -40,7 +40,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
[Fact]
public void MarchingSquares_BoxFaceVsTorus_ProducesSegmentsOrPreciseNoContour()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1)));
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1)));
var result = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
if (result.SegmentCount > 0)
@@ -56,7 +56,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
[Fact]
public void MarchingSquares_DeterministicOrdering()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)));
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)));
var a = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
var b = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
@@ -69,7 +69,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
[Fact]
public void MarchingSquares_SkipsInsideOutsideOnlyCells()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(1));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(1));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
var grid = RestrictedFieldGridSampler.Sample(field, new RestrictedFieldGridOptions(17, 17));
@@ -107,7 +107,7 @@ public sealed class SurfaceRestrictedFieldMarchingSquaresTests
Assert.Contains(result.Segments.SelectMany(s => s.Diagnostics), d => d.StartsWith("ambiguous-cell", StringComparison.Ordinal));
}
- private static (SurfaceRestrictedField field, RestrictedFieldSampleGrid grid) CreateGrid(CirSubtractNode root)
+ private static (SurfaceRestrictedField field, RestrictedFieldSampleGrid grid) CreateGrid(SdfSubtractNode root)
{
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldTests.cs
index 629b4698..70ae11b1 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceRestrictedFieldTests.cs
@@ -11,7 +11,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedFieldGrid_BoxFaceVsCylinder_HasMixedCells()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -27,7 +27,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedFieldGrid_BoxFaceVsSphere_HasMixedCells()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -38,7 +38,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedFieldGrid_BoxFaceVsTorus_SamplesAndReportsMixedOrDeferred()
{
- var root = new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -51,7 +51,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedFieldGrid_DeterministicOrdering()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -67,7 +67,7 @@ public sealed class SurfaceRestrictedFieldTests
[InlineData(17, 1)]
public void RestrictedFieldGrid_InvalidResolution_Rejected(int u, int v)
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -94,7 +94,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_BoxFaceVsCylinder_EvaluatesDeterministically()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -113,7 +113,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_BoxFaceVsSphere_EvaluatesDeterministically()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -126,7 +126,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_BoxFaceVsTorus_EvaluatesDespiteMaterializationDeferred()
{
- var root = new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1));
+ var root = new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1));
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
@@ -140,7 +140,7 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_RejectsNonRectanglePlanarSource()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var circlePlanar = Assert.Single(SourceSurfaceExtractor.Extract(root.Right).Descriptors, d => d.ParameterPayloadReference == "cap-top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, circlePlanar, SubtractOperandSide.Right);
@@ -151,8 +151,8 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_RejectsMissingBoundedGeometry()
{
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "synthetic", null, null, Transform3D.Identity, "test", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3));
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "synthetic", null, null, Transform3D.Identity, "test", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3));
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
Assert.Equal(SurfaceRestrictedFieldStatus.Unsupported, field.Status);
@@ -162,10 +162,10 @@ public sealed class SurfaceRestrictedFieldTests
[Fact]
public void RestrictedField_SubtractSideSelection_SelectsOppositeOperand()
{
- var left = new CirSphereNode(2);
- var right = new CirCylinderNode(1, 8);
- var root = new CirSubtractNode(left, right);
- var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "synthetic", BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-1, -1, 0), new Point3D(1, -1, 0), new Point3D(1, 1, 0), new Point3D(-1, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "test", nameof(CirBoxNode), null, FacePatchOrientationRole.Forward);
+ var left = new SdfSphereNode(2);
+ var right = new SdfCylinderNode(1, 8);
+ var root = new SdfSubtractNode(left, right);
+ var source = new SourceSurfaceDescriptor(SurfacePatchFamily.Planar, "synthetic", BoundedPlanarPatchGeometry.CreateRectangle(new Point3D(-1, -1, 0), new Point3D(1, -1, 0), new Point3D(1, 1, 0), new Point3D(-1, 1, 0), new Vector3D(0, 0, 1)), null, Transform3D.Identity, "test", nameof(SdfBoxNode), null, FacePatchOrientationRole.Forward);
var leftSource = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
var rightSource = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Right);
diff --git a/Aetheris.Kernel.Firmament.Tests/SurfaceTrimContourStitcherTests.cs b/Aetheris.Kernel.Firmament.Tests/SurfaceTrimContourStitcherTests.cs
index f461c6b5..d574e0de 100644
--- a/Aetheris.Kernel.Firmament.Tests/SurfaceTrimContourStitcherTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SurfaceTrimContourStitcherTests.cs
@@ -11,7 +11,7 @@ public sealed class SurfaceTrimContourStitcherTests
[Fact]
public void ContourStitch_BoxFaceVsCylinder_ProducesClosedLoop()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20)), 65);
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20)), 65);
var extraction = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
var stitched = SurfaceTrimContourStitcher.Stitch(extraction);
Assert.Contains(stitched.Chains, c => c.Status == SurfaceTrimContourChainStatus.ClosedLoop || c.Status == SurfaceTrimContourChainStatus.BoundaryTouching);
@@ -23,7 +23,7 @@ public sealed class SurfaceTrimContourStitcherTests
[Fact]
public void ContourStitch_BoxFaceVsSphere_ProducesClosedLoop()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 65);
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 65);
var extraction = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
var stitched = SurfaceTrimContourStitcher.Stitch(extraction);
Assert.Contains(stitched.Chains, c => c.Status == SurfaceTrimContourChainStatus.ClosedLoop || c.Status == SurfaceTrimContourChainStatus.BoundaryTouching);
@@ -32,7 +32,7 @@ public sealed class SurfaceTrimContourStitcherTests
[Fact]
public void ContourStitch_BoxFaceVsTorus_StitchesOrReportsPrecisely()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1)), 65);
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1)), 65);
var extraction = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
var stitched = SurfaceTrimContourStitcher.Stitch(extraction);
if (extraction.SegmentCount == 0) Assert.Contains("contour-stitching-empty-input", stitched.Diagnostics);
@@ -67,7 +67,7 @@ public sealed class SurfaceTrimContourStitcherTests
[Fact]
public void ContourStitch_DeterministicOrdering()
{
- var (field, grid) = CreateGrid(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 33);
+ var (field, grid) = CreateGrid(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 33);
var extraction = RestrictedFieldMarchingSquaresExtractor.Extract(grid, field.Parameterization);
var a = SurfaceTrimContourStitcher.Stitch(extraction);
var b = SurfaceTrimContourStitcher.Stitch(extraction);
@@ -75,7 +75,7 @@ public sealed class SurfaceTrimContourStitcherTests
Assert.Equal(a.Chains.Select(c => (c.Status, c.OrderingKey, c.Points.Count)), b.Chains.Select(c => (c.Status, c.OrderingKey, c.Points.Count)));
}
- private static (SurfaceRestrictedField field, RestrictedFieldSampleGrid grid) CreateGrid(CirSubtractNode root, int resolution)
+ private static (SurfaceRestrictedField field, RestrictedFieldSampleGrid grid) CreateGrid(SdfSubtractNode root, int resolution)
{
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
diff --git a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryExecutorTests.cs b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryExecutorTests.cs
index 938026d5..6d0df443 100644
--- a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryExecutorTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryExecutorTests.cs
@@ -13,7 +13,7 @@ public sealed class ThroughHoleRecoveryExecutorTests
[Fact]
public void ThroughHoleExecutor_BoxCylinderPlan_ProducesBrepBody()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirCylinderNode(2d, 20d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfCylinderNode(2d, 20d));
var plan = BuildPlanFromPlanner(root);
var result = ThroughHoleRecoveryExecutor.Execute(plan);
@@ -28,9 +28,9 @@ public sealed class ThroughHoleRecoveryExecutorTests
[Fact]
public void ThroughHoleExecutor_TranslatedBoxCylinderPlan_ProducesBrepBody()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
- new CirTransformNode(new CirCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
+ new SdfTransformNode(new SdfCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
var plan = BuildPlanFromPlanner(root);
var result = ThroughHoleRecoveryExecutor.Execute(plan);
@@ -71,7 +71,7 @@ public sealed class ThroughHoleRecoveryExecutorTests
[Fact]
public void ThroughHoleExecutor_BodyHasExpectedSurfaceFamiliesOrTopologySummary()
{
- var root = new CirSubtractNode(new CirBoxNode(30d, 20d, 12d), new CirCylinderNode(4d, 24d));
+ var root = new SdfSubtractNode(new SdfBoxNode(30d, 20d, 12d), new SdfCylinderNode(4d, 24d));
var plan = BuildPlanFromPlanner(root);
var result = ThroughHoleRecoveryExecutor.Execute(plan);
@@ -98,7 +98,7 @@ public sealed class ThroughHoleRecoveryExecutorTests
[Fact]
public void ThroughHoleExecutor_DoesNotExportStep()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirCylinderNode(2d, 20d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfCylinderNode(2d, 20d));
var plan = BuildPlanFromPlanner(root);
var result = ThroughHoleRecoveryExecutor.Execute(plan);
@@ -107,7 +107,7 @@ public sealed class ThroughHoleRecoveryExecutorTests
Assert.Contains("No STEP export attempted in CIR-RECOVERY-V2.", result.Diagnostics);
}
- private static ThroughHoleRecoveryPlan BuildPlanFromPlanner(CirNode root)
+ private static ThroughHoleRecoveryPlan BuildPlanFromPlanner(SdfNode root)
{
var decision = FrepMaterializerPlanner.Decide(new FrepMaterializerContext(root), [Policy]);
var evaluation = Assert.Single(decision.Evaluations);
diff --git a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryPolicyTests.cs b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryPolicyTests.cs
index ec4e53a7..f78ceb23 100644
--- a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryPolicyTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryPolicyTests.cs
@@ -12,7 +12,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_DirectBoxCylinder_AdmitsAndCreatesPlan()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))));
Assert.True(eval.Admissible);
Assert.Equal(FrepMaterializerCapability.ExactBRep, eval.Capability);
var plan = Assert.IsType<ThroughHoleRecoveryPlan>(eval.Plan);
@@ -26,9 +26,9 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_TranslatedBoxCylinder_Admits()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
- new CirTransformNode(new CirCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20, 20, 10), Transform3D.CreateTranslation(new Vector3D(5, 2, 4))),
+ new SdfTransformNode(new SdfCylinderNode(3, 16), Transform3D.CreateTranslation(new Vector3D(4, 1, 4))));
var eval = _policy.Evaluate(new FrepMaterializerContext(root));
Assert.True(eval.Admissible);
Assert.Contains("translation-wrapper-supported", eval.Evidence);
@@ -37,7 +37,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void Planner_SelectsThroughHolePolicy_OverFallback()
{
- var context = new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20)));
+ var context = new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20)));
var decision = FrepMaterializerPlanner.Decide(context, [
_policy,
new FakePolicy("fallback", FrepMaterializerPolicyEvaluation.Admitted("fallback", 1d, FrepMaterializerCapability.CirOnly))
@@ -48,7 +48,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_RejectsBoxSphere()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2))));
Assert.False(eval.Admissible);
Assert.Contains(eval.RejectionReasons, r => r.Contains("UnsupportedRightNotCylinder", StringComparison.Ordinal));
}
@@ -56,7 +56,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_RejectsBlindCylinder()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8))));
Assert.False(eval.Admissible);
Assert.Contains(eval.RejectionReasons, r => r.Contains("UnsupportedNotThroughHole", StringComparison.Ordinal));
}
@@ -64,7 +64,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_RejectsTangentOrGrazing()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, 0, 0))))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateTranslation(new Vector3D(3, 0, 0))))));
Assert.False(eval.Admissible);
Assert.Contains(eval.RejectionReasons, r => r.Contains("UnsupportedTangentOrGrazing", StringComparison.Ordinal));
}
@@ -72,7 +72,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_RejectsUnsupportedTransform()
{
- var eval = _policy.Evaluate(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTransformNode(new CirCylinderNode(2, 20), Transform3D.CreateRotationX(0.2)))));
+ var eval = _policy.Evaluate(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTransformNode(new SdfCylinderNode(2, 20), Transform3D.CreateRotationX(0.2)))));
Assert.False(eval.Admissible);
Assert.Contains(eval.RejectionReasons, r => r.Contains("UnsupportedTransform", StringComparison.Ordinal));
}
@@ -80,7 +80,7 @@ public sealed class ThroughHoleRecoveryPolicyTests
[Fact]
public void ThroughHolePolicy_DecisionTraceContainsPlanEvidence()
{
- var decision = FrepMaterializerPlanner.Decide(new FrepMaterializerContext(new CirSubtractNode(new CirBoxNode(20, 10, 8), new CirCylinderNode(2, 20))), [_policy]);
+ var decision = FrepMaterializerPlanner.Decide(new FrepMaterializerContext(new SdfSubtractNode(new SdfBoxNode(20, 10, 8), new SdfCylinderNode(2, 20))), [_policy]);
var eval = Assert.Single(decision.Evaluations);
Assert.Contains("semantic-through-hole", eval.Evidence);
Assert.Contains(eval.Evidence, e => e.Contains("expected-patches", StringComparison.Ordinal));
diff --git a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryStepSmokeTests.cs b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryStepSmokeTests.cs
index 3557a6c8..93c5d0a5 100644
--- a/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryStepSmokeTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ThroughHoleRecoveryStepSmokeTests.cs
@@ -13,7 +13,7 @@ public sealed class ThroughHoleRecoveryStepSmokeTests
[Fact]
public void ThroughHoleRecoveryStepSmoke_CanonicalBoxCylinder_ExportsStep()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirCylinderNode(2d, 20d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfCylinderNode(2d, 20d));
var pipeline = RecoverAndExport(root, "v3-canonical");
@@ -35,9 +35,9 @@ public sealed class ThroughHoleRecoveryStepSmokeTests
[Fact]
public void ThroughHoleRecoveryStepSmoke_TranslatedBoxCylinder_ExportsStep()
{
- var root = new CirSubtractNode(
- new CirTransformNode(new CirBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(5d, 2d, 4d))),
- new CirTransformNode(new CirCylinderNode(3d, 16d), Transform3D.CreateTranslation(new Vector3D(4d, 1d, 4d))));
+ var root = new SdfSubtractNode(
+ new SdfTransformNode(new SdfBoxNode(20d, 20d, 10d), Transform3D.CreateTranslation(new Vector3D(5d, 2d, 4d))),
+ new SdfTransformNode(new SdfCylinderNode(3d, 16d), Transform3D.CreateTranslation(new Vector3D(4d, 1d, 4d))));
var pipeline = RecoverAndExport(root, "v3-translated");
@@ -51,7 +51,7 @@ public sealed class ThroughHoleRecoveryStepSmokeTests
[Fact]
public void ThroughHoleRecoveryStepSmoke_RejectsUnsupportedBeforeExport()
{
- var root = new CirSubtractNode(new CirBoxNode(20d, 10d, 8d), new CirSphereNode(3d));
+ var root = new SdfSubtractNode(new SdfBoxNode(20d, 10d, 8d), new SdfSphereNode(3d));
var pipeline = RecoverAndExport(root, "v3-unsupported");
@@ -66,7 +66,7 @@ public sealed class ThroughHoleRecoveryStepSmokeTests
[Fact]
public void ThroughHoleRecoveryStepSmoke_DoesNotChangeExporterBehavior()
{
- var root = new CirSubtractNode(new CirBoxNode(12d, 12d, 12d), new CirCylinderNode(2d, 20d));
+ var root = new SdfSubtractNode(new SdfBoxNode(12d, 12d, 12d), new SdfCylinderNode(2d, 20d));
var pipeline = RecoverAndExport(root, "v3-exporter-behavior");
@@ -77,7 +77,7 @@ public sealed class ThroughHoleRecoveryStepSmokeTests
Assert.Contains("no rematerializer wiring", pipeline.Diagnostics, StringComparer.Ordinal);
}
- private static RecoveryStepPipelineResult RecoverAndExport(CirNode root, string productName)
+ private static RecoveryStepPipelineResult RecoverAndExport(SdfNode root, string productName)
{
var diagnostics = new List<string>();
var decision = FrepMaterializerPlanner.Decide(new FrepMaterializerContext(root), [Policy]);
diff --git a/Aetheris.Kernel.Firmament.Tests/TieredTrimRepresentationBuilderTests.cs b/Aetheris.Kernel.Firmament.Tests/TieredTrimRepresentationBuilderTests.cs
index 58df6579..a7beb810 100644
--- a/Aetheris.Kernel.Firmament.Tests/TieredTrimRepresentationBuilderTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/TieredTrimRepresentationBuilderTests.cs
@@ -10,7 +10,7 @@ public sealed class TieredTrimRepresentationBuilderTests
[Fact]
public void TieredTrim_CylinderCircleSelection_BuildsAnalyticCircleRepresentation()
{
- var (field, stitched, selection) = BuildSelection(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 20)), 65, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
+ var (field, stitched, selection) = BuildSelection(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 20)), 65, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
var result = TieredTrimRepresentationBuilder.Build(selection, stitched, field);
Assert.Equal(TieredTrimRepresentationKind.AnalyticCircle, result.Representation.Kind);
@@ -24,7 +24,7 @@ public sealed class TieredTrimRepresentationBuilderTests
[Fact]
public void TieredTrim_SphereCircleSelection_BuildsAnalyticCircleRepresentation()
{
- var (field, stitched, selection) = BuildSelection(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(6)), 65, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
+ var (field, stitched, selection) = BuildSelection(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(6)), 65, new RestrictedContourSnapOptions(0.06d, 0.02d, 8));
var result = TieredTrimRepresentationBuilder.Build(selection, stitched, field);
Assert.Equal(TieredTrimRepresentationKind.AnalyticCircle, result.Representation.Kind);
Assert.NotNull(result.Representation.Circle);
@@ -50,7 +50,7 @@ public sealed class TieredTrimRepresentationBuilderTests
[Fact]
public void TieredTrim_Torus_DoesNotClaimGenericExactness()
{
- var (field, stitched, selection) = BuildSelection(new CirSubtractNode(new CirBoxNode(12, 12, 12), new CirTorusNode(4, 1)), 65, new RestrictedContourSnapOptions(0.01d, 0.01d, 8));
+ var (field, stitched, selection) = BuildSelection(new SdfSubtractNode(new SdfBoxNode(12, 12, 12), new SdfTorusNode(4, 1)), 65, new RestrictedContourSnapOptions(0.01d, 0.01d, 8));
var result = TieredTrimRepresentationBuilder.Build(selection, stitched, field);
Assert.Contains(result.Diagnostics, d => d == "tiered-trim-torus-generic-exactness-not-claimed");
Assert.False(result.Representation.ExactStepExported);
@@ -81,7 +81,7 @@ public sealed class TieredTrimRepresentationBuilderTests
Assert.Contains(result.Representation.SurfaceIntersectionProvenance.Diagnostics, d => d.StartsWith("tiered-trim-provenance-missing", StringComparison.Ordinal));
}
- private static (SurfaceRestrictedField field, SurfaceTrimContourStitchResult stitched, RestrictedContourSnapSelectionResult selection) BuildSelection(CirSubtractNode root, int resolution, RestrictedContourSnapOptions options)
+ private static (SurfaceRestrictedField field, SurfaceTrimContourStitchResult stitched, RestrictedContourSnapSelectionResult selection) BuildSelection(SdfSubtractNode root, int resolution, RestrictedContourSnapOptions options)
{
var source = Assert.Single(SourceSurfaceExtractor.Extract(root.Left).Descriptors, d => d.ParameterPayloadReference == "top");
var field = SurfaceRestrictedFieldFactory.ForSubtractSource(root, source, SubtractOperandSide.Left);
diff --git a/Aetheris.Kernel.Firmament.Tests/TopologyAssemblyDryRunTests.cs b/Aetheris.Kernel.Firmament.Tests/TopologyAssemblyDryRunTests.cs
index 2e9bef8f..129d7641 100644
--- a/Aetheris.Kernel.Firmament.Tests/TopologyAssemblyDryRunTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/TopologyAssemblyDryRunTests.cs
@@ -10,7 +10,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_BoxMinusCylinder_PlansFacesAndLoops()
{
- var result = TopologyAssemblyDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = TopologyAssemblyDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.True(result.IsSuccess);
Assert.NotEmpty(result.PlannedFaces);
@@ -22,7 +22,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_BoxMinusSphere_PlansSphericalPatchWithoutUnsupported()
{
- var result = TopologyAssemblyDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3)));
+ var result = TopologyAssemblyDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3)));
Assert.Contains(result.PlannedFaces, p => p.SurfaceFamily == SurfacePatchFamily.Spherical);
Assert.Contains(result.PlannedFaces.Where(p => p.SurfaceFamily == SurfacePatchFamily.Spherical).SelectMany(p => p.LoopGroups.SelectMany(g => g.LoopDescriptors)), l => l.TrimCurveFamily == TrimCurveFamily.Circle);
@@ -32,7 +32,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_BoxMinusTorus_DefersDueTrimLoops()
{
- var result = TopologyAssemblyDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1)));
+ var result = TopologyAssemblyDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1)));
Assert.Contains(result.PlannedFaces, p => p.SurfaceFamily == SurfacePatchFamily.Toroidal);
Assert.Equal(TopologyAssemblyReadiness.Deferred, result.Readiness);
@@ -42,7 +42,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_NonSubtract_NotApplicable()
{
- var result = TopologyAssemblyDryRunPlanner.Generate(new CirUnionNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2)));
+ var result = TopologyAssemblyDryRunPlanner.Generate(new SdfUnionNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2)));
Assert.False(result.IsSuccess);
Assert.Equal(TopologyAssemblyReadiness.NotApplicable, result.Readiness);
@@ -52,7 +52,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_DeterministicOrdering()
{
- var node = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var node = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var first = TopologyAssemblyDryRunPlanner.Generate(node);
var second = TopologyAssemblyDryRunPlanner.Generate(node);
@@ -63,7 +63,7 @@ public sealed class TopologyAssemblyDryRunTests
[Fact]
public void TopologyDryRun_DoesNotEmitBRepTopology()
{
- var result = TopologyAssemblyDryRunPlanner.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = TopologyAssemblyDryRunPlanner.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.False(result.TopologyEmissionImplemented);
Assert.Contains(result.Diagnostics, d => d.Contains("topology-emission-not-implemented", StringComparison.Ordinal));
diff --git a/Aetheris.Kernel.Firmament.Tests/TopologyPairingEvidenceTests.cs b/Aetheris.Kernel.Firmament.Tests/TopologyPairingEvidenceTests.cs
index 4086bbcb..9f441441 100644
--- a/Aetheris.Kernel.Firmament.Tests/TopologyPairingEvidenceTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/TopologyPairingEvidenceTests.cs
@@ -10,7 +10,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_BoxMinusCylinder_CreatesEdgeUses()
{
- var result = TopologyPairingEvidenceGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8)));
+ var result = TopologyPairingEvidenceGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8)));
Assert.True(result.IsSuccess);
Assert.NotEmpty(result.PlannedEdgeUses);
@@ -23,7 +23,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_BoxMinusSphere_CircularLoopsHaveClosureEvidence()
{
- var result = TopologyPairingEvidenceGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3)));
+ var result = TopologyPairingEvidenceGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3)));
Assert.Contains(result.PlannedEdgeUses, e => e.TrimCurveFamily == TrimCurveFamily.Circle);
Assert.Contains(result.PlannedEdgeUses, e => e.TrimCurveFamily == TrimCurveFamily.Circle && e.IdentityToken is not null);
@@ -34,7 +34,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_BoxMinusTorus_DefersClosureAndPairing()
{
- var result = TopologyPairingEvidenceGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirTorusNode(4, 1)));
+ var result = TopologyPairingEvidenceGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfTorusNode(4, 1)));
Assert.Equal(TopologyPairingReadiness.Deferred, result.Readiness);
Assert.DoesNotContain(result.PlannedCoedgePairings, p => p.PairingKind == PlannedCoedgePairingKind.SharedTrimIdentity);
@@ -45,7 +45,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_CoedgePairingDeferredWhenIdentityMissing()
{
- var result = TopologyPairingEvidenceGenerator.Generate(new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3)));
+ var result = TopologyPairingEvidenceGenerator.Generate(new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3)));
Assert.Contains(result.PlannedCoedgePairings, p => p.PairingKind == PlannedCoedgePairingKind.Deferred);
Assert.Contains(result.Diagnostics, d => d.Contains("missing-identity", StringComparison.OrdinalIgnoreCase) || d.Contains("token-mismatch", StringComparison.OrdinalIgnoreCase) || d.Contains("ambiguous-token", StringComparison.OrdinalIgnoreCase));
@@ -54,7 +54,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingIdentity_TokensAreDeterministic()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirSphereNode(3));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(3));
var first = TopologyPairingEvidenceGenerator.Generate(root);
var second = TopologyPairingEvidenceGenerator.Generate(root);
Assert.Equal(first.PlannedEdgeUses.Select(e => e.IdentityToken?.OrderingKey), second.PlannedEdgeUses.Select(e => e.IdentityToken?.OrderingKey));
@@ -63,7 +63,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_NonSubtract_NotApplicable()
{
- var result = TopologyPairingEvidenceGenerator.Generate(new CirUnionNode(new CirBoxNode(10, 10, 10), new CirSphereNode(2)));
+ var result = TopologyPairingEvidenceGenerator.Generate(new SdfUnionNode(new SdfBoxNode(10, 10, 10), new SdfSphereNode(2)));
Assert.False(result.IsSuccess);
Assert.Equal(TopologyPairingReadiness.NotApplicable, result.Readiness);
@@ -73,7 +73,7 @@ public sealed class TopologyPairingEvidenceTests
[Fact]
public void PairingEvidence_DeterministicOrdering()
{
- var root = new CirSubtractNode(new CirBoxNode(10, 10, 10), new CirCylinderNode(2, 8));
+ var root = new SdfSubtractNode(new SdfBoxNode(10, 10, 10), new SdfCylinderNode(2, 8));
var first = TopologyPairingEvidenceGenerator.Generate(root);
var second = TopologyPairingEvidenceGenerator.Generate(root);
diff --git a/Aetheris.Kernel.Firmament/Analysis/CirNativeAnalysisService.cs b/Aetheris.Kernel.Firmament/Analysis/CirNativeAnalysisService.cs
index 3617405a..ae90ecae 100644
--- a/Aetheris.Kernel.Firmament/Analysis/CirNativeAnalysisService.cs
+++ b/Aetheris.Kernel.Firmament/Analysis/CirNativeAnalysisService.cs
@@ -6,25 +6,25 @@ using Aetheris.Kernel.Firmament.Lowering;
namespace Aetheris.Kernel.Firmament.Analysis;
-public enum CirNativeAnalysisInputKind { Firmament, CirTape, CirNode }
+public enum CirNativeAnalysisInputKind { Firmament, SdfTape, SdfNode }
public enum CirNativeAnalysisResultKind { Approximate, ClassifierDerived }
public enum CirNativeEstimatorKind { Dense, Adaptive }
public sealed record CirNativeLoweringDiagnostic(int? OpIndex, string? FeatureId, string Message);
public sealed record CirNativeLoweringSummary(bool Supported, int SupportedOpCount, int UnsupportedOpCount, IReadOnlyList<CirNativeLoweringDiagnostic> Diagnostics);
public sealed record CirNativeBounds(Point3D Min, Point3D Max);
-public sealed record CirNativePointClassification(Point3D Point, CirPointClassification Classification, double SignedDistance);
-public sealed record CirNativeVolumeResult(CirNativeEstimatorKind Estimator, double EstimatedVolume, int? Resolution, CirAdaptiveVolumeOptions? AdaptiveOptions, int? SampledPointCount, int? TotalRegionsVisited, int? RegionsClassifiedInside, int? RegionsClassifiedOutside, int? RegionsSubdivided, int? RegionsSampledDirectly, int? UnknownOrRejectedRegions, int? MaxDepthReached, int TraceEventCount, IReadOnlyList<CirAdaptiveTraceEvent> TraceHead, bool Approximate);
+public sealed record CirNativePointClassification(Point3D Point, SdfPointClassification Classification, double SignedDistance);
+public sealed record CirNativeVolumeResult(CirNativeEstimatorKind Estimator, double EstimatedVolume, int? Resolution, SdfAdaptiveVolumeOptions? AdaptiveOptions, int? SampledPointCount, int? TotalRegionsVisited, int? RegionsClassifiedInside, int? RegionsClassifiedOutside, int? RegionsSubdivided, int? RegionsSampledDirectly, int? UnknownOrRejectedRegions, int? MaxDepthReached, int TraceEventCount, IReadOnlyList<SdfAdaptiveTraceEvent> TraceHead, bool Approximate);
public sealed record CirNativeAnalysisResult(bool Success, string Backend, CirNativeAnalysisInputKind InputKind, CirNativeAnalysisResultKind ResultKind, IReadOnlyList<string> Notes, IReadOnlyList<CirNativeLoweringDiagnostic> Diagnostics, CirNativeLoweringSummary? Lowering, CirNativeBounds? Bounds, CirNativeVolumeResult? Volume, IReadOnlyList<CirNativePointClassification> PointClassifications);
public static class CirNativeAnalysisService
{
- public static CirNativeAnalysisResult AnalyzeTape(CirTape tape, CirBounds bounds, IEnumerable<Point3D>? points = null, int? denseResolution = null, CirAdaptiveVolumeOptions? adaptiveOptions = null)
- => AnalyzeCore(tape, bounds, CirNativeAnalysisInputKind.CirTape, points, denseResolution, adaptiveOptions, null);
+ public static CirNativeAnalysisResult AnalyzeTape(SdfTape tape, SdfBounds bounds, IEnumerable<Point3D>? points = null, int? denseResolution = null, SdfAdaptiveVolumeOptions? adaptiveOptions = null)
+ => AnalyzeCore(tape, bounds, CirNativeAnalysisInputKind.SdfTape, points, denseResolution, adaptiveOptions, null);
- public static CirNativeAnalysisResult AnalyzeNode(CirNode node, IEnumerable<Point3D>? points = null, int? denseResolution = null, CirAdaptiveVolumeOptions? adaptiveOptions = null)
- => AnalyzeCore(CirTapeLowerer.Lower(node), node.Bounds, CirNativeAnalysisInputKind.CirNode, points, denseResolution, adaptiveOptions, null);
+ public static CirNativeAnalysisResult AnalyzeNode(SdfNode node, IEnumerable<Point3D>? points = null, int? denseResolution = null, SdfAdaptiveVolumeOptions? adaptiveOptions = null)
+ => AnalyzeCore(SdfTapeLowerer.Lower(node), node.Bounds, CirNativeAnalysisInputKind.SdfNode, points, denseResolution, adaptiveOptions, null);
- public static CirNativeAnalysisResult AnalyzeFirmamentPlan(FirmamentPrimitiveLoweringPlan plan, IEnumerable<Point3D>? points = null, int? denseResolution = null, CirAdaptiveVolumeOptions? adaptiveOptions = null)
+ public static CirNativeAnalysisResult AnalyzeFirmamentPlan(FirmamentPrimitiveLoweringPlan plan, IEnumerable<Point3D>? points = null, int? denseResolution = null, SdfAdaptiveVolumeOptions? adaptiveOptions = null)
{
var lowering = FirmamentCirLowerer.Lower(plan);
var diagnostics = lowering.Diagnostics.Select(d => new CirNativeLoweringDiagnostic(null, d.Source, d.Message)).ToArray();
@@ -36,15 +36,15 @@ public static class CirNativeAnalysisService
["BRep backend may still support materialized analysis; CIR lowering is unsupported for this model."], diagnostics, loweringSummary, null, null, []);
}
- return AnalyzeCore(CirTapeLowerer.Lower(lowering.Value.Root), lowering.Value.Root.Bounds, CirNativeAnalysisInputKind.Firmament, points, denseResolution, adaptiveOptions, loweringSummary);
+ return AnalyzeCore(SdfTapeLowerer.Lower(lowering.Value.Root), lowering.Value.Root.Bounds, CirNativeAnalysisInputKind.Firmament, points, denseResolution, adaptiveOptions, loweringSummary);
}
- private static CirNativeAnalysisResult AnalyzeCore(CirTape tape, CirBounds bounds, CirNativeAnalysisInputKind inputKind, IEnumerable<Point3D>? points, int? denseResolution, CirAdaptiveVolumeOptions? adaptiveOptions, CirNativeLoweringSummary? lowering)
+ private static CirNativeAnalysisResult AnalyzeCore(SdfTape tape, SdfBounds bounds, CirNativeAnalysisInputKind inputKind, IEnumerable<Point3D>? points, int? denseResolution, SdfAdaptiveVolumeOptions? adaptiveOptions, CirNativeLoweringSummary? lowering)
{
var classifications = (points ?? []).Select(point =>
{
var value = tape.Evaluate(point);
- var kind = double.Abs(value) <= 1e-6d ? CirPointClassification.Boundary : (value < 0d ? CirPointClassification.Inside : CirPointClassification.Outside);
+ var kind = double.Abs(value) <= 1e-6d ? SdfPointClassification.Boundary : (value < 0d ? SdfPointClassification.Inside : SdfPointClassification.Outside);
return new CirNativePointClassification(point, kind, value);
}).ToArray();
@@ -54,7 +54,7 @@ public static class CirNativeAnalysisService
if (adaptiveOptions is not null)
{
- var adaptive = CirAdaptiveVolumeEstimator.EstimateVolume(tape, bounds, adaptiveOptions);
+ var adaptive = SdfAdaptiveVolumeEstimator.EstimateVolume(tape, bounds, adaptiveOptions);
volume = new CirNativeVolumeResult(CirNativeEstimatorKind.Adaptive, adaptive.EstimatedVolume, null, adaptive.Options, null, adaptive.TotalRegionsVisited, adaptive.RegionsClassifiedInside, adaptive.RegionsClassifiedOutside, adaptive.RegionsSubdivided, adaptive.RegionsSampledDirectly, adaptive.UnknownOrRejectedRegions, adaptive.MaxDepthReached, adaptive.TraceEvents.Count, adaptive.TraceEvents, true);
notes.AddRange(adaptive.Notes);
resultKind = CirNativeAnalysisResultKind.Approximate;
@@ -62,8 +62,8 @@ public static class CirNativeAnalysisService
else if (denseResolution.HasValue)
{
var resolution = int.Max(1, denseResolution.Value);
- var volumeNode = new CirTapeVolumeNode(tape, bounds);
- volume = new CirNativeVolumeResult(CirNativeEstimatorKind.Dense, CirVolumeEstimator.EstimateVolume(volumeNode, resolution), resolution, null, resolution * resolution * resolution, null, null, null, null, null, 0, null, 0, [], true);
+ var volumeNode = new SdfTapeVolumeNode(tape, bounds);
+ volume = new CirNativeVolumeResult(CirNativeEstimatorKind.Dense, SdfVolumeEstimator.EstimateVolume(volumeNode, resolution), resolution, null, resolution * resolution * resolution, null, null, null, null, null, 0, null, 0, [], true);
notes.Add("Dense CIR volume estimation uses regular grid center-point sampling and is approximate.");
resultKind = CirNativeAnalysisResultKind.Approximate;
}
@@ -71,9 +71,9 @@ public static class CirNativeAnalysisService
return new CirNativeAnalysisResult(true, "cir", inputKind, resultKind, notes, [], lowering, new CirNativeBounds(bounds.Min, bounds.Max), volume, classifications);
}
- private sealed record CirTapeVolumeNode(CirTape Tape, CirBounds TapeBounds) : CirNode(CirNodeKind.Transform)
+ private sealed record SdfTapeVolumeNode(SdfTape Tape, SdfBounds TapeBounds) : SdfNode(SdfNodeKind.Transform)
{
- public override CirBounds Bounds => TapeBounds;
+ public override SdfBounds Bounds => TapeBounds;
public override double Evaluate(Point3D point) => Tape.Evaluate(point);
}
}
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/FacePatchCandidateDryRun.cs b/Aetheris.Kernel.Firmament/Diagnostics/FacePatchCandidateDryRun.cs
index b77917a3..1617cd27 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/FacePatchCandidateDryRun.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/FacePatchCandidateDryRun.cs
@@ -139,7 +139,7 @@ internal sealed record FacePatchCandidateGenerationResult(
internal static class FacePatchCandidateGenerator
{
- internal static FacePatchCandidateGenerationResult Generate(CirNode root, NativeGeometryReplayLog? replayLog = null)
+ internal static FacePatchCandidateGenerationResult Generate(SdfNode root, NativeGeometryReplayLog? replayLog = null)
{
var extraction = SourceSurfaceExtractor.Extract(root, replayLog);
var candidates = new List<FacePatchCandidate>();
@@ -153,7 +153,7 @@ internal static class FacePatchCandidateGenerator
diagnostics.AddRange(extraction.UnsupportedNodeReasons.Select(r => $"source-surface-extraction-unsupported: {r}"));
}
- if (root is not CirSubtractNode subtract)
+ if (root is not SdfSubtractNode subtract)
{
foreach (var source in extraction.Descriptors)
{
@@ -319,8 +319,8 @@ internal static class FacePatchCandidateGenerator
_ => FacePatchCandidateReadiness.Unsupported
};
- private static bool IsFromNode(SourceSurfaceDescriptor source, CirNode node)
- => source.OwningCirNodeKind == node.GetType().Name;
+ private static bool IsFromNode(SourceSurfaceDescriptor source, SdfNode node)
+ => source.OwningSdfNodeKind == node.GetType().Name;
private static int Score(TrimCapabilityClassification c)
=> c switch
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/MaterializationReadinessAnalyzer.cs b/Aetheris.Kernel.Firmament/Diagnostics/MaterializationReadinessAnalyzer.cs
index 2bff549d..bb8e80d7 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/MaterializationReadinessAnalyzer.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/MaterializationReadinessAnalyzer.cs
@@ -53,10 +53,10 @@ internal sealed record MaterializationReadinessReport(
internal static class MaterializationReadinessAnalyzer
{
- internal static MaterializationReadinessReport Analyze(CirNode root, NativeGeometryReplayLog? replayLog = null)
+ internal static MaterializationReadinessReport Analyze(SdfNode root, NativeGeometryReplayLog? replayLog = null)
{
var source = SourceSurfaceExtractor.Extract(root, replayLog);
- var nonSubtract = root is not CirSubtractNode;
+ var nonSubtract = root is not SdfSubtractNode;
var candidates = FacePatchCandidateGenerator.Generate(root, replayLog);
var topology = TopologyAssemblyDryRunPlanner.Generate(candidates);
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/ShellStitchingDryRun.cs b/Aetheris.Kernel.Firmament/Diagnostics/ShellStitchingDryRun.cs
index aacf97a9..2b8feeb5 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/ShellStitchingDryRun.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/ShellStitchingDryRun.cs
@@ -86,7 +86,7 @@ internal sealed record ShellStitchingDryRunResult(
internal static class ShellStitchingDryRunPlanner
{
- internal static ShellStitchingDryRunResult Generate(CirNode root)
+ internal static ShellStitchingDryRunResult Generate(SdfNode root)
{
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var generation = FacePatchCandidateGenerator.Generate(root);
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/SurfaceFamilyBoxCylinderPressureTest.cs b/Aetheris.Kernel.Firmament/Diagnostics/SurfaceFamilyBoxCylinderPressureTest.cs
index 3d26cffc..79797337 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/SurfaceFamilyBoxCylinderPressureTest.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/SurfaceFamilyBoxCylinderPressureTest.cs
@@ -34,7 +34,7 @@ internal static class SurfaceFamilyBoxCylinderPressureTest
{
private static readonly string[] RequiredStages = ["InputValidation","PlanarPatchEmission","CylindricalWallEmission","TokenPairingAnalysis","StitchCandidatePlanning","CombinedBodyRemap","SharedEdgeRewrite","DuplicateEdgeCleanup","VertexMergePlanning","LoopClosureValidation","ShellClosureValidation","BrepBodyValidation","StepExportSmoke"];
- internal static SurfaceFamilyBoxCylinderPressureTestResult Run(CirNode root, SurfaceFamilyBoxCylinderPressureTestOptions? options = null)
+ internal static SurfaceFamilyBoxCylinderPressureTestResult Run(SdfNode root, SurfaceFamilyBoxCylinderPressureTestOptions? options = null)
{
options ??= new();
var stages = new List<SurfaceFamilyPressureStageResult>();
@@ -45,7 +45,7 @@ internal static class SurfaceFamilyBoxCylinderPressureTest
var edgeUse = new Dictionary<string, int>(StringComparer.Ordinal);
var reached = "InputValidation";
- if (root is not CirSubtractNode { Left: CirBoxNode, Right: CirCylinderNode })
+ if (root is not SdfSubtractNode { Left: SdfBoxNode, Right: SdfCylinderNode })
{
stages.Add(new("InputValidation", SurfaceFamilyPressureStageStatus.Failed, ["canonical-input-required: subtract(box,cylinder)"], new Dictionary<string, int>()));
blockers.Add(Block("InputValidation", "unsupported-input-noncanonical", "Only canonical Subtract(Box,Cylinder) is supported.", "Provide a canonical subtract node with box base and cylinder tool."));
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/SurfacePatchDescriptorScaffold.cs b/Aetheris.Kernel.Firmament/Diagnostics/SurfacePatchDescriptorScaffold.cs
index e44da459..d42f4c56 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/SurfacePatchDescriptorScaffold.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/SurfacePatchDescriptorScaffold.cs
@@ -59,7 +59,7 @@ internal sealed record SourceSurfaceDescriptor(
CylindricalSurfaceGeometryEvidence? CylindricalGeometryEvidence,
Transform3D Transform,
string Provenance,
- string? OwningCirNodeKind,
+ string? OwningSdfNodeKind,
int? ReplayOpIndex,
FacePatchOrientationRole OrientationRole);
@@ -387,7 +387,7 @@ internal sealed class PlanarSurfaceMaterializer : ISurfaceFamilyMaterializer
return emission with { Diagnostics = emission.Diagnostics.Concat(diagnostics).Distinct().ToArray() };
}
- internal PlanarPatchSetMaterializationResult EmitSupportedPlanarPatches(CirNode root, NativeGeometryReplayLog? replayLog = null)
+ internal PlanarPatchSetMaterializationResult EmitSupportedPlanarPatches(SdfNode root, NativeGeometryReplayLog? replayLog = null)
{
var generation = FacePatchCandidateGenerator.Generate(root, replayLog);
var entries = new List<PlanarPatchSetEntry>();
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/TopologyAssemblyDryRun.cs b/Aetheris.Kernel.Firmament/Diagnostics/TopologyAssemblyDryRun.cs
index 737e41da..10db5a07 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/TopologyAssemblyDryRun.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/TopologyAssemblyDryRun.cs
@@ -47,7 +47,7 @@ internal sealed record TopologyAssemblyDryRunResult(
internal static class TopologyAssemblyDryRunPlanner
{
- internal static TopologyAssemblyDryRunResult Generate(CirNode root)
+ internal static TopologyAssemblyDryRunResult Generate(SdfNode root)
=> Generate(FacePatchCandidateGenerator.Generate(root));
internal static TopologyAssemblyDryRunResult Generate(FacePatchCandidateGenerationResult candidateResult)
diff --git a/Aetheris.Kernel.Firmament/Diagnostics/TopologyPairingEvidenceDryRun.cs b/Aetheris.Kernel.Firmament/Diagnostics/TopologyPairingEvidenceDryRun.cs
index aff2b5ac..8d791d8c 100644
--- a/Aetheris.Kernel.Firmament/Diagnostics/TopologyPairingEvidenceDryRun.cs
+++ b/Aetheris.Kernel.Firmament/Diagnostics/TopologyPairingEvidenceDryRun.cs
@@ -81,7 +81,7 @@ internal sealed record TopologyPairingEvidenceResult(
internal static class TopologyPairingEvidenceGenerator
{
- internal static TopologyPairingEvidenceResult Generate(CirNode root) => Generate(TopologyAssemblyDryRunPlanner.Generate(root));
+ internal static TopologyPairingEvidenceResult Generate(SdfNode root) => Generate(TopologyAssemblyDryRunPlanner.Generate(root));
internal static TopologyPairingEvidenceResult Generate(TopologyAssemblyDryRunResult dryRun)
{
diff --git a/Aetheris.Kernel.Firmament/Execution/RetainedLoopTrimOracleIntegrator.cs b/Aetheris.Kernel.Firmament/Execution/RetainedLoopTrimOracleIntegrator.cs
index 5f983f21..9e92f712 100644
--- a/Aetheris.Kernel.Firmament/Execution/RetainedLoopTrimOracleIntegrator.cs
+++ b/Aetheris.Kernel.Firmament/Execution/RetainedLoopTrimOracleIntegrator.cs
@@ -4,9 +4,9 @@ namespace Aetheris.Kernel.Firmament.Execution;
internal static class RetainedLoopTrimOracleIntegrator
{
- internal static List<FacePatchCandidate> Attach(CirNode root, List<FacePatchCandidate> candidates, List<string> globalDiagnostics)
+ internal static List<FacePatchCandidate> Attach(SdfNode root, List<FacePatchCandidate> candidates, List<string> globalDiagnostics)
{
- if (root is not CirSubtractNode subtract) return candidates;
+ if (root is not SdfSubtractNode subtract) return candidates;
var leftDescriptors = SourceSurfaceExtractor.Extract(subtract.Left).Descriptors;
var rightDescriptors = SourceSurfaceExtractor.Extract(subtract.Right).Descriptors;
@@ -82,7 +82,7 @@ internal static class RetainedLoopTrimOracleIntegrator
return next;
}
- private static TieredTrimCurveRepresentation BuildLoopRepresentation(SourceSurfaceDescriptor source, CirNode opposite, string routing)
+ private static TieredTrimCurveRepresentation BuildLoopRepresentation(SourceSurfaceDescriptor source, SdfNode opposite, string routing)
{
var field = SurfaceRestrictedFieldFactory.ForSourceAndOpposite(source, opposite, routing);
var grid = RestrictedFieldGridSampler.Sample(field, new RestrictedFieldGridOptions(65, 65));
diff --git a/Aetheris.Kernel.Firmament/Execution/SelectedOppositeFieldBuilder.cs b/Aetheris.Kernel.Firmament/Execution/SelectedOppositeFieldBuilder.cs
index 7209e64a..aa873710 100644
--- a/Aetheris.Kernel.Firmament/Execution/SelectedOppositeFieldBuilder.cs
+++ b/Aetheris.Kernel.Firmament/Execution/SelectedOppositeFieldBuilder.cs
@@ -12,7 +12,7 @@ internal enum SelectedOppositeFieldBuildStatus
internal sealed record SelectedOppositeFieldBuildResult(
SelectedOppositeFieldBuildStatus Status,
- CirNode? Node,
+ SdfNode? Node,
string Diagnostic);
internal static class SelectedOppositeFieldBuilder
@@ -38,7 +38,7 @@ internal static class SelectedOppositeFieldBuilder
return new(SelectedOppositeFieldBuildStatus.Deferred, null, "selected-opposite-field: cylinder-orientation-unsupported");
}
- var node = new CirTransformNode(new CirCylinderNode(cylinder.Radius, cylinder.Height), transform);
+ var node = new SdfTransformNode(new SdfCylinderNode(cylinder.Radius, cylinder.Height), transform);
return new(SelectedOppositeFieldBuildStatus.Success, node, "selected-opposite-field: cylinder");
}
diff --git a/Aetheris.Kernel.Firmament/Execution/SourceSurfaceExtraction.cs b/Aetheris.Kernel.Firmament/Execution/SourceSurfaceExtraction.cs
index 2b1b0e39..97849db8 100644
--- a/Aetheris.Kernel.Firmament/Execution/SourceSurfaceExtraction.cs
+++ b/Aetheris.Kernel.Firmament/Execution/SourceSurfaceExtraction.cs
@@ -62,13 +62,13 @@ internal sealed record SourceSurfaceExtractionResult(
internal static class SourceSurfaceExtractor
{
- internal static SourceSurfaceExtractionResult Extract(CirNode root, NativeGeometryReplayLog? replayLog = null)
+ internal static SourceSurfaceExtractionResult Extract(SdfNode root, NativeGeometryReplayLog? replayLog = null)
{
var descriptors = new List<SourceSurfaceDescriptor>();
var diagnostics = new List<SourceSurfaceExtractionDiagnostic>();
var unsupported = new List<string>();
Visit(root, Transform3D.Identity, descriptors, diagnostics, unsupported, replayLog);
- if (root is CirSubtractNode or CirUnionNode or CirIntersectNode)
+ if (root is SdfSubtractNode or SdfUnionNode or SdfIntersectNode)
{
diagnostics.Add(new("retention-deferred", "Boolean source-surface extraction inventories primitive surfaces only; retained/discarded classification is deferred."));
}
@@ -76,35 +76,35 @@ internal static class SourceSurfaceExtractor
return new(unsupported.Count == 0, descriptors, diagnostics, unsupported);
}
- private static void Visit(CirNode node, Transform3D accumulated, List<SourceSurfaceDescriptor> descriptors, List<SourceSurfaceExtractionDiagnostic> diagnostics, List<string> unsupported, NativeGeometryReplayLog? replayLog)
+ private static void Visit(SdfNode node, Transform3D accumulated, List<SourceSurfaceDescriptor> descriptors, List<SourceSurfaceExtractionDiagnostic> diagnostics, List<string> unsupported, NativeGeometryReplayLog? replayLog)
{
switch (node)
{
- case CirTransformNode transformNode:
+ case SdfTransformNode transformNode:
Visit(transformNode.Child, Transform3D.Compose(accumulated, transformNode.Transform), descriptors, diagnostics, unsupported, replayLog);
return;
- case CirBoxNode box:
- AddBoxDescriptors(box, accumulated, descriptors, replayLog, nameof(CirBoxNode));
+ case SdfBoxNode box:
+ AddBoxDescriptors(box, accumulated, descriptors, replayLog, nameof(SdfBoxNode));
return;
- case CirCylinderNode cylinder:
- AddCylinderDescriptors(cylinder, accumulated, descriptors, replayLog, diagnostics, nameof(CirCylinderNode));
+ case SdfCylinderNode cylinder:
+ AddCylinderDescriptors(cylinder, accumulated, descriptors, replayLog, diagnostics, nameof(SdfCylinderNode));
return;
- case CirSphereNode:
+ case SdfSphereNode:
descriptors.Add(CreateDescriptor(SurfacePatchFamily.Spherical, "sphere", null, null, accumulated, node, replayLog, FacePatchOrientationRole.Forward));
return;
- case CirTorusNode:
+ case SdfTorusNode:
descriptors.Add(CreateDescriptor(SurfacePatchFamily.Toroidal, "torus", null, null, accumulated, node, replayLog, FacePatchOrientationRole.Forward));
diagnostics.Add(new("torus-materialization-deferred", "Toroidal source surface extracted; downstream materialization remains deferred."));
return;
- case CirSubtractNode subtract:
+ case SdfSubtractNode subtract:
Visit(subtract.Left, accumulated, descriptors, diagnostics, unsupported, replayLog);
Visit(subtract.Right, accumulated, descriptors, diagnostics, unsupported, replayLog);
return;
- case CirUnionNode union:
+ case SdfUnionNode union:
Visit(union.Left, accumulated, descriptors, diagnostics, unsupported, replayLog);
Visit(union.Right, accumulated, descriptors, diagnostics, unsupported, replayLog);
return;
- case CirIntersectNode intersect:
+ case SdfIntersectNode intersect:
Visit(intersect.Left, accumulated, descriptors, diagnostics, unsupported, replayLog);
Visit(intersect.Right, accumulated, descriptors, diagnostics, unsupported, replayLog);
return;
@@ -114,20 +114,20 @@ internal static class SourceSurfaceExtractor
}
}
- private static void AddBoxDescriptors(CirBoxNode box, Transform3D transform, List<SourceSurfaceDescriptor> descriptors, NativeGeometryReplayLog? replayLog, string owningKind)
+ private static void AddBoxDescriptors(SdfBoxNode box, Transform3D transform, List<SourceSurfaceDescriptor> descriptors, NativeGeometryReplayLog? replayLog, string owningKind)
{
var hx = box.Width * 0.5d;
var hy = box.Height * 0.5d;
var hz = box.Depth * 0.5d;
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "top", CreateBoundedPatch(transform, new(-hx, -hy, hz), new(hx, -hy, hz), new(hx, hy, hz), new(-hx, hy, hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "bottom", CreateBoundedPatch(transform, new(-hx, hy, -hz), new(hx, hy, -hz), new(hx, -hy, -hz), new(-hx, -hy, -hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "left", CreateBoundedPatch(transform, new(-hx, -hy, -hz), new(-hx, hy, -hz), new(-hx, hy, hz), new(-hx, -hy, hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "right", CreateBoundedPatch(transform, new(hx, -hy, hz), new(hx, hy, hz), new(hx, hy, -hz), new(hx, -hy, -hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "front", CreateBoundedPatch(transform, new(-hx, hy, -hz), new(hx, hy, -hz), new(hx, hy, hz), new(-hx, hy, hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "back", CreateBoundedPatch(transform, new(-hx, -hy, hz), new(hx, -hy, hz), new(hx, -hy, -hz), new(-hx, -hy, -hz)), null, transform, CirNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "top", CreateBoundedPatch(transform, new(-hx, -hy, hz), new(hx, -hy, hz), new(hx, hy, hz), new(-hx, hy, hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "bottom", CreateBoundedPatch(transform, new(-hx, hy, -hz), new(hx, hy, -hz), new(hx, -hy, -hz), new(-hx, -hy, -hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "left", CreateBoundedPatch(transform, new(-hx, -hy, -hz), new(-hx, hy, -hz), new(-hx, hy, hz), new(-hx, -hy, hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "right", CreateBoundedPatch(transform, new(hx, -hy, hz), new(hx, hy, hz), new(hx, hy, -hz), new(hx, -hy, -hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "front", CreateBoundedPatch(transform, new(-hx, hy, -hz), new(hx, hy, -hz), new(hx, hy, hz), new(-hx, hy, hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "back", CreateBoundedPatch(transform, new(-hx, -hy, hz), new(hx, -hy, hz), new(hx, -hy, -hz), new(-hx, -hy, -hz)), null, transform, SdfNodeKind.Box, replayLog, FacePatchOrientationRole.Forward, owningKind));
}
- private static void AddCylinderDescriptors(CirCylinderNode cylinder, Transform3D transform, List<SourceSurfaceDescriptor> descriptors, NativeGeometryReplayLog? replayLog, List<SourceSurfaceExtractionDiagnostic> diagnostics, string owningKind)
+ private static void AddCylinderDescriptors(SdfCylinderNode cylinder, Transform3D transform, List<SourceSurfaceDescriptor> descriptors, NativeGeometryReplayLog? replayLog, List<SourceSurfaceExtractionDiagnostic> diagnostics, string owningKind)
{
var sideEvidence = TryCreateCylindricalSideGeometryEvidence(cylinder, transform, out var sideDiagnostic);
if (sideDiagnostic is not null)
@@ -135,7 +135,7 @@ internal static class SourceSurfaceExtractor
diagnostics.Add(sideDiagnostic);
}
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Cylindrical, "side", null, sideEvidence, transform, CirNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Cylindrical, "side", null, sideEvidence, transform, SdfNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Forward, owningKind));
var topCap = TryCreateCircularCapGeometry(cylinder, transform, isTopCap: true, out var topDiagnostic);
var bottomCap = TryCreateCircularCapGeometry(cylinder, transform, isTopCap: false, out var bottomDiagnostic);
if (topDiagnostic is not null)
@@ -148,8 +148,8 @@ internal static class SourceSurfaceExtractor
diagnostics.Add(bottomDiagnostic);
}
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "cap-top", topCap, null, transform, CirNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Forward, owningKind));
- descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "cap-bottom", bottomCap, null, transform, CirNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Reversed, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "cap-top", topCap, null, transform, SdfNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Forward, owningKind));
+ descriptors.Add(CreateDescriptor(SurfacePatchFamily.Planar, "cap-bottom", bottomCap, null, transform, SdfNodeKind.Cylinder, replayLog, FacePatchOrientationRole.Reversed, owningKind));
}
@@ -162,7 +162,7 @@ internal static class SourceSurfaceExtractor
return BoundedPlanarPatchGeometry.CreateRectangle(w00, w10, w11, w01, (w10 - w00).Cross(w01 - w00));
}
- private static BoundedPlanarPatchGeometry? TryCreateCircularCapGeometry(CirCylinderNode cylinder, Transform3D transform, bool isTopCap, out SourceSurfaceExtractionDiagnostic? diagnostic)
+ private static BoundedPlanarPatchGeometry? TryCreateCircularCapGeometry(SdfCylinderNode cylinder, Transform3D transform, bool isTopCap, out SourceSurfaceExtractionDiagnostic? diagnostic)
{
diagnostic = null;
var z = (isTopCap ? 1d : -1d) * cylinder.Height * 0.5d;
@@ -189,7 +189,7 @@ internal static class SourceSurfaceExtractor
return BoundedPlanarPatchGeometry.CreateCircle(worldCenter, worldNormal, radiusX);
}
- private static CylindricalSurfaceGeometryEvidence? TryCreateCylindricalSideGeometryEvidence(CirCylinderNode cylinder, Transform3D transform, out SourceSurfaceExtractionDiagnostic? diagnostic)
+ private static CylindricalSurfaceGeometryEvidence? TryCreateCylindricalSideGeometryEvidence(SdfCylinderNode cylinder, Transform3D transform, out SourceSurfaceExtractionDiagnostic? diagnostic)
{
diagnostic = null;
var localBottom = new Point3D(0d, 0d, -cylinder.Height * 0.5d);
@@ -217,14 +217,14 @@ internal static class SourceSurfaceExtractor
return new CylindricalSurfaceGeometryEvidence(worldBottom, axis, radiusX, height, worldBottom, worldTop);
}
- private static SourceSurfaceDescriptor CreateDescriptor(SurfacePatchFamily family, string provenanceRole, BoundedPlanarPatchGeometry? boundedPlanarGeometry, CylindricalSurfaceGeometryEvidence? cylindricalGeometryEvidence, Transform3D transform, CirNodeKind nodeKind, NativeGeometryReplayLog? replayLog, FacePatchOrientationRole orientation, string owningKind)
+ private static SourceSurfaceDescriptor CreateDescriptor(SurfacePatchFamily family, string provenanceRole, BoundedPlanarPatchGeometry? boundedPlanarGeometry, CylindricalSurfaceGeometryEvidence? cylindricalGeometryEvidence, Transform3D transform, SdfNodeKind nodeKind, NativeGeometryReplayLog? replayLog, FacePatchOrientationRole orientation, string owningKind)
{
var op = replayLog?.Operations.LastOrDefault();
var placementSuffix = op is null ? "" : $"|placement:{op.ResolvedPlacement.Kind}";
return new SourceSurfaceDescriptor(family, provenanceRole, boundedPlanarGeometry, cylindricalGeometryEvidence, transform, $"cir:{nodeKind.ToString().ToLowerInvariant()}:{provenanceRole}{placementSuffix}", owningKind, op?.OpIndex, orientation);
}
- private static SourceSurfaceDescriptor CreateDescriptor(SurfacePatchFamily family, string provenanceRole, BoundedPlanarPatchGeometry? boundedPlanarGeometry, CylindricalSurfaceGeometryEvidence? cylindricalGeometryEvidence, Transform3D transform, CirNode node, NativeGeometryReplayLog? replayLog, FacePatchOrientationRole orientation, string? owningKind = null)
+ private static SourceSurfaceDescriptor CreateDescriptor(SurfacePatchFamily family, string provenanceRole, BoundedPlanarPatchGeometry? boundedPlanarGeometry, CylindricalSurfaceGeometryEvidence? cylindricalGeometryEvidence, Transform3D transform, SdfNode node, NativeGeometryReplayLog? replayLog, FacePatchOrientationRole orientation, string? owningKind = null)
{
var op = replayLog?.Operations.LastOrDefault();
var placementSuffix = op is null ? "" : $"|placement:{op.ResolvedPlacement.Kind}";
diff --git a/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyShellAssembler.cs b/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyShellAssembler.cs
index 05cb92f5..679b79e7 100644
--- a/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyShellAssembler.cs
+++ b/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyShellAssembler.cs
@@ -16,7 +16,7 @@ internal sealed record SurfaceFamilyShellAssemblyResult(
internal static class SurfaceFamilyShellAssembler
{
internal static SurfaceFamilyShellAssemblyResult TryAssembleBoxMinusCylinder(
- CirNode root,
+ SdfNode root,
NativeGeometryReplayLog? replayLog = null)
{
_ = replayLog;
diff --git a/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyStitchCandidatePlanner.cs b/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyStitchCandidatePlanner.cs
index 5ba81f38..0bbd216a 100644
--- a/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyStitchCandidatePlanner.cs
+++ b/Aetheris.Kernel.Firmament/Execution/SurfaceFamilyStitchCandidatePlanner.cs
@@ -123,7 +123,7 @@ internal static class SurfaceFamilyStitchCandidatePlanner
StitchExecutionImplemented: false);
}
- internal static SurfaceFamilyStitchPlanResult PlanBoxCylinder(CirNode root)
+ internal static SurfaceFamilyStitchPlanResult PlanBoxCylinder(SdfNode root)
{
var planar = new PlanarSurfaceMaterializer().EmitSupportedPlanarPatches(root);
var gen = FacePatchCandidateGenerator.Generate(root);
diff --git a/Aetheris.Kernel.Firmament/Execution/SurfaceRestrictedField.cs b/Aetheris.Kernel.Firmament/Execution/SurfaceRestrictedField.cs
index 47b24288..2b18a957 100644
--- a/Aetheris.Kernel.Firmament/Execution/SurfaceRestrictedField.cs
+++ b/Aetheris.Kernel.Firmament/Execution/SurfaceRestrictedField.cs
@@ -51,7 +51,7 @@ internal sealed record RestrictedFieldSample(
internal sealed record SurfaceRestrictedField(
SourceSurfaceDescriptor SourceSurface,
PlanarRectangleParameterization? Parameterization,
- CirTape? OppositeTape,
+ SdfTape? OppositeTape,
SurfaceRestrictedFieldStatus Status,
IReadOnlyList<string> Diagnostics)
{
@@ -84,14 +84,14 @@ internal sealed record SurfaceRestrictedField(
internal static class SurfaceRestrictedFieldFactory
{
- internal static SurfaceRestrictedField ForSubtractSource(CirSubtractNode root, SourceSurfaceDescriptor source, SubtractOperandSide side)
+ internal static SurfaceRestrictedField ForSubtractSource(SdfSubtractNode root, SourceSurfaceDescriptor source, SubtractOperandSide side)
{
var opposite = side == SubtractOperandSide.Left ? root.Right : root.Left;
var routing = side == SubtractOperandSide.Left ? "opposite-operand-selected:right" : "opposite-operand-selected:left";
return ForSourceAndOpposite(source, opposite, routing);
}
- internal static SurfaceRestrictedField ForSourceAndOpposite(SourceSurfaceDescriptor source, CirNode opposite, string routingDiagnostic)
+ internal static SurfaceRestrictedField ForSourceAndOpposite(SourceSurfaceDescriptor source, SdfNode opposite, string routingDiagnostic)
{
var diagnostics = new List<string>();
if (!TryBuildPlanarRectangle(source, out var parameterization, out var parameterizationDiagnostic))
@@ -107,7 +107,7 @@ internal static class SurfaceRestrictedFieldFactory
try
{
- var tape = CirTapeLowerer.Lower(opposite);
+ var tape = SdfTapeLowerer.Lower(opposite);
diagnostics.Add("opposite-tape-lowered");
diagnostics.Add("evaluation-available");
diagnostics.Add("contour-extraction-not-implemented");
diff --git a/Aetheris.Kernel.Firmament/Execution/TieredTrimRepresentationBuilder.cs b/Aetheris.Kernel.Firmament/Execution/TieredTrimRepresentationBuilder.cs
index 3dffa601..8eba78c5 100644
--- a/Aetheris.Kernel.Firmament/Execution/TieredTrimRepresentationBuilder.cs
+++ b/Aetheris.Kernel.Firmament/Execution/TieredTrimRepresentationBuilder.cs
@@ -147,7 +147,7 @@ internal static class TieredTrimRepresentationBuilder
var sourceKey = field?.SourceSurface.ParameterPayloadReference;
var sourceFamily = field?.SourceSurface.Family;
if (string.IsNullOrWhiteSpace(sourceKey)) d.Add("tiered-trim-provenance-missing-source-surface-key");
- var oppositeKind = field?.OppositeTape is null ? null : "CirTape";
+ var oppositeKind = field?.OppositeTape is null ? null : "SdfTape";
if (oppositeKind is null) d.Add("tiered-trim-provenance-missing-opposite-field-kind");
var side = field?.Diagnostics.FirstOrDefault(x => x.StartsWith("opposite-operand-selected:", StringComparison.Ordinal));
diff --git a/Aetheris.Kernel.Firmament/Lowering/FirmamentCirLowerer.cs b/Aetheris.Kernel.Firmament/Lowering/FirmamentCirLowerer.cs
index fa465458..25a55d4c 100644
--- a/Aetheris.Kernel.Firmament/Lowering/FirmamentCirLowerer.cs
+++ b/Aetheris.Kernel.Firmament/Lowering/FirmamentCirLowerer.cs
@@ -10,14 +10,14 @@ using Aetheris.Kernel.Firmament.Diagnostics;
namespace Aetheris.Kernel.Firmament.Lowering;
public sealed record CirLoweringDiagnostic(int OpIndex, string FeatureId, string Message);
-public sealed record CirLoweringResult(CirNode Root, IReadOnlyList<CirLoweringDiagnostic> Diagnostics);
+public sealed record CirLoweringResult(SdfNode Root, IReadOnlyList<CirLoweringDiagnostic> Diagnostics);
internal static class FirmamentCirLowerer
{
public static KernelResult<CirLoweringResult> Lower(FirmamentPrimitiveLoweringPlan plan)
{
ArgumentNullException.ThrowIfNull(plan);
- var nodesByFeature = new Dictionary<string, CirNode>(StringComparer.Ordinal);
+ var nodesByFeature = new Dictionary<string, SdfNode>(StringComparer.Ordinal);
var diagnostics = new List<CirLoweringDiagnostic>();
foreach (var primitive in plan.Primitives.OrderBy(p => p.OpIndex))
@@ -56,9 +56,9 @@ internal static class FirmamentCirLowerer
rhs = ApplyPlacement(rhs, boolean.Placement, boolean.OpIndex, boolean.FeatureId, nodesByFeature, diagnostics);
var composed = boolean.Kind switch
{
- FirmamentLoweredBooleanKind.Add => new CirUnionNode(lhs, rhs),
- FirmamentLoweredBooleanKind.Subtract => new CirSubtractNode(lhs, rhs),
- FirmamentLoweredBooleanKind.Intersect => new CirIntersectNode(lhs, rhs),
+ FirmamentLoweredBooleanKind.Add => new SdfUnionNode(lhs, rhs),
+ FirmamentLoweredBooleanKind.Subtract => new SdfSubtractNode(lhs, rhs),
+ FirmamentLoweredBooleanKind.Intersect => new SdfIntersectNode(lhs, rhs),
_ => lhs
};
@@ -90,7 +90,7 @@ internal static class FirmamentCirLowerer
return KernelResult<CirLoweringResult>.Success(new CirLoweringResult(root, diagnostics));
}
- private static CirNode? LowerTool(FirmamentLoweredBoolean boolean, List<CirLoweringDiagnostic> diagnostics)
+ private static SdfNode? LowerTool(FirmamentLoweredBoolean boolean, List<CirLoweringDiagnostic> diagnostics)
{
if (!boolean.Tool.RawFields.TryGetValue("op", out var op))
{
@@ -102,40 +102,40 @@ internal static class FirmamentCirLowerer
{
"box" when boolean.Tool.RawFields.TryGetValue("size", out var size) => BuildBox(size),
"cylinder" when boolean.Tool.RawFields.TryGetValue("radius", out var radius) && boolean.Tool.RawFields.TryGetValue("height", out var height)
- => new CirCylinderNode(double.Parse(radius), double.Parse(height)),
- "sphere" when boolean.Tool.RawFields.TryGetValue("radius", out var sr) => new CirSphereNode(double.Parse(sr)),
+ => new SdfCylinderNode(double.Parse(radius), double.Parse(height)),
+ "sphere" when boolean.Tool.RawFields.TryGetValue("radius", out var sr) => new SdfSphereNode(double.Parse(sr)),
"torus" when boolean.Tool.RawFields.TryGetValue("major_radius", out var major) && boolean.Tool.RawFields.TryGetValue("minor_radius", out var minor)
- => new CirTorusNode(double.Parse(major), double.Parse(minor)),
+ => new SdfTorusNode(double.Parse(major), double.Parse(minor)),
"cone" when boolean.Tool.RawFields.TryGetValue("bottom_radius", out var br) && boolean.Tool.RawFields.TryGetValue("top_radius", out var tr) && boolean.Tool.RawFields.TryGetValue("height", out var ch)
- => new CirConeNode(double.Parse(br), double.Parse(tr), double.Parse(ch)),
+ => new SdfConeNode(double.Parse(br), double.Parse(tr), double.Parse(ch)),
_ => UnsupportedTool(boolean, diagnostics)
};
}
- private static CirNode? UnsupportedTool(FirmamentLoweredBoolean boolean, List<CirLoweringDiagnostic> diagnostics)
+ private static SdfNode? UnsupportedTool(FirmamentLoweredBoolean boolean, List<CirLoweringDiagnostic> diagnostics)
{
diagnostics.Add(new(boolean.OpIndex, boolean.FeatureId, $"Unsupported boolean tool op for CIR-M1: {boolean.Tool.OpName}."));
return null;
}
- private static CirNode? LowerPrimitive(FirmamentLoweredPrimitive primitive, List<CirLoweringDiagnostic> diagnostics) => primitive switch
+ private static SdfNode? LowerPrimitive(FirmamentLoweredPrimitive primitive, List<CirLoweringDiagnostic> diagnostics) => primitive switch
{
- { Kind: FirmamentLoweredPrimitiveKind.Box, Parameters: FirmamentLoweredBoxParameters box } => new CirBoxNode(box.SizeX, box.SizeY, box.SizeZ),
- { Kind: FirmamentLoweredPrimitiveKind.Cylinder, Parameters: FirmamentLoweredCylinderParameters cylinder } => new CirCylinderNode(cylinder.Radius, cylinder.Height),
- { Kind: FirmamentLoweredPrimitiveKind.Sphere, Parameters: FirmamentLoweredSphereParameters sphere } => new CirSphereNode(sphere.Radius),
- { Kind: FirmamentLoweredPrimitiveKind.Torus, Parameters: FirmamentLoweredTorusParameters torus } => new CirTorusNode(torus.MajorRadius, torus.MinorRadius),
- { Kind: FirmamentLoweredPrimitiveKind.Cone, Parameters: FirmamentLoweredConeParameters cone } => new CirConeNode(cone.BottomRadius, cone.TopRadius, cone.Height),
+ { Kind: FirmamentLoweredPrimitiveKind.Box, Parameters: FirmamentLoweredBoxParameters box } => new SdfBoxNode(box.SizeX, box.SizeY, box.SizeZ),
+ { Kind: FirmamentLoweredPrimitiveKind.Cylinder, Parameters: FirmamentLoweredCylinderParameters cylinder } => new SdfCylinderNode(cylinder.Radius, cylinder.Height),
+ { Kind: FirmamentLoweredPrimitiveKind.Sphere, Parameters: FirmamentLoweredSphereParameters sphere } => new SdfSphereNode(sphere.Radius),
+ { Kind: FirmamentLoweredPrimitiveKind.Torus, Parameters: FirmamentLoweredTorusParameters torus } => new SdfTorusNode(torus.MajorRadius, torus.MinorRadius),
+ { Kind: FirmamentLoweredPrimitiveKind.Cone, Parameters: FirmamentLoweredConeParameters cone } => new SdfConeNode(cone.BottomRadius, cone.TopRadius, cone.Height),
_ => UnsupportedPrimitive(primitive, diagnostics)
};
- private static CirNode? UnsupportedPrimitive(FirmamentLoweredPrimitive primitive, List<CirLoweringDiagnostic> diagnostics)
+ private static SdfNode? UnsupportedPrimitive(FirmamentLoweredPrimitive primitive, List<CirLoweringDiagnostic> diagnostics)
{
diagnostics.Add(new(primitive.OpIndex, primitive.FeatureId, $"Unsupported primitive for CIR-M1: {primitive.Kind}."));
return null;
}
- private static CirNode ApplyDefaultPrimitiveLocalFrame(FirmamentLoweredPrimitive primitive, CirNode node)
+ private static SdfNode ApplyDefaultPrimitiveLocalFrame(FirmamentLoweredPrimitive primitive, SdfNode node)
{
var zShift = primitive switch
{
@@ -155,16 +155,16 @@ internal static class FirmamentCirLowerer
return node;
}
- return new CirTransformNode(node, Transform3D.CreateTranslation(new Vector3D(0d, 0d, zShift)));
+ return new SdfTransformNode(node, Transform3D.CreateTranslation(new Vector3D(0d, 0d, zShift)));
}
- private static CirNode BuildBox(string sizeRaw)
+ private static SdfNode BuildBox(string sizeRaw)
{
var parts = sizeRaw.Trim('[', ']').Split(',').Select(p => double.Parse(p.Trim())).ToArray();
- return new CirBoxNode(parts[0], parts[1], parts[2]);
+ return new SdfBoxNode(parts[0], parts[1], parts[2]);
}
- private static CirNode ApplyDefaultToolLocalFrame(FirmamentLoweredToolOp tool, CirNode node)
+ private static SdfNode ApplyDefaultToolLocalFrame(FirmamentLoweredToolOp tool, SdfNode node)
{
var zShift = ResolveDefaultToolFrameZShift(tool);
if (!zShift.HasValue || Math.Abs(zShift.Value) <= 1e-12d)
@@ -172,7 +172,7 @@ internal static class FirmamentCirLowerer
return node;
}
- return new CirTransformNode(node, Transform3D.CreateTranslation(new Vector3D(0d, 0d, zShift.Value)));
+ return new SdfTransformNode(node, Transform3D.CreateTranslation(new Vector3D(0d, 0d, zShift.Value)));
}
private static double? ResolveDefaultToolFrameZShift(FirmamentLoweredToolOp tool)
@@ -202,7 +202,7 @@ internal static class FirmamentCirLowerer
return null;
}
- private static CirNode ApplyPlacement(CirNode node, FirmamentLoweredPlacement? placement, int opIndex, string featureId, IReadOnlyDictionary<string, CirNode> loweredFeatures, List<CirLoweringDiagnostic> diagnostics)
+ private static SdfNode ApplyPlacement(SdfNode node, FirmamentLoweredPlacement? placement, int opIndex, string featureId, IReadOnlyDictionary<string, SdfNode> loweredFeatures, List<CirLoweringDiagnostic> diagnostics)
{
if (placement is null)
{
@@ -228,11 +228,11 @@ internal static class FirmamentCirLowerer
return node;
}
- return new CirTransformNode(node, Transform3D.CreateTranslation(translation));
+ return new SdfTransformNode(node, Transform3D.CreateTranslation(translation));
}
- private static Point3D? ResolvePlacementAnchor(FirmamentLoweredPlacement placement, IReadOnlyDictionary<string, CirNode> loweredFeatures, int opIndex, string featureId, List<CirLoweringDiagnostic> diagnostics)
+ private static Point3D? ResolvePlacementAnchor(FirmamentLoweredPlacement placement, IReadOnlyDictionary<string, SdfNode> loweredFeatures, int opIndex, string featureId, List<CirLoweringDiagnostic> diagnostics)
{
if (placement.On is null || placement.On is FirmamentLoweredPlacementOriginAnchor)
{
diff --git a/Aetheris.Kernel.Firmament/Materializer/CirBoxCylinderRecognizer.cs b/Aetheris.Kernel.Firmament/Materializer/CirBoxCylinderRecognizer.cs
index e1d258cc..3547eb8f 100644
--- a/Aetheris.Kernel.Firmament/Materializer/CirBoxCylinderRecognizer.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/CirBoxCylinderRecognizer.cs
@@ -28,7 +28,7 @@ internal enum CirBoxCylinderAxisKind
}
internal sealed record CirBoxCylinderRecognizerInput(
- CirNode Root,
+ SdfNode Root,
NativeGeometryReplayLog? ReplayLog = null,
string? SourceLabel = null);
@@ -62,12 +62,12 @@ internal static class CirBoxCylinderRecognizer
var diagnostics = new List<string>();
var tol = ToleranceContext.Default.Linear;
- if (input.Root is not CirSubtractNode subtract)
+ if (input.Root is not SdfSubtractNode subtract)
{
- return Fail(CirBoxCylinderRecognitionReason.UnsupportedRootNotSubtract, "Root must be CirSubtractNode.", diagnostics);
+ return Fail(CirBoxCylinderRecognitionReason.UnsupportedRootNotSubtract, "Root must be SdfSubtractNode.", diagnostics);
}
- if (subtract.Left is CirSubtractNode or CirUnionNode or CirIntersectNode || subtract.Right is CirSubtractNode or CirUnionNode or CirIntersectNode)
+ if (subtract.Left is SdfSubtractNode or SdfUnionNode or SdfIntersectNode || subtract.Right is SdfSubtractNode or SdfUnionNode or SdfIntersectNode)
{
return Fail(CirBoxCylinderRecognitionReason.UnsupportedNestedOrComposite, "Nested/composite booleans are unsupported in CIR-STEP-V1.", diagnostics);
}
@@ -82,14 +82,14 @@ internal static class CirBoxCylinderRecognizer
return Fail(CirBoxCylinderRecognitionReason.UnsupportedTransform, "Subtract right operand has unsupported transform wrapper.", diagnostics);
}
- if (leftNode is not CirBoxNode box)
+ if (leftNode is not SdfBoxNode box)
{
- return Fail(CirBoxCylinderRecognitionReason.UnsupportedLeftNotBox, "Subtract left operand must normalize to CirBoxNode.", diagnostics);
+ return Fail(CirBoxCylinderRecognitionReason.UnsupportedLeftNotBox, "Subtract left operand must normalize to SdfBoxNode.", diagnostics);
}
- if (rightNode is not CirCylinderNode cylinder)
+ if (rightNode is not SdfCylinderNode cylinder)
{
- return Fail(CirBoxCylinderRecognitionReason.UnsupportedRightNotCylinder, "Subtract right operand must normalize to CirCylinderNode.", diagnostics);
+ return Fail(CirBoxCylinderRecognitionReason.UnsupportedRightNotCylinder, "Subtract right operand must normalize to SdfCylinderNode.", diagnostics);
}
if (box.Width <= 0d || box.Height <= 0d || box.Depth <= 0d || !double.IsFinite(box.Width) || !double.IsFinite(box.Height) || !double.IsFinite(box.Depth))
@@ -106,7 +106,11 @@ internal static class CirBoxCylinderRecognizer
var boxMaxZ = boxTranslation.Z + (box.Depth * 0.5d);
var cylinderMinZ = cylinderTranslation.Z - (cylinder.Height * 0.5d);
var cylinderMaxZ = cylinderTranslation.Z + (cylinder.Height * 0.5d);
- if (cylinderMinZ > boxMinZ + tol || cylinderMaxZ < boxMaxZ - tol)
+ // Intent decompilation must not promote a geometrically short tool to an exact through-hole.
+ // Use only a roundoff allowance here; the model-space tolerance is an admissibility band,
+ // not permission to change recovered topology.
+ var spanRoundoff = double.Max(1e-12d, box.Depth * Aetheris.Kernel.Core.Numerics.ToleranceContext.Default.Relative);
+ if (cylinderMinZ > boxMinZ + spanRoundoff || cylinderMaxZ < boxMaxZ - spanRoundoff)
{
return Fail(CirBoxCylinderRecognitionReason.UnsupportedNotThroughHole, "Cylinder does not span full box depth.", diagnostics);
}
@@ -179,11 +183,11 @@ internal static class CirBoxCylinderRecognizer
diagnostics.Add($"Replay context: opIndex={cylinderSubtract.OpIndex}, feature='{cylinderSubtract.FeatureId}', source='{cylinderSubtract.SourceFeatureId}', toolKind='{cylinderSubtract.ToolKind}'.");
}
- private static bool TryUnwrapTranslation(CirNode node, out CirNode unwrapped, out Vector3D translation)
+ private static bool TryUnwrapTranslation(SdfNode node, out SdfNode unwrapped, out Vector3D translation)
{
unwrapped = node;
translation = Vector3D.Zero;
- while (unwrapped is CirTransformNode transformNode)
+ while (unwrapped is SdfTransformNode transformNode)
{
if (!TryExtractPureTranslation(transformNode.Transform, out var step))
{
diff --git a/Aetheris.Kernel.Firmament/Materializer/CirBrepMaterializer.cs b/Aetheris.Kernel.Firmament/Materializer/CirBrepMaterializer.cs
index 90e21c19..aa9796cb 100644
--- a/Aetheris.Kernel.Firmament/Materializer/CirBrepMaterializer.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/CirBrepMaterializer.cs
@@ -16,7 +16,7 @@ internal static class CirBrepMaterializer
private static readonly JudgmentEngine<CirBrepMaterializerContext> Engine = new();
private static readonly ICirBrepMaterializerStrategy[] Registry = [new SubtractBoxCylinderStrategy(), new SubtractBoxBoxStrategy(), new SubtractBoxTorusUnsupportedStrategy()];
- internal static CirBrepMaterializationResult TryMaterialize(CirNode root) => TryMaterialize(new CirBrepMaterializerContext(root, null));
+ internal static CirBrepMaterializationResult TryMaterialize(SdfNode root) => TryMaterialize(new CirBrepMaterializerContext(root, null));
internal static CirBrepMaterializationResult TryMaterialize(CirBrepMaterializerContext context)
{
@@ -33,7 +33,7 @@ internal static class CirBrepMaterializer
return result with { SelectedStrategy = selected, StrategyRejections = judgment.Rejections };
}
- internal sealed record CirBrepMaterializerContext(CirNode Root, NativeGeometryReplayLog? ReplayLog)
+ internal sealed record CirBrepMaterializerContext(SdfNode Root, NativeGeometryReplayLog? ReplayLog)
{
internal NativeGeometryReplayOperation? LatestOperation => ReplayLog?.Operations.LastOrDefault(op => op.OperationKind.StartsWith("boolean:subtract", StringComparison.OrdinalIgnoreCase)) ?? ReplayLog?.Operations.LastOrDefault();
}
@@ -97,16 +97,16 @@ internal static class CirBrepMaterializer
}
}
- private sealed record Match(CirBoxNode LeftBox, Vector3D LeftTranslation, Vector3D RightTranslation, CirCylinderNode? Cylinder, CirBoxNode? RightBox);
+ private sealed record Match(SdfBoxNode LeftBox, Vector3D LeftTranslation, Vector3D RightTranslation, SdfCylinderNode? Cylinder, SdfBoxNode? RightBox);
private static bool TryMatch(CirBrepMaterializerContext context, bool cylinder, out Match? match, out string reason)
{
match = null;
- if (context.Root is not CirSubtractNode s) { reason = "CIR root is not subtract."; return false; }
- if (!TryUnwrapTranslation(s.Left, out var lnode, out var lt) || lnode is not CirBoxNode lb) { reason = "Subtract lhs must be translated/untranslated box with translation-only transforms."; return false; }
+ if (context.Root is not SdfSubtractNode s) { reason = "CIR root is not subtract."; return false; }
+ if (!TryUnwrapTranslation(s.Left, out var lnode, out var lt) || lnode is not SdfBoxNode lb) { reason = "Subtract lhs must be translated/untranslated box with translation-only transforms."; return false; }
if (!TryUnwrapTranslation(s.Right, out var rnode, out var rt)) { reason = "Subtract rhs contains unsupported non-translation transform."; return false; }
if (!ReplayMatches(context, cylinder ? "cylinder" : "box", out reason)) return false;
- if (cylinder && rnode is CirCylinderNode rc) { match = new(lb, lt, rt, rc, null); reason = "matched"; return true; }
- if (!cylinder && rnode is CirBoxNode rb) { match = new(lb, lt, rt, null, rb); reason = "matched"; return true; }
+ if (cylinder && rnode is SdfCylinderNode rc) { match = new(lb, lt, rt, rc, null); reason = "matched"; return true; }
+ if (!cylinder && rnode is SdfBoxNode rb) { match = new(lb, lt, rt, null, rb); reason = "matched"; return true; }
reason = cylinder ? "Subtract rhs must be translated/untranslated cylinder." : "Subtract rhs must be translated/untranslated box.";
return false;
}
@@ -123,15 +123,15 @@ internal static class CirBrepMaterializer
private static bool TryMatchTorus(CirBrepMaterializerContext context, out string reason)
{
- if (context.Root is not CirSubtractNode s) { reason = "CIR root is not subtract."; return false; }
- if (!TryUnwrapTranslation(s.Left, out var lnode, out _) || lnode is not CirBoxNode) { reason = "Subtract lhs must be translated/untranslated box with translation-only transforms."; return false; }
- if (!TryUnwrapTranslation(s.Right, out var rnode, out _) || rnode is not CirTorusNode) { reason = "Subtract rhs must be translated/untranslated torus."; return false; }
+ if (context.Root is not SdfSubtractNode s) { reason = "CIR root is not subtract."; return false; }
+ if (!TryUnwrapTranslation(s.Left, out var lnode, out _) || lnode is not SdfBoxNode) { reason = "Subtract lhs must be translated/untranslated box with translation-only transforms."; return false; }
+ if (!TryUnwrapTranslation(s.Right, out var rnode, out _) || rnode is not SdfTorusNode) { reason = "Subtract rhs must be translated/untranslated torus."; return false; }
return ReplayMatches(context, "torus", out reason);
}
private static CirBrepMaterializationResult Failed(string pattern, string message, IReadOnlyList<KernelDiagnostic> d) => new(false, null, pattern, "materialize-failed", d, message, null, []);
private static BrepBody TranslateBody(BrepBody body, Vector3D t) => t == Vector3D.Zero ? body : FirmamentPrimitiveExecutionTranslation.TranslateBody(body, t);
- private static bool TryUnwrapTranslation(CirNode node, out CirNode unwrapped, out Vector3D translation) { var total = Vector3D.Zero; var cur = node; while (cur is CirTransformNode tr) { if (!TryExtractPureTranslation(tr.Transform, out var local)) { unwrapped = node; translation = Vector3D.Zero; return false; } total += local; cur = tr.Child; } unwrapped = cur; translation = total; return true; }
+ private static bool TryUnwrapTranslation(SdfNode node, out SdfNode unwrapped, out Vector3D translation) { var total = Vector3D.Zero; var cur = node; while (cur is SdfTransformNode tr) { if (!TryExtractPureTranslation(tr.Transform, out var local)) { unwrapped = node; translation = Vector3D.Zero; return false; } total += local; cur = tr.Child; } unwrapped = cur; translation = total; return true; }
private static bool TryExtractPureTranslation(Transform3D transform, out Vector3D translation) { var o = transform.Apply(Point3D.Origin); var x = transform.Apply(new Point3D(1,0,0)); var y = transform.Apply(new Point3D(0,1,0)); var z = transform.Apply(new Point3D(0,0,1)); var eps=1e-9d; if(!NearlyEqual(x-o,new Vector3D(1,0,0),eps)||!NearlyEqual(y-o,new Vector3D(0,1,0),eps)||!NearlyEqual(z-o,new Vector3D(0,0,1),eps)){ translation=Vector3D.Zero; return false;} translation=o-Point3D.Origin; return true; }
private static bool NearlyEqual(Vector3D l, Vector3D r, double eps) => double.Abs(l.X-r.X)<=eps && double.Abs(l.Y-r.Y)<=eps && double.Abs(l.Z-r.Z)<=eps;
}
diff --git a/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPlanner.cs b/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPlanner.cs
index b64893ec..8f6cd5fd 100644
--- a/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPlanner.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPlanner.cs
@@ -12,10 +12,18 @@ public interface IFrepMaterializerPolicy
}
public sealed record FrepMaterializerContext(
- CirNode Root,
+ SdfNode Root,
NativeGeometryReplayLog? ReplayLog = null,
string? SourceLabel = null);
+/// <summary>Declares a bounded SDF decompiler/reverse-engineering contract. This is intent recovery, not CIR authority or a general inverse.</summary>
+public sealed record SdfDecompilationContract(
+ string AdmittedInputFamily,
+ string Purpose,
+ string TopologyRecovery,
+ bool ExactWithinAdmittedFamily,
+ string LossAndAdmissibility);
+
public enum FrepMaterializerCapability
{
ExactBRep,
diff --git a/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPolicyCatalog.cs b/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPolicyCatalog.cs
index c84d273c..02680ac4 100644
--- a/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPolicyCatalog.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/FrepMaterializerPolicyCatalog.cs
@@ -9,7 +9,8 @@ public enum FrepMaterializerPolicyCategory
public sealed record FrepMaterializerPolicyRegistration(
IFrepMaterializerPolicy Policy,
FrepMaterializerPolicyCategory Category,
- string Description);
+ string Description,
+ SdfDecompilationContract? DecompilationContract = null);
public sealed record FrepMaterializerPolicyCatalogSnapshot(
IReadOnlyList<string> PolicyNames,
@@ -19,7 +20,8 @@ public static class FrepMaterializerPolicyCatalog
{
private static readonly IReadOnlyList<FrepMaterializerPolicyRegistration> DefaultRegistrationsValue =
[
- new(new HoleRecoveryPolicy(), FrepMaterializerPolicyCategory.SemanticExact, "Composable semantic hole-family policy with through-hole variant exact BRep recovery."),
+ new(new HoleRecoveryPolicy(), FrepMaterializerPolicyCategory.SemanticExact, "Bounded SDF decompilation for recognized box/cylinder hole intent.",
+ new("recognized orthogonal box minus admitted cylindrical through/blind/counterbore/countersink families","recover editable hole intent","predetermined family topology populated from recognized parameters",true,"rejects transforms, tangencies, and compositions outside the named family; no arbitrary topology inversion")),
new(new CirOnlyFallbackPolicy(), FrepMaterializerPolicyCategory.CirOnlyFallback, "Intent-preserving fallback when no exact semantic BRep policy is admissible.")
];
diff --git a/Aetheris.Kernel.Firmament/Materializer/FrepSemanticRecoveryRematerializer.cs b/Aetheris.Kernel.Firmament/Materializer/FrepSemanticRecoveryRematerializer.cs
index 4fe6bf38..30e72c2d 100644
--- a/Aetheris.Kernel.Firmament/Materializer/FrepSemanticRecoveryRematerializer.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/FrepSemanticRecoveryRematerializer.cs
@@ -18,7 +18,7 @@ internal static class FrepSemanticRecoveryRematerializer
{
internal static FrepSemanticRecoveryResult TryRecover(
- CirNode root,
+ SdfNode root,
NativeGeometryReplayLog? replayLog = null,
string? sourceLabel = null)
{
diff --git a/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryPolicy.cs b/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryPolicy.cs
index 8d6a70b1..ec28931d 100644
--- a/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryPolicy.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/HoleRecoveryPolicy.cs
@@ -72,19 +72,19 @@ internal sealed class CountersinkVariant : IHoleRecoveryVariant
"CountersinkVariant evaluated."
};
- if (context.Root is not CirSubtractNode outer || outer.Left is not CirSubtractNode inner)
+ if (context.Root is not SdfSubtractNode outer || outer.Left is not SdfSubtractNode inner)
{
diagnostics.Add("not countersink shape: requires Subtract(Subtract(Box,Cylinder),Cone). ");
return new(Name, false, 0d, null, ["countersink", "rectangular-box-host"], ["UnsupportedCountersinkShape"], diagnostics);
}
- var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
+ var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
if (!hostRec.Success || hostRec.Value is null)
{
return new(Name, false, 0d, null, ["countersink", "rectangular-box-host"], [hostRec.Diagnostic, $"host-recognizer-reason:{hostRec.Reason}"], hostRec.Diagnostics);
}
- if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var coneNode, out var coneTranslation) || coneNode is not CirConeNode cone)
+ if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var coneNode, out var coneTranslation) || coneNode is not SdfConeNode cone)
{
diagnostics.Add("missing cone primitive / unexpected tool kind.");
return new(Name, false, 0d, null, ["countersink", "rectangular-box-host"], ["UnsupportedMissingConePrimitiveOrTransform"], diagnostics);
@@ -192,19 +192,19 @@ internal sealed class ChamferedEntryHoleVariant : IHoleRecoveryVariant
public HoleRecoveryVariantEvaluation Evaluate(FrepMaterializerContext context)
{
var diagnostics = new List<string> { "ChamferedEntryHoleVariant evaluated." };
- if (context.Root is not CirSubtractNode outer || outer.Left is not CirSubtractNode inner)
+ if (context.Root is not SdfSubtractNode outer || outer.Left is not SdfSubtractNode inner)
{
diagnostics.Add("not chamfered-entry shape: requires Subtract(Subtract(Box,Cylinder),Cone).");
return new(Name, false, 0d, null, ["chamfered-entry", "rectangular-box-host"], ["UnsupportedChamferedEntryShape"], diagnostics);
}
- var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
+ var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
if (!hostRec.Success || hostRec.Value is null)
{
return new(Name, false, 0d, null, ["chamfered-entry", "rectangular-box-host"], [hostRec.Diagnostic, $"host-recognizer-reason:{hostRec.Reason}"], hostRec.Diagnostics);
}
- if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var coneNode, out var coneTranslation) || coneNode is not CirConeNode cone)
+ if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var coneNode, out var coneTranslation) || coneNode is not SdfConeNode cone)
{
diagnostics.Add("missing cone primitive / unexpected tool kind.");
return new(Name, false, 0d, null, ["chamfered-entry", "rectangular-box-host"], ["UnsupportedMissingConePrimitiveOrTransform"], diagnostics);
@@ -351,26 +351,26 @@ internal sealed class BlindHoleVariant : IHoleRecoveryVariant
return new(Name, true, Score, plan, evidence, Array.Empty<string>(), diagnostics);
}
- private static bool TryBuildBlindPlan(CirNode root, out HoleRecoveryPlan plan, out List<string> diagnostics, out string rejection)
+ private static bool TryBuildBlindPlan(SdfNode root, out HoleRecoveryPlan plan, out List<string> diagnostics, out string rejection)
{
diagnostics = ["BlindHoleVariant evaluated."];
rejection = string.Empty;
plan = null!;
- if (root is not CirSubtractNode subtract)
+ if (root is not SdfSubtractNode subtract)
{
rejection = "UnsupportedRootNotSubtract";
diagnostics.Add("Blind-hole requires Subtract(Box, Cylinder). ");
return false;
}
- if (subtract.Left is CirSubtractNode or CirUnionNode or CirIntersectNode || subtract.Right is CirSubtractNode or CirUnionNode or CirIntersectNode)
+ if (subtract.Left is SdfSubtractNode or SdfUnionNode or SdfIntersectNode || subtract.Right is SdfSubtractNode or SdfUnionNode or SdfIntersectNode)
{
rejection = "UnsupportedNestedOrComposite";
diagnostics.Add("Nested/composite booleans are unsupported for blind-hole V8.");
return false;
}
- if (!CounterboreVariant.TryUnwrapTranslation(subtract.Left, out var left, out var hostT) || left is not CirBoxNode box)
+ if (!CounterboreVariant.TryUnwrapTranslation(subtract.Left, out var left, out var hostT) || left is not SdfBoxNode box)
{
rejection = "UnsupportedHostNotBoxOrTransform";
diagnostics.Add("Blind-hole host must be box with translation-only transform.");
@@ -378,7 +378,7 @@ internal sealed class BlindHoleVariant : IHoleRecoveryVariant
return false;
}
- if (!CounterboreVariant.TryUnwrapTranslation(subtract.Right, out var right, out var toolT) || right is not CirCylinderNode cyl)
+ if (!CounterboreVariant.TryUnwrapTranslation(subtract.Right, out var right, out var toolT) || right is not SdfCylinderNode cyl)
{
rejection = "UnsupportedToolNotCylinderOrTransform";
diagnostics.Add("Blind-hole tool must be cylinder with translation-only transform.");
@@ -464,23 +464,23 @@ internal sealed class CounterboreVariant : IHoleRecoveryVariant
public HoleRecoveryVariantEvaluation Evaluate(FrepMaterializerContext context)
{
- if (context.Root is not CirSubtractNode outerSubtract)
+ if (context.Root is not SdfSubtractNode outerSubtract)
{
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], ["UnsupportedRootNotNestedSubtract"], ["Root must be nested subtract for counterbore."]);
}
- if (outerSubtract.Left is not CirSubtractNode innerSubtract)
+ if (outerSubtract.Left is not SdfSubtractNode innerSubtract)
{
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], ["UnsupportedCounterboreShape"], ["Counterbore requires Subtract(Subtract(host,small),large) structure."]);
}
- var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(innerSubtract.Left, innerSubtract.Right), context.ReplayLog, context.SourceLabel));
+ var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(innerSubtract.Left, innerSubtract.Right), context.ReplayLog, context.SourceLabel));
if (!hostRec.Success || hostRec.Value is null)
{
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], [hostRec.Diagnostic, $"small-recognizer-reason:{hostRec.Reason}"], hostRec.Diagnostics);
}
- var shallowRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(innerSubtract.Left, outerSubtract.Right), context.ReplayLog, context.SourceLabel));
+ var shallowRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(innerSubtract.Left, outerSubtract.Right), context.ReplayLog, context.SourceLabel));
if (shallowRec.Success)
{
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], ["UnsupportedLargeCylinderThroughFullDepth"], ["Large cylinder spans full host depth and is not a counterbore relief."]);
@@ -491,7 +491,7 @@ internal sealed class CounterboreVariant : IHoleRecoveryVariant
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], [shallowRec.Diagnostic, $"large-recognizer-reason:{shallowRec.Reason}"], shallowRec.Diagnostics);
}
- if (!TryUnwrapTranslation(outerSubtract.Right, out var largeNode, out var largeTranslation) || largeNode is not CirCylinderNode largeCylinder)
+ if (!TryUnwrapTranslation(outerSubtract.Right, out var largeNode, out var largeTranslation) || largeNode is not SdfCylinderNode largeCylinder)
{
return new(Name, false, 0d, null, ["counterbore", "rectangular-box-host"], ["UnsupportedLargeTool"], ["Counterbore relief tool must be cylindrical with translation-only transform."]);
}
@@ -550,11 +550,11 @@ internal sealed class CounterboreVariant : IHoleRecoveryVariant
return new(Name, true, Score, plan, evidence, Array.Empty<string>(), ["CounterboreVariant admitted canonical nested subtract pattern."]);
}
- internal static bool TryUnwrapTranslation(Aetheris.Continuum.Backends.Sdf.CirNode node, out Aetheris.Continuum.Backends.Sdf.CirNode unwrapped, out Aetheris.Kernel.Core.Math.Vector3D translation)
+ internal static bool TryUnwrapTranslation(Aetheris.Continuum.Backends.Sdf.SdfNode node, out Aetheris.Continuum.Backends.Sdf.SdfNode unwrapped, out Aetheris.Kernel.Core.Math.Vector3D translation)
{
unwrapped = node;
translation = Aetheris.Kernel.Core.Math.Vector3D.Zero;
- while (unwrapped is Aetheris.Continuum.Backends.Sdf.CirTransformNode transformNode)
+ while (unwrapped is Aetheris.Continuum.Backends.Sdf.SdfTransformNode transformNode)
{
var origin = transformNode.Transform.Apply(Aetheris.Kernel.Core.Math.Point3D.Origin);
var x = transformNode.Transform.Apply(new Aetheris.Kernel.Core.Math.Point3D(1d, 0d, 0d));
@@ -591,25 +591,25 @@ internal sealed class SteppedHoleVariant : IHoleRecoveryVariant
public HoleRecoveryVariantEvaluation Evaluate(FrepMaterializerContext context)
{
var diagnostics = new List<string> { "SteppedHoleVariant evaluated." };
- if (context.Root is not CirSubtractNode outer || outer.Left is not CirSubtractNode middle || middle.Left is not CirSubtractNode inner)
+ if (context.Root is not SdfSubtractNode outer || outer.Left is not SdfSubtractNode middle || middle.Left is not SdfSubtractNode inner)
{
diagnostics.Add("stepped shape requires Subtract(Subtract(Subtract(Box,Small),Medium),Large). ");
return new(Name, false, 0d, null, ["stepped-hole", "rectangular-box-host"], ["UnsupportedSteppedShape"], diagnostics);
}
- var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new CirSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
+ var hostRec = CirBoxCylinderRecognizer.Recognize(new CirBoxCylinderRecognizerInput(new SdfSubtractNode(inner.Left, inner.Right), context.ReplayLog, context.SourceLabel));
if (!hostRec.Success || hostRec.Value is null)
{
return new(Name, false, 0d, null, ["stepped-hole", "rectangular-box-host"], [hostRec.Diagnostic, $"small-recognizer-reason:{hostRec.Reason}"], hostRec.Diagnostics);
}
- if (!CounterboreVariant.TryUnwrapTranslation(middle.Right, out var mediumNode, out var mediumT) || mediumNode is not CirCylinderNode medium)
+ if (!CounterboreVariant.TryUnwrapTranslation(middle.Right, out var mediumNode, out var mediumT) || mediumNode is not SdfCylinderNode medium)
{
diagnostics.Add("medium segment tool must be cylindrical with translation-only transform.");
return new(Name, false, 0d, null, ["stepped-hole", "rectangular-box-host"], ["UnsupportedMediumTool"], diagnostics);
}
- if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var largeNode, out var largeT) || largeNode is not CirCylinderNode large)
+ if (!CounterboreVariant.TryUnwrapTranslation(outer.Right, out var largeNode, out var largeT) || largeNode is not SdfCylinderNode large)
{
diagnostics.Add("large segment tool must be cylindrical with translation-only transform.");
return new(Name, false, 0d, null, ["stepped-hole", "rectangular-box-host"], ["UnsupportedLargeTool"], diagnostics);
diff --git a/Aetheris.slnx b/Aetheris.slnx
index 754ddcb4..e1764001 100644
--- a/Aetheris.slnx
+++ b/Aetheris.slnx
@@ -8,6 +8,7 @@
<Project Path="tools/Aetheris.Continuum.M2/Aetheris.Continuum.M2.csproj" />
<Project Path="tools/Aetheris.Continuum.M3/Aetheris.Continuum.M3.csproj" />
<Project Path="tools/Aetheris.Continuum.M4/Aetheris.Continuum.M4.csproj" />
+ <Project Path="tools/Aetheris.Continuum.M4B/Aetheris.Continuum.M4B.csproj" />
<Project Path="tools/Aetheris.Continuum.AttentionE0/Aetheris.Continuum.AttentionE0.csproj" />
<Project Path="tools/Aetheris.Continuum.AttentionE1/Aetheris.Continuum.AttentionE1.csproj" />
<Project Path="Aetheris.Forge/Aetheris.Forge.csproj" />
diff --git a/docs/air-a0-architecture-probe-report.md b/docs/air-a0-architecture-probe-report.md
index 0f96e52f..0c4a92b2 100644
--- a/docs/air-a0-architecture-probe-report.md
+++ b/docs/air-a0-architecture-probe-report.md
@@ -21,10 +21,10 @@ Best immediate next lab: **AIR-X1 minimal Profile IR + AirProfileStackExtrude sp
- `ProfileStackExtrudePlanAdapter`
- `FrepSemanticRecoveryRematerializer`
- CIR/FRep:
- - `CirNode` / `CirNodes`
+ - `SdfNode` / `SdfNodes`
- primitive nodes: box, cylinder, cone, sphere, torus
- boolean nodes: union/subtract/intersect
- - `CirTape` and inline `CirTapeLowerer`
+ - `SdfTape` and inline `SdfTapeLowerer`
- `FirmamentCirLowerer`
- BRep:
- `BrepPrimitives` (`CreateBox/CreateCylinder/CreateCone/CreateSphere/CreateTorus` and extrusion helper usage)
diff --git a/docs/air-cir-a0-authority-and-mirror-contract.md b/docs/air-cir-a0-authority-and-mirror-contract.md
index 8e4774b2..7b8f9f5c 100644
--- a/docs/air-cir-a0-authority-and-mirror-contract.md
+++ b/docs/air-cir-a0-authority-and-mirror-contract.md
@@ -99,13 +99,13 @@ STEP is not internal construction truth. Importing STEP can recover explicit BRe
### 3.1 CIR is a primitive/CSG field tree with semantic evaluation
-`CirNodeKind` currently includes `Box`, `Cylinder`, `Sphere`, `Torus`, `Cone`, `Union`, `Subtract`, `Intersect`, and `Transform`. `CirNode` exposes `Bounds` and an abstract `Evaluate(Point3D)` evaluator. Primitive nodes implement signed-field style evaluators: boxes use axis-aligned distance-to-box math, cylinders use radial/height distance, spheres evaluate radius distance, cones evaluate a finite cone field, and CSG nodes compose children with min/max/negation semantics.
+`SdfNodeKind` currently includes `Box`, `Cylinder`, `Sphere`, `Torus`, `Cone`, `Union`, `Subtract`, `Intersect`, and `Transform`. `SdfNode` exposes `Bounds` and an abstract `Evaluate(Point3D)` evaluator. Primitive nodes implement signed-field style evaluators: boxes use axis-aligned distance-to-box math, cylinders use radial/height distance, spheres evaluate radius distance, cones evaluate a finite cone field, and CSG nodes compose children with min/max/negation semantics.
This is field/evaluation evidence, not topology evidence: a CIR node can answer signed-value queries, but it does not carry emitted face IDs, edge IDs, loop IDs, STEP entity identities, or profile-stack correspondence.
### 3.2 CIR tape/runtime is evaluation-directed
-`CirTape` lowers CIR evaluation into linear instructions for point evaluation, interval evaluation, and region classification. The E0 runtime design explicitly frames the tape as a point-evaluation-first runtime for map/section/volume-heavy analysis paths, with interval classifications as conservative signals.
+`SdfTape` lowers CIR evaluation into linear instructions for point evaluation, interval evaluation, and region classification. The E0 runtime design explicitly frames the tape as a point-evaluation-first runtime for map/section/volume-heavy analysis paths, with interval classifications as conservative signals.
This direction reinforces that CIR is an analysis runtime and mirror candidate, not the default place to reconstruct explicit topology.
@@ -264,16 +264,16 @@ Do not assume either BRep or CIR is globally “truth.” Authority depends on t
| AIR/emitter lane | BRep status | CIR mirror status today | Plausible mirror strategy | Allowed analyzer uses | Blocker | Recommended milestone |
|---|---|---|---|---|---|---|
-| 1. Box primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized primitive layouts | Existing `CirBoxNode` can represent simple box fields; mirror metadata not standardized | Exact axis-aligned/placed box mirror from AIR primitive | Point containment, approximate volume, map occupancy | Need explicit mirror admission/provenance and dispatch diagnostics | CIR-MAP-X1, AIR-CIR-X1 |
-| 2. Cylinder primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized cylinder layouts | Existing `CirCylinderNode`; mirror metadata not standardized | Exact finite cylinder mirror for supported placement/axis policy | Point containment, approximate volume, map occupancy | Placement/axis/tolerance provenance and backend dispatch | CIR-MAP-X1, AIR-CIR-X1 |
-| 3. Sphere primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized sphere layouts | Existing `CirSphereNode`; mirror metadata not standardized | Exact sphere mirror | Point containment, approximate volume, map occupancy | Mirror admission/provenance and analyzer selection | CIR-MAP-X1, AIR-CIR-X1 |
-| 4. Cone/frustum | BRep support exists in primitive/emitter lanes where present, but map raycast primitive gate is narrower than all analytic surfaces | Existing `CirConeNode`; no general analyzer mirror contract | Exact finite cone/frustum mirror for bounded primitive cases | Point containment, approximate volume, later map occupancy | BRep map support and CIR mirror capability diagnostics are not admitted for general cones | AIR-CIR-X1, later CIR-MAP primitive expansion |
-| 5. Torus | BRep analytic surface support exists in topology/export contexts where present; current BRep raycast primitive map gate does not admit torus | Existing `CirTorusNode`; no admitted map mirror contract | Exact torus field for standalone primitive or bounded analytic uses | Point containment/volume/map only after explicit mirror admission | Topology/export vs field semantics and unsupported map backend today | AIR-CIR-X1, later CIR-MAP primitive expansion |
+| 1. Box primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized primitive layouts | Existing `SdfBoxNode` can represent simple box fields; mirror metadata not standardized | Exact axis-aligned/placed box mirror from AIR primitive | Point containment, approximate volume, map occupancy | Need explicit mirror admission/provenance and dispatch diagnostics | CIR-MAP-X1, AIR-CIR-X1 |
+| 2. Cylinder primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized cylinder layouts | Existing `SdfCylinderNode`; mirror metadata not standardized | Exact finite cylinder mirror for supported placement/axis policy | Point containment, approximate volume, map occupancy | Placement/axis/tolerance provenance and backend dispatch | CIR-MAP-X1, AIR-CIR-X1 |
+| 3. Sphere primitive | Supported by `BrepPrimitives`; raycast/containment support exists for recognized sphere layouts | Existing `SdfSphereNode`; mirror metadata not standardized | Exact sphere mirror | Point containment, approximate volume, map occupancy | Mirror admission/provenance and analyzer selection | CIR-MAP-X1, AIR-CIR-X1 |
+| 4. Cone/frustum | BRep support exists in primitive/emitter lanes where present, but map raycast primitive gate is narrower than all analytic surfaces | Existing `SdfConeNode`; no general analyzer mirror contract | Exact finite cone/frustum mirror for bounded primitive cases | Point containment, approximate volume, later map occupancy | BRep map support and CIR mirror capability diagnostics are not admitted for general cones | AIR-CIR-X1, later CIR-MAP primitive expansion |
+| 5. Torus | BRep analytic surface support exists in topology/export contexts where present; current BRep raycast primitive map gate does not admit torus | Existing `SdfTorusNode`; no admitted map mirror contract | Exact torus field for standalone primitive or bounded analytic uses | Point containment/volume/map only after explicit mirror admission | Topology/export vs field semantics and unsupported map backend today | AIR-CIR-X1, later CIR-MAP primitive expansion |
| 6. Profile extrusion / line-only polygon prism | `BrepExtrude` and line/arc profile extrusion emit explicit topology | No current generic CIR mirror | Convex polyhedron/half-space evaluator for line-only convex profiles; generalized polygon winding/extrusion evaluator later | Containment, approximate volume, map occupancy after admission | No half-space/poly-prism CIR node/evaluator or mirror contract today | CIR-PRISMATIC-X1 |
| 7. Profile-authored vertical chamfer | Production-adjacent internal emitter packages profile-chamfer-as-extrude for bounded cases | No current admitted mirror distinct from profile extrusion | Mirror the resulting changed profile prism, likely half-space/poly-prism for line-only bounded cases | Same as profile extrusion after admission | Needs profile-prism mirror strategy and provenance from chamfered profile atom | CIR-PRISMATIC-X1 |
| 8. Prismatic section transition | `PrismaticSectionTransitionEmitter` emits explicit transition BReps for admitted section/correspondence cases | No current admitted CIR mirror | Section-stack implicit evaluator, ruled side half-spaces for simple equal-count line-only cases, or deferred | Approximate map/volume/containment only after admission; not section contour topology | No section-stack/transition field evaluator and no mirror metadata | CIR-PRISMATIC-X1, EDGE-PRISMATIC-X8 |
| 9. Profile-hole rectangle minus circles | BRep paths and bounded recognizers exist for selected box-minus-cylinder style cases | CIR can represent box subtract cylinder in bounded canonical cases; mirror admission not generalized | Exact CSG `box - cylinder(s)` for through holes that satisfy bounded recognizer constraints | Containment, approximate volume, map occupancy after admission | Multiple holes, non-through/blind holes, tangent/grazing, and profile provenance need explicit gates | AIR-CIR-X1, CIR-MAP-X1 for single through-hole subset |
-| 10. Ruled transition/frustum | BRep transition/frustum lanes exist where constructed explicitly | Cone/frustum can mirror only rotational/conical subset today | Use `CirConeNode` for true cone/frustum; section-stack evaluator for non-conical ruled transitions | Field analysis for admitted conical subset | General ruled surfaces do not map to current CIR primitives | CIR-PRISMATIC-X1 or a ruled-transition mirror milestone |
+| 10. Ruled transition/frustum | BRep transition/frustum lanes exist where constructed explicitly | Cone/frustum can mirror only rotational/conical subset today | Use `SdfConeNode` for true cone/frustum; section-stack evaluator for non-conical ruled transitions | Field analysis for admitted conical subset | General ruled surfaces do not map to current CIR primitives | CIR-PRISMATIC-X1 or a ruled-transition mirror milestone |
| 11. AirChamfer no-history/local-edge | Narrow experimental/prototype/shadow route evidence exists; legacy bounded routes remain authoritative where production exists | `mirror-unavailable` today for general local-edge AirChamfer | Only reducible planar half-space cuts/simple cylinders should be considered; otherwise deferred | None by default; field uses only after specific reduction admits mirror | Loss of face identity, local topology graft semantics, and no general half-space mirror | AIR-CIR-A1 after prismatic half-space proof |
| 12. Fillet legacy/manufacturing fillet | `BrepBoundedFillet` remains production route for current bounded cases | `mirror-unavailable` today except trivial cylindrical/spherical/torus-like reductions if separately proven | Analytic SDF blends or primitive torus/cylinder/sphere subsets, but not general fillet topology | None by default | Topological split/trim identity and blend semantics are not captured by current CIR mirror contract | Separate fillet-mirror audit after chamfer/prismatic proof |
| 13. Boolean composition fallback | BRep/STEP Boolean fallback exists where routed; Firmament-to-CIR supports selected primitive booleans | CIR supports primitive CSG node composition but not exported topology authority | Use CIR CSG only for admitted primitive compositions with declared losses | Containment, approximate volume, map occupancy; not topology parity | General Boolean BRep topology and trims cannot be recovered from CIR by default | AIR-CIR-X1 for primitive CSG mirrors; no default CIR-to-BRep extraction |
diff --git a/docs/cir-5s-a0-namespace-organization.md b/docs/cir-5s-a0-namespace-organization.md
index 4a386c39..b68ec4d1 100644
--- a/docs/cir-5s-a0-namespace-organization.md
+++ b/docs/cir-5s-a0-namespace-organization.md
@@ -14,12 +14,12 @@ No algorithms were rewritten and no behavior changes were intended.
| Current file | Current namespace | Proposed area | Proposed namespace | Reason | Risk | Notes |
|---|---|---|---|---|---|---|
-| `Aetheris.Kernel.Core/Cir/CirNode.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core CIR model. | Low | CirCore concept already represented by `Core/Cir` folder. |
-| `Aetheris.Kernel.Core/Cir/CirNodes.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core CIR operations. | Low | No move needed in A0. |
-| `Aetheris.Kernel.Core/Cir/CirTape.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Tape representation/eval. | Low | No move needed in A0. |
+| `Aetheris.Kernel.Core/Cir/SdfNode.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core CIR model. | Low | CirCore concept already represented by `Core/Cir` folder. |
+| `Aetheris.Kernel.Core/Cir/SdfNodes.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core CIR operations. | Low | No move needed in A0. |
+| `Aetheris.Kernel.Core/Cir/SdfTape.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Tape representation/eval. | Low | No move needed in A0. |
| `Aetheris.Kernel.Core/Cir/CirAnalysis.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | CIR evaluation/interval analysis. | Low | No move needed in A0. |
| `Aetheris.Kernel.Core/Cir/CirRegionPlanner.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Region planning core. | Low | No move needed in A0. |
-| `Aetheris.Kernel.Core/Cir/CirAdaptiveVolumeEstimator.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core adaptive evaluation. | Low | No move needed in A0. |
+| `Aetheris.Kernel.Core/Cir/SdfAdaptiveVolumeEstimator.cs` | `Aetheris.Kernel.Core.Cir` | LeaveInPlace (CirCore already) | `Aetheris.Kernel.Core.Cir` | Core adaptive evaluation. | Low | No move needed in A0. |
| `Aetheris.Kernel.Firmament/Execution/CirBrepMaterializer.cs` | `Aetheris.Kernel.Firmament.Execution` | Materializer | `Aetheris.Kernel.Firmament.Materializer` | Primary CIR→BRep recovery/materialization path. | Low | Moved in A0. |
| `Aetheris.Kernel.Firmament/Execution/CirBoxCylinderRecognizer.cs` | `Aetheris.Kernel.Firmament.Execution` | Materializer | `Aetheris.Kernel.Firmament.Materializer` | Recovery recognizer/policy signal. | Low | Moved in A0. |
| `Aetheris.Kernel.Firmament/Execution/NativeGeometryRematerializer.cs` | `Aetheris.Kernel.Firmament.Execution` | Materializer | `Aetheris.Kernel.Firmament.Materializer` | Rematerialization entrypoint. | Low | Moved in A0. |
diff --git a/docs/cir-a0-analyzer-integration.md b/docs/cir-a0-analyzer-integration.md
index 8086d7d2..8eb5af4e 100644
--- a/docs/cir-a0-analyzer-integration.md
+++ b/docs/cir-a0-analyzer-integration.md
@@ -48,16 +48,16 @@ This path is authoritative for materialized geometry/export and must remain unch
From the current kernel/tests/docs state:
- Firmament-to-CIR lowering exists but is subset-bounded (`FirmamentCirLowerer`), with explicit failures for unsupported primitives/booleans/placement semantics.
-- Point classification exists (`CirAnalyzer.ClassifyPoint` over signed-distance evaluate).
-- Dense grid volume estimate exists (`CirVolumeEstimator`).
-- Adaptive/tape interval-assisted volume estimation exists (`CirAdaptiveVolumeEstimator` + region planning).
+- Point classification exists (`SdfAnalyzer.ClassifyPoint` over signed-distance evaluate).
+- Dense grid volume estimate exists (`SdfVolumeEstimator`).
+- Adaptive/tape interval-assisted volume estimation exists (`SdfAdaptiveVolumeEstimator` + region planning).
- CIR-vs-BRep differential matrix/reporting exists in tests/artifacts.
- Calibration harness exists (currently test-internal) and reports policy/work/error metrics.
### Current limitations
- Lowering subset is intentionally incomplete.
-- CIR analysis API shape is primitive-level (`CirNode`, `CirTape`) and not yet integrated into CLI contracts.
+- CIR analysis API shape is primitive-level (`SdfNode`, `SdfTape`) and not yet integrated into CLI contracts.
- No user-facing analyzer output schema yet communicates CIR uncertainty and lowering coverage.
---
diff --git a/docs/cir-a1-native-analysis-service.md b/docs/cir-a1-native-analysis-service.md
index 31416cf4..272160c0 100644
--- a/docs/cir-a1-native-analysis-service.md
+++ b/docs/cir-a1-native-analysis-service.md
@@ -11,8 +11,8 @@
## Supported inputs
- `FirmamentPrimitiveLoweringPlan` via `AnalyzeFirmamentPlan`.
-- `CirTape` + bounds via `AnalyzeTape`.
-- `CirNode` via `AnalyzeNode` (lowered to tape internally).
+- `SdfTape` + bounds via `AnalyzeTape`.
+- `SdfNode` via `AnalyzeNode` (lowered to tape internally).
## Result contract overview
diff --git a/docs/cir-cone-v1-cir-cone-primitive.md b/docs/cir-cone-v1-cir-cone-primitive.md
index 4af9c0fc..450fe08e 100644
--- a/docs/cir-cone-v1-cir-cone-primitive.md
+++ b/docs/cir-cone-v1-cir-cone-primitive.md
@@ -2,11 +2,11 @@
## Scope outcome
-This milestone adds a bounded `CirConeNode` primitive to CIR semantic and tape evaluation paths, plus Firmament→CIR lowering for cone primitives/tools.
+This milestone adds a bounded `SdfConeNode` primitive to CIR semantic and tape evaluation paths, plus Firmament→CIR lowering for cone primitives/tools.
## Parameter convention
-`CirConeNode(bottomRadius, topRadius, height)`.
+`SdfConeNode(bottomRadius, topRadius, height)`.
- Native frame is origin-centered on Z.
- Bottom cap plane: `z = -height/2` with radius `bottomRadius`.
@@ -28,23 +28,23 @@ Validation:
## Transform policy
-- No axis/orientation fields in `CirConeNode`.
-- Arbitrary placement/orientation stays in `CirTransformNode` and tape inverse payload transforms, matching existing primitive conventions.
+- No axis/orientation fields in `SdfConeNode`.
+- Arbitrary placement/orientation stays in `SdfTransformNode` and tape inverse payload transforms, matching existing primitive conventions.
## Tape/lowering status
Added:
-- `CirTapeOpCode.EvalCone`,
-- `CirTapeConePayload`,
+- `SdfTapeOpCode.EvalCone`,
+- `SdfTapeConePayload`,
- point evaluation path,
- conservative interval path (corner-sampled bound in local transformed AABB),
-- `CirTapeLowerer` support.
+- `SdfTapeLowerer` support.
## Firmament lowering status
Firmament already has cone primitive syntax and lowered cone parameters. CIR lowering now maps:
-- primitive `cone` -> `CirConeNode`,
-- boolean tool `cone` -> `CirConeNode`.
+- primitive `cone` -> `SdfConeNode`,
+- boolean tool `cone` -> `SdfConeNode`.
## Source-surface extraction status
@@ -59,6 +59,6 @@ Inspected existing BRep cone/frustum path; no low-risk apex-topology cleanup was
## Next milestone suggestion
CIR-RECOVERY-V11:
-1. update `CountersinkVariant` recognition to admit bounded cone tool patterns using `CirConeNode`,
+1. update `CountersinkVariant` recognition to admit bounded cone tool patterns using `SdfConeNode`,
2. add strict coaxial/entry/depth/radius checks,
3. wire executor cone subtract path and countersink STEP smoke in that milestone (not in V1).
diff --git a/docs/cir-e0-evaluation-runtime.md b/docs/cir-e0-evaluation-runtime.md
index 1ebe561c..a239f759 100644
--- a/docs/cir-e0-evaluation-runtime.md
+++ b/docs/cir-e0-evaluation-runtime.md
@@ -3,19 +3,19 @@
Status: **Design milestone only** (no production code changes).
-> CIR-MAP-X1 note (May 29, 2026): a lab/test-only primitive map prototype now lowers admitted box/cylinder/sphere `CirNode` mirrors to `CirTape` and samples deterministic orthographic rays for occupancy/thickness parity against the BRep raycast primitive baseline. This is evidence for tape-backed dense map evaluation, not a production analyzer dispatch change.
+> CIR-MAP-X1 note (May 29, 2026): a lab/test-only primitive map prototype now lowers admitted box/cylinder/sphere `SdfNode` mirrors to `SdfTape` and samples deterministic orthographic rays for occupancy/thickness parity against the BRep raycast primitive baseline. This is evidence for tape-backed dense map evaluation, not a production analyzer dispatch change.
-> CIR-E1.1 framing note (May 5, 2026): the linear `CirTape` introduced in E1 is now the intended runtime/MIR direction for serious CIR evaluation paths. `CirNode` remains intentionally in place as a semantic prototype/builder surface, a compatibility lowering source, and an oracle for parity tests while lowering/execution paths are still converging.
+> CIR-E1.1 framing note (May 5, 2026): the linear `SdfTape` introduced in E1 is now the intended runtime/MIR direction for serious CIR evaluation paths. `SdfNode` remains intentionally in place as a semantic prototype/builder surface, a compatibility lowering source, and an oracle for parity tests while lowering/execution paths are still converging.
## 1) Current CIR evaluation limitations
-Current CIR is intentionally a semantic tree with `CirNode.Evaluate(point)` dispatch per node kind and recursive composition (`min/max` for boolean ops). This is correct for representation but has runtime limits for dense sampling workloads. Specifically:
+Current CIR is intentionally a semantic tree with `SdfNode.Evaluate(point)` dispatch per node kind and recursive composition (`min/max` for boolean ops). This is correct for representation but has runtime limits for dense sampling workloads. Specifically:
- Point evaluation is recursive and recomputes shared work for every sample; no linearized execution form exists today.
-- `CirVolumeEstimator.EstimateVolume` currently performs a dense triple loop and calls `node.Evaluate(p)` per cell center, so all tree recursion overhead appears in hot loops.
-- `CirAnalyzer` only provides point classification plus passthrough volume estimate; there is no region-level classification/early-out.
+- `SdfVolumeEstimator.EstimateVolume` currently performs a dense triple loop and calls `node.Evaluate(p)` per cell center, so all tree recursion overhead appears in hot loops.
+- `SdfAnalyzer` only provides point classification plus passthrough volume estimate; there is no region-level classification/early-out.
- Current boolean composition follows implicit field algebra (`Union=min`, `Subtract=max(left,-right)`, `Intersect=max`), which is semantically useful but not guaranteed to preserve exact signed-distance behavior after composition.
-- Transform evaluation currently inverts transform per call path (`CirTransformNode.Evaluate`), so repeated region queries have no transform cache plan.
+- Transform evaluation currently inverts transform per call path (`SdfTransformNode.Evaluate`), so repeated region queries have no transform cache plan.
Implication: CIR has a semantic kernel, but no dedicated evaluation runtime yet for map/section/volume-heavy analysis paths.
@@ -69,7 +69,7 @@ E0 recommendation: prefer explicit transform instructions for inspectability.
### 2.5 Output and provenance
- Tape has one designated `OutputSlot`.
-- Every instruction should optionally retain source-node provenance (`CirNodeKind`, stable lowering index, and optional user-facing trace label) to support diagnostics.
+- Every instruction should optionally retain source-node provenance (`SdfNodeKind`, stable lowering index, and optional user-facing trace label) to support diagnostics.
## 3) Interval / region evaluation model
@@ -169,7 +169,7 @@ So analogy is useful at planner/orchestration level (deterministic inspectable p
A staged model:
-1. **Tier A**: current recursive interpreter (`CirNode.Evaluate`) remains baseline oracle.
+1. **Tier A**: current recursive interpreter (`SdfNode.Evaluate`) remains baseline oracle.
2. **Tier B**: tape interpreter (flat arrays/spans, no recursion for core primitives/booleans) for hot point loops and better tracing.
3. **Tier C**: compiled delegate (`Func<Point3D,double>` or struct evaluator) emitted from tape via expression trees or generated methods; rely on .NET JIT.
4. **Tier D**: region-specialized reduced tape (after interval pruning), interpreted first, optionally compiled if repeatedly reused.
@@ -250,7 +250,7 @@ Immediate next step: **CIR-E1 (tape lowering + tape point interpreter)**.
Definition of done for CIR-E1:
-- deterministic lowering from existing `CirNode` tree to linear tape with provenance,
+- deterministic lowering from existing `SdfNode` tree to linear tape with provenance,
- tape point evaluation parity checked against recursive evaluator on existing CIR fixtures,
- no behavioral change required yet in external CLI paths,
- first-pass trace output showing instruction execution and selected evaluation tier.
@@ -259,19 +259,19 @@ Definition of done for CIR-E1:
### 13.1 What changed in framing
-- M0/M1 used tree-first framing to prove semantics quickly (`CirNode` primitives/booleans/transforms).
-- After E1, runtime framing is tape-first: `CirTape` is the intended MIR/runtime substrate for evaluation-centric workloads.
+- M0/M1 used tree-first framing to prove semantics quickly (`SdfNode` primitives/booleans/transforms).
+- After E1, runtime framing is tape-first: `SdfTape` is the intended MIR/runtime substrate for evaluation-centric workloads.
- Tree-to-tape lowering remains a first-class adapter during transition and for backward compatibility.
-### 13.2 `CirNode` role during transition
+### 13.2 `SdfNode` role during transition
-`CirNode` is retained deliberately for three roles:
+`SdfNode` is retained deliberately for three roles:
1. convenience semantic builder/prototype surface,
2. compatibility source for deterministic lowering to tape,
3. recursive oracle used by parity/differential tests.
-This is not a deprecation notice for `CirNode`; it is an execution-path reframing.
+This is not a deprecation notice for `SdfNode`; it is an execution-path reframing.
### 13.3 Transform handling after CIR-E2
@@ -280,7 +280,7 @@ CIR-E2 removes the transitional recursive transform escape hatch from tape evalu
Chosen strategy: **Option B (baked local inverse transform per primitive payload)**.
- lowering carries an accumulated inverse transform while traversing the tree,
-- `CirTransformNode` composes that accumulator and lowers only its child (no emitted transform opcode),
+- `SdfTransformNode` composes that accumulator and lowers only its child (no emitted transform opcode),
- primitive tape payloads (`EvalBox`/`EvalCylinder`/`EvalSphere`) now store the accumulated inverse transform,
- tape execution applies that payload transform before primitive SDF evaluation.
@@ -288,7 +288,7 @@ Resulting runtime shape:
- tape remains straight-line SSA for current node kinds,
- transform evaluation is fully self-contained in tape data/instructions,
-- tape point evaluation no longer calls `CirNode.Evaluate` for supported nodes.
+- tape point evaluation no longer calls `SdfNode.Evaluate` for supported nodes.
This preserves deterministic lowering and prepares interval evaluation and later bytecode/register compaction work by keeping execution ownership inside tape runtime data.
diff --git a/docs/cir-f0-fall-forward-design.md b/docs/cir-f0-fall-forward-design.md
index 3ab0f10d..d1f0afbc 100644
--- a/docs/cir-f0-fall-forward-design.md
+++ b/docs/cir-f0-fall-forward-design.md
@@ -68,7 +68,7 @@ Introduce internal (non-public) `NativeGeometryState` per executed feature front
- `ExecutionMode`: `BRepActive | CirOnly | Failed`
- `MaterializedBody`: optional `BrepBody`
-- `ConstructiveIntentRoot`: optional `CirNode` (or tape handle)
+- `ConstructiveIntentRoot`: optional `SdfNode` (or tape handle)
- `MaterializationAuthority`: `BRepAuthoritative | CirIntentOnly | PendingRematerialization`
- `Provenance`: feature/op mapping, placement transform history, selector anchor provenance
- `Diagnostics`: accumulated state diagnostics with transition events
diff --git a/docs/cir-f10-real-planar-source-emission.md b/docs/cir-f10-real-planar-source-emission.md
index 858ebca6..dee3e039 100644
--- a/docs/cir-f10-real-planar-source-emission.md
+++ b/docs/cir-f10-real-planar-source-emission.md
@@ -13,7 +13,7 @@ Because of the readiness rule (**no readiness, no emission**) and anti-fabricati
- Added `PlanarPatchPayloadBuilder.TryBuildRectanglePayload(SourceSurfaceDescriptor, out string? payload, out string diagnostic)`.
- Builder accepts existing bounded payload (`rect3d:...`) and returns success.
- Builder rejects real F8 extractor role payloads (`top`, `bottom`, etc.) with a precise blocker diagnostic.
-- Added focused tests against real `SourceSurfaceExtractor.Extract(new CirBoxNode(...))` descriptors and readiness-gated emission refusal.
+- Added focused tests against real `SourceSurfaceExtractor.Extract(new SdfBoxNode(...))` descriptors and readiness-gated emission refusal.
## Supported behavior in this milestone
diff --git a/docs/cir-f101-bounded-planar-source-geometry.md b/docs/cir-f101-bounded-planar-source-geometry.md
index c636551e..bc007ec6 100644
--- a/docs/cir-f101-bounded-planar-source-geometry.md
+++ b/docs/cir-f101-bounded-planar-source-geometry.md
@@ -18,7 +18,7 @@ Corner ordering is deterministic and explicitly defines the rectangle perimeter
## Supported scope
-Implemented only for planar faces extracted from `CirBoxNode`.
+Implemented only for planar faces extracted from `SdfBoxNode`.
- all six box faces now include bounded planar geometry,
- corners are transformed to world-space during extraction,
diff --git a/docs/cir-f102-cylinder-cap-planar-geometry.md b/docs/cir-f102-cylinder-cap-planar-geometry.md
index 362eb55e..2607a7b6 100644
--- a/docs/cir-f102-cylinder-cap-planar-geometry.md
+++ b/docs/cir-f102-cylinder-cap-planar-geometry.md
@@ -2,9 +2,9 @@
## Purpose
-CIR-F10.1 added bounded planar **rectangular** geometry for `CirBoxNode` planar descriptors so real extracted box faces can deterministically derive `rect3d:` payloads.
+CIR-F10.1 added bounded planar **rectangular** geometry for `SdfBoxNode` planar descriptors so real extracted box faces can deterministically derive `rect3d:` payloads.
-CIR-F10.2 extends bounded planar **source evidence** for `CirCylinderNode` planar cap descriptors to include deterministic **circular** bounded geometry.
+CIR-F10.2 extends bounded planar **source evidence** for `SdfCylinderNode` planar cap descriptors to include deterministic **circular** bounded geometry.
This milestone is evidence-enrichment only. It does not emit circular cap topology.
@@ -24,7 +24,7 @@ Factory helpers (`CreateRectangle`, `CreateCircle`) keep construction determinis
## Cylinder cap extraction behavior
-For `CirCylinderNode`, extraction now produces:
+For `SdfCylinderNode`, extraction now produces:
- 1 cylindrical side descriptor (unchanged),
- 2 planar cap descriptors (`cap-top`, `cap-bottom`) with circular bounded geometry when representable.
diff --git a/docs/cir-f106-cylindrical-source-geometry-evidence.md b/docs/cir-f106-cylindrical-source-geometry-evidence.md
index 725aa6f3..1332006d 100644
--- a/docs/cir-f106-cylindrical-source-geometry-evidence.md
+++ b/docs/cir-f106-cylindrical-source-geometry-evidence.md
@@ -19,7 +19,7 @@ This evidence is internal-only dry-run geometry evidence and does not introduce
## Extractor behavior
-For `CirCylinderNode` side descriptors:
+For `SdfCylinderNode` side descriptors:
- canonical cylindrical evidence is populated from real cylinder semantics,
- identity and translation transforms preserve evidence,
diff --git a/docs/cir-f108-planar-patch-set-emission.md b/docs/cir-f108-planar-patch-set-emission.md
index f4ceaa5c..77966a34 100644
--- a/docs/cir-f108-planar-patch-set-emission.md
+++ b/docs/cir-f108-planar-patch-set-emission.md
@@ -13,7 +13,7 @@ This milestone is intentionally bounded:
## API and result semantics
-`PlanarSurfaceMaterializer.EmitSupportedPlanarPatches(CirNode root, NativeGeometryReplayLog? replayLog = null)` returns a planar patch-set result with:
+`PlanarSurfaceMaterializer.EmitSupportedPlanarPatches(SdfNode root, NativeGeometryReplayLog? replayLog = null)` returns a planar patch-set result with:
- success flag,
- emitted standalone planar patch bodies,
diff --git a/docs/cir-f4-first-materializer.md b/docs/cir-f4-first-materializer.md
index 0861ec8c..a6c24377 100644
--- a/docs/cir-f4-first-materializer.md
+++ b/docs/cir-f4-first-materializer.md
@@ -11,9 +11,9 @@ It reuses existing trusted BRep primitive constructors and bounded boolean subtr
## Boundaries
Supported:
-- root `CirSubtractNode`
+- root `SdfSubtractNode`
- lhs box, rhs cylinder
-- optional pure-translation `CirTransformNode` wrappers
+- optional pure-translation `SdfTransformNode` wrappers
Unsupported:
- non-translation transforms
diff --git a/docs/cir-f5-second-materializer.md b/docs/cir-f5-second-materializer.md
index c5170836..b1e96be4 100644
--- a/docs/cir-f5-second-materializer.md
+++ b/docs/cir-f5-second-materializer.md
@@ -7,10 +7,10 @@ CIR-F5 adds exactly one new pattern: `subtract(box,box)` (box minus box), while
## Supported shape
Supported:
-- root `CirSubtractNode`
-- lhs: translated/untranslated `CirBoxNode`
-- rhs: translated/untranslated `CirBoxNode` or `CirCylinderNode`
-- pure-translation `CirTransformNode` wrappers only
+- root `SdfSubtractNode`
+- lhs: translated/untranslated `SdfBoxNode`
+- rhs: translated/untranslated `SdfBoxNode` or `SdfCylinderNode`
+- pure-translation `SdfTransformNode` wrappers only
## Explicitly unsupported
diff --git a/docs/cir-f7-box-minus-torus-pressure-test.md b/docs/cir-f7-box-minus-torus-pressure-test.md
index e4d91e05..3e69ce98 100644
--- a/docs/cir-f7-box-minus-torus-pressure-test.md
+++ b/docs/cir-f7-box-minus-torus-pressure-test.md
@@ -9,8 +9,8 @@
## Layer audit
- **Firmament:** torus primitive/tool support already existed in parsing, validation, lowering plan, selector contracts, and primitive execution paths.
-- **CIR (before F7):** torus was missing from `CirNode`/tape lowering and therefore blocked CIR fallback for torus families.
-- **CIR (F7):** added bounded `CirTorusNode` + tape opcode/payload lowering/evaluation so `subtract(box,torus)` is representable and analyzable in CIR.
+- **CIR (before F7):** torus was missing from `SdfNode`/tape lowering and therefore blocked CIR fallback for torus families.
+- **CIR (F7):** added bounded `SdfTorusNode` + tape opcode/payload lowering/evaluation so `subtract(box,torus)` is representable and analyzable in CIR.
- **BRep primitives / STEP:** torus primitive and torus surface export already exist.
- **Boolean subtract:** no safe exact `box - torus` path is currently available in the bounded subtract-family materializers.
- **Replay-guided materializer registry (F6):** extended with named strategy `subtract_box_torus` that recognizes the replay/CIR family and emits precise unsupported diagnostics.
diff --git a/docs/cir-f8-guided-analytic-materialization.md b/docs/cir-f8-guided-analytic-materialization.md
index 234d0e05..05fc0682 100644
--- a/docs/cir-f8-guided-analytic-materialization.md
+++ b/docs/cir-f8-guided-analytic-materialization.md
@@ -10,11 +10,11 @@ Aetheris already has broad analytic *surface* representation across Firmament/CI
| Family | Firmament primitive/tool | CIR node/tape | BRep primitive | BRep surface kind | STEP AP242 export | Boolean/materializer support |
|---|---|---|---|---|---|---|
-| Plane / box | Yes (`box`) | Yes (`CirBoxNode`, `EvalBox`) | Yes | Plane | Yes (`PLANE`) | Strong: `subtract(box,box)`, many safe composition paths |
-| Cylinder | Yes (`cylinder`) | Yes (`CirCylinderNode`, `EvalCylinder`) | Yes | Cylinder | Yes (`CYLINDRICAL_SURFACE`) | Strong: `subtract(box,cylinder)` plus safe-family boolean builders |
-| Sphere | Yes (`sphere`) | Yes (`CirSphereNode`, `EvalSphere`) | Yes | Sphere | Yes (`SPHERICAL_SURFACE`) | No dedicated CIR rematerializer strategy yet |
+| Plane / box | Yes (`box`) | Yes (`SdfBoxNode`, `EvalBox`) | Yes | Plane | Yes (`PLANE`) | Strong: `subtract(box,box)`, many safe composition paths |
+| Cylinder | Yes (`cylinder`) | Yes (`SdfCylinderNode`, `EvalCylinder`) | Yes | Cylinder | Yes (`CYLINDRICAL_SURFACE`) | Strong: `subtract(box,cylinder)` plus safe-family boolean builders |
+| Sphere | Yes (`sphere`) | Yes (`SdfSphereNode`, `EvalSphere`) | Yes | Sphere | Yes (`SPHERICAL_SURFACE`) | No dedicated CIR rematerializer strategy yet |
| Cone | Yes (`cone`) | **Partial**: local-frame shift exists, but no cone CIR primitive/tool lowering path | Yes | Cone | Yes (`CONICAL_SURFACE`) | No dedicated CIR rematerializer strategy |
-| Torus | Yes (`torus`) | Yes (`CirTorusNode`, `EvalTorus`) | Yes | Torus | Yes (`TOROIDAL_SURFACE`) | Explicitly recognized unsupported strategy: `subtract(box,torus)` |
+| Torus | Yes (`torus`) | Yes (`SdfTorusNode`, `EvalTorus`) | Yes | Torus | Yes (`TOROIDAL_SURFACE`) | Explicitly recognized unsupported strategy: `subtract(box,torus)` |
| Prismatic/extrusion | Yes (`triangular_prism`, `hexagonal_prism`, `straight_slot`, `slot_cut`) | No general extrusion CIR node family | Yes (`BrepExtrude`-backed primitives) | Mostly planar side/cap surfaces | Exported through bound topology + line/arc/spline edges | Safe boolean families exist for polygonal/prismatic through-cuts |
| BSpline/NURBS | Not central in Firmament primitives | Not central in CIR booleans | Present in geometry model | `BSplineSurfaceWithKnots` | Yes (`B_SPLINE_SURFACE_WITH_KNOTS`) | Not in current CIR rematerializer families |
@@ -101,7 +101,7 @@ family
parameters
transform
provenance
-owningCirNodeId / replayOpIndex / featureId
+owningSdfNodeId / replayOpIndex / featureId
orientationRole (base/tool/cap/side/seam)
```
diff --git a/docs/cir-f82-source-surface-and-trim-capabilities.md b/docs/cir-f82-source-surface-and-trim-capabilities.md
index 401201f6..aa0b86d8 100644
--- a/docs/cir-f82-source-surface-and-trim-capabilities.md
+++ b/docs/cir-f82-source-surface-and-trim-capabilities.md
@@ -32,7 +32,7 @@ Current notable entries:
## Source-surface extraction behavior
-`SourceSurfaceExtractor.Extract(CirNode, NativeGeometryReplayLog?)` traverses CIR including booleans and transform nodes.
+`SourceSurfaceExtractor.Extract(SdfNode, NativeGeometryReplayLog?)` traverses CIR including booleans and transform nodes.
- Box: 6 planar descriptors (`top/bottom/left/right/front/back`)
- Cylinder: 1 cylindrical side + 2 planar caps
diff --git a/docs/cir-f83-face-patch-dry-run.md b/docs/cir-f83-face-patch-dry-run.md
index 529cd6b7..bcb9c0c9 100644
--- a/docs/cir-f83-face-patch-dry-run.md
+++ b/docs/cir-f83-face-patch-dry-run.md
@@ -13,7 +13,7 @@ This milestone intentionally **does not emit BRep topology**.
## New dry-run artifact
-`FacePatchCandidateGenerator.Generate(CirNode root, NativeGeometryReplayLog? replayLog = null)` returns a `FacePatchCandidateGenerationResult` containing:
+`FacePatchCandidateGenerator.Generate(SdfNode root, NativeGeometryReplayLog? replayLog = null)` returns a `FacePatchCandidateGenerationResult` containing:
- extracted source surfaces,
- dry-run face patch candidates,
diff --git a/docs/cir-f84-subtract-retention-classification.md b/docs/cir-f84-subtract-retention-classification.md
index 82227f30..99744d3f 100644
--- a/docs/cir-f84-subtract-retention-classification.md
+++ b/docs/cir-f84-subtract-retention-classification.md
@@ -31,7 +31,7 @@ Each dry-run `FacePatchCandidate` now includes:
## Subtract-only behavior
-Retention classification applies only to `CirSubtractNode` roots in CIR-F8.4.
+Retention classification applies only to `SdfSubtractNode` roots in CIR-F8.4.
- subtract root: base/tool candidates receive explicit subtract retention roles.
- non-subtract root: candidates are marked `NotApplicable` + deferred retention diagnostic.
diff --git a/docs/cir-m2-differential-analysis.md b/docs/cir-m2-differential-analysis.md
index 81d528d1..3f2efa7a 100644
--- a/docs/cir-m2-differential-analysis.md
+++ b/docs/cir-m2-differential-analysis.md
@@ -25,13 +25,13 @@ Unsupported forms fail with explicit lowering diagnostics.
For shared Firmament fixtures, tests compare:
1. Approximate volume
- - CIR: `CirAnalyzer.EstimateVolume`.
+ - CIR: `SdfAnalyzer.EstimateVolume`.
- BRep: voxelized `BrepSpatialQueries.ClassifyPoint` over body vertex bounds.
2. Point classification
- - CIR: `CirAnalyzer.ClassifyPoint`.
+ - CIR: `SdfAnalyzer.ClassifyPoint`.
- BRep: `BrepSpatialQueries.ClassifyPoint` for selected probe points.
3. Bounds
- - CIR: `CirNode.Bounds`.
+ - CIR: `SdfNode.Bounds`.
- BRep: bounds reconstructed from body vertices.
## What mismatches mean
diff --git a/docs/cir-m4-differential-matrix.md b/docs/cir-m4-differential-matrix.md
index dc8d71bd..eb95537d 100644
--- a/docs/cir-m4-differential-matrix.md
+++ b/docs/cir-m4-differential-matrix.md
@@ -21,7 +21,7 @@ For each supported fixture case:
1. **Lowering status**: CIR lower success/failure and diagnostics.
2. **Bounds**: CIR AABB vs BRep vertex-derived AABB (`min/max/extents` deltas).
3. **Approximate volume**:
- - CIR: `CirAnalyzer.EstimateVolume(root, resolution)`
+ - CIR: `SdfAnalyzer.EstimateVolume(root, resolution)`
- BRep: voxel estimate using `BrepSpatialQueries.ClassifyPoint` over BRep AABB at identical resolution.
4. **Probe classifications**: fixed semantic probe points compared between CIR and BRep point classification.
diff --git a/docs/cir-map-x1-primitive-map-prototype.md b/docs/cir-map-x1-primitive-map-prototype.md
index 84caed42..0577c0ea 100644
--- a/docs/cir-map-x1-primitive-map-prototype.md
+++ b/docs/cir-map-x1-primitive-map-prototype.md
@@ -36,7 +36,7 @@ Prismatic mirrors are deliberately excluded from X1.
### 4.1 Backend choice: tape first, node as lowering source
-The lab evaluator accepts a `CirNode` by lowering it through `CirTapeLowerer.Lower(...)`, and also accepts an already-lowered `CirTape` with explicit bounds. X1 therefore exercises the tape runtime for map sampling while preserving `CirNode` as the semantic builder/oracle surface.
+The lab evaluator accepts a `SdfNode` by lowering it through `SdfTapeLowerer.Lower(...)`, and also accepts an already-lowered `SdfTape` with explicit bounds. X1 therefore exercises the tape runtime for map sampling while preserving `SdfNode` as the semantic builder/oracle surface.
Diagnostic emitted by the test prototype:
diff --git a/docs/cir-map-x2-mirror-aware-primitive-map-dispatch.md b/docs/cir-map-x2-mirror-aware-primitive-map-dispatch.md
index 1c5fd998..e11b8997 100644
--- a/docs/cir-map-x2-mirror-aware-primitive-map-dispatch.md
+++ b/docs/cir-map-x2-mirror-aware-primitive-map-dispatch.md
@@ -24,7 +24,7 @@ The lab dispatcher types are internal to the test assembly:
- `CirMapDispatchPrototype` — policy entry point;
- `CirMapDispatchResult` — selected backend, mirror admission result, optional map result, optional BRep comparison, diagnostics, and recommendation;
- `CirMapBackendCandidate` — candidate backend/admissibility/reason record;
-- `CirMapBackendKind` — `CirTape`, `CirNode`, `BrepRaycastBaseline`, or `Unsupported`;
+- `CirMapBackendKind` — `SdfTape`, `SdfNode`, `BrepRaycastBaseline`, or `Unsupported`;
- `CirMapAnalyzerUse` — requested analyzer use such as `MapOccupancy`, `FaceIdentity`, `TopologyParity`, `PointContainment`, and `SectionSampling`;
- `CirMapBaselineComparison` — stable summary comparison between CIR and BRep maps.
@@ -32,7 +32,7 @@ Inputs are deliberately explicit:
- a `CirMirrorAdmission` source descriptor;
- the requested analyzer use;
-- the `CirNode` primitive when a CIR map is potentially allowed;
+- the `SdfNode` primitive when a CIR map is potentially allowed;
- a `CirMapPrototypeRequest` containing view, rows, cols, bounds, sample count, root iterations, and tolerance;
- an optional `BrepBody` baseline for primitive parity comparison.
@@ -50,13 +50,13 @@ Outputs include:
The dispatcher applies this policy:
1. Convert the requested analyzer use to a `CirMirrorCapability` and ask `CirMirrorAdmissionService`.
-2. If admission is `mirror-admitted-exact`, the requested use is map occupancy, and the admitted capabilities include `MapOccupancy`, select `CirTape`.
+2. If admission is `mirror-admitted-exact`, the requested use is map occupancy, and the admitted capabilities include `MapOccupancy`, select `SdfTape`.
3. If the request asks for face identity or topology parity, reject CIR as lossy for the request and select `Unsupported`.
4. If the source is prismatic/profile-chamfer and mirror admission is unavailable or unsupported, select `Unsupported` and emit no prismatic-mirror-used diagnostics.
5. If an optional BRep primitive baseline is provided, evaluate the existing BRep raycast baseline over the same request and compare bounded summaries.
6. Never route production CLI/analyzer calls through this dispatcher.
-`CirNode` is kept only as a semantic primitive source for lowering to tape; the selected successful backend is `CirTape`.
+`SdfNode` is kept only as a semantic primitive source for lowering to tape; the selected successful backend is `SdfTape`.
## 5. Mirror-admitted primitive cases
@@ -72,7 +72,7 @@ The X2 proof cases are:
For each case:
- mirror admission status is `mirror-admitted-exact`;
-- selected backend is `CirTape`;
+- selected backend is `SdfTape`;
- map occupancy is produced by the CIR tape evaluator;
- the BRep raycast baseline is compared over stable summaries;
- diagnostics include backend selection, baseline comparison, parity success, no prismatic mirror use, and no production analyzer behavior change.
diff --git a/docs/cir-recovery-v10-countersink-variant-executor-step.md b/docs/cir-recovery-v10-countersink-variant-executor-step.md
index 72eeacaf..fae704bb 100644
--- a/docs/cir-recovery-v10-countersink-variant-executor-step.md
+++ b/docs/cir-recovery-v10-countersink-variant-executor-step.md
@@ -9,7 +9,7 @@ We added `CountersinkVariant` to the `HoleRecoveryPolicy` JudgmentEngine lane an
## Blocker isolated
- Current CIR primitives are `Box`, `Cylinder`, `Sphere`, `Torus` (+ boolean and transform nodes).
-- There is no `CirConeNode` / conical primitive available to represent the countersink entry tool in semantic recovery input.
+- There is no `SdfConeNode` / conical primitive available to represent the countersink entry tool in semantic recovery input.
- Because of that, V10 cannot safely implement bounded countersink recognition/execution from CIR without scope expansion into CIR primitive surface area.
## What landed now
@@ -33,7 +33,7 @@ We added `CountersinkVariant` to the `HoleRecoveryPolicy` JudgmentEngine lane an
## Recommended V11
-1. Introduce bounded CIR cone primitive support (`CirConeNode`) with translation-only transform conventions matching existing primitive lowering patterns.
+1. Introduce bounded CIR cone primitive support (`SdfConeNode`) with translation-only transform conventions matching existing primitive lowering patterns.
2. Add `CountersinkVariant` bounded recognition for `Subtract(Subtract(Box,Cylinder),Cone)` with strict coaxial/entry/depth/radius checks.
3. Extend `HoleRecoveryExecutor` with cone subtract path using existing `BrepPrimitives.CreateCone` + `BrepBoolean.Subtract`.
4. Add countersink STEP smoke asserting `CONICAL_SURFACE`, `CYLINDRICAL_SURFACE`, and no `BREP_WITH_VOIDS`.
diff --git a/docs/cir-recovery-v11-countersink-cone-execution-step.md b/docs/cir-recovery-v11-countersink-cone-execution-step.md
index bd3a00e5..1a5366fd 100644
--- a/docs/cir-recovery-v11-countersink-cone-execution-step.md
+++ b/docs/cir-recovery-v11-countersink-cone-execution-step.md
@@ -1,8 +1,8 @@
-# CIR-RECOVERY-V11: CountersinkVariant via CirConeNode + executor + STEP smoke
+# CIR-RECOVERY-V11: CountersinkVariant via SdfConeNode + executor + STEP smoke
Bounded supported shape: `Subtract(Subtract(Box,Cylinder),Cone)` with translation-only wrappers.
-- `CountersinkVariant` now detects canonical countersink with `CirConeNode`.
+- `CountersinkVariant` now detects canonical countersink with `SdfConeNode`.
- Coaxial XY, entry-face touch, cone ordering, transition radius compatibility, strict clearance, and non-through cone depth are enforced.
- Produces `HoleRecoveryPlan` with conical + cylindrical profile stack and `HoleKind.Countersink`.
- `HoleRecoveryExecutor` now executes countersink by subtracting through cylinder then cone.
diff --git a/docs/cir-recovery-v16-bottom-entry-chamfered-hole.md b/docs/cir-recovery-v16-bottom-entry-chamfered-hole.md
index ac955518..7e2dc9ad 100644
--- a/docs/cir-recovery-v16-bottom-entry-chamfered-hole.md
+++ b/docs/cir-recovery-v16-bottom-entry-chamfered-hole.md
@@ -27,7 +27,7 @@ Subtract(
Where:
- `Box` is rectangular host.
- `HoleCylinder` is coaxial Z-axis cylindrical base hole.
-- `ChamferCone` is `CirConeNode`.
+- `ChamferCone` is `SdfConeNode`.
- direct or identity/pure-translation wrappers are allowed.
- no rotation/non-translation transforms.
diff --git a/docs/cir-recovery-v1a-frep-materializer-policy-scaffold.md b/docs/cir-recovery-v1a-frep-materializer-policy-scaffold.md
index 7e2eaa6d..249a855f 100644
--- a/docs/cir-recovery-v1a-frep-materializer-policy-scaffold.md
+++ b/docs/cir-recovery-v1a-frep-materializer-policy-scaffold.md
@@ -22,7 +22,7 @@ The planner evaluates all policies, retains all evaluations (including rejected
The context is node-first and intentionally minimal:
-- `CirNode Root`
+- `SdfNode Root`
- optional `NativeGeometryReplayLog`
- optional `SourceLabel`
diff --git a/docs/cir-recovery-v3-through-hole-step-smoke.md b/docs/cir-recovery-v3-through-hole-step-smoke.md
index 5555c3ca..cf611cde 100644
--- a/docs/cir-recovery-v3-through-hole-step-smoke.md
+++ b/docs/cir-recovery-v3-through-hole-step-smoke.md
@@ -10,7 +10,7 @@ This milestone only proves that executor-produced BRep for canonical/translated
## Pipeline exercised
-1. Build CIR root (`CirSubtractNode` with box host and cylinder tool).
+1. Build CIR root (`SdfSubtractNode` with box host and cylinder tool).
2. Run `FrepMaterializerPlanner.Decide(..., [ThroughHoleRecoveryPolicy])`.
3. Extract `ThroughHoleRecoveryPlan` from selected policy evaluation.
4. Execute `ThroughHoleRecoveryExecutor.Execute(plan)` to produce exact `BrepBody`.
diff --git a/docs/cir-recovery-v7a-counterbore-variant-plan.md b/docs/cir-recovery-v7a-counterbore-variant-plan.md
index dcad903a..a3daf2e1 100644
--- a/docs/cir-recovery-v7a-counterbore-variant-plan.md
+++ b/docs/cir-recovery-v7a-counterbore-variant-plan.md
@@ -15,8 +15,8 @@ Primary admitted shape:
With constraints:
-- host is `CirBoxNode` (translation wrappers allowed),
-- both tools are `CirCylinderNode` (translation wrappers allowed),
+- host is `SdfBoxNode` (translation wrappers allowed),
+- both tools are `SdfCylinderNode` (translation wrappers allowed),
- cylinders are coaxial in XY,
- `Large.Radius > Small.Radius`,
- small cylinder is through-hole relative to host depth,
diff --git a/docs/cir-step-v1-box-cylinder-recognizer.md b/docs/cir-step-v1-box-cylinder-recognizer.md
index c9c73102..4f3938c8 100644
--- a/docs/cir-step-v1-box-cylinder-recognizer.md
+++ b/docs/cir-step-v1-box-cylinder-recognizer.md
@@ -2,14 +2,14 @@
## Scope
Production recognizer for canonical CIR shape:
-- `CirSubtractNode(Box, Cylinder)`
-- optional identity/pure-translation wrappers (`CirTransformNode`) around operands.
+- `SdfSubtractNode(Box, Cylinder)`
+- optional identity/pure-translation wrappers (`SdfTransformNode`) around operands.
This milestone does **not** build BRep, export STEP, or wire rematerializer behavior.
## Inputs
`CirBoxCylinderRecognizerInput`:
-- required: `CirNode Root` (authoritative geometry)
+- required: `SdfNode Root` (authoritative geometry)
- optional: `NativeGeometryReplayLog ReplayLog` for provenance diagnostics
- optional: `SourceLabel`
@@ -18,7 +18,7 @@ This milestone does **not** build BRep, export STEP, or wire rematerializer beha
## Accepted shape
Accepted only when all are true:
1. root is subtract,
-2. lhs normalizes to `CirBoxNode`, rhs normalizes to `CirCylinderNode`,
+2. lhs normalizes to `SdfBoxNode`, rhs normalizes to `SdfCylinderNode`,
3. wrappers (if any) are identity/pure-translation only,
4. dimensions finite positive,
5. cylinder is canonical Z-axis (no rotation allowed),
diff --git a/docs/cir-t0-surface-restricted-field-trim-oracle.md b/docs/cir-t0-surface-restricted-field-trim-oracle.md
index 6e4bbe73..ba686c90 100644
--- a/docs/cir-t0-surface-restricted-field-trim-oracle.md
+++ b/docs/cir-t0-surface-restricted-field-trim-oracle.md
@@ -28,7 +28,7 @@ SurfaceRestrictedField
ParameterizationContract (IRestrictedSurfaceParameterization)
Domain2D (uMin,uMax,vMin,vMax + seam flags)
OppositeSelection (operand role + source/opposite subtree ids)
- OppositeField (CirTape preferred; CirNode fallback for diagnostics)
+ OppositeField (SdfTape preferred; SdfNode fallback for diagnostics)
ToleranceContext
OrientationPolicy
Evaluate(u,v) -> RestrictedFieldSample
@@ -36,10 +36,10 @@ SurfaceRestrictedField
Diagnostics (construction + sampling provenance)
```
-### Why `CirTape` first, `CirNode` second
+### Why `SdfTape` first, `SdfNode` second
-- `CirTape` is already the runtime execution form with primitive payload transforms and point evaluation, and has interval classification infrastructure that can be adapted conceptually to 2D cells after mapping into world-space bounds.
-- `CirNode` should remain available as semantic oracle and for debugging parity checks, but the restricted-field runtime should execute tape-first to stay aligned with CIR-E architecture.
+- `SdfTape` is already the runtime execution form with primitive payload transforms and point evaluation, and has interval classification infrastructure that can be adapted conceptually to 2D cells after mapping into world-space bounds.
+- `SdfNode` should remain available as semantic oracle and for debugging parity checks, but the restricted-field runtime should execute tape-first to stay aligned with CIR-E architecture.
### How “opposite” is encoded
@@ -62,11 +62,11 @@ In subtract roots, opposite is role-dependent:
### CIR evaluation runtime
-- `CirNode` and concrete nodes (box/cylinder/sphere/torus/transform/union/subtract/intersect) provide semantic SDF evaluation and bounds.
-- `CirTapeLowerer` composes transforms into inverse payload transforms and lowers booleans to `Min/Max/Neg` instruction sequences.
-- `CirTape.Evaluate` provides pointwise field values; `EvaluateInterval` provides conservative 3D AABB intervals.
+- `SdfNode` and concrete nodes (box/cylinder/sphere/torus/transform/union/subtract/intersect) provide semantic SDF evaluation and bounds.
+- `SdfTapeLowerer` composes transforms into inverse payload transforms and lowers booleans to `Min/Max/Neg` instruction sequences.
+- `SdfTape.Evaluate` provides pointwise field values; `EvaluateInterval` provides conservative 3D AABB intervals.
- `CirRegionPlanner` already uses `JudgmentEngine` for admissibility/utility-based decision among classify/subdivide/sample options.
-- `CirAdaptiveVolumeEstimator` already operationalizes planner decisions, adaptive splitting, direct sampling, and trace diagnostics.
+- `SdfAdaptiveVolumeEstimator` already operationalizes planner decisions, adaptive splitting, direct sampling, and trace diagnostics.
### Surface descriptor/readiness infrastructure
@@ -143,7 +143,7 @@ Current torus descriptors are family/provenance only plus deferred diagnostics;
### Subtract semantics (first contract)
-For `CirSubtractNode(A,B)`:
+For `SdfSubtractNode(A,B)`:
- for descriptors originating from `A`: opposite field is `Lower(B)`;
- for descriptors originating from `B`: opposite field is `Lower(A)`.
@@ -152,7 +152,7 @@ For `CirSubtractNode(A,B)`:
Partially:
-- current code uses `IsFromNode` by comparing `SourceSurfaceDescriptor.OwningCirNodeKind` to `node.GetType().Name`; this is not robust when both sides share primitive type (e.g., cylinder minus cylinder).
+- current code uses `IsFromNode` by comparing `SourceSurfaceDescriptor.OwningSdfNodeKind` to `node.GetType().Name`; this is not robust when both sides share primitive type (e.g., cylinder minus cylinder).
Missing for robust trim-oracle routing:
@@ -197,9 +197,9 @@ Impact on torus cases:
Reusable immediately:
-- opposite field evaluation via `CirTape.Evaluate`,
+- opposite field evaluation via `SdfTape.Evaluate`,
- tolerance semantics (`ToleranceContext`) and sign classification idioms,
-- planner pattern from `CirRegionPlanner`/`CirAdaptiveVolumeEstimator`.
+- planner pattern from `CirRegionPlanner`/`SdfAdaptiveVolumeEstimator`.
Needs 2D equivalents/new components:
diff --git a/docs/cir-t1-planar-restricted-field.md b/docs/cir-t1-planar-restricted-field.md
index b966fae5..80474e12 100644
--- a/docs/cir-t1-planar-restricted-field.md
+++ b/docs/cir-t1-planar-restricted-field.md
@@ -23,12 +23,12 @@ It rejects non-planar, missing bounded geometry, non-rectangle bounded geometry,
## Subtract opposite operand selection
-For `CirSubtractNode(left,right)`, T1 uses explicit source side:
+For `SdfSubtractNode(left,right)`, T1 uses explicit source side:
- source side `Left` => opposite node `right`
- source side `Right` => opposite node `left`
-Opposite node is lowered via `CirTapeLowerer.Lower` and sampled via `CirTape.Evaluate`.
+Opposite node is lowered via `SdfTapeLowerer.Lower` and sampled via `SdfTape.Evaluate`.
## Evaluation behavior
diff --git a/docs/continuum/architecture.md b/docs/continuum/architecture.md
index 1942663c..4f88a1f1 100644
--- a/docs/continuum/architecture.md
+++ b/docs/continuum/architecture.md
@@ -1,106 +1,58 @@
# Aetheris Continuum architecture
-## Definition and authority
+## Authority
-**CIR means Continuum Implicit Representation.** A CIR value represents an occupied continuum region, optionally partitioned into material or semantic regions, through spatial queries. Occupancy is fundamental. Signed distance, gradients, projection, and exact cell classification are optional capabilities.
+- Firmament expresses typed source intent.
+- AIR / typed construction recipes own constructive lowering decisions.
+- BRep owns exact boundary identity, analytic supports, trims, adjacency, topology, and interchange.
+- CIR (Continuum Implicit Representation) owns occupied material and continuum-region classification.
+- SDF is one CIR backend/capability family; CIR is not synonymous with SDF.
+- SurfaceMeshIR is a separate derived structured boundary approximation, never occupancy or exact-boundary authority.
+- BoundaryOffsetMap is a derived Cut-cell-local cache, never exact geometry authority.
-CIR is not inherently an SDF, mesh, BRep, CSG tree, NURBS model, or topology graph. SDF is one CIR evaluation backend.
+```mermaid
+flowchart TD
+ F["Firmament / source intent"] --> A["Typed construction / AIR"]
+ A --> B["Exact BRep"]
+ A --> C["Complete CIR"]
+ S["SDF backend"] --> C
+ B --> M["SurfaceMeshIR (derived boundary path)"]
+ B --> X["BRep + CIR association"]
+ C --> X
+ X --> W["Continuum Cut-cell composition"]
+ W --> O["BoundaryOffsetMap / integration"]
+ O --> Q["Future mechanics operator"]
+```
-Authority is deliberately split:
+Generated whole-part analysis requires BRep and CIR to carry the same construction-source identity. `ExactCoaxialConstructionPlan` is the first production dual-lowered family. CIR is built analytically from prism half-spaces, cone/frustum profiles, cylinders, the concave toroidal root profile, and caps; it is not derived from BRep tessellation. The BRep is independently materialized from the same plan.
-| Representation | Owns | Does not silently own |
-| --- | --- | --- |
-| BRep | exact faces, edges, vertices, trims, adjacency, orientation, topology identity, STEP interchange, semantic boundary ownership, and provenance | occupied-field sampling or regular-cell state |
-| CIR | occupied-space classification, continuum/material regions, implicit fields, cell occupancy, and geometry sampling | exact boundary topology or stable face/edge identity |
-| SurfaceMeshIR | derived structured approximation of the BRep boundary for tessellation, DCC, STL, and possible candidate-cell acceleration | occupancy or exact-boundary authority |
-| SDF backend | distance-like evaluation, analytic primitives, field composition, transforms, intervals, gradients where exposed, and sampling support | the definition of CIR |
+## Material side and topology orientation
-Implicit representations remain because they are unusually strong for occupancy, material fields, distance/proximity cues, Boolean-like volumetric classification, regular lattices, and continuum analysis—not as a fallback attempt to replace exact BRep.
+`ExactSupportNormal` is the differential normal of the analytic support. `ParameterizationNormal` may apply BRep `SameSense`, but is still not an occupancy answer. `MaterialSideClassifier.ClassifyMaterialSide` probes CIR on both sides of the exact support normal and returns typed evidence. `SameSense`, face orientation, and coedge sense remain topology/parameterization evidence only.
-The dependency direction is `Aetheris.Continuum -> Aetheris.Kernel.Core`. Core supplies general math, tolerances, JudgmentEngine, and exact geometry/BRep types. Core must not reference Continuum.
+## SDF capabilities
-## Pre-extraction audit (AETHERIS-CONTINUUM-M0)
+`SdfFieldCapabilities` distinguishes sign-correct occupancy, conservative intervals, exact Euclidean signed distance, and gradient availability. Rigid transforms preserve exact distance; non-rigid scale removes that claim. General union/intersection/subtraction retain sign and conservative interval promises but do not advertise exact Euclidean distance. Intersection `SdfBounds` is a safe union container and is explicitly not tight.
-This inventory was written before implementation movement. The eight files under `Aetheris.Kernel.Core/Cir` totaled 1,893 lines.
+## Recovery policy
-| Existing item | Location/capability | Class | M0 disposition |
-| --- | --- | --- | --- |
-| `CirNode`, `CirBounds`, point classification | `Core/Cir/CirNode.cs`, `CirAnalysis.cs` | A: CIR concept mixed with B: SDF contract | split broad CIR contracts from signed-distance backend; retain narrow legacy names only in the backend |
-| analytic box, cylinder, cone, sphere, torus | `Core/Cir/CirNodes.cs` | B: SDF backend | move without rewriting |
-| union, subtraction, intersection, transforms | `Core/Cir/CirNodes.cs` | B: SDF field/composition backend | move without rewriting |
-| dense volume sampler | `CirNodes.cs` | A/B: continuum sampling tied to SDF nodes | move; new lattice sampling becomes representation-neutral |
-| tape instructions, payloads, lowering, point evaluation | `Core/Cir/CirTape.cs` | B: SDF backend | move intact under the SDF backend |
-| conservative field intervals and region classification | `CirTape.cs` | B with A-facing capability | move; expose through optional cell-bounds classification capability |
-| adaptive volume estimator | `CirAdaptiveVolumeEstimator.cs` | D: continuum experiment tied to SDF tape | move to Continuum; preserve regression behavior |
-| `CirRegionPlanner` using `JudgmentEngine` | `CirRegionPlanner.cs` | D: continuum strategy selection | move to Continuum; it correctly uses explicit admissibility/scoring |
-| mirror admission/provenance metadata | `CirMirrorMetadata.cs` | D/E: AIR consumer bridge and experimental policy | move out of Core; preserve as internal compatibility surface |
-| convex prismatic mirror and top-view map | `Cir/Mirrors/CirConvexPolyhedronMirror.cs` | D: AIR/prismatic consumer-specific implicit mirror | move out of Core; keep dependency on Core prismatic/math types |
-| `AirCirMirrorAdapter` | `Core/Air/AirCirMirrorAdapter.cs` | D: misplaced AIR-to-CIR consumer adapter | move with Continuum so Core does not depend on Continuum |
-| `Point3D`, `Vector3D`, `Transform3D` | `Core/Math` | C: general kernel utility | remain in Core |
-| `ToleranceContext` | `Core/Numerics` | C: general kernel utility | remain in Core |
-| `JudgmentEngine` | `Core/Judgment` | C: general bounded-strategy utility | remain in Core |
-| Firmament CIR lowering | `Kernel.Firmament/Lowering/FirmamentCirLowerer.cs` | D: consumer/compiler bridge | remain in Firmament and reference Continuum |
-| Firmament analysis/materializers/recovery | `Kernel.Firmament/Analysis`, `Materializer`, and related execution | D plus E: bounded consumers and historically overextended CIR-to-BRep experiments | remain consumers; generic rematerialization redesign is out of M0 |
-| CLI | no direct CIR implementation dependency found; CIR data is exposed through Firmament/AIR summaries | D: transitive consumer | no new direct authority path |
-| Core CIR tests | 11 focused files under `Kernel.Core.Tests/Cir` plus AIR mirror tests | tests owned by old location | move CIR/SDF regression ownership to `Aetheris.Continuum.Tests`; leave genuinely Core tests in Core |
-| Firmament/FrictionLab tests | lowering, analysis, recovery, and experimental mirror coverage | consumer regression tests | retain in consumer test assemblies and update references |
-| serialization/debug | no general CIR serializer; diagnostics are records/strings and CLI summaries | E: incomplete | add deterministic lattice JSON diagnostics in Continuum; do not invent persistence format |
-| gradients/normals | no general public CIR gradient contract found; SDF tape provides values/intervals only | E: missing capability seam | add optional capability; finite-difference SDF adapter may implement it |
-| generic BRep -> CIR | none; existing paths primarily lower constructive Firmament/AIR to CIR or narrowly rematerialize CIR to BRep | E: absent and major | explicitly not required for M0 |
+Arbitrary CIR/SDF to exact BRep is not a general inverse. Retained Firmament paths are bounded SDF decompilers for intent recovery and carry an explicit `SdfDecompilationContract`. Generated exact geometry uses AIR/typed construction to BRep directly.
-### Old architecture problems
+Arbitrary BRep/STEP to authoritative CIR is not implemented. A future imported-solid milestone may introduce a bounded analytic-shell adapter with exact point containment and face correspondence, but M4B does not assume or simulate that conversion.
-The public `CirNode.Evaluate` contract made CIR look synonymous with a scalar signed-distance evaluator. Continuum implementation, SDF bytecode, adaptive sampling policy, AIR mirror provenance, and prismatic consumer experiments all lived in Core. This made Core appear to own an implicit-modeling authority while Firmament also used CIR in the opposite direction for narrow BRep recovery. The assembly boundary did not communicate the now-established authority split.
+## Hard invariants
-### BRep and boundary identity
+1. Core does not depend on Continuum.
+2. CIR != SDF and BRep != CIR.
+3. No representation is a universal replacement for another.
+4. SurfaceMeshIR is never occupancy authority.
+5. BoundaryOffsetMap is never exact geometry authority.
+6. Generated whole-part BRep and CIR share constructive lineage.
+7. Arbitrary CIR to BRep and arbitrary BRep to CIR recovery are not assumed.
+8. `SameSense` is not material-side truth.
+9. JudgmentEngine arbitrates genuinely competing bounded interpretations; it is not representation authority and is absent from deterministic dual lowering.
+10. Geometry sampling is separate from future mechanics quadrature.
-A cut cell may carry a `BoundaryReference` with source representation, stable source identifier, optional exact BRep face identifier, and semantic region. This is an attachment hook, not inferred correspondence. M0 analytic fixtures use analytic boundary identifiers. A future bounded BRep-to-CIR bridge may attach exact face references only when it can prove the correspondence.
+## Dependencies
-No generic BRep-to-CIR conversion is required in M0. Imported STEP/BRep bodies cannot acquire an implicit mirror merely because sampling would be convenient.
-
-### Geometry sampling versus solver quadrature
-
-`GeometrySamplePlan` answers what portion of a cell is occupied and which boundaries are candidates. Its deterministic subcell patterns may later grow from 2x2x2 to 4x4x4 or hierarchical reuse.
-
-Solver quadrature is a future, separate artifact that will choose integration locations and weights for PDE terms. Geometry samples are not quadrature points and M0 introduces no solver state.
-
-### Boundary offset map seam
-
-A future `BoundaryOffsetMap` is a compact local, derived cache for a cut cell: source boundary reference, local frame, offset/normal samples, parameter bounds, and approximation/error metadata. It is analogous to a rendering displacement/normal map only as a storage intuition. It never becomes exact geometry authority; BRep and/or CIR remain authoritative.
-
-### SurfaceMeshIR relationship
-
-SurfaceMeshIR may later accelerate candidate boundary-cell detection, provide structured samples and normal/parameter hints, or propagate semantic regions. Every result must still be confirmed against occupancy authority. SurfaceMeshIR does not classify material by itself.
-
-## Oct Continuum Boundary Experiment audit
-
-Local evidence was available in `C:/Users/yuech/source/repos/oct/Experiments/ContinuumComputabilityBoundary` and was read without modifying that repository.
-
-Ideas that transfer cleanly:
-
-- M4's plain Cartesian specification and deterministic row-major indexing;
-- M11's fixed, deterministic MSAA-style coverage samples;
-- M12's separation of a cheap base pattern from later selective higher-rate boundary sampling;
-- M15's conclusion that coverage and signed-distance narrow bands are related but distinct capabilities;
-- explicit metrics and fixed ordering for reproducibility.
-
-M1 source review corrected an important nuance: M12's quarter-point 2x2 and eighth-offset 4x4 patterns were disjoint, so the Oct experiment recomputed its upgraded cells and did not demonstrate hierarchical sample reuse. Aetheris retains those regular layouts for comparison and adds a separate nested base whose coordinates are a subset of regular 4x4.
-
-Ideas redesigned for Aetheris:
-
-- Oct's site/cell masks become typed 3D `CellIndex`, bounds, and `Inside/Outside/Cut` records;
-- sampled coverage is used only in Cut cells after analytic/interval classification where available;
-- SDF is an optional backend/cue rather than the continuum definition;
-- refinement selection and solver transfer/flux structures are deferred.
-
-Ideas made obsolete or inappropriate by Aetheris authority:
-
-- sampled masks must not stand in for exact BRep boundary identity;
-- coverage gradients need not pretend to be exact normals when CIR/SDF or BRep can supply them;
-- solver coupling, flux, and balance records from later Oct milestones do not belong in this geometry-only substrate.
-
-## Deferred numerical distinctions
-
-Geometric refinement means more deterministic samples, improved offset maps, or a higher MSAA rate without changing lattice cells. Physical refinement means smaller cells or AMR. Boundary curvature alone does not force AMR.
-
-Tiny active fractions will eventually require numerical policy such as cell aggregation, basis aggregation, redistribution, or a minimum-active-fraction rule. That is solver stabilization, not M0 geometry, and no such policy is embedded in `CutCell`.
+`Aetheris.Continuum` depends on Core and StandardLibrary's public typed coaxial construction plan. StandardLibrary depends on Forge/Core and does not depend on Continuum. Core exposes the bounded `ContinuumConstructionDescriptor`. The sole remaining Continuum friend access is legacy AIR/prismatic mirror experimentation, recorded with an explicit removal trigger in the refactoring notes.
diff --git a/docs/continuum/artifacts/m4b/architecture-refactoring-disposition.json b/docs/continuum/artifacts/m4b/architecture-refactoring-disposition.json
new file mode 100644
index 00000000..5fdfe853
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/architecture-refactoring-disposition.json
@@ -0,0 +1,7 @@
+{
+ "milestone": "AETHERIS-CONTINUUM-M4B",
+ "authority": "typed construction -\u003E BRep \u002B CIR",
+ "sdfNames": "source-broken to Sdf*",
+ "genericBrepToCir": "not implemented",
+ "serialization": "deferred; diagnostics JSON is not interchange"
+}
diff --git a/docs/continuum/artifacts/m4b/complete-association-evidence.json b/docs/continuum/artifacts/m4b/complete-association-evidence.json
new file mode 100644
index 00000000..fef154f9
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/complete-association-evidence.json
@@ -0,0 +1,24 @@
+{
+ "associationPassed": true,
+ "hexBolt": true,
+ "rows": [
+ {
+ "name": "hex-baseline",
+ "associationPassed": true,
+ "maximumConsistencyResidual": 3.552713678800501E-15,
+ "consistencyProbeCount": 100
+ },
+ {
+ "name": "hex-rotate-y-29",
+ "associationPassed": true,
+ "maximumConsistencyResidual": 3.520535194044623,
+ "consistencyProbeCount": 100
+ },
+ {
+ "name": "hex-compound-17-31-13",
+ "associationPassed": true,
+ "maximumConsistencyResidual": 4.835562698158373,
+ "consistencyProbeCount": 100
+ }
+ ]
+}
diff --git a/docs/continuum/artifacts/m4b/deterministic-hashes.json b/docs/continuum/artifacts/m4b/deterministic-hashes.json
new file mode 100644
index 00000000..081d8cee
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/deterministic-hashes.json
@@ -0,0 +1,7 @@
+{
+ "algorithm": "SHA-256",
+ "hash": "7e621e552448529d2e4862610b2dee93ac634c5c6d9ef3e5aa44433dc9633f33",
+ "repeatedIdentity": true,
+ "repeatedMetrics": true,
+ "excludesPerformanceTimings": true
+}
diff --git a/docs/continuum/artifacts/m4b/dual-lowering-evidence.json b/docs/continuum/artifacts/m4b/dual-lowering-evidence.json
new file mode 100644
index 00000000..714f4f39
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/dual-lowering-evidence.json
@@ -0,0 +1,11 @@
+{
+ "constructionSourceIdentity": "M4B-GenericCoaxial:58b5e0f8b1972acb34cc1fb270d01a17a7d6ef75f30136ef532e65207411ed25",
+ "associationPassed": true,
+ "consistencyProbeCount": 120,
+ "supportFamilyCounts": {
+ "Cone": 10,
+ "Cylinder": 2,
+ "Plane": 11,
+ "Torus": 2
+ }
+}
diff --git a/docs/continuum/artifacts/m4b/generic-coaxial-metrics.json b/docs/continuum/artifacts/m4b/generic-coaxial-metrics.json
new file mode 100644
index 00000000..d1431be5
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/generic-coaxial-metrics.json
@@ -0,0 +1,41 @@
+{
+ "name": "generic-coaxial",
+ "constructionSourceIdentity": "M4B-GenericCoaxial:58b5e0f8b1972acb34cc1fb270d01a17a7d6ef75f30136ef532e65207411ed25",
+ "associationPassed": true,
+ "consistencyProbeCount": 120,
+ "maximumConsistencyResidual": 1.7763568394002505E-15,
+ "totalCells": 1728,
+ "inside": 288,
+ "outside": 848,
+ "cut": 592,
+ "supportFamilyCounts": {
+ "Cone": 10,
+ "Cylinder": 2,
+ "Plane": 11,
+ "Torus": 2
+ },
+ "compositionCounts": {
+ "FilletContact": 64,
+ "MultiFaceTrimJunction": 48,
+ "SingleFace": 312,
+ "ThreeFaceCorner": 8,
+ "TwoFaceEdge": 152
+ },
+ "judgmentEngineCalls": 48,
+ "exactVolume": 2488.71307899376,
+ "estimatedVolume": 2465.577846498851,
+ "absoluteVolumeError": 23.135232494908905,
+ "relativeVolumeError": 0.009296062567510987,
+ "exactBoundaryArea": 1362.8012697394363,
+ "estimatedBoundaryArea": 1381.5656601187748,
+ "relativeBoundaryAreaError": 0.013768985101493311,
+ "fineEstimatedVolume": 2503.913899287576,
+ "fineRelativeVolumeError": 0.006107903889009954,
+ "brepAndCirMaterializationMilliseconds": 0.6641,
+ "associationValidationMilliseconds": 1.1955,
+ "candidateDiscoveryMilliseconds": 1.8721,
+ "classificationMilliseconds": 27.3905,
+ "cutCellIntegrationMilliseconds": 594.0203,
+ "fineControlMilliseconds": 148.5957,
+ "totalMilliseconds": 1595.5125
+}
diff --git a/docs/continuum/artifacts/m4b/hexbolt-metrics.json b/docs/continuum/artifacts/m4b/hexbolt-metrics.json
new file mode 100644
index 00000000..fa30cae6
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/hexbolt-metrics.json
@@ -0,0 +1,41 @@
+{
+ "name": "hex-baseline",
+ "constructionSourceIdentity": "M4B-HexBolt:b2e86e279016f55625e074153f76561144dc7c3c85cbc943c3e3492a7e19acda",
+ "associationPassed": true,
+ "consistencyProbeCount": 100,
+ "maximumConsistencyResidual": 3.552713678800501E-15,
+ "totalCells": 1728,
+ "inside": 216,
+ "outside": 936,
+ "cut": 576,
+ "supportFamilyCounts": {
+ "Cone": 8,
+ "Cylinder": 2,
+ "Plane": 9,
+ "Torus": 2
+ },
+ "compositionCounts": {
+ "FilletContact": 64,
+ "MultiFaceTrimJunction": 36,
+ "SingleFace": 272,
+ "ThreeFaceCorner": 32,
+ "TwoFaceEdge": 164
+ },
+ "judgmentEngineCalls": 36,
+ "exactVolume": 2520.0469401890387,
+ "estimatedVolume": 2494.577446853513,
+ "absoluteVolumeError": 25.46949333552584,
+ "relativeVolumeError": 0.010106753540715902,
+ "exactBoundaryArea": 1382.6322807982408,
+ "estimatedBoundaryArea": 1406.2650956053524,
+ "relativeBoundaryAreaError": 0.01709262479642638,
+ "fineEstimatedVolume": 2531.626330827626,
+ "fineRelativeVolumeError": 0.004594910695480485,
+ "brepAndCirMaterializationMilliseconds": 0.5555,
+ "associationValidationMilliseconds": 0.9598,
+ "candidateDiscoveryMilliseconds": 1.015,
+ "classificationMilliseconds": 22.2435,
+ "cutCellIntegrationMilliseconds": 569.1681,
+ "fineControlMilliseconds": 105.6187,
+ "totalMilliseconds": 1425.6714
+}
diff --git a/docs/continuum/artifacts/m4b/orientation-matrix.json b/docs/continuum/artifacts/m4b/orientation-matrix.json
new file mode 100644
index 00000000..0d998259
--- /dev/null
+++ b/docs/continuum/artifacts/m4b/orientation-matrix.json
@@ -0,0 +1,125 @@
+[
+ {
+ "name": "hex-baseline",
+ "constructionSourceIdentity": "M4B-HexBolt:b2e86e279016f55625e074153f76561144dc7c3c85cbc943c3e3492a7e19acda",
+ "associationPassed": true,
+ "consistencyProbeCount": 100,
+ "maximumConsistencyResidual": 3.552713678800501E-15,
+ "totalCells": 1728,
+ "inside": 216,
+ "outside": 936,
+ "cut": 576,
+ "supportFamilyCounts": {
+ "Cone": 8,
+ "Cylinder": 2,
+ "Plane": 9,
+ "Torus": 2
+ },
+ "compositionCounts": {
+ "FilletContact": 64,
+ "MultiFaceTrimJunction": 36,
+ "SingleFace": 272,
+ "ThreeFaceCorner": 32,
+ "TwoFaceEdge": 164
+ },
+ "judgmentEngineCalls": 36,
+ "exactVolume": 2520.0469401890387,
+ "estimatedVolume": 2494.577446853513,
+ "absoluteVolumeError": 25.46949333552584,
+ "relativeVolumeError": 0.010106753540715902,
+ "exactBoundaryArea": 1382.6322807982408,
+ "estimatedBoundaryArea": 1406.2650956053524,
+ "relativeBoundaryAreaError": 0.01709262479642638,
+ "fineEstimatedVolume": 2531.626330827626,
+ "fineRelativeVolumeError": 0.004594910695480485,
+ "brepAndCirMaterializationMilliseconds": 0.5555,
+ "associationValidationMilliseconds": 0.9598,
+ "candidateDiscoveryMilliseconds": 1.015,
+ "classificationMilliseconds": 22.2435,
+ "cutCellIntegrationMilliseconds": 569.1681,
+ "fineControlMilliseconds": 105.6187,
+ "totalMilliseconds": 1425.6714
+ },
+ {
+ "name": "hex-rotate-y-29",
+ "constructionSourceIdentity": "M4B-HexBolt:b2e86e279016f55625e074153f76561144dc7c3c85cbc943c3e3492a7e19acda",
+ "associationPassed": true,
+ "consistencyProbeCount": 100,
+ "maximumConsistencyResidual": 3.520535194044623,
+ "totalCells": 1728,
+ "inside": 48,
+ "outside": 1210,
+ "cut": 470,
+ "supportFamilyCounts": {
+ "Cone": 8,
+ "Cylinder": 2,
+ "Plane": 9,
+ "Torus": 2
+ },
+ "compositionCounts": {
+ "FilletContact": 32,
+ "MultiFaceTrimJunction": 46,
+ "SingleFace": 62,
+ "ThreeFaceCorner": 22,
+ "TwoFaceEdge": 290
+ },
+ "judgmentEngineCalls": 46,
+ "exactVolume": 2520.0469401890387,
+ "estimatedVolume": 2523.5326896251067,
+ "absoluteVolumeError": 3.4857494360680903,
+ "relativeVolumeError": 0.0013832081381018285,
+ "exactBoundaryArea": 1382.6322807982408,
+ "estimatedBoundaryArea": 1390.3086749776608,
+ "relativeBoundaryAreaError": 0.00555201428899672,
+ "fineEstimatedVolume": 2519.287067137031,
+ "fineRelativeVolumeError": 0.00030153130875832214,
+ "brepAndCirMaterializationMilliseconds": 0.3418,
+ "associationValidationMilliseconds": 0.8855,
+ "candidateDiscoveryMilliseconds": 0.7806,
+ "classificationMilliseconds": 16.9116,
+ "cutCellIntegrationMilliseconds": 529.909,
+ "fineControlMilliseconds": 98.0548,
+ "totalMilliseconds": 1358.0011
+ },
+ {
+ "name": "hex-compound-17-31-13",
+ "constructionSourceIdentity": "M4B-HexBolt:b2e86e279016f55625e074153f76561144dc7c3c85cbc943c3e3492a7e19acda",
+ "associationPassed": true,
+ "consistencyProbeCount": 100,
+ "maximumConsistencyResidual": 4.835562698158373,
+ "totalCells": 1728,
+ "inside": 15,
+ "outside": 1377,
+ "cut": 336,
+ "supportFamilyCounts": {
+ "Cone": 8,
+ "Cylinder": 2,
+ "Plane": 9,
+ "Torus": 2
+ },
+ "compositionCounts": {
+ "FilletContact": 35,
+ "MultiFaceTrimJunction": 42,
+ "SingleFace": 21,
+ "ThreeFaceCorner": 20,
+ "TwoFaceEdge": 198
+ },
+ "judgmentEngineCalls": 42,
+ "exactVolume": 2520.0469401890387,
+ "estimatedVolume": 2522.0944835563873,
+ "absoluteVolumeError": 2.0475433673486805,
+ "relativeVolumeError": 0.0008125020747411499,
+ "exactBoundaryArea": 1382.6322807982408,
+ "estimatedBoundaryArea": 1375.3765193700183,
+ "relativeBoundaryAreaError": 0.005247788243475347,
+ "fineEstimatedVolume": 2518.9957907552707,
+ "fineRelativeVolumeError": 0.0004171150215515753,
+ "brepAndCirMaterializationMilliseconds": 0.3452,
+ "associationValidationMilliseconds": 0.8802,
+ "candidateDiscoveryMilliseconds": 0.8933,
+ "classificationMilliseconds": 12.767,
+ "cutCellIntegrationMilliseconds": 364.4002,
+ "fineControlMilliseconds": 66.9237,
+ "totalMilliseconds": 1118.6765
+ }
+]
diff --git a/docs/continuum/continuum-refactoring-notes.md b/docs/continuum/continuum-refactoring-notes.md
index df73d4fb..04b462be 100644
--- a/docs/continuum/continuum-refactoring-notes.md
+++ b/docs/continuum/continuum-refactoring-notes.md
@@ -1,116 +1,26 @@
-# Continuum refactoring notes
-
-These items were discovered during AETHERIS-CONTINUUM-M0 and intentionally not expanded into broad reconstruction.
-
-## Historical SDF types retain `Cir*` names
-
-- **Current state:** `CirNode`, `CirTape`, `CirBounds`, and related records now live under `Aetheris.Continuum.Backends.Sdf`, but their names predate the rule that CIR is broader than SDF.
-- **Problem:** the namespace communicates backend ownership, while individual names can still suggest that the SDF tree is the whole CIR model.
-- **Why larger than M0:** renaming the public family affects Firmament lowering/materializers, FrictionLab experiments, docs, external API consumers, and serialized/reflected type-name assumptions that need a compatibility policy.
-- **Proposed direction:** rename toward `SdfNode`, `SdfTape`, and a general bounds type in a source-breaking milestone; keep `SdfContinuumRegion` as the explicit CIR adapter and retire old names once consumers migrate.
-- **Blocks M0:** no.
-- **Recommended milestone:** CONTINUUM-M1A API naming and compatibility review.
-
-## Legacy AIR/prismatic bridge reaches Core internals
-
-- **Current state:** the relocated `Bridges/Air` and `Mirrors` code uses internal AIR and prismatic source records through `InternalsVisibleTo("Aetheris.Continuum")`.
-- **Problem:** dependency direction is correct, but the friend-assembly surface is implicit and wider than a small stable bridge contract.
-- **Why larger than M0:** extracting public source descriptors requires coordinated AIR/BRepPlan design and would affect experimental chamfer/prismatic routes.
-- **Proposed direction:** define a small immutable public/internal bridge DTO in Core that exposes only admitted section vertices, correspondence, source identity, and provenance; have Continuum consume that DTO.
-- **Blocks M0:** no; Core has no Continuum reference and behavior remains regression-tested.
-- **Recommended milestone:** AIR-CIR-M1 bridge contract.
-
-## Firmament contains substantial CIR-to-BRep recovery logic
-
-- **Current state:** Firmament recognizers/materializers and FrictionLab experiments consume CIR trees to recover bounded BRep output.
-- **Problem:** historical documents sometimes frame CIR as constructive boundary authority; this conflicts with the new authority contract if generalized.
-- **Why larger than M0:** the paths contain feature-family policy, topology stitching, trim oracles, recovery diagnostics, and many regressions. Moving or redesigning them would be kernel-wide work.
-- **Proposed direction:** retain only explicit, bounded rematerializers as consumer adapters with declared loss/admissibility; prefer AIR/BRep construction as the exact path and prohibit generic implicit-to-exact claims without proof.
-- **Blocks M0:** no; existing consumers compile and retain behavior.
-- **Recommended milestone:** CIR-BREP authority cleanup after Continuum M1 experiments.
-
-## Generic BRep-to-CIR conversion is absent
-
-- **Current state:** generated Firmament/AIR shapes may carry admitted mirrors; arbitrary imported trimmed BRep/STEP does not.
-- **Problem:** future continuum analysis of arbitrary imports needs occupied-region interpretation and boundary correspondence.
-- **Why larger than M0:** correct conversion requires oriented closed-shell interpretation, trimmed periodic analytic surfaces, robust point containment, tolerance/error contracts, and face-identity mapping.
-- **Proposed direction:** start with a bounded closed analytic-shell adapter that exposes occupancy and exact face candidates; do not begin with universal tessellation-as-authority conversion.
-- **Blocks M0:** no; analytic fixtures prove the substrate.
-- **Recommended milestone:** CONTINUUM-BREP-BRIDGE-M0, separately scoped.
-
-## SDF interval and transform contracts need mathematical labels
-
-- **Current state:** the tape preserves analytic interval bounds and transformed primitives; `CirTransformNode.Evaluate` returns the child scalar after inverse transformation.
-- **Problem:** under general non-rigid scaling, the scalar may retain correct sign/occupancy but is not necessarily exact Euclidean signed distance. `CirIntersectNode.Bounds` also uses a safe union rather than a tight intersection.
-- **Why larger than M0:** tightening requires auditing transform classes, Lipschitz/error metadata, empty intersections, and all interval regression expectations.
-- **Proposed direction:** distinguish sign-correct implicit field, conservative interval field, and exact-distance capability; advertise exact signed distance only when transform/composition rules preserve it.
-- **Blocks M0:** no; M0 classification requires occupancy and bounded classification, not universal exact-distance claims.
-- **Recommended milestone:** SDF-CAPABILITIES-M1.
-
-## Serialization/versioning contract is missing
-
-- **Current state:** no general CIR serializer was found. Existing diagnostics and CLI records are runtime/debug shapes; repository sources were updated to the new namespace directly.
-- **Problem:** reflected type-name persistence or future public interchange would be brittle across the extraction.
-- **Why larger than M0:** a stable format requires schema/version/identity decisions beyond moving code.
-- **Proposed direction:** define a representation-neutral CIR descriptor schema with explicit backend payload/version only when a real persistence consumer exists.
-- **Blocks M0:** no.
-- **Recommended milestone:** first milestone that needs persisted Continuum artifacts.
-
-## Boundary-area estimation is intentionally absent
-
-- **Current state:** analytic fixtures report exact boundary area, while sampled estimated area is null.
-- **Problem:** occupancy coverage alone does not define a trustworthy surface-area estimator.
-- **Why larger than M0:** a useful estimate should consume reconstructed local cuts, normals, or offset maps and carry an error contract.
-- **Proposed direction:** make boundary-position and area error part of the first BoundaryOffsetMap experiment.
-- **Blocks M0:** no; volume convergence and Cut-cell localization are demonstrated.
-- **Recommended milestone:** CONTINUUM-M1 offset-surface/MSAA experiment.
-
-## BoundaryOffsetMap V1 integration is Z-extruded
-
-- **Current state:** M1 integrates sampled local graphs whose `V` tangent is the lattice Z axis. This covers the analytic through-cylinder and oblique-plane controls with one representation-neutral polygon clipper.
-- **Problem:** arbitrary oriented/trimmed surfaces need local-domain clipping and surface-area/first-moment integration that is not reducible to one extruded XY section.
-- **Impact:** the V1 map representation is general enough to carry such data, but its first occupancy/area estimator is intentionally bounded.
-- **Proposed fix:** add a local patch-domain integration contract and test it first on one non-extruded analytic sphere or torus patch; do not route through arbitrary triangles or a global atlas.
-- **Blocks M1:** no; both declared M1 fixtures are exact Z extrusions and fail explicitly otherwise.
-- **Suggested future milestone:** CONTINUUM-M2 local patch integration.
-
-## Independent offset-map validation dominates experimental query cost
-
-- **Current state:** every generated M1 map is checked at `(2*resolution+1)^2` independent half-stride points. The best cylinder run spends 32,192 of 45,120 raw requests on validation.
-- **Problem:** this is appropriate proof cost for M1 but too expensive as a default production cache policy.
-- **Impact:** fixed-lattice accuracy and runtime still improve, but exact-query counts make the validation/production distinction important.
-- **Proposed fix:** retain exhaustive mode for evidence and add a deterministic bounded validation policy or analytic error certificate capability for trusted supports.
-- **Blocks M1:** no; query accounting includes the cost rather than hiding it.
-- **Suggested future milestone:** CONTINUUM-M2 map certification and validation policy.
-
-## M2 projected-footprint integration is accuracy-oriented, not production-cheap
-
-- **Current state:** M2 removes the arbitrary-orientation blocker by projecting each Cut-cell box to the exact local frame, taking its convex footprint, and deterministically integrating material thickness and bilinear-map area. A dense bounded quadrature makes the sphere evidence stable.
-- **Problem:** the quadrature dominates the production-like M2 timing (roughly 400 ms of the 451 ms adaptive baseline) even though it performs no exact BRep queries.
-- **Impact:** fixed-lattice geometry beats the 32-cubed reference on volume error and the runtime certificate eliminates oracle queries, but the experiment does not yet establish an end-to-end setup-time win.
-- **Proposed direction:** integrate clipped piecewise-bilinear graph patches analytically or with a conservative adaptive error estimate; preserve the current dense path as the experimental oracle. Do not introduce AMR or make triangles geometry authority.
-- **Blocks M2:** no; M2's intended exact-BRep identity, arbitrary-frame, fidelity, area/volume, orientation, and certification proofs all execute on the real path.
-- **Suggested future milestone:** CONTINUUM-M3 torus plus cheap local graph integration.
-# Exact face-normal semantic naming
-
-- **Issue:** `ExactBrepBoundaryQuery.OutwardNormal` historically encoded the sphere assumption that the bound face normal is outward. The production `ConcaveFilletConstruction` torus support is deliberately oriented into material, so `FaceGeometryBinding.SameSense` alone does not establish a universal material/outward convention across construction families.
-- **Impact:** Continuum must not silently negate a concave face normal. Doing so reversed the root-fillet material-side probe during M3 bring-up.
-- **Proposed direction:** introduce a kernel-level oriented-shell query that returns both exact support normal and shell material-side classification. Until that exists, Continuum fixtures must state the construction contract explicitly and verify it against CIR with deterministic two-sided probes.
-- **Blocker status:** not an M3 blocker; M3 records `exactFaceNormalIsMaterialSide` explicitly and fails on CIR disagreement.
-- **Recommended future milestone:** multi-face whole-part Cut-cell composition, where oriented-shell authority can replace per-fixture declarations.
-
-## Complete root-fillet BRep/CIR identity is missing
-
-- **Issue:** the M3 `BrepTorusRootFilletContinuumRegion` models a closed analytic shoulder/root/shaft envelope, but the exact construction body supplied to it also contains the upstream prism/cone and downstream frustum/end-cap. They share valid root-fillet faces but are not the same complete solid.
-- **Impact:** M4's deterministic face/edge/vertex consistency gate correctly rejects the pair for whole-shell composition. Using it anyway would attach unrelated exact faces to CIR occupancy and silently violate representation authority.
-- **Proposed direction:** create a complete CIR for the exact coaxial construction (preferably from its typed constructive recipe, not sampled BRep conversion), or materialize a bounded BRep containing exactly the current analytic shoulder/root/shaft envelope. Then add trimmed Plane/Cylinder/Cone/Torus whole-shell projection and integration incrementally.
-- **Blocker status:** blocks production non-planar whole-part M4, HexBolt, and root-fillet contact area accounting; does not block the convex planar closed-shell proof.
-- **Recommended future milestone:** AETHERIS-CONTINUUM-M4.1 non-planar whole-shell authority alignment.
-
-## Transform3D stores single-precision matrices
-
-- **Issue:** `Transform3D` converts geometry to `System.Numerics.Matrix4x4`, whose entries and operations are single precision.
-- **Impact:** rotated BRep/CIR consistency probes and otherwise exact planar volume/area accumulate errors around 1e-7, requiring a scale-aware consistency tolerance. Baseline unrotated integration remains near double-precision roundoff.
-- **Proposed direction:** introduce a double-precision rigid transform type or migrate `Transform3D` storage without changing public composition order semantics.
-- **Blocker status:** not a classification blocker; it limits the meaningful numerical tolerance for rotated exact-authority comparisons.
-- **Recommended future milestone:** kernel numeric-foundation cleanup before solver verification tolerances are standardized.
+# Continuum refactoring disposition after M4B
+
+This is the active disposition for AETHERIS-CONTINUUM-M4B. Historical M0–M4 observations are closed here rather than retained as an archaeological backlog.
+
+| Item | Decision | M4B action and result | Remaining debt / revisit trigger |
+| --- | --- | --- | --- |
+| Historical SDF `Cir*` names | RESOLVE IN M4B | Source-broken backend nodes, bounds, tape, instructions, payloads, analyzers, and adaptive estimators to `Sdf*`; no aliases remain. `SdfContinuumRegion` remains the CIR adapter. | None. |
+| AIR/prismatic friend-assembly bridge | RESOLVE IN M4B | Added immutable Core-owned `ContinuumConstructionDescriptor` containing bounded sections, correspondence, admitted operations, source/semantic identity, and provenance. | `InternalsVisibleTo(Aetheris.Continuum)` remains for legacy AIR mirror experiments. Remove it when those experiments accept only the descriptor; do not widen the DTO to expose AIR/BRepPlan internals. |
+| CIR/SDF to BRep recovery authority | RESOLVE IN M4B | Classified retained Firmament routes as bounded SDF decompilation/reverse engineering for intent recovery. `SdfDecompilationContract` declares family, purpose, predetermined/recovered topology, exactness, and loss/admissibility. | Rename remaining historical `Frep*`/`CirBrep*` class names only in a separately coordinated consumer API cleanup. Their authority is already bounded. |
+| Generic BRep to CIR absence | DEFER WITH EXPLICIT REASON | Generated geometry dual-lowers from typed construction. No reverse-engineering of production BRep was added. | Revisit only for an imported STEP/BRep continuum consumer with a separately scoped analytic-shell containment/correspondence contract. |
+| SDF mathematical capability labels | RESOLVE IN M4B | Added `SignCorrectOccupancy`, `ConservativeIntervals`, `ExactEuclideanSignedDistance`, and `Gradient`. Non-rigid transforms and general CSG do not advertise exact distance; intersection bounds remain explicitly conservative. | Add Lipschitz/error metadata only when a consumer needs quantitative field magnitude bounds. |
+| Serialization/versioning | DEFER WITH EXPLICIT REASON | No stable public CIR serialization is promised. M4B JSON is deterministic diagnostic evidence only. | Revisit when a real persisted interchange consumer exists. |
+| Boundary-area estimation absent | ALREADY RESOLVED | M1 introduced boundary-map area evidence; M2 generalized exact-support local integration; M4B adds an orientation-corrected CIR area control. | None as an architectural ambiguity. Accuracy improvements remain ordinary numerical work. |
+| BoundaryOffsetMap V1 Z extrusion | ALREADY RESOLVED | M2 introduced arbitrary local frames and projected footprints; M3 added anisotropic torus maps and trims. | None. |
+| Independent validation dominates cost | ALREADY RESOLVED | M3 separated runtime certificates from optional oracle validation and reported both costs. | Revisit certification policy only for production performance targets. |
+| M2 dense projected-footprint cost | ALREADY RESOLVED | M3 structured clipping/integration replaced the dense production path while retaining the dense oracle. | None. |
+| Exact face-normal semantic naming | RESOLVE IN M4B | `ExactSupportNormal`, `ParameterizationNormal`, and `MaterialSideClassifier.ClassifyMaterialSide` are separate. Removed `OutwardNormal`, `ExactFaceNormal`, and the root fixture direction flag. | Extend exact-support differential queries only when adding another admitted analytic support family. |
+| Complete root-fillet BRep/CIR identity | RESOLVE IN M4B | `ExactCoaxialDualMaterializer` emits complete BRep and complete CIR from one `ExactCoaxialConstructionPlan`; generic coaxial and reference HexBolt associations pass. | None for the admitted coaxial family. |
+| `Transform3D` single precision | RESOLVE IN M4B | Replaced `Matrix4x4` storage/operations with deterministic double-precision affine math, inverse, rigidity checks, and preserved first-then-second composition. | Consider a public matrix interchange DTO only if external serialization needs one. |
+
+## Active debt
+
+1. Remove the remaining Continuum friend access after legacy AIR mirror experiments migrate wholly to `ContinuumConstructionDescriptor`. Trigger: the next production use of that mirror path.
+2. Imported STEP/BRep continuum support remains absent by design. Trigger: an approved imported-solid mechanics/continuum milestone with containment and face-correspondence requirements.
+3. No CIR interchange schema exists. Trigger: a concrete persistence consumer.
+4. Whole-part non-planar Cut-cell integration currently combines exact planar composition, M3 torus maps, and bounded CIR sampling controls for other curved cells. Trigger: mechanics accuracy requirements tighter than the persisted M4B error matrix; extend local exact maps rather than adding AMR or mesh authority.
diff --git a/docs/continuum/m0-extraction.md b/docs/continuum/m0-extraction.md
index 2a5bc2c7..f632b16e 100644
--- a/docs/continuum/m0-extraction.md
+++ b/docs/continuum/m0-extraction.md
@@ -73,7 +73,7 @@ The existing analytic primitives (box, cylinder, cone, sphere, torus), CSG-style
`SdfContinuumRegion` is the adapter from the historical node/tape model to CIR occupancy plus optional signed-distance, gradient, and bounds-classification capabilities. This makes the direction explicit: the SDF backend implements CIR; CIR does not inherit an SDF requirement.
-The historical public type names (`CirNode`, `CirTape`, and related records) remain inside the SDF backend for source migration economy. There is no old-namespace shim and no second CIR API. A later narrow rename is documented as debt.
+The historical public type names (`SdfNode`, `SdfTape`, and related records) remain inside the SDF backend for source migration economy. There is no old-namespace shim and no second CIR API. A later narrow rename is documented as debt.
## Core cleanup and ownership
diff --git a/docs/continuum/m2-brep-curved-boundary.md b/docs/continuum/m2-brep-curved-boundary.md
index 5ebc99b2..2d3c72dc 100644
--- a/docs/continuum/m2-brep-curved-boundary.md
+++ b/docs/continuum/m2-brep-curved-boundary.md
@@ -29,7 +29,7 @@ The sphere runtime certificate uses a conservative local Hessian estimate for `h
## Exact boundary authority and query bridge
-The primary fixture is the existing `BrepPrimitives.CreateSphere` body: one closed periodic exact `SphereSurface` face. No new convenience geometry was added. `BrepSphereContinuumRegion` owns a `CirTransformNode(CirSphereNode)` for classification and separately owns the BRep body/face reference. A deterministic five-direction consistency probe verifies that the CIR inside/outside result agrees with the BRep material-side normal; disagreement throws explicitly.
+The primary fixture is the existing `BrepPrimitives.CreateSphere` body: one closed periodic exact `SphereSurface` face. No new convenience geometry was added. `BrepSphereContinuumRegion` owns a `SdfTransformNode(SdfSphereNode)` for classification and separately owns the BRep body/face reference. A deterministic five-direction consistency probe verifies that the CIR inside/outside result agrees with the BRep material-side normal; disagreement throws explicitly.
`ExactBrepBoundaryQuery` is the bounded M2 bridge. For an exact referenced sphere face it supports exact point and face-normal evaluation, nearest support projection, parameter recovery, transformed center/radius access, and exact-surface frame construction. Unsupported surface families fail explicitly. It does not inspect tessellation or `SurfaceMeshIR`, and it does not admit NURBS.
diff --git a/docs/continuum/m4b-constructive-alignment.md b/docs/continuum/m4b-constructive-alignment.md
new file mode 100644
index 00000000..8eacac86
--- /dev/null
+++ b/docs/continuum/m4b-constructive-alignment.md
@@ -0,0 +1,28 @@
+# M4B constructive CIR/BRep alignment
+
+AETHERIS-CONTINUUM-M4B establishes one typed source lineage for complete production coaxial geometry:
+
+```text
+ExactCoaxialPartRecipe / HexBoltSpec
+ -> ExactCoaxialConstructionPlan
+ -> ExactConstructionMaterializer -> complete exact BRep
+ -> ExactCoaxialContinuumRegion -> complete CIR
+```
+
+The CIR covers the regular-prism head, cone/plane treatment, top cap, shoulder/root transition, cylinder, end frustum, and end cap. Hyperbola curves remain exact BRep trim identity; CIR represents their occupied-space consequence and does not duplicate trim topology.
+
+`CirBrepAssociation` records CIR region, BRep body, outer shell, semantic model, and construction-source identity. The consistency gate checks deterministic face/edge/vertex boundary samples, interior/exterior probes, conservative extent containment, and lineage. It rejects a different source identity and accepts the generic coaxial part and McMaster reference HexBolt.
+
+Whole-shell candidates use exact BRep curve evaluations for trim bounds. Plane, Cylinder, Cone, and Torus faces are admitted. Material side is resolved by exact support normals plus CIR two-sided probes. Single-face, edge, corner, trim-junction, and fillet-contact composition are reported; JudgmentEngine is called only for the remaining multi-face trim ambiguity.
+
+The persisted metrics under `artifacts/m4b` use one fixed 12³ lattice and a 24³ brute-force control, without AMR. Fixed Cut cells use exact planar composition or bounded CIR sampling for curved multi-support cells; boundary area uses a deterministic orientation-corrected CIR Crofton control. JSON files are diagnostics, not a stable interchange schema.
+
+Double-precision `Transform3D` removes the prior float storage floor. Unrotated association extent residuals return to double roundoff. Rotated CIR bounds remain conservative transformed containers, so their reported containment residual is intentionally non-zero; all exact boundary and occupancy probes still agree.
+
+## SDF decompilation
+
+Existing SDF-to-BRep tooling is retained as reverse engineering for intent recovery. The admitted hole-family policy declares predetermined family topology, exactness within the recognized family, rejection conditions, and known losses. It is not described as general CIR inversion.
+
+## Result and remaining numerical work
+
+The architecture and whole-part representation identity are settled for the admitted production coaxial family. M4B does not claim that every non-planar Cut-cell uses a closed-form exact integrator: Plane is exact, torus reuses M3 structured maps, and the general Cylinder/Cone multi-support path currently uses a bounded CIR sampling control. Tightening that numerical path is the remaining trigger before mechanics tests demand stricter integration tolerances; it does not reopen representation authority.
diff --git a/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md b/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md
index 6c5dee48..4f512717 100644
--- a/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md
+++ b/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md
@@ -133,19 +133,19 @@ CIR is Aetheris's constructive implicit/FRep evaluation representation. Current
- composition: `Union`, `Subtract`, `Intersect`;
- placement: `Transform`.
-Every `CirNode` exposes:
+Every `SdfNode` exposes:
```csharp
double Evaluate(Point3D point)
```
-where negative values classify as inside, positive values classify as outside, and near-zero values classify as boundary under a tolerance. `CirAnalyzer.ClassifyPoint` wraps that convention for point classification.
+where negative values classify as inside, positive values classify as outside, and near-zero values classify as boundary under a tolerance. `SdfAnalyzer.ClassifyPoint` wraps that convention for point classification.
-`CirTape` is the linear runtime direction for hot CIR evaluation paths. It lowers primitive and CSG node evaluation into instruction/payload arrays and supports:
+`SdfTape` is the linear runtime direction for hot CIR evaluation paths. It lowers primitive and CSG node evaluation into instruction/payload arrays and supports:
- point evaluation via `Evaluate(Point3D)`;
-- interval evaluation via `EvaluateInterval(CirBounds)`;
-- region classification via `ClassifyRegion(CirBounds, tolerance)` returning inside/outside/mixed.
+- interval evaluation via `EvaluateInterval(SdfBounds)`;
+- region classification via `ClassifyRegion(SdfBounds, tolerance)` returning inside/outside/mixed.
The current CIR runtime design already calls out `Analyze map` as a workload that can reuse per-tile interval culling, while dense volume and section sampling can also benefit from tape/interval evaluation.
@@ -343,7 +343,7 @@ Risks:
- **Boundary/tolerance mismatch:** CIR field zero-crossings and BRep trimmed-face intersections may classify boundary samples differently.
- **Topology lost in CIR path:** face IDs, trims, loop identity, shell identity, and explicit adjacency are not inherently available from a scalar field.
- **Representation-dependent output:** the same model could report different visible face metadata or depths depending on backend.
-- **Performance illusions:** a recursive `CirNode.Evaluate` prototype may be slower or less robust than expected if tape/interval runtime is not used.
+- **Performance illusions:** a recursive `SdfNode.Evaluate` prototype may be slower or less robust than expected if tape/interval runtime is not used.
- **Imported STEP ambiguity:** reconstructing CIR from BRep without an admitted recognizer can silently manufacture intent that was not preserved.
Guardrails:
diff --git a/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md b/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md
index 87fd4f7e..ca13e4db 100644
--- a/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md
+++ b/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md
@@ -27,7 +27,7 @@ The test-only prototype introduces these internal test types:
- `GeneratedPrismaticMapSource` — generated prismatic source sections plus optional correspondence.
- `HybridMapDispatchResult` — selected backend, admission status, requested use, summary, known losses, diagnostics, and recommendation.
- `HybridMapSummary` — stable map summary fields.
-- `HybridMapBackendKind` — `CirConvexPolyhedron`, `CirTape`, `BrepRaycast`, or `Unsupported`.
+- `HybridMapBackendKind` — `CirConvexPolyhedron`, `SdfTape`, `BrepRaycast`, or `Unsupported`.
The summary reports:
diff --git a/docs/frictionlab/cir-brep-x3-box-cylinder-recognition-lab.md b/docs/frictionlab/cir-brep-x3-box-cylinder-recognition-lab.md
index fbf15d1e..765783ee 100644
--- a/docs/frictionlab/cir-brep-x3-box-cylinder-recognition-lab.md
+++ b/docs/frictionlab/cir-brep-x3-box-cylinder-recognition-lab.md
@@ -4,7 +4,7 @@
Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.FrictionLab.Tests/CIRLab`.
## 1) Exact CIR shape
-- Hypothesis: recognize `CirSubtractNode(CirBoxNode, CirCylinderNode)` with optional pure translations.
+- Hypothesis: recognize `SdfSubtractNode(SdfBoxNode, SdfCylinderNode)` with optional pure translations.
- Experiments: direct node + translated wrappers tests.
- Evidence: direct and translated cases pass; non-subtract rejected.
- Conclusion: first production recognizer should require subtract(box,cylinder) after optional translation-unwrapping.
@@ -26,7 +26,7 @@ Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.Fr
- Confidence: High.
## 4) Allowed axes
-- Evidence: `CirCylinderNode` encodes only canonical Z axis; no intrinsic arbitrary-axis field.
+- Evidence: `SdfCylinderNode` encodes only canonical Z axis; no intrinsic arbitrary-axis field.
- Conclusion: axis variation must come from transforms.
- Recommendation: v1 supports only native Z-axis cases (plus translation).
- Confidence: High.
@@ -39,7 +39,7 @@ Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.Fr
- Confidence: High.
## 6) Firmament lowering shape for `boolean_box_cylinder_hole`
-- Evidence (source inspection): lowerer always emits primitive local-frame + placement via `CirTransformNode`, then boolean `CirSubtractNode`.
+- Evidence (source inspection): lowerer always emits primitive local-frame + placement via `SdfTransformNode`, then boolean `SdfSubtractNode`.
- Conclusion: real path is frequently subtract of transformed operands, not always literal raw primitives.
- Recommendation: recognizer should include wrapper normalization.
- Confidence: Medium-High.
@@ -51,13 +51,13 @@ Lab-only experiments in `Aetheris.Firmament.FrictionLab/CIRLab` and `Aetheris.Fr
- Confidence: Medium.
## 8) What counts as box
-- Evidence: accepted only `CirBoxNode`; non-box lhs rejected in tests.
-- Recommendation: strict `CirBoxNode` for v1.
+- Evidence: accepted only `SdfBoxNode`; non-box lhs rejected in tests.
+- Recommendation: strict `SdfBoxNode` for v1.
- Confidence: High.
## 9) What counts as cylinder
-- Evidence: accepted only `CirCylinderNode`; sphere tool rejected.
-- Recommendation: strict finite circular `CirCylinderNode` only.
+- Evidence: accepted only `SdfCylinderNode`; sphere tool rejected.
+- Recommendation: strict finite circular `SdfCylinderNode` only.
- Confidence: High.
## 10) Hole position constraints
diff --git a/docs/frictionlab/cir-brep-x31-firmament-lowering-entrypoint-lab.md b/docs/frictionlab/cir-brep-x31-firmament-lowering-entrypoint-lab.md
index 570cc450..61920267 100644
--- a/docs/frictionlab/cir-brep-x31-firmament-lowering-entrypoint-lab.md
+++ b/docs/frictionlab/cir-brep-x31-firmament-lowering-entrypoint-lab.md
@@ -24,9 +24,9 @@
Fixture: `testdata/firmament/examples/boolean_box_cylinder_hole.firmament`.
Result:
-- Lowered CIR root is `CirSubtractNode`.
-- Both operands are `CirTransformNode` wrappers (not raw primitive direct children).
-- Wrapped children are `CirBoxNode` (lhs) and `CirCylinderNode` (rhs).
+- Lowered CIR root is `SdfSubtractNode`.
+- Both operands are `SdfTransformNode` wrappers (not raw primitive direct children).
+- Wrapped children are `SdfBoxNode` (lhs) and `SdfCylinderNode` (rhs).
- Replay operation for `hole` is `boolean:subtract`, source `base`, tool kind `cylinder`.
Recommendation:
@@ -44,7 +44,7 @@ Recommendation:
| Source | Detect subtract box-cylinder | Recover dimensions/translation | Unsupported transform handling | Notes |
|---|---|---|---|---|
-| Raw `CirNode` lowered tree | Yes | Yes | Yes (by transform inspection) | Most direct for geometric-shape recognition. |
+| Raw `SdfNode` lowered tree | Yes | Yes | Yes (by transform inspection) | Most direct for geometric-shape recognition. |
| `FirmamentPrimitiveLoweringPlan` | Yes (feature/op semantics) | Partial (placement fields, not final composed CIR tree) | Semantic placement validation available | Good companion context; less direct for shape matching. |
| `NativeGeometryReplayLog` | Yes (`boolean:subtract`, tool kind) | Placement translation available in resolved form | Yes (resolved placement kind/diagnostic) | Strong diagnostics and provenance; not full CSG shape alone. |
@@ -101,12 +101,12 @@ Updated finding: **High confidence** that real `boolean_box_cylinder_hole` lower
## 11) Updated answer for item 7
-Updated finding: **High confidence** that canonical v1 production recognizer should be **raw lowered `CirNode` tree entrypoint first**; plan/replay/native-state adapters are optional support layers, not primary entrypoints.
+Updated finding: **High confidence** that canonical v1 production recognizer should be **raw lowered `SdfNode` tree entrypoint first**; plan/replay/native-state adapters are optional support layers, not primary entrypoints.
## 12) Final production recommendation
- Entrypoint: lowered CIR node tree.
-- Accepted shapes: `CirSubtractNode` with lhs box and rhs cylinder after translation-wrapper normalization.
+- Accepted shapes: `SdfSubtractNode` with lhs box and rhs cylinder after translation-wrapper normalization.
- Wrappers: required for translation wrappers; reject rotation/non-translation in v1 canonical path.
- Adapters: replay and native-state optional diagnostics now; plan/replay adapter as v2 hardening.
diff --git a/docs/frictionlab/cir-brep-x4-recognizer-source-contract-lab.md b/docs/frictionlab/cir-brep-x4-recognizer-source-contract-lab.md
index 25b42973..8e65efb5 100644
--- a/docs/frictionlab/cir-brep-x4-recognizer-source-contract-lab.md
+++ b/docs/frictionlab/cir-brep-x4-recognizer-source-contract-lab.md
@@ -6,7 +6,7 @@
- Kept all experiment code within FrictionLab-only folders.
## 2) Source APIs inspected
-- CIR nodes: `CirNode`, `CirSubtractNode`, `CirTransformNode`, `CirBoxNode`, `CirCylinderNode`.
+- CIR nodes: `SdfNode`, `SdfSubtractNode`, `SdfTransformNode`, `SdfBoxNode`, `SdfCylinderNode`.
- Lowering/execution: `FirmamentPrimitiveLoweringPlan`, `FirmamentPrimitiveExecutor`, `FirmamentPrimitiveExecutionResult`, `FirmamentCirLowerer`.
- Native state: `NativeGeometryState`, `NativeGeometryReplayLog`, `NativeGeometryReplayOperation`, `NativeGeometryCirMirrorState`.
- Analysis/readiness: `CirNativeAnalysisService`, `MaterializationReadinessAnalyzer`.
@@ -16,7 +16,7 @@ Fixture: `testdata/firmament/examples/boolean_box_cylinder_hole.firmament`.
| Source | Available at recognizer call site | Geometry tree | Dimensions/transforms | Provenance ids/tool/source | Sufficient alone | Diagnostic value |
|---|---|---:|---:|---:|---:|---:|
-| Raw lowered `CirNode` root | Yes (via lowering) | Yes | Yes | No | Yes (v1 geometry) | Medium |
+| Raw lowered `SdfNode` root | Yes (via lowering) | Yes | Yes | No | Yes (v1 geometry) | Medium |
| `FirmamentPrimitiveLoweringPlan` | Yes | Indirect (needs lower) | Yes (parametric intent) | Feature-level intent | No | Medium |
| `FirmamentPrimitiveExecutionResult` | Yes | Indirect (via state only) | Partial | Yes | No | High |
| `NativeGeometryState` | Yes | No traversable root (only root reference string) | No direct tree | Yes | No | High |
@@ -24,13 +24,13 @@ Fixture: `testdata/firmament/examples/boolean_box_cylinder_hole.firmament`.
| `CirMirror` summary | Yes | No | Bounds + approximate volume only | No | No | Low/Medium |
## 4) Experiment 2 node-only envelope findings
-- `FromNode(CirNode)` successfully recognizes canonical direct and translation-wrapped forms.
+- `FromNode(SdfNode)` successfully recognizes canonical direct and translation-wrapped forms.
- Unsupported transforms still reject via existing recognizer behavior.
- Missing provenance is explicit: no op/feature/tool diagnostics without replay.
- Conclusion: node-only is sufficient for v1 **geometry classification**, not sufficient for richer diagnostics.
## 5) Experiment 3 node+replay findings
-- `FromNode(CirNode, NativeGeometryReplayLog?)` preserves recognition parity with node-only.
+- `FromNode(SdfNode, NativeGeometryReplayLog?)` preserves recognition parity with node-only.
- When replay exists, diagnostics can include subtract op / feature / source feature / tool kind context.
- Recognition still works when replay is absent.
- Mismatch policy validated: replay contradiction is surfaced as mismatch diagnostic; it does not override node geometry.
@@ -39,15 +39,15 @@ Fixture: `testdata/firmament/examples/boolean_box_cylinder_hole.firmament`.
## 6) Experiment 4 NativeGeometryState findings
- `NativeGeometryState` alone cannot provide traversable CIR root; only `CirIntentRootReference` string is available.
- Therefore state-alone recognition is insufficient.
-- A convenience adapter can accept `NativeGeometryState` only when caller also provides explicit `CirNode root`.
+- A convenience adapter can accept `NativeGeometryState` only when caller also provides explicit `SdfNode root`.
## 7) Experiment 5 lowering plan / execution result findings
- Plan/execution expose strong intent/provenance context and are stable upstream entrypoints.
- Neither is a direct substitute for geometric root inspection.
-- Recommended usage: higher layer extracts/retains lowered `CirNode`, then attaches plan/result-derived diagnostics.
+- Recommended usage: higher layer extracts/retains lowered `SdfNode`, then attaches plan/result-derived diagnostics.
## 8) Experiment 6 mismatch / precedence policy
-- Authoritative geometry source: lowered `CirNode`.
+- Authoritative geometry source: lowered `SdfNode`.
- Diagnostic-only sources: replay log, native state, plan, execution result.
- Precedence:
1. Node geometry decides recognition success/failure.
@@ -59,7 +59,7 @@ Lab prototype:
```csharp
public sealed record CirBoxCylinderRecognizerInput(
- CirNode Root,
+ SdfNode Root,
NativeGeometryReplayLog? ReplayLog = null,
NativeGeometryState? NativeState = null,
FirmamentPrimitiveLoweringPlan? LoweringPlan = null,
@@ -74,10 +74,10 @@ Constructors/adapters validated:
## 10) Final v1 recognizer source contract
**Recommended v1 production contract:**
-- Required: `CirNode Root`
+- Required: `SdfNode Root`
- Optional: `NativeGeometryReplayLog? ReplayLog`
-Rationale: `CirNode` is only source that consistently carries exact subtract topology + primitive dimensions + transform wrappers needed for canonical recognition. Replay is a high-value optional provenance channel.
+Rationale: `SdfNode` is only source that consistently carries exact subtract topology + primitive dimensions + transform wrappers needed for canonical recognition. Replay is a high-value optional provenance channel.
## 11) Recommended v2 adapters
- Adapter from `FirmamentPrimitiveExecutionResult` -> `CirBoxCylinderRecognizerInput` requiring explicit root retention.
diff --git a/docs/frictionlab/cir-brep-x8-generic-cir-brep-executor-lab.md b/docs/frictionlab/cir-brep-x8-generic-cir-brep-executor-lab.md
index 6df7b2a1..f314c4d5 100644
--- a/docs/frictionlab/cir-brep-x8-generic-cir-brep-executor-lab.md
+++ b/docs/frictionlab/cir-brep-x8-generic-cir-brep-executor-lab.md
@@ -1,10 +1,10 @@
# CIR-BREP-X8 generic CIR tree → BRep executor feasibility lab
## Purpose and scope
-FrictionLab-only feasibility probe for recursive `CirNode -> BrepBody` execution; no production wiring changes.
+FrictionLab-only feasibility probe for recursive `SdfNode -> BrepBody` execution; no production wiring changes.
## Code inspected
-`CirNode` / all node types, `BrepPrimitives`, `BrepBoolean` + safe composition/coaxial families, `HoleRecoveryPolicy` variants, `HoleRecoveryExecutor`, STEP exporter.
+`SdfNode` / all node types, `BrepPrimitives`, `BrepBoolean` + safe composition/coaxial families, `HoleRecoveryPolicy` variants, `HoleRecoveryExecutor`, STEP exporter.
## Prototype shape
`GenericCirBrepExecutorLab` recursively maps CIR primitives/booleans/transforms into BRep constructors + `BrepBoolean` calls and emits structured per-scenario diagnostics.
diff --git a/docs/groove-a0-bounded-revolved-groove-audit.md b/docs/groove-a0-bounded-revolved-groove-audit.md
index af73b96a..a7a86c73 100644
--- a/docs/groove-a0-bounded-revolved-groove-audit.md
+++ b/docs/groove-a0-bounded-revolved-groove-audit.md
@@ -29,7 +29,7 @@ Current known operation vocabulary includes `torus`, `straight_slot`, `slot_cut`
### CIR + materializer state
-- CIR has `CirTorusNode` representation and tape lowering payload for torus.
+- CIR has `SdfTorusNode` representation and tape lowering payload for torus.
- Replay-guided materializer registry intentionally recognizes `subtract(box,torus)` then returns explicit unsupported materialization diagnostic.
- Source surface extraction and dry-run scaffolds include toroidal descriptors; downstream trim/materialization for toroidal subtract interactions remains deferred.
@@ -100,7 +100,7 @@ Why:
### Preferred shape: dedicated `CirRevolvedGrooveNode` (or equivalent intent node)
-Preferred over plain `CirSubtractNode(CirTorusNode)` for this feature family.
+Preferred over plain `SdfSubtractNode(SdfTorusNode)` for this feature family.
- Preserves explicit feature intent and constraints for analysis/materialization.
- Keeps fallback path analyzable even when materialization unavailable.
@@ -209,7 +209,7 @@ Recommended descriptor fields:
Preferred: `CirRevolvedGrooveNode` carrying descriptor + provenance handles.
-Alternative (transitional): annotated `CirSubtractNode(CirTorusNode)` with groove-intent metadata sidecar; acceptable short-term but weaker long-term.
+Alternative (transitional): annotated `SdfSubtractNode(SdfTorusNode)` with groove-intent metadata sidecar; acceptable short-term but weaker long-term.
## Materializer strategy
diff --git a/docs/release/p1-cir-volume-closeout-m3.md b/docs/release/p1-cir-volume-closeout-m3.md
index 591a567b..a04d1346 100644
--- a/docs/release/p1-cir-volume-closeout-m3.md
+++ b/docs/release/p1-cir-volume-closeout-m3.md
@@ -8,9 +8,9 @@ Outcome B: intentional defer. Correct post-STEP CIR/FRep occupied-volume verific
| Layer | Implemented responsibility | Relevant limits |
| --- | --- | --- |
-| Firmament primitive lowering | Boxes, cylinders, cones, spheres, tori and basic Boolean composition lower to `CirNode` | canonical Profile/Compose whole-loop Fillet does not lower to CIR; `Fillet` is explicitly rejected by `FirmamentCirLowerer` |
+| Firmament primitive lowering | Boxes, cylinders, cones, spheres, tori and basic Boolean composition lower to `SdfNode` | canonical Profile/Compose whole-loop Fillet does not lower to CIR; `Fillet` is explicitly rejected by `FirmamentCirLowerer` |
| CIR semantic field | Primitive signed-distance evaluators, transforms, union, subtraction and intersection | no node describing a trimmed Profile Fillet or its ExactRolling/compatibility policy |
-| CIR runtime | `CirTape` point and interval evaluation | primitive/Boolean instruction set only |
+| CIR runtime | `SdfTape` point and interval evaluation | primitive/Boolean instruction set only |
| CIR volume | dense regular-cell center sampling and adaptive region subdivision/direct sampling | deterministic and approximate, but no returned absolute error bound or convergence certificate |
| CIR to BRep | narrow rematerializers for box-minus-cylinder and box-minus-box; torus subtraction recognized but unsupported | direction is opposite the required bridge |
| BRep to CIR | none | reconstructing occupied material from arbitrary imported trimmed analytic faces requires topology/domain interpretation |
diff --git a/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md b/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md
index e71a9c75..b7b75594 100644
--- a/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md
+++ b/docs/roadmap/cir-frep-authoritative-volume-post-preview1.md
@@ -25,7 +25,7 @@ Make `Assert Volume` consume a deterministic CIR/FRep occupied-volume result wit
## Existing oracles
- primitive and hole analytic formulas;
-- `CirAdaptiveVolumeEstimatorTests` and calibration tests;
+- `SdfAdaptiveVolumeEstimatorTests` and calibration tests;
- M2 frozen STEP hashes and per-face forensic evidence;
- independent whole-loop values 913725.7396023329 and 913733.5792146825 mm³;
- FreeCAD/OCCT validity and matching volume evidence;
diff --git a/docs/surface-feature-a0-architecture-audit.md b/docs/surface-feature-a0-architecture-audit.md
index dc1a1417..63f148bf 100644
--- a/docs/surface-feature-a0-architecture-audit.md
+++ b/docs/surface-feature-a0-architecture-audit.md
@@ -8,8 +8,8 @@ Scope: design/audit only; no production behavior changes.
### Current authored families in Aetheris
-- **Volumetric primitives**: `box`, `cylinder`, `sphere`, `torus` in Firmament lowering map directly to CIR primitive nodes (`CirBoxNode`, `CirCylinderNode`, `CirSphereNode`, `CirTorusNode`).
-- **Boolean volume operations**: `add`, `subtract`, `intersect` lower to `CirUnionNode`, `CirSubtractNode`, `CirIntersectNode`.
+- **Volumetric primitives**: `box`, `cylinder`, `sphere`, `torus` in Firmament lowering map directly to CIR primitive nodes (`SdfBoxNode`, `SdfCylinderNode`, `SdfSphereNode`, `SdfTorusNode`).
+- **Boolean volume operations**: `add`, `subtract`, `intersect` lower to `SdfUnionNode`, `SdfSubtractNode`, `SdfIntersectNode`.
- **Library/Forge-backed primitives**: `rounded_corner_box` and `slot_cut` are produced by `ForgeAtomics.RoundedRectangle(...)` + `ForgeAtomics.ExtrudeCentered(...)` in `StandardLibraryPrimitives`.
- **Reusable library part**: `cube_with_cylindrical_hole` in `StandardLibraryReusableParts` is implemented as `BrepBoolean.Subtract(cube, cylinder)`.
- **Edge features (bounded manufacturing style)**: chamfer/fillet are validated and preflighted as explicit bounded edge-finishing families (not generic freeform edge modification).
diff --git a/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step
index 71539f53..9ebbd862 100644
--- a/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step
+++ b/testdata/firmament/examples/mcmaster_91180a151_threadless_hex_bolt.step
@@ -12,7 +12,7 @@ DATA;
#5=PLANE($,#4);
#6=CARTESIAN_POINT($,(-0,6.5,3.75277674973257));
#7=VERTEX_POINT($,#6);
-#8=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#8=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946513));
#9=VERTEX_POINT($,#8);
#10=CARTESIAN_POINT($,(-0,6.5,3.75277674973257));
#11=DIRECTION($,(0,-0.866025403784439,0.5));
@@ -20,9 +20,9 @@ DATA;
#13=LINE($,#10,#12);
#14=EDGE_CURVE($,#7,#9,#13,.T.);
#15=ORIENTED_EDGE($,$,$,#14,.T.);
-#16=CARTESIAN_POINT($,(-4.67955271361447,0,7.50555349946514));
+#16=CARTESIAN_POINT($,(-4.67955271361447,0,7.50555349946513));
#17=VERTEX_POINT($,#16);
-#18=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#18=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946513));
#19=DIRECTION($,(-1,0,0));
#20=VECTOR($,#19,1);
#21=LINE($,#18,#20);
@@ -54,7 +54,7 @@ DATA;
#47=PLANE($,#46);
#48=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
#49=VERTEX_POINT($,#48);
-#50=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946514));
+#50=CARTESIAN_POINT($,(0,0.000000000000001,7.50555349946513));
#51=DIRECTION($,(0,-0.866025403784439,-0.5));
#52=VECTOR($,#51,1);
#53=LINE($,#50,#52);
@@ -81,21 +81,21 @@ DATA;
#74=FACE_OUTER_BOUND('',#73,.T.);
#75=ADVANCED_FACE('',(#74),#47,.T.);
#76=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
-#77=DIRECTION($,(0,-1,-0));
+#77=DIRECTION($,(0,-1,0));
#78=DIRECTION($,(1,0,0));
#79=AXIS2_PLACEMENT_3D($,#76,#77,#78);
#80=PLANE($,#79);
-#81=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#81=CARTESIAN_POINT($,(0,-6.5,-3.75277674973256));
#82=VERTEX_POINT($,#81);
#83=CARTESIAN_POINT($,(0,-6.5,3.75277674973257));
-#84=DIRECTION($,(0,0,-1));
+#84=DIRECTION($,(0,-0,-1));
#85=VECTOR($,#84,1);
#86=LINE($,#83,#85);
#87=EDGE_CURVE($,#49,#82,#86,.T.);
#88=ORIENTED_EDGE($,$,$,#87,.T.);
-#89=CARTESIAN_POINT($,(-4.67955271361447,-6.5,-3.75277674973257));
+#89=CARTESIAN_POINT($,(-4.67955271361447,-6.5,-3.75277674973256));
#90=VERTEX_POINT($,#89);
-#91=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#91=CARTESIAN_POINT($,(0,-6.5,-3.75277674973256));
#92=DIRECTION($,(-1,0,0));
#93=VECTOR($,#92,1);
#94=LINE($,#91,#93);
@@ -113,20 +113,20 @@ DATA;
#106=EDGE_LOOP($,(#88,#96,#104,#105));
#107=FACE_OUTER_BOUND('',#106,.T.);
#108=ADVANCED_FACE('',(#107),#80,.T.);
-#109=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#109=CARTESIAN_POINT($,(0,-6.5,-3.75277674973256));
#110=DIRECTION($,(0,-0.5,-0.866025403784439));
#111=DIRECTION($,(1,0,0));
#112=AXIS2_PLACEMENT_3D($,#109,#110,#111);
#113=PLANE($,#112);
#114=CARTESIAN_POINT($,(0,-0.000000000000002,-7.50555349946513));
#115=VERTEX_POINT($,#114);
-#116=CARTESIAN_POINT($,(0,-6.5,-3.75277674973257));
+#116=CARTESIAN_POINT($,(0,-6.5,-3.75277674973256));
#117=DIRECTION($,(0,0.866025403784439,-0.5));
#118=VECTOR($,#117,1);
#119=LINE($,#116,#118);
#120=EDGE_CURVE($,#82,#115,#119,.T.);
#121=ORIENTED_EDGE($,$,$,#120,.T.);
-#122=CARTESIAN_POINT($,(-4.67955271361447,-0.000000000000002,-7.50555349946514));
+#122=CARTESIAN_POINT($,(-4.67955271361447,-0.000000000000001,-7.50555349946513));
#123=VERTEX_POINT($,#122);
#124=CARTESIAN_POINT($,(0,-0.000000000000002,-7.50555349946513));
#125=DIRECTION($,(-1,0,0));
@@ -139,7 +139,7 @@ DATA;
#132=DIRECTION($,(1,0,0));
#133=AXIS2_PLACEMENT_3D($,#130,#131,#132);
#134=HYPERBOLA($,#133,3.03099977800749,6.5);
-#135=TRIMMED_CURVE($,#134,(PARAMETER_VALUE(-0.549306144334054)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#135=TRIMMED_CURVE($,#134,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
#136=EDGE_CURVE($,#90,#123,#135,.T.);
#137=ORIENTED_EDGE($,$,$,#136,.F.);
#138=ORIENTED_EDGE($,$,$,#95,.F.);
@@ -159,7 +159,7 @@ DATA;
#152=LINE($,#149,#151);
#153=EDGE_CURVE($,#115,#148,#152,.T.);
#154=ORIENTED_EDGE($,$,$,#153,.T.);
-#155=CARTESIAN_POINT($,(-4.67955271361448,6.5,-3.75277674973257));
+#155=CARTESIAN_POINT($,(-4.67955271361447,6.5,-3.75277674973257));
#156=VERTEX_POINT($,#155);
#157=CARTESIAN_POINT($,(0,6.5,-3.75277674973257));
#158=DIRECTION($,(-1,0,0));
@@ -168,11 +168,11 @@ DATA;
#161=EDGE_CURVE($,#148,#156,#160,.T.);
#162=ORIENTED_EDGE($,$,$,#161,.T.);
#163=CARTESIAN_POINT($,(-8.17944978910712,3.25,-5.62916512459885));
-#164=DIRECTION($,(-0,-0.5,0.866025403784439));
+#164=DIRECTION($,(-0,-0.499999999999999,0.866025403784439));
#165=DIRECTION($,(1,0,0));
#166=AXIS2_PLACEMENT_3D($,#163,#164,#165);
#167=HYPERBOLA($,#166,3.03099977800749,6.5);
-#168=TRIMMED_CURVE($,#167,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334054)),.T.,.PARAMETER.);
+#168=TRIMMED_CURVE($,#167,(PARAMETER_VALUE(-0.549306144334054)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
#169=EDGE_CURVE($,#123,#156,#168,.T.);
#170=ORIENTED_EDGE($,$,$,#169,.F.);
#171=ORIENTED_EDGE($,$,$,#128,.F.);
@@ -191,12 +191,12 @@ DATA;
#184=EDGE_CURVE($,#148,#7,#183,.T.);
#185=ORIENTED_EDGE($,$,$,#184,.T.);
#186=ORIENTED_EDGE($,$,$,#38,.T.);
-#187=CARTESIAN_POINT($,(-8.17944978910712,6.5,-0.000000000000002));
-#188=DIRECTION($,(-0,-1,0));
+#187=CARTESIAN_POINT($,(-8.17944978910712,6.5,-0.000000000000007));
+#188=DIRECTION($,(-0,-1,0.000000000000001));
#189=DIRECTION($,(1,0,0));
#190=AXIS2_PLACEMENT_3D($,#187,#188,#189);
#191=HYPERBOLA($,#190,3.03099977800749,6.5);
-#192=TRIMMED_CURVE($,#191,(PARAMETER_VALUE(-0.549306144334055)),(PARAMETER_VALUE(0.549306144334055)),.T.,.PARAMETER.);
+#192=TRIMMED_CURVE($,#191,(PARAMETER_VALUE(-0.549306144334054)),(PARAMETER_VALUE(0.549306144334056)),.T.,.PARAMETER.);
#193=EDGE_CURVE($,#156,#25,#192,.T.);
#194=ORIENTED_EDGE($,$,$,#193,.F.);
#195=ORIENTED_EDGE($,$,$,#161,.F.);
@@ -247,7 +247,7 @@ DATA;
#240=EDGE_CURVE($,#207,#233,#239,.T.);
#241=ORIENTED_EDGE($,$,$,#240,.T.);
#242=CARTESIAN_POINT($,(-5.3,-5.34770686836891,3.0875));
-#243=DIRECTION($,(0.4226182617407,-0.784885567221396,0.453153893518325));
+#243=DIRECTION($,(0.4226182617407,-0.784885567221395,0.453153893518325));
#244=VECTOR($,#243,1);
#245=LINE($,#242,#244);
#246=EDGE_CURVE($,#233,#57,#245,.T.);
@@ -268,7 +268,7 @@ DATA;
#261=EDGE_CURVE($,#233,#254,#260,.T.);
#262=ORIENTED_EDGE($,$,$,#261,.T.);
#263=CARTESIAN_POINT($,(-5.3,-5.34770686836891,-3.0875));
-#264=DIRECTION($,(0.4226182617407,-0.784885567221396,-0.453153893518325));
+#264=DIRECTION($,(0.4226182617407,-0.784885567221396,-0.453153893518324));
#265=VECTOR($,#264,1);
#266=LINE($,#263,#265);
#267=EDGE_CURVE($,#254,#90,#266,.T.);
diff --git a/tools/Aetheris.Continuum.M4B/Aetheris.Continuum.M4B.csproj b/tools/Aetheris.Continuum.M4B/Aetheris.Continuum.M4B.csproj
new file mode 100644
index 00000000..d1ac6605
--- /dev/null
+++ b/tools/Aetheris.Continuum.M4B/Aetheris.Continuum.M4B.csproj
@@ -0,0 +1,4 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>
+ <ItemGroup><ProjectReference Include="..\..\Aetheris.Continuum\Aetheris.Continuum.csproj" /></ItemGroup>
+</Project>
diff --git a/tools/Aetheris.Continuum.M4B/Program.cs b/tools/Aetheris.Continuum.M4B/Program.cs
new file mode 100644
index 00000000..096682f1
--- /dev/null
+++ b/tools/Aetheris.Continuum.M4B/Program.cs
@@ -0,0 +1,50 @@
+using System.Diagnostics;
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Aetheris.Continuum.Boundaries;
+using Aetheris.Continuum.Lattice;
+using Aetheris.Continuum.Regions.Constructive;
+using Aetheris.Continuum.Sampling;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.StandardLibrary;
+
+var options=new JsonSerializerOptions{WriteIndented=true,PropertyNamingPolicy=JsonNamingPolicy.CamelCase,Converters={new JsonStringEnumConverter()}};
+var root=FindRoot(AppContext.BaseDirectory);var output=Path.Combine(root,"docs","continuum","artifacts","m4b");Directory.CreateDirectory(output);
+var genericRecipe=new ExactCoaxialPartRecipe("M4B-GenericCoaxial",8,13,5.3,12.35,25,.2,8,35,.9375,6.125,22,"M4B","reference");
+var genericPlan=ExactCoaxialPartBuilder.Plan(genericRecipe).Value!;var hexPlan=HexBoltConstructionPlanner.Plan(McMasterHexBoltSpecs.Reference91180A151,"M4B-HexBolt").Value!;
+_ = Run("warmup",genericPlan,Transform3D.Identity,8,16);
+var generic=Run("generic-coaxial",genericPlan,Transform3D.Identity,12,24);
+var orientations=new[]{
+ Run("hex-baseline",hexPlan,Transform3D.Identity,12,24),
+ Run("hex-rotate-y-29",hexPlan,Transform3D.CreateRotationY(29d*double.Pi/180d),12,24),
+ Run("hex-compound-17-31-13",hexPlan,Transform3D.CreateRotationX(17d*double.Pi/180d)*Transform3D.CreateRotationY(31d*double.Pi/180d)*Transform3D.CreateRotationZ(13d*double.Pi/180d),12,24)
+};
+var deterministicA=Run("determinism-a",hexPlan,Transform3D.Identity,8,16);var deterministicB=Run("determinism-a",hexPlan,Transform3D.Identity,8,16);
+var projection=JsonSerializer.Serialize(new{generic=Stable(generic),orientations=orientations.Select(Stable)},options);var hash=Convert.ToHexStringLower(SHA256.HashData(Encoding.UTF8.GetBytes(projection)));
+Write("generic-coaxial-metrics.json",generic);Write("hexbolt-metrics.json",orientations[0]);Write("orientation-matrix.json",orientations);
+Write("dual-lowering-evidence.json",new{generic.ConstructionSourceIdentity,generic.AssociationPassed,generic.ConsistencyProbeCount,generic.SupportFamilyCounts});
+Write("complete-association-evidence.json",new{generic.AssociationPassed,hexBolt=orientations.All(x=>x.AssociationPassed),rows=orientations.Select(x=>new{x.Name,x.AssociationPassed,x.MaximumConsistencyResidual,x.ConsistencyProbeCount})});
+Write("deterministic-hashes.json",new{algorithm="SHA-256",hash,repeatedIdentity=deterministicA.ConstructionSourceIdentity==deterministicB.ConstructionSourceIdentity,repeatedMetrics=JsonSerializer.Serialize(Stable(deterministicA),options)==JsonSerializer.Serialize(Stable(deterministicB),options),excludesPerformanceTimings=true});
+Write("architecture-refactoring-disposition.json",new{milestone="AETHERIS-CONTINUUM-M4B",authority="typed construction -> BRep + CIR",sdfNames="source-broken to Sdf*",genericBrepToCir="not implemented",serialization="deferred; diagnostics JSON is not interchange"});
+Console.WriteLine(JsonSerializer.Serialize(new{output,generic,orientations,hash},options));
+
+RunMetrics Run(string name,ExactCoaxialConstructionPlan plan,Transform3D transform,int fixedN,int fineN)
+{
+ var total=Stopwatch.StartNew();var stage=Stopwatch.StartNew();var dual=ExactCoaxialDualMaterializer.Materialize(plan,transform);stage.Stop();var materializeMs=stage.Elapsed.TotalMilliseconds;
+ var semantics=dual.Brep.Semantics.Where(s=>s.Face.HasValue).GroupBy(s=>s.Face!.Value).ToDictionary(g=>g.Key,g=>string.Join("|",g.Select(x=>x.StableId).Order()));
+ stage.Restart();var association=new CirBrepAssociation(dual.Continuum.Id,plan.StableId,"outer-shell",plan.StableId,dual.ConstructionSourceIdentity);var shell=new WholeShellBoundaryQuery(dual.Brep.Body,association,transform,semantics);stage.Stop();var discoveryMs=stage.Elapsed.TotalMilliseconds;
+ stage.Restart();var consistency=BrepCirConsistencyChecker.Check(dual.Continuum,shell,2e-7);if(!consistency.Passed)throw new InvalidOperationException(name+": "+consistency.Summary+Environment.NewLine+string.Join(Environment.NewLine,consistency.Probes.Where(p=>!p.Passed)));var composer=new WholePartCutCellComposer(dual.Continuum,shell);stage.Stop();var associationMs=stage.Elapsed.TotalMilliseconds;
+ stage.Restart();var fixedGrid=ContinuumGridClassifier.Classify(dual.Continuum,new LatticeSpec(dual.Continuum.Bounds,fixedN,fixedN,fixedN),4);stage.Stop();var classificationMs=stage.Elapsed.TotalMilliseconds;
+ stage.Restart();var sets=fixedGrid.CutCells.Where(c=>shell.Query(c.Bounds).Count>0).Select(c=>composer.Compose(c.Index,c.Bounds)).ToArray();stage.Stop();var integrationMs=stage.Elapsed.TotalMilliseconds;
+ stage.Restart();var fine=ContinuumGridClassifier.Classify(dual.Continuum,new LatticeSpec(dual.Continuum.Bounds,fineN,fineN,fineN),4);stage.Stop();var fineMs=stage.Elapsed.TotalMilliseconds;
+ var fixedVolume=fixedGrid.EstimatedOccupiedVolume;
+ var area=ContinuumSurfaceAreaEstimator.Estimate(dual.Continuum,fixedN*8,fixedN*8,fixedN*8);var exactV=dual.Continuum.AnalyticReferenceVolume;var exactA=dual.Continuum.AnalyticReferenceBoundaryArea;
+ var support=shell.Faces.GroupBy(f=>f.SupportKind.ToString()).OrderBy(g=>g.Key).ToDictionary(g=>g.Key,g=>g.Count());var composition=sets.GroupBy(s=>s.CompositionKind.ToString()).OrderBy(g=>g.Key).ToDictionary(g=>g.Key,g=>g.Count());
+ total.Stop();return new(name,dual.ConstructionSourceIdentity,consistency.Passed,consistency.Probes.Count,consistency.MaximumExtentResidual,fixedGrid.Lattice.TotalCellCount,fixedGrid.InsideCellCount,fixedGrid.Cells.Count(c=>c.Classification==CellClassification.Outside),fixedGrid.CutCellCount,support,composition,composer.JudgmentCallCount,exactV,fixedVolume,double.Abs(fixedVolume-exactV),double.Abs(fixedVolume-exactV)/exactV,exactA,area,double.Abs(area-exactA)/exactA,fine.EstimatedOccupiedVolume,double.Abs(fine.EstimatedOccupiedVolume-exactV)/exactV,materializeMs,associationMs,discoveryMs,classificationMs,integrationMs,fineMs,total.Elapsed.TotalMilliseconds);
+}
+void Write(string file,object value)=>File.WriteAllText(Path.Combine(output,file),JsonSerializer.Serialize(value,options)+Environment.NewLine,new UTF8Encoding(false));
+object Stable(RunMetrics x)=>new{x.Name,x.ConstructionSourceIdentity,x.AssociationPassed,x.ConsistencyProbeCount,x.MaximumConsistencyResidual,x.TotalCells,x.Inside,x.Outside,x.Cut,x.SupportFamilyCounts,x.CompositionCounts,x.JudgmentEngineCalls,x.ExactVolume,x.EstimatedVolume,x.AbsoluteVolumeError,x.RelativeVolumeError,x.ExactBoundaryArea,x.EstimatedBoundaryArea,x.RelativeBoundaryAreaError,x.FineEstimatedVolume,x.FineRelativeVolumeError};
+static string FindRoot(string start){for(var d=new DirectoryInfo(start);d is not null;d=d.Parent)if(File.Exists(Path.Combine(d.FullName,"Aetheris.slnx")))return d.FullName;throw new DirectoryNotFoundException();}
+sealed record RunMetrics(string Name,string ConstructionSourceIdentity,bool AssociationPassed,int ConsistencyProbeCount,double MaximumConsistencyResidual,int TotalCells,int Inside,int Outside,int Cut,IReadOnlyDictionary<string,int> SupportFamilyCounts,IReadOnlyDictionary<string,int> CompositionCounts,int JudgmentEngineCalls,double ExactVolume,double EstimatedVolume,double AbsoluteVolumeError,double RelativeVolumeError,double ExactBoundaryArea,double EstimatedBoundaryArea,double RelativeBoundaryAreaError,double FineEstimatedVolume,double FineRelativeVolumeError,double BrepAndCirMaterializationMilliseconds,double AssociationValidationMilliseconds,double CandidateDiscoveryMilliseconds,double ClassificationMilliseconds,double CutCellIntegrationMilliseconds,double FineControlMilliseconds,double TotalMilliseconds);