Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add curvature-continuous bounded fillet support

Yuechen Li4c5c31d124be
diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.cs
index 5caafd2d..02619d0d 100644
--- a/Aetheris.CLI/CliRunner.cs
+++ b/Aetheris.CLI/CliRunner.cs
@@ -498,6 +498,7 @@ public static class CliRunner
outputPath = build.Value.OutputPath,
conceptIr = build.Value.Export.ConceptIr,
air = build.Value.Export.Air,
+ plateau = build.Value.Export.Plateau,
roundedBox = build.Value.Export.RoundedBox,
hollow = build.Value.Export.Hollow,
lattice = build.Value.Export.Lattice,
@@ -612,6 +613,7 @@ public static class CliRunner
chain.TransitionPolicy, chain.Continuity, chain.SmoothPolicy, chain.StartTermination, chain.EndTermination,
transitions = materialized.Transitions, pcurves = materialized.Pcurves, selfIntersection = materialized.SelfIntersection,
continuityEvidence = materialized.ContinuityEvidence, smoothSelection = materialized.SmoothSelection,
+ profileNormalization = materialized.ProfileNormalization, geometricJoins = materialized.GeometricJoins,
diagnostics = materialized.Diagnostics
};
stdout.WriteLine(JsonSerializer.Serialize(inspection, JsonOptions));
@@ -652,6 +654,7 @@ public static class CliRunner
surfaceInventory = surfaces, rationalProductSurfaces = 0, facetedProductFallback = 0, pcurves = materialized.Pcurves,
selfIntersection = materialized.SelfIntersection,
continuityEvidence = materialized.ContinuityEvidence, smoothSelection = materialized.SmoothSelection,
+ profileNormalization = materialized.ProfileNormalization, geometricJoins = materialized.GeometricJoins,
stepReimport = new { success = reimport.IsSuccess, diagnostics = reimport.Diagnostics.Select(item => item.Message) },
timingsMilliseconds = materialized.Timing
};
@@ -1415,6 +1418,15 @@ Model CanonicalPanel {
else foreach (var diagnostic in section.Diagnostics) stderr.WriteLine("error: " + diagnostic);
return section.IsSuccess ? 0 : 1;
}
+ if (PlateauAuthoring.IsSource(source) && !System.Text.RegularExpressions.Regex.IsMatch(source, @"\bAssembly\s+"))
+ {
+ var plateau = FirmamentBuildAndExport.CompileSource(source, Path.GetDirectoryName(fullPath));
+ if (json) stdout.WriteLine(JsonSerializer.Serialize(new { command = "inspect", success = plateau.IsSuccess, input = fullPath,
+ plateau = plateau.IsSuccess ? plateau.Value.Plateau : null, diagnostics = plateau.Diagnostics }, JsonOptions));
+ else if (plateau.IsSuccess) stdout.WriteLine($"Plateau: {plateau.Value.Plateau!.FaceCount} faces; G2 contact/trim report available with --json.");
+ else foreach (var d in plateau.Diagnostics) stderr.WriteLine(d.Message);
+ return plateau.IsSuccess ? 0 : 1;
+ }
if (GearAuthoring.IsGearSource(source))
{
var gear = GearAuthoring.Parse(source);
@@ -2268,6 +2280,14 @@ Model CanonicalPanel {
else stdout.WriteLine($"Firmament V2 Sculpting validation: {payload.status} ({payload.summary.fatalDiagnosticCount} fatal, 0 warning)");
return sculpt.IsSuccess ? 0 : 1;
}
+ if (PlateauAuthoring.IsSource(validationSource) && !System.Text.RegularExpressions.Regex.IsMatch(validationSource, @"\bAssembly\s+"))
+ {
+ var plateau = FirmamentBuildAndExport.CompileSource(validationSource, Path.GetDirectoryName(Path.GetFullPath(sourcePath)));
+ var payload = new { source = sourcePath, status = plateau.IsSuccess ? "valid" : "invalid", domain = "Plateau", diagnostics = plateau.Diagnostics };
+ if (json) stdout.WriteLine(JsonSerializer.Serialize(new { firmamentV2Validation = payload }, JsonOptions));
+ else stdout.WriteLine($"Plateau validation: {payload.status}");
+ return plateau.IsSuccess ? 0 : 1;
+ }
if (PipingAuthoring.IsPipingSource(validationSource))
{
var piping = PipingAuthoring.Compile(validationSource, Path.GetFullPath(sourcePath));
diff --git a/Aetheris.Kernel.Core.Tests/Brep/EdgeFinishing/BrepBoundedFilletTests.cs b/Aetheris.Kernel.Core.Tests/Brep/EdgeFinishing/BrepBoundedFilletTests.cs
index 18c63405..bceedb9b 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/EdgeFinishing/BrepBoundedFilletTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/EdgeFinishing/BrepBoundedFilletTests.cs
@@ -1,3 +1,5 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Math;
using Aetheris.Kernel.Core.Brep;
using Aetheris.Kernel.Core.Brep.Boolean;
using Aetheris.Kernel.Core.Brep.EdgeFinishing;
@@ -7,6 +9,56 @@ namespace Aetheris.Kernel.Core.Tests.Brep.EdgeFinishing;
public sealed class BrepBoundedFilletTests
{
+ [Theory]
+ [InlineData(0.5)]
+ [InlineData(1.5)]
+ [InlineData(3)]
+ public void CurvatureContinuousModeReusesTopologyAndMatchesPlanarSupports(double radius)
+ {
+ var source = CreatePlanarSourceWithLRootComposition();
+ var selection = BrepBoundedManufacturingFilletPreflight.ResolveInternalConcaveVerticalEdge(
+ source.SafeBooleanComposition!, BrepBoundedManufacturingFilletEdge.InnerXMaxYMax, radius).Value;
+ var circular = BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(source, selection, radius);
+ var smooth = BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(source, selection, radius, BoundedFilletProfile.CurvatureContinuous);
+ Assert.True(smooth.IsSuccess, string.Join("\n", smooth.Diagnostics.Select(d => d.Message)));
+ Assert.Equal(circular.Value.Topology.Faces.Count(), smooth.Value.Topology.Faces.Count());
+ Assert.Equal(circular.Value.Topology.Edges.Count(), smooth.Value.Topology.Edges.Count());
+ var surface = Assert.Single(smooth.Value.Bindings.FaceBindings.Select(b => smooth.Value.Geometry.GetSurface(b.SurfaceGeometryId)),
+ s => s.Kind == SurfaceGeometryKind.BSplineSurfaceWithKnots).BSplineSurfaceWithKnots!;
+ foreach (var v in new[] { 0d, 0.25, 0.5, 0.75, 1d })
+ {
+ var controls = surface.ControlPoints.Select(row => row[0] + (row[1] - row[0]) * v).ToArray();
+ var section = new BSpline3Curve(5, controls, [6, 6], [0, 1], "UNSPECIFIED", false, false, "UNSPECIFIED");
+ foreach (var u in new[] { 0d, 1d })
+ {
+ var tangent = section.EvaluateTangent(u);
+ var second = section.EvaluateSecondDerivative(u);
+ Assert.True(tangent.Length > 0.1);
+ var curvature = tangent.Cross(second).Length / System.Math.Pow(tangent.Length, 3);
+ Assert.True(curvature < 1e-12, $"curvature={curvature:R}");
+ var point = section.Evaluate(u);
+ var sideNormal = tangent.Cross(new Vector3D(0, 0, 1));
+ Assert.Contains(smooth.Value.Bindings.FaceBindings.Select(b => smooth.Value.Geometry.GetSurface(b.SurfaceGeometryId)),
+ support => support.Kind == SurfaceGeometryKind.Plane &&
+ System.Math.Abs((point - support.Plane!.Value.Origin).Dot(support.Plane.Value.Normal.ToVector())) < 1e-9 &&
+ sideNormal.Cross(support.Plane.Value.Normal.ToVector()).Length < 1e-9 &&
+ sideNormal.Dot(support.Plane.Value.Normal.ToVector()) > 0);
+ }
+ }
+ }
+
+ [Fact]
+ public void SmoothModeRejectsCircularTerminationContract()
+ {
+ var source = CreatePlanarSourceWithNotchComposition();
+ var selection = BrepBoundedManufacturingFilletPreflight.ResolveInternalConcaveVerticalEdges(source.SafeBooleanComposition!,
+ [BrepBoundedManufacturingFilletEdge.InnerXMaxYMin, BrepBoundedManufacturingFilletEdge.InnerXMaxYMax], 1).Value;
+ var circular = BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(source, selection, 1).Value;
+ var result = BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(circular, selection, 1, BoundedFilletProfile.CurvatureContinuous);
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, d => d.Message == "BoundedFilletSmoothCylindricalTerminationUnsupported");
+ }
+
[Fact]
public void FilletTrustedPolyhedralSingleInternalConcaveEdge_Builds_CylindricalFace_ForCanonicalSelection()
{
diff --git a/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs b/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
index 09db2f72..281543a3 100644
--- a/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Step242/Step242LoopRoleNormalizationRegressionTests.cs
@@ -184,7 +184,7 @@ public sealed class Step242LoopRoleNormalizationRegressionTests
Assert.All(first, s =>
{
Assert.True(s.AdaptivePointCount >= s.LegacyPointCount);
- var expected = System.Math.Max(2, (int)System.Math.Ceiling(System.Math.Abs(s.TrimSpan) / (System.Math.PI / 4d))) + 1;
+ var expected = System.Math.Max(2, (int)System.Math.Ceiling(System.Math.Abs(s.TrimSpan) / (System.Math.PI / 64d))) + 1;
Assert.Equal(expected, s.AdaptivePointCount);
});
diff --git a/Aetheris.Kernel.Core/Brep/BrepBindings.cs b/Aetheris.Kernel.Core/Brep/BrepBindings.cs
index a1d0b495..2a2817e1 100644
--- a/Aetheris.Kernel.Core/Brep/BrepBindings.cs
+++ b/Aetheris.Kernel.Core/Brep/BrepBindings.cs
@@ -1,3 +1,4 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
using Aetheris.Kernel.Core.Geometry;
using Aetheris.Kernel.Core.Topology;
@@ -17,7 +18,7 @@ public readonly record struct FaceGeometryBinding(
public readonly record struct SurfaceParameterPoint(double U, double V);
-public enum PcurveGeometryKind { Line, Circle, Ellipse, Polyline }
+public enum PcurveGeometryKind { Line, Circle, Ellipse, Polyline, Polynomial }
/// <summary>A face-local parameter-space curve with the same parameter as its bound 3D edge.</summary>
public sealed record PcurveGeometry
@@ -29,6 +30,7 @@ public sealed record PcurveGeometry
Points = points;
}
+ public BSpline3Curve? PolynomialCurve { get; private init; }
public PcurveGeometryKind Kind { get; }
public ParameterInterval Domain { get; }
public IReadOnlyList<SurfaceParameterPoint> Points { get; }
@@ -46,10 +48,25 @@ public sealed record PcurveGeometry
public static PcurveGeometry Polyline(ParameterInterval domain, IReadOnlyList<SurfaceParameterPoint> points)
=> new(PcurveGeometryKind.Polyline, domain, points.ToArray());
+ /// <summary>Reuses the polynomial curve authority in the UV plane (Z must be zero).</summary>
+ public static PcurveGeometry Polynomial(ParameterInterval domain, BSpline3Curve curve)
+ {
+ if (!double.IsFinite(domain.Start) || !double.IsFinite(domain.End) || domain.Start == domain.End ||
+ System.Math.Min(domain.Start, domain.End) < curve.DomainStart || System.Math.Max(domain.Start, domain.End) > curve.DomainEnd ||
+ curve.ControlPoints.Any(p => !double.IsFinite(p.X) || !double.IsFinite(p.Y) || p.Z != 0))
+ throw new ArgumentException("Polynomial pcurve requires a finite in-domain trim and UV-plane controls.");
+ return new(PcurveGeometryKind.Polynomial, domain, []) { PolynomialCurve = curve };
+ }
+
public SurfaceParameterPoint Evaluate(double parameter)
{
var span = Domain.End - Domain.Start;
var fraction = double.Abs(span) <= 1e-15d ? 0d : System.Math.Clamp((parameter - Domain.Start) / span, 0d, 1d);
+ if (PolynomialCurve is { } polynomial)
+ {
+ var point = polynomial.Evaluate(Domain.Start + span * fraction);
+ return new(point.X, point.Y);
+ }
if (Kind == PcurveGeometryKind.Circle)
{
var angle = Domain.Start + (span * fraction);
diff --git a/Aetheris.Kernel.Core/Brep/BrepPcurveValidator.cs b/Aetheris.Kernel.Core/Brep/BrepPcurveValidator.cs
index cd72c0e8..95607a49 100644
--- a/Aetheris.Kernel.Core/Brep/BrepPcurveValidator.cs
+++ b/Aetheris.Kernel.Core/Brep/BrepPcurveValidator.cs
@@ -57,7 +57,7 @@ public static class BrepPcurveValidator
continue;
}
var interval = edgeBinding.TrimInterval ?? binding.Pcurve.Domain;
- if (!FiniteOrdered(binding.Pcurve.Domain) || binding.Pcurve.Points.Count == 0)
+ if (!FiniteOrdered(binding.Pcurve.Domain) || (binding.Pcurve.Points.Count == 0 && binding.Pcurve.PolynomialCurve is null))
{
domainValid = false;
diagnostics.Add($"surf-pcurve-invalid:coedge={coedge.Id.Value}:domain");
diff --git a/Aetheris.Kernel.Core/Brep/EdgeFinishing/BrepBoundedFillet.cs b/Aetheris.Kernel.Core/Brep/EdgeFinishing/BrepBoundedFillet.cs
index 87fa1ef8..78913fba 100644
--- a/Aetheris.Kernel.Core/Brep/EdgeFinishing/BrepBoundedFillet.cs
+++ b/Aetheris.Kernel.Core/Brep/EdgeFinishing/BrepBoundedFillet.cs
@@ -11,8 +11,12 @@ using Aetheris.Kernel.Core.Topology;
namespace Aetheris.Kernel.Core.Brep.EdgeFinishing;
+/// <summary>Cross-section law for an admitted bounded concave fillet.</summary>
+public enum BoundedFilletProfile { Circular, CurvatureContinuous }
+
/// <summary>
-/// F0/F1 bounded constant-radius cylindrical fillet builder for explicit internal concave planar-planar vertical edges.
+/// F0/F1 bounded fillet builder for explicit internal concave planar-planar vertical edges.
+/// Circular remains the default; CurvatureContinuous changes only the admitted section law.
/// </summary>
public static class BrepBoundedFillet
{
@@ -24,8 +28,11 @@ public static class BrepBoundedFillet
public static KernelResult<BrepBody> FilletTrustedPolyhedralSingleInternalConcaveEdge(
BrepBody sourceBody,
BoundedManufacturingFilletSelection selection,
- double radius)
+ double radius,
+ BoundedFilletProfile profile = BoundedFilletProfile.Circular)
{
+ if (!Enum.IsDefined(profile))
+ return KernelResult<BrepBody>.Failure([Failure("BoundedFilletProfileUnsupported", "firmament.fillet-profile")]);
var contextResult = BrepBoundedFilletContext.TryCreate(sourceBody, selection, radius);
if (!contextResult.IsSuccess)
{
@@ -33,6 +40,9 @@ public static class BrepBoundedFillet
}
var context = contextResult.Value;
+ // Existing cylinder termination contracts describe circular sections only.
+ if (profile == BoundedFilletProfile.CurvatureContinuous && context.HasCylindricalSourceFaces)
+ return KernelResult<BrepBody>.Failure([Failure("BoundedFilletSmoothCylindricalTerminationUnsupported", "firmament.fillet-profile")]);
var engine = new JudgmentEngine<BrepBoundedFilletContext>();
var judgment = engine.Evaluate(context, BuildCandidates());
if (!judgment.IsSuccess || !judgment.Selection.HasValue || judgment.Selection.Value.Candidate.Name == RejectCandidate)
@@ -45,9 +55,9 @@ public static class BrepBoundedFillet
return judgment.Selection.Value.Candidate.Name switch
{
- SingleEdgeCylindricalFilletCandidate => BuildConcaveFilletBody(sourceBody, context),
- ChainedSameRadiusCylindricalFilletCandidate => BuildConcaveFilletBody(sourceBody, context),
- ChainedSameRadiusCylindricalTerminationCandidate => BuildConcaveFilletBody(sourceBody, context),
+ SingleEdgeCylindricalFilletCandidate => BuildConcaveFilletBody(sourceBody, context, profile),
+ ChainedSameRadiusCylindricalFilletCandidate => BuildConcaveFilletBody(sourceBody, context, profile),
+ ChainedSameRadiusCylindricalTerminationCandidate => BuildConcaveFilletBody(sourceBody, context, profile),
_ => KernelResult<BrepBody>.Failure([Failure($"Bounded fillet selected unsupported candidate '{judgment.Selection.Value.Candidate.Name}'.", "firmament.fillet-bounded")])
};
}
@@ -110,7 +120,7 @@ public static class BrepBoundedFillet
return "No bounded single-edge/chained fillet candidate was admissible.";
}
- private static KernelResult<BrepBody> BuildConcaveFilletBody(BrepBody sourceBody, BrepBoundedFilletContext context)
+ private static KernelResult<BrepBody> BuildConcaveFilletBody(BrepBody sourceBody, BrepBoundedFilletContext context, BoundedFilletProfile profile)
{
if (!TryBuildOrthogonalFootprintLoop(context.OccupiedCells, out var loop, out var loopFailure))
{
@@ -131,14 +141,14 @@ public static class BrepBoundedFillet
filletedLoop,
context.Selection.MinZ,
context.Selection.MaxZ,
- sourceBody.SafeBooleanComposition);
+ sourceBody.SafeBooleanComposition, profile);
}
private static KernelResult<BrepBody> BuildExtrudedBodyWithArcs(
IReadOnlyList<LoopSegment2D> segments,
double minZ,
double maxZ,
- SafeBooleanComposition? safeBooleanComposition)
+ SafeBooleanComposition? safeBooleanComposition, BoundedFilletProfile profile)
{
var height = maxZ - minZ;
if (height <= 0d)
@@ -221,6 +231,13 @@ public static class BrepBoundedFillet
bindings.AddEdgeBinding(new EdgeGeometryBinding(topEdge, new CurveGeometryId(curveId), new ParameterInterval(0d, segment.Length)));
curveId++;
}
+ else if (profile == BoundedFilletProfile.CurvatureContinuous)
+ {
+ geometry.AddCurve(new CurveGeometryId(curveId), CurveGeometry.FromBSpline(SmoothSection(segment, minZ)));
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(bottomEdge, new CurveGeometryId(curveId++), new ParameterInterval(0, 1)));
+ geometry.AddCurve(new CurveGeometryId(curveId), CurveGeometry.FromBSpline(SmoothSection(segment, maxZ)));
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(topEdge, new CurveGeometryId(curveId++), new ParameterInterval(0, 1)));
+ }
else
{
var centerBottom = new Point3D(segment.Center!.Value.X, segment.Center.Value.Y, minZ);
@@ -259,6 +276,14 @@ public static class BrepBoundedFillet
var outwardNormal = Direction3D.Create(new Vector3D(segment.End.Y - segment.Start.Y, -(segment.End.X - segment.Start.X), 0d));
geometry.AddSurface(new SurfaceGeometryId(surfaceId), SurfaceGeometry.FromPlane(new PlaneSurface(new Point3D(segment.Start.X, segment.Start.Y, minZ), outwardNormal, direction)));
}
+ else if (profile == BoundedFilletProfile.CurvatureContinuous)
+ {
+ var bottom = SmoothSection(segment, minZ).ControlPoints;
+ var top = SmoothSection(segment, maxZ).ControlPoints;
+ var net = bottom.Select((point, index) => (IReadOnlyList<Point3D>)new[] { point, top[index] }).ToArray();
+ geometry.AddSurface(new SurfaceGeometryId(surfaceId), SurfaceGeometry.FromBSplineSurfaceWithKnots(
+ new BSplineSurfaceWithKnots(5, 1, net, "UNSPECIFIED", false, false, false, [6, 6], [2, 2], [0, 1], [0, 1], "UNSPECIFIED")));
+ }
else
{
var center = segment.Center!.Value;
@@ -285,6 +310,13 @@ public static class BrepBoundedFillet
: KernelResult<BrepBody>.Failure(validation.Diagnostics);
}
+ private static BSpline3Curve SmoothSection(LoopSegment2D segment, double z)
+ {
+ var center = segment.Center!.Value;
+ return CurvatureContinuousFilletSection.CreateQuarter(
+ new(segment.Start.X, segment.Start.Y, z), new(segment.End.X, segment.End.Y, z), new(center.X, center.Y, z));
+ }
+
private static (double Start, double End) ComputeArcParameterRange((double X, double Y) center, (double X, double Y) start, (double X, double Y) end, bool clockwise)
{
var startAngle = System.Math.Atan2(start.Y - center.Y, start.X - center.X);
diff --git a/Aetheris.Kernel.Core/Brep/EdgeFinishing/CurvatureContinuousFilletSection.cs b/Aetheris.Kernel.Core/Brep/EdgeFinishing/CurvatureContinuousFilletSection.cs
new file mode 100644
index 00000000..cdd19b85
--- /dev/null
+++ b/Aetheris.Kernel.Core/Brep/EdgeFinishing/CurvatureContinuousFilletSection.cs
@@ -0,0 +1,22 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Brep.EdgeFinishing;
+
+/// <summary>The qualified fixed quintic quarter-section, shared by local and loop fillets.</summary>
+public static class CurvatureContinuousFilletSection
+{
+ public static BSpline3Curve CreateQuarter(Point3D start, Point3D end, Point3D center)
+ {
+ var fromCenter = start - center;
+ var toCenter = end - center;
+ if (fromCenter.Length <= 0 || toCenter.Length <= 0 ||
+ !double.IsFinite(fromCenter.Length + toCenter.Length) ||
+ System.Math.Abs(fromCenter.Dot(toCenter)) > 1e-12 * fromCenter.Length * toCenter.Length)
+ throw new ArgumentException("Fillet quarter requires finite nonzero orthogonal support directions.");
+ return new BSpline3Curve(5,
+ [start, start + toCenter * 0.25, start + toCenter * 0.5,
+ end + fromCenter * 0.5, end + fromCenter * 0.25, end],
+ [6, 6], [0, 1], "UNSPECIFIED", false, false, "UNSPECIFIED");
+ }
+}
diff --git a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
index 87101f7e..9d733427 100644
--- a/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
+++ b/Aetheris.Kernel.Core/Brep/Tessellation/BrepDisplayTessellator.cs
@@ -1460,6 +1460,22 @@ public static class BrepDisplayTessellator
foreach (var coedge in coedges)
{
executionBudget?.ThrowIfExpired("TrimLoopSampling", faceId, surfaceKind);
+ // Consume the bound face-space authority when available. Numerical 3D
+ // reprojection is only the legacy fallback for bodies without pcurves.
+ if (body.Bindings.TryGetPcurveBinding(coedge.Id, out var pc) && pc.FaceId == faceId)
+ {
+ var edge = body.Bindings.GetEdgeBinding(coedge.EdgeId);
+ var reversed = coedge.IsReversed ^ !edge.OrientedEdgeSense ^ !pc.SameSense;
+ var segments = pc.Pcurve.Kind == PcurveGeometryKind.Line ? 1 : System.Math.Max(32, options.MinimumSegments);
+ for (var i = 0; i <= segments; i++)
+ {
+ var fraction = (double)i / segments;
+ if (reversed) fraction = 1 - fraction;
+ var uv = pc.Pcurve.Evaluate(pc.Pcurve.Domain.Start + fraction * (pc.Pcurve.Domain.End - pc.Pcurve.Domain.Start));
+ AppendUniqueUvPoint(uvPoints, (uv.U, uv.V));
+ }
+ continue;
+ }
var sampledCurve = TrySampleCoedgeForTrimEvaluation(body, faceId, coedge, vertexPointsResult.Value, options, executionBudget, surfaceKind);
if (!sampledCurve.IsSuccess)
{
diff --git a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs b/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
index fac688d5..07372344 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Exporter.cs
@@ -1052,6 +1052,19 @@ public static class Step242Exporter
string contextId)
{
if (!surfaceIds.TryGetValue(binding.SurfaceGeometryId, out var surfaceId)) return null;
+ if (binding.Pcurve.PolynomialCurve is { } polynomial)
+ {
+ var controls = polynomial.ControlPoints.Select(p => writer.AddEntity("CARTESIAN_POINT", "$",
+ Step242TextWriter.List(Step242TextWriter.Number(p.X), Step242TextWriter.Number(p.Y))))
+ .Select(Step242TextWriter.Ref).ToArray();
+ var curve = writer.AddEntity("B_SPLINE_CURVE_WITH_KNOTS", "$", polynomial.Degree.ToString(System.Globalization.CultureInfo.InvariantCulture),
+ Step242TextWriter.List(controls), Step242TextWriter.Enum(polynomial.CurveForm),
+ Step242TextWriter.BooleanLogical(polynomial.ClosedCurve), Step242TextWriter.BooleanLogical(polynomial.SelfIntersect),
+ Step242TextWriter.List(polynomial.KnotMultiplicities.Select(n => n.ToString(System.Globalization.CultureInfo.InvariantCulture)).ToArray()),
+ Step242TextWriter.List(polynomial.KnotValues.Select(Step242TextWriter.Number).ToArray()), Step242TextWriter.Enum(polynomial.KnotSpec));
+ var representation = writer.AddEntity("DEFINITIONAL_REPRESENTATION", Step242TextWriter.String("pcurve"), Step242TextWriter.List(curve), Step242TextWriter.Ref(contextId));
+ return writer.AddEntity("PCURVE", "$", Step242TextWriter.Ref(surfaceId), Step242TextWriter.Ref(representation));
+ }
var samples = binding.Pcurve.Kind switch
{
PcurveGeometryKind.Line => 2,
diff --git a/Aetheris.Kernel.Core/Step242/Step242Importer.cs b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
index da297e85..41500389 100644
--- a/Aetheris.Kernel.Core/Step242/Step242Importer.cs
+++ b/Aetheris.Kernel.Core/Step242/Step242Importer.cs
@@ -3413,7 +3413,9 @@ public static class Step242Importer
private static int ComputeAdaptiveCircleSegmentCount(double span)
{
- const double maxSegmentAngle = double.Pi / 4d;
+ // Classification polygon only; exact edge geometry is retained. The former
+ // two-chord quarter arc falsely rejected close polynomial inner trims.
+ const double maxSegmentAngle = double.Pi / 64d;
var normalizedSpan = double.Abs(span);
var segmentCount = (int)double.Ceiling(normalizedSpan / maxSegmentAngle);
return System.Math.Max(2, segmentCount);
diff --git a/Aetheris.Kernel.Firmament.Tests/ClosedBoundary2X1Tests.cs b/Aetheris.Kernel.Firmament.Tests/ClosedBoundary2X1Tests.cs
index d163d7aa..deb967a8 100644
--- a/Aetheris.Kernel.Firmament.Tests/ClosedBoundary2X1Tests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ClosedBoundary2X1Tests.cs
@@ -7,6 +7,32 @@ namespace Aetheris.Kernel.Firmament.Tests;
public sealed class ClosedBoundary2X1Tests
{
+ [Fact]
+ public void SmoothBoundaryCompilesThroughOrdinaryExtrusionAndTemplateBinding()
+ {
+ const string source = """
+ Model SmoothPlate {
+ Units: mm
+ Template < W: Length > Struct Plate {
+ SmoothRoundedRect2 Outline { Center: [W / 2, -30mm / 2] Size: [W, 30mm] CornerExtent: 6mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Body { Profile: Section From: 0mm To: 3mm }
+ }
+ Struct Item = Plate<W: 40mm>
+ }
+ """;
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ Assert.True(build.IsSuccess, string.Join("\n", build.Diagnostics.Select(d => d.Message)));
+ Assert.Contains("B_SPLINE_CURVE_WITH_KNOTS", build.Value.StepText);
+ var profileSource = Source("SmoothRoundedRect2 Shape { Center: [0mm,0mm] Size: [40mm,30mm] CornerExtent: 6mm }");
+ var parsed = FirmamentV2Parser.Parse(profileSource);
+ Assert.True(parsed.IsSuccess, string.Join("\n", parsed.Diagnostics));
+ Assert.Equal("SmoothRoundedRect2", Assert.Single(parsed.Document!.Boundaries!).ShapeType);
+ var profile = ProfileAuthoringParser.ResolveNamedProfile(profileSource, "Boundary", out var diagnostics);
+ Assert.Empty(diagnostics);
+ Assert.Equal(8, profile!.Loops.Single().Segments.Count(s => s.Geometry is LineArcCubicBezier2D));
+ }
+
[Fact]
public void DimensionalArithmetic_ReachesBoundaryAndExtrusionWithoutTruncation()
{
diff --git a/Aetheris.Kernel.Firmament.Tests/FilletProfileModeTests.cs b/Aetheris.Kernel.Firmament.Tests/FilletProfileModeTests.cs
new file mode 100644
index 00000000..f0c139c2
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/FilletProfileModeTests.cs
@@ -0,0 +1,53 @@
+using Aetheris.Kernel.Firmament.FirmamentV2;
+using Aetheris.Kernel.Firmament.Materializer;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class FilletProfileModeTests
+{
+ [Fact]
+ public void ExistingConcaveFilletRouteCarriesSmoothProfileToStep()
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Regression/Fillet/concave-curvature-continuous.firmament");
+ var smooth = CompatibilityBuild(source);
+ Assert.True(smooth.IsSuccess, string.Join("\n", smooth.Diagnostics.Select(d => d.Message)));
+ Assert.Contains("B_SPLINE_SURFACE_WITH_KNOTS", smooth.Value.Export.StepText);
+ var circular = CompatibilityBuild(source.Replace("profile: CurvatureContinuous", "profile: Circular"));
+ Assert.True(circular.IsSuccess, string.Join("\n", circular.Diagnostics.Select(d => d.Message)));
+ Assert.Contains("CYLINDRICAL_SURFACE", circular.Value.Export.StepText);
+ Assert.DoesNotContain("B_SPLINE_SURFACE_WITH_KNOTS", circular.Value.Export.StepText);
+ }
+
+ [Theory]
+ [InlineData("Unknown")]
+ [InlineData("1")]
+ public void InvalidProfileDoesNotSilentlyUseCircularMode(string mode)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Regression/Fillet/concave-curvature-continuous.firmament")
+ .Replace("profile: CurvatureContinuous", "profile: " + mode);
+ var result = CompatibilityBuild(source);
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, d => d.Message.Contains("BoundedFilletProfileUnsupported"));
+ }
+
+ [Fact]
+ public void ProfileBoundaryRouteDoesNotPretendToSupportSmoothContactShells()
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament");
+ var profile = ProfileAuthoringParser.ResolveNamedProfile(source, "Section", out var diagnostics);
+ Assert.Empty(diagnostics);
+ Assert.NotNull(profile);
+ Assert.False(ProfileBoundaryChamferSourceBinder.TryBindFillet(source, profile!, "Body", out _, out _, out _, out var diagnostic));
+ Assert.Equal("ProfileBoundaryFilletProfileModeUnsupported:CurvatureContinuous:polynomial-contact-shell-required", diagnostic);
+ var result = FirmamentBuildAndExport.CompileSource(source);
+ Assert.False(result.IsSuccess);
+ }
+ private static Aetheris.Kernel.Core.Results.KernelResult<FirmamentBuildAndExportResult> CompatibilityBuild(string source)
+ {
+ var directory = Path.Combine(FirmamentCorpusHarness.RepoRoot(), "artifacts", "local", "fillet-profile-tests", Guid.NewGuid().ToString("N"));
+ Directory.CreateDirectory(directory);
+ var file = Path.Combine(directory, "input.firmament");
+ File.WriteAllText(file, source);
+ return FirmamentBuildAndExport.Run(file, Path.Combine(directory, "result.step"));
+ }
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/PlanarPlateauTests.cs b/Aetheris.Kernel.Firmament.Tests/PlanarPlateauTests.cs
new file mode 100644
index 00000000..46451702
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/PlanarPlateauTests.cs
@@ -0,0 +1,156 @@
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.FirmamentV2;
+using Aetheris.Surfacing;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class PlanarPlateauTests
+{
+ [Fact]
+ public void MixedFootprintProducesExactContactsAndG2PatchJoins()
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/SectionChain/smooth-corner-sections.firmament");
+ var input = SectionChainAuthoringParser.Compile(source, materialize: false);
+ Assert.True(input.IsSuccess, string.Join("\n", input.Diagnostics));
+ var section = input.Chain!.Sections[0];
+ var result = PlanarPlateauContacts.Build("Plateau", section.Profile, section.Frame, 3, 2, "Body.Top", "Plateau.Top");
+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics));
+ Assert.Equal(12, result.Plan!.Spans.Count);
+ Assert.All(result.Plan.Joins, j => Assert.True(j.Status == "G2WithinSampledTolerance", $"{j.BoundaryIdentity}: {j.Status} {j.MaximumNormalAngleDegrees} {j.MaximumShapeOperatorResidual}"));
+ }
+ [Fact]
+ public void MixedPlateauGraftsTrimmedManifoldAndPreservesBaseTopology()
+ {
+ var input = SectionChainAuthoringParser.Compile(FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/SectionChain/smooth-corner-sections.firmament"), false).Chain!.Sections[0];
+ var source = BrepPrimitives.CreateBox(100, 80, 5).Value;
+ var top = source.Bindings.FaceBindings.Single(b => source.Geometry.GetSurface(b.SurfaceGeometryId).Plane is { } p && p.Normal.ToVector().Z > .99);
+ var frame = input.Frame with { Origin = new Point3D(0, 0, 2.5) };
+ var plan = PlanarPlateauContacts.Build("Plateau", input.Profile, frame, 3, 2, "Body.Top", "Plateau.Top");
+ Assert.True(plan.IsSuccess, string.Join("\n", plan.Diagnostics));
+ var built = PlanarPlateauMaterializer.Apply(source, top.FaceId, plan.Plan!);
+ Assert.True(built.IsSuccess, string.Join("\n", built.Diagnostics));
+ Assert.True(built.Pcurves!.LoopClosureValid);
+ Assert.True(built.Pcurves.MaximumReconstructionDeviation < 1e-9);
+ foreach (var edge in source.Topology.Edges) Assert.Equal(edge, built.Body!.Topology.GetEdge(edge.Id));
+ foreach (var face in source.Topology.Faces.Where(f => f.Id != top.FaceId)) Assert.Equal(face, built.Body!.Topology.GetFace(face.Id));
+ var polynomialTrims = built.Body!.Bindings.PcurveBindings.Where(pc => pc.Pcurve.Kind == PcurveGeometryKind.Polynomial).ToArray();
+ Assert.Equal(24, polynomialTrims.Length);
+ foreach (var pc in polynomialTrims)
+ {
+ var edge = built.Body.Bindings.GetEdgeBinding(built.Body.Topology.GetCoedge(pc.CoedgeId).EdgeId);
+ var curve = built.Body.Geometry.GetCurve(edge.CurveGeometryId).BSpline3!.Value;
+ var uv = pc.Pcurve.PolynomialCurve!.Value;
+ var plane = built.Body.Geometry.GetSurface(pc.SurfaceGeometryId).Plane!.Value;
+ Assert.Equal(curve.Degree, uv.Degree);
+ Assert.Equal(curve.KnotValues, uv.KnotValues);
+ Assert.Equal(curve.KnotMultiplicities, uv.KnotMultiplicities);
+ for (var i = 0; i < curve.ControlPoints.Count; i++)
+ {
+ var reconstructed = plane.Origin + plane.UAxis.ToVector() * uv.ControlPoints[i].X + plane.VAxis.ToVector() * uv.ControlPoints[i].Y;
+ Assert.True((reconstructed - curve.ControlPoints[i]).Length < 1e-12);
+ }
+ }
+ var exported = Step242Exporter.ExportBody(built.Body!);
+ Assert.True(exported.IsSuccess, string.Join("\n", exported.Diagnostics.Select(d => d.Message)));
+
+ }
+ [Theory]
+ [InlineData(0.1)]
+ [InlineData(1)]
+ [InlineData(10)]
+ public void SemanticPlateauWorksAtSeveralScales(double scale)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/Surfacing/g2-planar-plateau.firmament");
+ source = System.Text.RegularExpressions.Regex.Replace(source, @"([-+]?\d+(?:\.\d+)?)mm", m =>
+ (double.Parse(m.Groups[1].Value, System.Globalization.CultureInfo.InvariantCulture) * scale).ToString("R", System.Globalization.CultureInfo.InvariantCulture) + "mm");
+ var built = FirmamentBuildAndExport.CompileSource(source);
+ Assert.True(built.IsSuccess, string.Join("\n", built.Diagnostics.Select(d => d.Message)));
+ Assert.True(built.Value.Plateau!.ReimportManifold);
+ Assert.All(built.Value.Plateau.Contacts.Joins, j => Assert.Equal("G2WithinSampledTolerance", j.Status));
+ Assert.Equal(built.Value.StepText, FirmamentBuildAndExport.CompileSource(source).Value.StepText);
+ }
+
+ [Theory]
+ [InlineData("Width: 2mm", "Width: 0mm", "plateau-width-must-be-positive")]
+ [InlineData("Width: 2mm", "Width: -1mm", "plateau-width-must-be-positive")]
+ [InlineData("Width: 2mm", "Width: 20mm", "plateau-width-collapses-footprint")]
+ [InlineData("Height: 3mm", "Height: 0mm", "plateau-height-must-be-positive")]
+ [InlineData("Size: [60mm,40mm]", "Size: [120mm,40mm]", "plateau-contact-outside-support")]
+ public void InvalidPlateausFailBeforeExport(string from, string to, string error)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/Surfacing/g2-planar-plateau.firmament").Replace(from, to);
+ var result = FirmamentBuildAndExport.CompileSource(source);
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics, d => d.Message == error);
+ }
+
+ [Fact]
+ public void TightCornersAndStraightOnlyLoopsShareTheSamePath()
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/Surfacing/g2-planar-plateau.firmament");
+ var tight = FirmamentBuildAndExport.CompileSource(source.Replace("CornerExtent: 8mm", "CornerExtent: 1mm"));
+ Assert.True(tight.IsSuccess, string.Join("\n", tight.Diagnostics.Select(d => d.Message)));
+ Assert.All(tight.Value.Plateau!.Contacts.Joins, j => Assert.Equal("G2WithinSampledTolerance", j.Status));
+ var straight = FirmamentBuildAndExport.CompileSource(source.Replace("SmoothRoundedRect2 Footprint", "Rect2 Footprint").Replace(" CornerExtent: 8mm", ""));
+ Assert.True(straight.IsSuccess, string.Join("\n", straight.Diagnostics.Select(d => d.Message)));
+ Assert.Equal(4, straight.Value.Plateau!.Contacts.Spans.Count);
+ Assert.All(straight.Value.Plateau.Contacts.Joins.Where(j => j.BoundaryKind != "NeighboringFootprintSpans"), j => Assert.Equal("G2WithinSampledTolerance", j.Status));
+ Assert.Contains(straight.Value.Plateau.Contacts.Joins, j => j.BoundaryKind == "NeighboringFootprintSpans" && j.Status == "G0");
+ }
+
+ [Theory]
+ [InlineData("Size: [60mm,40mm]", "Size: [65mm,35mm]")]
+ [InlineData("Height: 3mm", "Height: 2.5mm")]
+ [InlineData("Width: 2mm", "Width: 1.2mm")]
+ [InlineData("Rect2 BaseBoundary { Center: [0mm,0mm] Size: [100mm,80mm] }", "RoundedRect2 BaseBoundary { Center: [0mm,0mm] Size: [100mm,80mm] Radius: 18mm }")]
+ public void ParametersRegenerateThroughOrdinaryPipeline(string from, string to)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/Surfacing/g2-planar-plateau.firmament");
+ Assert.Contains(from, source);
+ var result = FirmamentBuildAndExport.CompileSource(source.Replace(from, to));
+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics.Select(d => d.Message)));
+ Assert.True(result.Value.Plateau!.ReimportManifold);
+ Assert.All(result.Value.Plateau.Contacts.Joins, j => Assert.Equal("G2WithinSampledTolerance", j.Status));
+ }
+
+ [Fact]
+ public void DegenerateAndSelfCrossingFootprintsFailTyped()
+ {
+ var frame = SectionFrame.Create(Point3D.Origin, new(1, 0, 0), new(0, 1, 0));
+ var points = new[] { new SectionPoint2D(-1, -1), new SectionPoint2D(1, 1), new SectionPoint2D(-1, 1), new SectionPoint2D(1, -1) };
+ var spans = points.Select((p, i) => new SectionProfileSpan("S" + i, new SectionProfileCurve.Line(p, points[(i + 1) % 4]))).ToArray();
+ var cross = PlanarPlateauContacts.Build("Bad", new("P", spans, "S0"), frame, 1, .1, "Base", "Top");
+ Assert.False(cross.IsSuccess);
+ Assert.Contains(cross.Diagnostics, d => d.StartsWith("plateau-footprint-"));
+ spans[0] = new("S0", new SectionProfileCurve.PolynomialBSpline(3, [points[0], points[0], points[0], points[0]], [4, 4], [0, 1]));
+ Assert.False(PlanarPlateauContacts.Build("Bad", new("P", spans, "S0"), frame, 1, .1, "Base", "Top").IsSuccess);
+ }
+
+ [Fact]
+ public void FreshAuthoredPhoneUsesGenericPlateauAndMeshesEveryFace()
+ {
+ var path = FirmamentCorpusHarness.ResolveFixtureFullPath("fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament");
+ var compiled = new Aetheris.Kernel.Firmament.Assembly.AssemblyM1Pipeline().CompileFile(path);
+ Assert.True(compiled.IsSuccess, string.Join("\n", compiled.Diagnostics.Select(d => d.Message)));
+ var body = compiled.Geometry!.DefinitionBodies.Single(b => b.Key.StartsWith("BodyPart<")).Value;
+ Assert.Equal(35, body.Topology.Faces.Count());
+ Assert.All(body.Topology.Edges, e => Assert.Equal(2, body.Topology.Coedges.Count(c => c.EdgeId == e.Id)));
+ var mesh = Aetheris.Kernel.Firmament.Assembly.AssemblyDisplayMeshExporter.Export(compiled);
+ Assert.Equal(16, mesh.Definitions.Count);
+ Assert.All(mesh.Definitions, d => Assert.NotEmpty(d.Indices));
+ }
+
+ [Fact]
+ public void PolynomialPcurvesKeepDegreeKnotsAndExactPlaneParameters()
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/Surfacing/g2-planar-plateau.firmament");
+ var built = FirmamentBuildAndExport.CompileSource(source);
+ Assert.True(built.IsSuccess);
+ Assert.True(built.Value.Plateau!.Pcurves.MaximumReconstructionDeviation < 1e-9);
+ // Export retains 2D B-spline entities; it no longer samples polynomial trims.
+ Assert.Contains("B_SPLINE_CURVE_WITH_KNOTS", built.Value.StepText);
+ Assert.Contains("DEFINITIONAL_REPRESENTATION", built.Value.StepText);
+ }
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/SectionChainAuthoringTests.cs b/Aetheris.Kernel.Firmament.Tests/SectionChainAuthoringTests.cs
index 656ed90f..b76a4142 100644
--- a/Aetheris.Kernel.Firmament.Tests/SectionChainAuthoringTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/SectionChainAuthoringTests.cs
@@ -5,6 +5,69 @@ namespace Aetheris.Kernel.Firmament.Tests;
public sealed class SectionChainAuthoringTests
{
+ [Theory]
+ [InlineData(60, 40, 8, 0)]
+ [InlineData(77.98, 163.43, 19.43, 0)]
+ [InlineData(64, 44, 9, 27)]
+ public void SmoothCornersRemoveFootprintCurvatureJump(double width, double height, double extent, double rotation)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/SectionChain/smooth-corner-sections.firmament")
+ .Replace("Size: [60mm,40mm] CornerExtent: 8mm", FormattableString.Invariant($"Size: [{width}mm,{height}mm] CornerExtent: {extent}mm Rotation: {rotation}deg"));
+ var result = SectionChainAuthoringParser.Compile(source);
+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics));
+ Assert.Equal(12, result.Chain!.Sections[0].Profile.Spans.Count);
+ Assert.Equal(36, result.Materialization!.GeometricJoins.Count);
+ Assert.All(result.Materialization.GeometricJoins, join =>
+ {
+ Assert.Equal("G2WithinSampledTolerance", join.Status);
+ Assert.True(join.MaximumShapeOperatorResidual < 1e-9);
+ });
+ Assert.True(result.Materialization.Pcurves!.LoopClosureValid);
+ }
+
+ [Theory]
+ [InlineData("0mm")]
+ [InlineData("-1mm")]
+ [InlineData("20mm")]
+ [InlineData("21mm")]
+ public void SmoothCornersRejectDegenerateSideSpans(string extent)
+ {
+ var source = FirmamentCorpusHarness.ReadFixtureText("fixtures/Canonical/SectionChain/smooth-corner-sections.firmament")
+ .Replace("CornerExtent: 8mm", "CornerExtent: " + extent);
+ var result = SectionChainAuthoringParser.Compile(source);
+ Assert.False(result.IsSuccess);
+ Assert.Contains("firmament-boundary2-invalid-dimensions:Outline", result.Diagnostics);
+ Assert.Null(result.Materialization);
+ }
+
+ [Fact]
+ public void RoundedProfileNormalizationReachesStepAndReportsRealCurvatureJump()
+ {
+ var result = SectionChainAuthoringParser.Compile(FirmamentCorpusHarness.ReadFixtureText(
+ "fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament"));
+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics));
+ Assert.Equal(12, result.Materialization!.ProfileNormalization!.Curves.Count);
+ Assert.All(result.Materialization.GeometricJoins.Where(j => j.BoundaryKind == "NeighboringProfileSpans"), j =>
+ {
+ Assert.Equal("G1", j.Status);
+ Assert.True(j.MaximumPositionError < 1e-10);
+ Assert.True(j.MaximumNormalAngleDegrees < 1e-8);
+ Assert.InRange(j.MaximumShapeOperatorResidual!.Value, 0.125-1e-9, 0.125+1e-9);
+ });
+ Assert.All(result.Materialization.GeometricJoins.Where(j => j.BoundaryKind == "InternalSection"),
+ j => Assert.Equal("G2WithinSampledTolerance", j.Status));
+ }
+
+ [Fact]
+ public void G2RequestIsNotSilentlyDowngradedToNormalizedG1()
+ {
+ var result = SectionChainAuthoringParser.Compile(FirmamentCorpusHarness.ReadFixtureText(
+ "fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament").Replace("Continuity: G1", "Continuity: G2"));
+ Assert.False(result.IsSuccess);
+ Assert.Contains("section-chain-continuity-invalid:G2", result.Diagnostics);
+ Assert.Null(result.Materialization);
+ }
+
[Theory]
[InlineData("two-section-ruled.firmament", 2, SectionTermination.Cap, SectionTermination.Cap)]
[InlineData("six-section-ergonomic.firmament", 6, SectionTermination.Cap, SectionTermination.Cap)]
diff --git a/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs b/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs
index 2279afa5..e6341d5f 100644
--- a/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs
+++ b/Aetheris.Kernel.Firmament/Assembly/AssemblyDisplayMeshExporter.cs
@@ -29,6 +29,12 @@ public static class AssemblyDisplayMeshExporter
var useSurfaceMeshIr = body.Topology.Faces.All(face =>
body.TryGetFaceSurfaceGeometry(face.Id, out var surface)
&& surface?.Kind is SurfaceGeometryKind.Plane or SurfaceGeometryKind.Cylinder);
+ if (body.Geometry.Surfaces.Any(s => s.Value.Kind == SurfaceGeometryKind.BSplineSurfaceWithKnots))
+ {
+ var trims = Aetheris.Surfacing.BoundedPcurveBuilder.Populate(body.Topology, body.Geometry, body.Bindings);
+ if (!trims.IsSuccess)
+ throw new InvalidOperationException($"assembly-mesh-pcurve-failed:{identity}:" + string.Join(";", trims.Diagnostics));
+ }
var tessellation = useSurfaceMeshIr
? BrepDisplayTessellator.TessellateSurfaceMeshIr(body, effectiveOptions)
: BrepDisplayTessellator.TessellateBounded(body, effectiveOptions);
diff --git a/Aetheris.Kernel.Firmament/Execution/FirmamentPrimitiveExecutor.cs b/Aetheris.Kernel.Firmament/Execution/FirmamentPrimitiveExecutor.cs
index c632f482..1d439393 100644
--- a/Aetheris.Kernel.Firmament/Execution/FirmamentPrimitiveExecutor.cs
+++ b/Aetheris.Kernel.Firmament/Execution/FirmamentPrimitiveExecutor.cs
@@ -1404,7 +1404,12 @@ internal static class FirmamentPrimitiveExecutor
}
var selection = preflight.Value;
- return BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(baseBody, selection, radius);
+ var profile = BoundedFilletProfile.Circular;
+ if (boolean.Tool.RawFields.TryGetValue("profile", out var profileText) &&
+ (!Enum.TryParse(profileText, false, out profile) || !Enum.IsDefined(profile) || profileText != profile.ToString()))
+ return KernelResult<BrepBody>.Failure([new KernelDiagnostic(KernelDiagnosticCode.ValidationFailed,
+ KernelDiagnosticSeverity.Error, "BoundedFilletProfileUnsupported", Source: "firmament.fillet-profile")]);
+ return BrepBoundedFillet.FilletTrustedPolyhedralSingleInternalConcaveEdge(baseBody, selection, radius, profile);
}
private static bool TryParseDraftFaces(
diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
index 90369501..2dec239e 100644
--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
@@ -330,6 +330,11 @@ public static class FirmamentBuildAndExport
canonicalParseWatch.Stop();
var canonicalAdvanced = FirmamentV2Parser.TryGetCanonicalAdvancedBody(materializerInput, out var canonicalBody);
var materializerSource = canonicalAdvanced ? canonicalBody : materializerInput;
+ if (PlateauAuthoring.IsSource(materializerSource))
+ {
+ if (!v2Parse.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(v2Parse.Diagnostics.Select(SchemaDiagnostic).ToArray());
+ return PlateauAuthoring.Compile(materializerSource);
+ }
if (RevolveAuthoringParser.IsRevolveSource(materializerSource))
{
var authored = RevolveAuthoringParser.Parse(materializerSource, out var revolveDiagnostics);
diff --git a/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs b/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
index 4c65d5a4..5be3bf4b 100644
--- a/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentStepExportResult.cs
@@ -28,7 +28,8 @@ public sealed record FirmamentStepExportResult(
Aetheris.Kernel.Firmament.Structural.StructuralReport? Structural = null,
Aetheris.Kernel.Firmament.Piping.PipingReport? Piping = null,
FirmamentRevolveReport? Revolve = null,
- FirmamentGearReport? Gear = null);
+ FirmamentGearReport? Gear = null,
+ Aetheris.Kernel.Firmament.FirmamentV2.FirmamentPlateauReport? Plateau = null);
public sealed record FirmamentGearItemReport(
string Name,
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
index 9ca89e02..79c8388d 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
@@ -1,3 +1,4 @@
+using Aetheris.Kernel.Firmament.Materializer;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
@@ -13,7 +14,7 @@ internal static class ClosedBoundary2Authoring
internal const string Prefix = "firmament-boundary2-";
private const double Tol = 1e-9;
private static readonly Regex Header = new(
- @"\b(?:(?<plain>Rect2|Square2|Circle2|Ellipse2|Slot2|RoundedRect2)|(?<family>Triangle2|Polygon2)\s*<\s*(?<variant>[A-Za-z_]\w*)\s*>|RegularPolygon2\s*<\s*(?<count>[-+]?\d+)\s*>)\s+(?<name>[A-Za-z_]\w*)\s*\{",
+ @"\b(?:(?<plain>Rect2|Square2|Circle2|Ellipse2|Slot2|RoundedRect2|SmoothRoundedRect2)|(?<family>Triangle2|Polygon2)\s*<\s*(?<variant>[A-Za-z_]\w*)\s*>|RegularPolygon2\s*<\s*(?<count>[-+]?\d+)\s*>)\s+(?<name>[A-Za-z_]\w*)\s*\{",
RegexOptions.CultureInvariant);
internal sealed record Result(string Source, IReadOnlyList<FirmamentV2ClosedBoundary2Decl> Boundaries)
@@ -88,6 +89,7 @@ internal static class ClosedBoundary2Authoring
"Circle2" => Circle(source, name, body, rotation, span, diagnostics),
"Ellipse2" => Ellipse(name, body, rotation, span, diagnostics),
"Slot2" => Slot(name, body, rotation, span, diagnostics),
+ "SmoothRoundedRect2" => SmoothRoundedRect(name, body, rotation, span, diagnostics),
"RoundedRect2" => RoundedRect(name, body, rotation, span, diagnostics),
"Polygon2" => Polygon(source, name, variant!, body, rotation, span, diagnostics),
_ => RegularPolygon(name, variant!, body, rotation, span, diagnostics)
@@ -173,6 +175,78 @@ internal static class ClosedBoundary2Authoring
return Make(name, "RoundedRect2", null, c, rotation, new Dictionary<string, double> { ["Width"] = size.X, ["Height"] = size.Y, ["Radius"] = r }, [], guides, "Line+Circle", span, path, map, name + "_Path |> TraceLoop", area, perimeter);
}
+ // A fixed polynomial corner law. The two cubic halves have collinear first
+ // three controls at the side, and reflection symmetry gives G2 at the bisector.
+ internal static IReadOnlyDictionary<string, LineArcProfileCurve2D> SmoothGuides(string source, List<string> diagnostics)
+ {
+ var guides = new Dictionary<string, LineArcProfileCurve2D>();
+ var templates = FirmamentV2TemplateExpansion.DeclarationSpans(source, diagnostics);
+ foreach (Match header in Header.Matches(source))
+ {
+ if (templates.Any(span => header.Index >= span.Start && header.Index < span.Start + span.Length)) continue;
+ if (header.Groups["plain"].Value != "SmoothRoundedRect2") continue;
+ var open = source.IndexOf('{', header.Index); var close = Matching(source, open);
+ if (close < 0) continue;
+ var body = source[(open + 1)..close];
+ var rotation = Angle(body, "Rotation", 0d, out _);
+ var shape = SmoothRoundedRect(header.Groups["name"].Value, body, rotation,
+ new(header.Index, close - header.Index + 1), diagnostics);
+ if (shape is null) continue;
+ Point(body, "Center", out var center); Vector(body, "Size", out var size); Length(body, "CornerExtent", out var extent);
+ foreach (var curve in SmoothCurves(center, size, extent, rotation)) guides.TryAdd(shape.Declaration.Name + "." + curve.Key, curve.Value);
+ }
+ return guides;
+ }
+
+ private static Shape? SmoothRoundedRect(string name, string body, double rotation, FirmamentV2SourceSpan span, List<string> diagnostics)
+ {
+ if (!Point(body, "Center", out var c) || !Vector(body, "Size", out var size) ||
+ !Length(body, "CornerExtent", out var r) || !Positive(size.X, size.Y, r) || r >= Math.Min(size.X, size.Y) / 2)
+ return Invalid(name, "invalid-dimensions", diagnostics);
+ var curves = SmoothCurves(c, size, r, rotation);
+ var edges = curves.Keys.ToArray();
+ var map = edges.ToDictionary(edge => edge, edge => name + "." + edge);
+ // Cubic area integration is exact; perimeter uses fixed 256-interval Simpson quadrature (an estimate).
+ var area = curves.Values.Sum(ResolvedProfile2DValidator.SignedAreaContribution);
+ var perimeter = curves.Values.Sum(curve => curve is LineArcLineSegment2D line ? Distance(line.Start, line.End)
+ : SmoothCubicLength((LineArcCubicBezier2D)curve));
+ return Make(name, "SmoothRoundedRect2", null, c, rotation,
+ new Dictionary<string, double> { ["Width"] = size.X, ["Height"] = size.Y, ["CornerExtent"] = r },
+ [], edges, "Line+CubicBezier", span, null, map,
+ string.Join(" |> ", edges.Select(edge => name + "." + edge + " As " + edge)) + " |> Close", area, perimeter);
+ }
+
+ private static Dictionary<string, LineArcProfileCurve2D> SmoothCurves((double X, double Y) c, (double X, double Y) size, double r, double rotation)
+ {
+ var result = new Dictionary<string, LineArcProfileCurve2D>();
+ var sides = new[] { "Bottom", "Right", "Top", "Left" };
+ var corners = new[] { "BottomRightCorner", "TopRightCorner", "TopLeftCorner", "BottomLeftCorner" };
+ var b = Math.Pow(0.5, 0.25); var q = 1 - b; var a = b - 0.5;
+ for (var i = 0; i < 4; i++)
+ {
+ var w = i % 2 == 0 ? size.X : size.Y; var h = i % 2 == 0 ? size.Y : size.X;
+ (double X, double Y) Transform(double x, double y) => Rotate((c.X + x, c.Y + y), c, rotation + 90 * i);
+ (double X, double Y) Corner(double x, double y) => Transform(w / 2 - r + r * x, -h / 2 + r * y);
+ result.Add(sides[i], new LineArcLineSegment2D(Transform(-w / 2 + r, -h / 2), Corner(0, 0)));
+ result.Add(corners[i] + "A", new LineArcCubicBezier2D(Corner(0, 0), Corner(a, 0), Corner(2 * a, 0), Corner(b, q)));
+ result.Add(corners[i] + "B", new LineArcCubicBezier2D(Corner(b, q), Corner(1, 1 - 2 * a), Corner(1, 1 - a), Corner(1, 1)));
+ }
+ return result;
+ }
+
+ private static double SmoothCubicLength(LineArcCubicBezier2D curve)
+ {
+ double Speed(double t)
+ {
+ var u = 1 - t;
+ var x = 3 * (u * u * (curve.Control1.X - curve.Start.X) + 2 * u * t * (curve.Control2.X - curve.Control1.X) + t * t * (curve.End.X - curve.Control2.X));
+ var y = 3 * (u * u * (curve.Control1.Y - curve.Start.Y) + 2 * u * t * (curve.Control2.Y - curve.Control1.Y) + t * t * (curve.End.Y - curve.Control2.Y));
+ return Math.Sqrt(x * x + y * y);
+ }
+ const int n = 256;
+ return (Speed(0) + Speed(1) + Enumerable.Range(1, n - 1).Sum(i => (i % 2 == 0 ? 2 : 4) * Speed((double)i / n))) / (3 * n);
+ }
+
private static Shape? Polygon(string source, string name, string variant, string body, double rotation, FirmamentV2SourceSpan span, List<string> diagnostics)
{
IReadOnlyList<(double X, double Y)> vertices; IReadOnlyList<string> pointNames; Dictionary<string, double> dimensions = []; (double X, double Y) c;
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
index 164b3d23..9c1c5057 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
@@ -970,7 +970,7 @@ public static class FirmamentV2Parser
var known = new HashSet<string>(StringComparer.Ordinal)
{
- "Box", "Cylinder", "Cone", "Sphere", "Torus", "RoundedBox", "Frustum", "StandardPart", "ExactCoaxialPart", "Point2", "Line2", "Rect2", "Circle2", "Ellipse2Guide", "Concept", "Struct", "Construction", "Profile", "Span", "Compose", "Boss", "Pocket", "AddOffset", "RemoveOffset", "EdgeFinish",
+ "Box", "Cylinder", "Cone", "Sphere", "Torus", "RoundedBox", "Frustum", "StandardPart", "ExactCoaxialPart", "Point2", "Line2", "Rect2", "Circle2", "Ellipse2Guide", "SmoothRoundedRect2", "Plateau", "Concept", "Struct", "Construction", "Profile", "Span", "Compose", "Boss", "Pocket", "AddOffset", "RemoveOffset", "EdgeFinish",
"Record", "Static", "Template", "template", "ProfileDelta", "Selection", "InlineStep", "Recognize", "Replace", "Pmi", "Modify", "Match", "Require", "Assert"
};
var compatibilityOnly = new HashSet<string>(StringComparer.Ordinal)
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/PlateauAuthoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/PlateauAuthoring.cs
new file mode 100644
index 00000000..018f6198
--- /dev/null
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/PlateauAuthoring.cs
@@ -0,0 +1,88 @@
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Diagnostics;
+using Aetheris.Kernel.Core.Results;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.Materializer;
+using Aetheris.Surfacing;
+
+namespace Aetheris.Kernel.Firmament.FirmamentV2;
+
+public sealed record FirmamentPlateauReport(PlanarPlateauContactPlan Contacts,
+ IReadOnlyList<PlanarPlateauFaceIdentity> Faces, BrepPcurveEvidence Pcurves,
+ int FaceCount, int EdgeCount, int VertexCount, bool ReimportManifold,
+ double ContactGenerationMs, double TrimAndBrepGenerationMs, double TotalGenerationMs,
+ string WidthLaw = "ExactHomotheticShortAxisInset");
+
+/// <summary>One bounded semantic Plateau on an existing extruded planar support.</summary>
+public static class PlateauAuthoring
+{
+ private static readonly Regex Header = new(@"\bPlateau\s+(?<name>[A-Za-z_]\w*)\s*\{(?<body>[^{}]*)\}", RegexOptions.CultureInvariant);
+ public static bool IsSource(string source) => Regex.IsMatch(source, @"\bPlateau\s+[A-Za-z_]\w*\s*\{");
+
+ internal static KernelResult<FirmamentStepExportResult> Compile(string source)
+ {
+ KernelResult<FirmamentStepExportResult> Fail(IEnumerable<string> messages) => KernelResult<FirmamentStepExportResult>.Failure(
+ messages.Select(m => new KernelDiagnostic(KernelDiagnosticCode.ValidationFailed, KernelDiagnosticSeverity.Error, m, "FirmamentV2.Plateau")).ToArray());
+ var watch = Stopwatch.StartNew(); var declarations = Header.Matches(source).Cast<Match>().ToArray();
+ if (declarations.Length != 1) return Fail(["plateau-count-invalid"]);
+ var declaration = declarations[0]; var name = declaration.Groups["name"].Value; var body = declaration.Groups["body"].Value;
+ var fields = Regex.Matches(body, @"\b(?<key>[A-Za-z_]\w*)\s*:").Select(m => m.Groups["key"].Value).ToArray();
+ var allowed = new[] { "Base", "Footprint", "Height", "Width", "Inset", "Continuity", "Seam" };
+ if (fields.Any(f => !allowed.Contains(f)) || fields.Distinct().Count() != fields.Length)
+ return Fail(["plateau-unknown-or-duplicate-property"]);
+ string? Field(string field) => ProfileAuthoringParser.Property(body, field);
+ if (Field("Continuity") != "G2" || Field("Inset") != "Homothetic") return Fail(["plateau-requires-G2-and-Homothetic-inset"]);
+ var extrusions = Regex.Matches(source, @"\bExtrude\s+(?<name>[A-Za-z_]\w*)\s*\{");
+ if (extrusions.Count != 1 || Field("Base") != extrusions[0].Groups["name"].Value ||
+ Regex.IsMatch(source, @"\b(?:Modify|Compose|Boss|Pocket|Revolve|EdgeFinish)\s+")) return Fail(["plateau-base-requires-one-unmodified-extrusion"]);
+ if (!ProfileAuthoringParser.TryMeasure(Field("Height") ?? "", "mm", out var height) ||
+ !ProfileAuthoringParser.TryMeasure(Field("Width") ?? "", "mm", out var width)) return Fail(["plateau-dimensions-invalid"]);
+ var parsed = ProfileAuthoringParser.Parse(source);
+ if (parsed.Profile is null || parsed.Diagnostics.Count != 0) return Fail(parsed.Diagnostics);
+ var footprint = ProfileAuthoringParser.ResolveNamedProfile(source, Field("Footprint") ?? "", out var diagnostics);
+ if (footprint is null || diagnostics.Count != 0) return Fail(diagnostics);
+ if (footprint.Loops.Count != 1 || footprint.PlaneFrame != parsed.Profile.PlaneFrame) return Fail(["plateau-footprint-frame-or-loops-unsupported"]);
+ var baseBody = LineArcProfileExtrudeEmitter.TryEmit(parsed.Profile, parsed.Height);
+ if (baseBody.Body is null) return Fail(baseBody.Diagnostics);
+ var frame = parsed.Profile.EffectiveConstructionPlane;
+ var origin = frame.Origin + frame.AxisZ.ToVector() * (parsed.Profile.LocalEndDepth ?? parsed.Height);
+ var candidates = baseBody.Body.Bindings.FaceBindings.Where(b => b.SameSense && baseBody.Body.Geometry.GetSurface(b.SurfaceGeometryId).Plane is { } p &&
+ (p.Normal.ToVector() - frame.AxisZ.ToVector()).Length < 1e-10 && Math.Abs((p.Origin - origin).Dot(frame.AxisZ.ToVector())) < 1e-8).ToArray();
+ if (candidates.Length != 1) return Fail(["plateau-base-face-unresolved"]);
+ var spans = new List<SectionProfileSpan>();
+ foreach (var segment in footprint.Loops[0].Segments)
+ {
+ SectionProfileCurve? curve = segment.Geometry switch
+ {
+ LineArcLineSegment2D line => new SectionProfileCurve.Line(new(line.Start.X, line.Start.Y), new(line.End.X, line.End.Y)),
+ LineArcCubicBezier2D c => new SectionProfileCurve.PolynomialBSpline(3,
+ [new(c.Start.X, c.Start.Y), new(c.Control1.X, c.Control1.Y), new(c.Control2.X, c.Control2.Y), new(c.End.X, c.End.Y)], [4, 4], [0, 1]),
+ _ => null
+ };
+ if (curve is null) return Fail(["plateau-footprint-curve-unsupported:" + segment.Name]);
+ spans.Add(new(segment.Name, curve));
+ }
+ var seam = Field("Seam") ?? spans.FirstOrDefault(s => s.Curve is SectionProfileCurve.Line)?.SpanId ?? spans[0].SpanId;
+ var contactWatch = Stopwatch.StartNew();
+ var contacts = PlanarPlateauContacts.Build(name, new(footprint.Name, spans, seam), new(origin, frame.AxisX, frame.AxisY, frame.AxisZ),
+ height, width, Field("Base") + ".Top", name + ".Top");
+ contactWatch.Stop();
+ if (!contacts.IsSuccess) return Fail(contacts.Diagnostics);
+ var trimWatch = Stopwatch.StartNew();
+ var materialized = PlanarPlateauMaterializer.Apply(baseBody.Body, candidates[0].FaceId, contacts.Plan!);
+ trimWatch.Stop();
+ if (!materialized.IsSuccess) return Fail(materialized.Diagnostics);
+ var step = Step242Exporter.ExportBody(materialized.Body!, new Step242ExportOptions { ProductName = name });
+ if (!step.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(step.Diagnostics);
+ var imported = Step242Importer.ImportBody(step.Value);
+ if (!imported.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(imported.Diagnostics);
+ var manifold = imported.Value.Topology.Edges.All(e => imported.Value.Topology.Coedges.Count(c => c.EdgeId == e.Id) == 2);
+ if (!manifold) return Fail(["plateau-step-reimport-not-manifold"]);
+ var report = new FirmamentPlateauReport(contacts.Plan!, materialized.Faces, materialized.Pcurves!,
+ materialized.Body!.Topology.Faces.Count(), materialized.Body.Topology.Edges.Count(), materialized.Body.Topology.Vertices.Count(), manifold,
+ contactWatch.Elapsed.TotalMilliseconds, trimWatch.Elapsed.TotalMilliseconds, watch.Elapsed.TotalMilliseconds);
+ return KernelResult<FirmamentStepExportResult>.Success(new(step.Value, name, 0, "plateau", "Plateau", Plateau: report));
+ }
+}
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
index 2c6a0491..a84bafa3 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
@@ -256,6 +256,7 @@ public static class ProfileAuthoringParser
{ diagnostics.Add($"profile-layout-unresolved-ellipse:{match.Groups["n"].Value}"); continue; }
guides[match.Groups["n"].Value] = new LineArcFullEllipse2D(center, major, minor, rotation * Math.PI / 180d);
}
+ foreach (var guide in ClosedBoundary2Authoring.SmoothGuides(source, diagnostics)) guides[guide.Key] = guide.Value;
if (applySpans) ApplyGeometricSpans(source, points, guides, diagnostics, addGuides: true);
}
@@ -853,12 +854,14 @@ public static class ProfileAuthoringParser
private static bool IsClosed(IReadOnlyList<LineArcProfileCurve2D> curves) => curves.Count > 0 && Distance(Start(curves[0]), End(curves[^1])) <= Tolerance && curves.Zip(curves.Skip(1)).All(pair => Distance(End(pair.First), Start(pair.Second)) <= Tolerance);
private static double SignedArea(IEnumerable<LineArcProfileCurve2D> curves) => curves.Sum(curve => curve switch
{
+ LineArcCubicBezier2D cubic => ResolvedProfile2DValidator.SignedAreaContribution(cubic),
LineArcLineSegment2D line => (line.Start.X * line.End.Y - line.End.X * line.Start.Y) / 2d,
LineArcCircularArc2D arc => (arc.Radius * arc.Center.X * (Math.Sin(arc.StartAngleRadians + arc.SweepAngleRadians) - Math.Sin(arc.StartAngleRadians)) + arc.Radius * arc.Center.Y * (Math.Cos(arc.StartAngleRadians) - Math.Cos(arc.StartAngleRadians + arc.SweepAngleRadians)) + arc.Radius * arc.Radius * arc.SweepAngleRadians) / 2d,
_ => 0d
});
private static LineArcProfileCurve2D Reverse(LineArcProfileCurve2D curve) => curve switch
{
+ LineArcCubicBezier2D cubic => new LineArcCubicBezier2D(cubic.End, cubic.Control2, cubic.Control1, cubic.Start),
LineArcLineSegment2D line => new LineArcLineSegment2D(line.End, line.Start),
LineArcCircularArc2D arc => new LineArcCircularArc2D(arc.Center, arc.Radius, arc.StartAngleRadians + arc.SweepAngleRadians, -arc.SweepAngleRadians),
_ => curve
@@ -976,8 +979,8 @@ public static class ProfileAuthoringParser
private static double DegreesToRadians(double value) => value * Math.PI / 180d;
private static double Heading((double X, double Y) from, (double X, double Y) to) => Math.Atan2(to.Y - from.Y, to.X - from.X) * 180d / Math.PI;
private static double Distance((double X, double Y) a, (double X, double Y) b) => Math.Sqrt((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y));
- private static (double X,double Y) Start(LineArcProfileCurve2D curve)=>curve switch{LineArcLineSegment2D line=>line.Start,LineArcCircularArc2D arc=>(arc.Center.X+arc.Radius*Math.Cos(arc.StartAngleRadians),arc.Center.Y+arc.Radius*Math.Sin(arc.StartAngleRadians)),_=>throw new InvalidOperationException()};
- private static (double X,double Y) End(LineArcProfileCurve2D curve)=>curve switch{LineArcLineSegment2D line=>line.End,LineArcCircularArc2D arc=>(arc.Center.X+arc.Radius*Math.Cos(arc.StartAngleRadians+arc.SweepAngleRadians),arc.Center.Y+arc.Radius*Math.Sin(arc.StartAngleRadians+arc.SweepAngleRadians)),_=>throw new InvalidOperationException()};
+ private static (double X,double Y) Start(LineArcProfileCurve2D curve)=>curve switch{LineArcCubicBezier2D cubic=>cubic.Start,LineArcLineSegment2D line=>line.Start,LineArcCircularArc2D arc=>(arc.Center.X+arc.Radius*Math.Cos(arc.StartAngleRadians),arc.Center.Y+arc.Radius*Math.Sin(arc.StartAngleRadians)),_=>throw new InvalidOperationException()};
+ private static (double X,double Y) End(LineArcProfileCurve2D curve)=>curve switch{LineArcCubicBezier2D cubic=>cubic.End,LineArcLineSegment2D line=>line.End,LineArcCircularArc2D arc=>(arc.Center.X+arc.Radius*Math.Cos(arc.StartAngleRadians+arc.SweepAngleRadians),arc.Center.Y+arc.Radius*Math.Sin(arc.StartAngleRadians+arc.SweepAngleRadians)),_=>throw new InvalidOperationException()};
private static bool OnLine((double X, double Y) point, LineArcLineSegment2D line) => Math.Abs((line.End.X - line.Start.X) * (point.Y - line.Start.Y) - (line.End.Y - line.Start.Y) * (point.X - line.Start.X)) < 1e-7;
private static bool OnCircle((double X, double Y) point, (double X, double Y) center, double radius) => Math.Abs(Distance(point, center) - radius) < 1e-7;
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs
index 7a747b05..6f54543d 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/SectionChainAuthoringParser.cs
@@ -80,8 +80,12 @@ public static class SectionChainAuthoringParser
correspondence.Add(new(from, to, mappings));
}
+ var tolerance = 1e-5;
+ var toleranceText = ProfileAuthoringParser.Property(declaration.Body, "ApproximationTolerance");
+ if (toleranceText is not null && (!ProfileAuthoringParser.TryMeasure(toleranceText, "mm", out tolerance) || tolerance <= 0))
+ diagnostics.Add("section-chain-normalization-tolerance-invalid:positive-length-required");
if (diagnostics.Count != 0) return Fail(diagnostics);
- var chain = new SectionChain(declaration.Name, sections, correspondence, transition, start, end, continuity);
+ var chain = new SectionChain(declaration.Name, sections, correspondence, transition, start, end, continuity, ProfileApproximationTolerance: tolerance);
if (!materialize) return new(true, chain, null, []);
var result = SectionChainMaterializer.Materialize(chain);
if (!result.IsSuccess)
@@ -93,6 +97,7 @@ public static class SectionChainAuthoringParser
private static SectionProfileSpan? Convert(ResolvedProfileSegment2D segment, List<string> diagnostics, string section) => segment.Geometry switch
{
+ LineArcCubicBezier2D cubic => new(segment.Name, new SectionProfileCurve.PolynomialBSpline(3, [new(cubic.Start.X, cubic.Start.Y), new(cubic.Control1.X, cubic.Control1.Y), new(cubic.Control2.X, cubic.Control2.Y), new(cubic.End.X, cubic.End.Y)], [4, 4], [0, 1])),
LineArcLineSegment2D line => new(segment.Name, new SectionProfileCurve.Line(new(line.Start.X, line.Start.Y), new(line.End.X, line.End.Y))),
LineArcCircularArc2D arc => new(segment.Name, new SectionProfileCurve.Arc(new(arc.Center.X, arc.Center.Y), arc.Radius, arc.StartAngleRadians, arc.SweepAngleRadians)),
_ => Unsupported(segment, diagnostics, section)
diff --git a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
index f2780b33..a7d0359f 100644
--- a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
@@ -85,6 +85,12 @@ public static class ProfileBoundaryChamferSourceBinder
target = null; radius = 0d; endClearance = 0d; diagnostic = null;
var finish = EdgeFinishHeader.Matches(source).Cast<Match>().Select(match => (Match: match, Body: Block(source, match.Index + match.Length - 1))).FirstOrDefault(x => x.Body is not null && On.IsMatch(x.Body) && string.Equals(Kind.Match(x.Body).Groups["value"].Value, "Fillet", StringComparison.Ordinal));
if (finish.Body is null) { diagnostic = "ProfileBoundaryFilletBoundaryRequired"; return false; }
+ var profileMode = Regex.Match(finish.Body, @"\bProfile\s*:\s*(?<mode>[^\s;}]+)", RegexOptions.CultureInvariant);
+ if (profileMode.Success && profileMode.Groups["mode"].Value != "Circular")
+ {
+ diagnostic = $"ProfileBoundaryFilletProfileModeUnsupported:{profileMode.Groups["mode"].Value}:polynomial-contact-shell-required";
+ return false;
+ }
var radiusMatch = Radius.Match(finish.Body); var clearanceMatch = EndClearance.Match(finish.Body);
if (!radiusMatch.Success || !double.TryParse(radiusMatch.Groups["value"].Value, NumberStyles.Float, CultureInfo.InvariantCulture, out radius) || !double.IsFinite(radius) || radius <= 0d) { diagnostic = "ProfileBoundaryFilletRadiusMustBePositive"; return false; }
var targetMatch = Target.Match(finish.Body); var on = On.Match(finish.Body);
diff --git a/Aetheris.Kernel.Firmament/Materializer/ResolvedProfile2D.cs b/Aetheris.Kernel.Firmament/Materializer/ResolvedProfile2D.cs
index 83c8f136..0cdc0b6f 100644
--- a/Aetheris.Kernel.Firmament/Materializer/ResolvedProfile2D.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/ResolvedProfile2D.cs
@@ -58,10 +58,25 @@ public static class ResolvedProfile2DValidator
var validation=Validate(profile); if(!validation.IsValid)return new(LineArcProfileExtrudeStatus.Rejected,null,validation.Diagnostics);
return LineArcProfileExtrudeEmitter.TryEmit(profile, height);
}
- private static bool Endpoints(LineArcProfileCurve2D c,out (double X,double Y) a,out (double X,double Y) b){switch(c){case LineArcLineSegment2D l:a=l.Start;b=l.End;return true;case LineArcCircularArc2D x:a=(x.Center.X+x.Radius*Math.Cos(x.StartAngleRadians),x.Center.Y+x.Radius*Math.Sin(x.StartAngleRadians));b=(x.Center.X+x.Radius*Math.Cos(x.StartAngleRadians+x.SweepAngleRadians),x.Center.Y+x.Radius*Math.Sin(x.StartAngleRadians+x.SweepAngleRadians));return true;default:a=default;b=default;return false;}}
+ private static bool Endpoints(LineArcProfileCurve2D c,out (double X,double Y) a,out (double X,double Y) b){switch(c){case LineArcCubicBezier2D z:a=z.Start;b=z.End;return true;case LineArcLineSegment2D l:a=l.Start;b=l.End;return true;case LineArcCircularArc2D x:a=(x.Center.X+x.Radius*Math.Cos(x.StartAngleRadians),x.Center.Y+x.Radius*Math.Sin(x.StartAngleRadians));b=(x.Center.X+x.Radius*Math.Cos(x.StartAngleRadians+x.SweepAngleRadians),x.Center.Y+x.Radius*Math.Sin(x.StartAngleRadians+x.SweepAngleRadians));return true;default:a=default;b=default;return false;}}
private static double Distance((double X,double Y)a,(double X,double Y)b)=>Math.Sqrt((a.X-b.X)*(a.X-b.X)+(a.Y-b.Y)*(a.Y-b.Y));
- private static double SignedAreaContribution(LineArcProfileCurve2D curve)
+ internal static double SignedAreaContribution(LineArcProfileCurve2D curve)
{
+ if (curve is LineArcCubicBezier2D cubic)
+ {
+ // Three-point Gauss integrates x*y' - y*x' (degree <= 5) exactly.
+ double Integrand(double t)
+ {
+ var u = 1 - t;
+ var x = u*u*u*cubic.Start.X + 3*u*u*t*cubic.Control1.X + 3*u*t*t*cubic.Control2.X + t*t*t*cubic.End.X;
+ var y = u*u*u*cubic.Start.Y + 3*u*u*t*cubic.Control1.Y + 3*u*t*t*cubic.Control2.Y + t*t*t*cubic.End.Y;
+ var dx = 3*(u*u*(cubic.Control1.X-cubic.Start.X)+2*u*t*(cubic.Control2.X-cubic.Control1.X)+t*t*(cubic.End.X-cubic.Control2.X));
+ var dy = 3*(u*u*(cubic.Control1.Y-cubic.Start.Y)+2*u*t*(cubic.Control2.Y-cubic.Control1.Y)+t*t*(cubic.End.Y-cubic.Control2.Y));
+ return x*dy-y*dx;
+ }
+ var d = Math.Sqrt(3d/5)/2;
+ return (5*Integrand(0.5-d)+8*Integrand(0.5)+5*Integrand(0.5+d))/36;
+ }
if (curve is LineArcCircularArc2D arc)
{
var a=(X:arc.Center.X+arc.Radius*Math.Cos(arc.StartAngleRadians),Y:arc.Center.Y+arc.Radius*Math.Sin(arc.StartAngleRadians));
diff --git a/Aetheris.Modules.Tests/SectionProfileNormalizationTests.cs b/Aetheris.Modules.Tests/SectionProfileNormalizationTests.cs
new file mode 100644
index 00000000..80a8cf0e
--- /dev/null
+++ b/Aetheris.Modules.Tests/SectionProfileNormalizationTests.cs
@@ -0,0 +1,180 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Surfacing;
+using Xunit;
+
+namespace Aetheris.Modules.Tests;
+
+public sealed class SectionProfileNormalizationTests
+{
+ [Fact]
+ public void ExistingPolynomialTracksRemainExactAndUnsupportedCurvesFailTyped()
+ {
+ var normalized = SectionProfileNormalizer.Normalize(Chain()).NormalizedChain!;
+ var repeated = SectionProfileNormalizer.Normalize(normalized);
+ Assert.True(repeated.IsSuccess);
+ Assert.Empty(repeated.Curves);
+ Assert.Equal(SectionChainCanonical.Fingerprint(normalized), SectionChainCanonical.Fingerprint(repeated.NormalizedChain!));
+ var sections = normalized.Sections.ToArray();
+ var spans = sections[0].Profile.Spans.ToArray();
+ spans[0] = spans[0] with { Curve = new UnsupportedCurve() };
+ sections[0] = sections[0] with { Profile = sections[0].Profile with { Spans = spans } };
+ Assert.Contains(SectionProfileNormalizer.Normalize(normalized with { Sections = sections }).Diagnostics,
+ d => d.Code == "section-chain-normalization-curve-unsupported");
+ var built = SectionChainMaterializer.Materialize(normalized with { Sections = sections });
+ Assert.False(built.IsSuccess);
+ Assert.Null(built.Body);
+ }
+
+ [Fact]
+ public void ChangedNormalizationGridExpandsTheReportedEditDependency()
+ {
+ Section Resize(Section section, double radius) => section with { Profile = section.Profile with {
+ Spans = section.Profile.Spans.Select(s => s with { Curve = ((SectionProfileCurve.Arc)s.Curve) with { Radius = radius } }).ToArray() } };
+ var chain = Chain();
+ chain = chain with { Sections = chain.Sections.Select(s => Resize(s, 1)).ToArray() };
+ var before = SectionProfileNormalizer.Normalize(chain);
+ var replacement = Resize(chain.Sections[0], 2);
+ var edited = SectionChainEditor.ReplaceSection(chain, replacement);
+ var after = SectionProfileNormalizer.Normalize(edited.Chain);
+ Assert.NotEqual(before.Decisions[0].SelectedSegmentCount, after.Decisions[0].SelectedSegmentCount);
+ Assert.Equal(2, edited.Delta.RecomputedTangentFields.Count);
+ Assert.Empty(edited.Delta.PreservedTerminations);
+ Assert.Empty(edited.Delta.PreservedTransitions);
+ }
+
+ private sealed record UnsupportedCurve : SectionProfileCurve;
+
+ [Fact]
+ public void ArcTracksHaveBoundedErrorCommonKnotsAndExactEndpointJets()
+ {
+ var chain = Chain();
+ var result = SectionProfileNormalizer.Normalize(chain);
+ Assert.True(result.IsSuccess, string.Join("\n", result.Diagnostics));
+ Assert.Equal(8, result.Curves.Count);
+ Assert.All(result.Curves, e =>
+ {
+ Assert.Equal(5, e.Degree);
+ Assert.True(e.CertifiedDeviationBound <= e.RequestedTolerance);
+ Assert.True(e.MaximumSampledDeviation <= e.CertifiedDeviationBound);
+ Assert.True(e.EndpointPositionError < 1e-12);
+ Assert.True(e.EndpointTangentAngleDegrees < 1e-9);
+ });
+ for (var span=0;span<4;span++)
+ {
+ var a=Assert.IsType<SectionProfileCurve.PolynomialBSpline>(result.NormalizedChain!.Sections[0].Profile.Spans[span].Curve);
+ var b=Assert.IsType<SectionProfileCurve.PolynomialBSpline>(result.NormalizedChain.Sections[1].Profile.Spans[span].Curve);
+ Assert.Equal(a.KnotValues,b.KnotValues);
+ Assert.Equal(a.KnotMultiplicities,b.KnotMultiplicities);
+ var spline=Curve(a);
+ // Analytic derivatives, including one-sided jets at all internal polynomial joins.
+ foreach(var knot in a.KnotValues.Skip(1).SkipLast(1))
+ {
+ Assert.True((spline.EvaluateTangent(knot-1e-10)-spline.EvaluateTangent(knot+1e-10)).Length < 1e-6);
+ Assert.True((spline.EvaluateSecondDerivative(knot-1e-10)-spline.EvaluateSecondDerivative(knot+1e-10)).Length < 1e-6);
+ }
+ for(var i=0;i<=4096;i++)
+ {
+ var p=spline.Evaluate(i/4096d);
+ Assert.True(Math.Abs(Math.Sqrt(p.X*p.X+p.Y*p.Y)-8) < 1e-5);
+ }
+ }
+ Assert.IsType<SectionProfileCurve.Arc>(chain.Sections[0].Profile.Spans[0].Curve);
+ Assert.Equal(result.Curves.Select(c=>c.ControlHash),SectionProfileNormalizer.Normalize(chain).Curves.Select(c=>c.ControlHash));
+ }
+
+ [Fact]
+ public void NormalizedArcChainHasSharedWatertightTopologyAndDeterministicStep()
+ {
+ var a=SectionChainMaterializer.Materialize(Chain());
+ Assert.True(a.IsSuccess,string.Join("\n",a.Diagnostics));
+ Assert.True(a.Pcurves!.LoopClosureValid);
+ Assert.All(a.Body!.Topology.Coedges.GroupBy(c=>c.EdgeId),g=>Assert.Equal(2,g.Count()));
+ var step=Step242Exporter.ExportBody(a.Body);
+ Assert.True(step.IsSuccess);
+ Assert.DoesNotContain("RATIONAL",step.Value);
+ Assert.True(Step242Importer.ImportBody(step.Value).IsSuccess);
+ Assert.Equal(step.Value,Step242Exporter.ExportBody(SectionChainMaterializer.Materialize(Chain()).Body!).Value);
+ }
+
+ [Fact]
+ public void LineOnlyG1IsNotReparameterizedAndG0RemainsRuled()
+ {
+ var lines=SectionChainTemplates.ErgonomicFairingG1();
+ var normalized=SectionProfileNormalizer.Normalize(lines);
+ Assert.Empty(normalized.Curves);
+ Assert.Equal(SectionChainCanonical.Fingerprint(lines),SectionChainCanonical.Fingerprint(normalized.NormalizedChain!));
+ var ruled=SectionChainMaterializer.Materialize(lines with { Continuity=SectionChainContinuity.G0,TransitionPolicy=SectionTransitionPolicy.Ruled });
+ Assert.True(ruled.IsSuccess,string.Join("\n",ruled.Diagnostics));
+ Assert.Null(ruled.ProfileNormalization);
+ }
+
+ [Theory]
+ [InlineData(0)]
+ [InlineData(-1)]
+ [InlineData(double.NaN)]
+ [InlineData(1e-20)]
+ public void ImpossibleToleranceFailsWithoutBody(double tolerance)
+ {
+ var result=SectionChainMaterializer.Materialize(Chain() with { ProfileApproximationTolerance=tolerance });
+ Assert.False(result.IsSuccess);
+ Assert.Null(result.Body);
+ Assert.Contains(result.Diagnostics,d=>d.Code.StartsWith("section-chain-normalization-tolerance"));
+ }
+
+ [Theory]
+ [InlineData(0,1)]
+ [InlineData(8,0)]
+ [InlineData(-8,1)]
+ [InlineData(8,7)]
+ public void DegenerateArcFailsTyped(double radius,double sweep)
+ {
+ var chain=Chain();var sections=chain.Sections.ToArray();var spans=sections[0].Profile.Spans.ToArray();
+ spans[0]=spans[0] with {Curve=new SectionProfileCurve.Arc(new(0,0),radius,0,sweep)};
+ sections[0]=sections[0] with {Profile=sections[0].Profile with {Spans=spans}};
+ var result=SectionProfileNormalizer.Normalize(chain with {Sections=sections});
+ Assert.False(result.IsSuccess);
+ Assert.Contains(result.Diagnostics,d=>d.Code=="section-chain-normalization-arc-invalid");
+ }
+
+ [Fact]
+ public void MixedLineArcCorrespondenceNormalizesLineExactly()
+ {
+ var chain=Chain();var sections=chain.Sections.ToArray();var spans=sections[0].Profile.Spans.ToArray();
+ spans[0]=spans[0] with {Curve=new SectionProfileCurve.Line(new(8,0),new(0,8))};
+ sections[0]=sections[0] with {Profile=sections[0].Profile with {Spans=spans}};
+ var result=SectionProfileNormalizer.Normalize(chain with {Sections=sections});
+ Assert.True(result.IsSuccess);
+ var c=Curve((SectionProfileCurve.PolynomialBSpline)result.NormalizedChain!.Sections[0].Profile.Spans[0].Curve);
+ for(var i=0;i<=100;i++) Assert.True((c.Evaluate(i/100d)-new Point3D(8-8*i/100d,8*i/100d,0)).Length < 1e-12);
+ }
+
+ [Fact]
+ public void TopologyMismatchFailsBeforeNormalization()
+ {
+ var chain=Chain();var sections=chain.Sections.ToArray();
+ sections[1]=sections[1] with {Profile=sections[1].Profile with {Spans=sections[1].Profile.Spans.Take(3).ToArray()}};
+ Assert.Contains(SectionProfileNormalizer.Normalize(chain with {Sections=sections}).Diagnostics,d=>d.Code=="section-chain-correspondence-topology-mismatch");
+ }
+
+ [Fact]
+ public void NormalizationDoesNotEraseSourceLineArcCurvatureJump()
+ {
+ var result=SectionProfileNormalizer.Normalize(Chain());
+ var c=Curve((SectionProfileCurve.PolynomialBSpline)result.NormalizedChain!.Sections[0].Profile.Spans[0].Curve);
+ var d=c.EvaluateTangent(0);var dd=c.EvaluateSecondDerivative(0);
+ var curvature=d.Cross(dd).Length/Math.Pow(d.Length,3);
+ Assert.InRange(curvature,1d/8-1e-10,1d/8+1e-10);
+ // An adjacent straight profile has curvature zero. Normalization is not a G2 repair.
+ Assert.True(curvature>0.12);
+ }
+
+ private static BSpline3Curve Curve(SectionProfileCurve.PolynomialBSpline c)=>new(c.Degree,c.ControlPoints.Select(p=>new Point3D(p.X,p.Y,0)).ToArray(),c.KnotMultiplicities,c.KnotValues,"UNSPECIFIED",false,false,"UNSPECIFIED");
+ private static SectionChain Chain()
+ {
+ Section Section(string name,double radius,double z)=>new(name,SectionFrame.Create(new(0,0,z),new(1,0,0),new(0,1,0)),
+ new(name+"Profile",Enumerable.Range(0,4).Select(i=>new SectionProfileSpan("Arc"+i,new SectionProfileCurve.Arc(new(0,0),radius,i*Math.PI/2,Math.PI/2))).ToArray(),"Arc0"));
+ return new("ArcNormalization",[Section("A",8,0),Section("B",9,12)],[],SectionTransitionPolicy.SmoothPolynomial,SectionTermination.Cap,SectionTermination.Cap,SectionChainContinuity.G1);
+ }
+}
diff --git a/Aetheris.Surfacing/BoundedPcurveBuilder.cs b/Aetheris.Surfacing/BoundedPcurveBuilder.cs
index ad61b080..3e433345 100644
--- a/Aetheris.Surfacing/BoundedPcurveBuilder.cs
+++ b/Aetheris.Surfacing/BoundedPcurveBuilder.cs
@@ -1,3 +1,4 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
using Aetheris.Kernel.Core.Brep;
using Aetheris.Kernel.Core.Geometry;
using Aetheris.Kernel.Core.Geometry.Surfaces;
@@ -29,6 +30,13 @@ public static class BoundedPcurveBuilder
diagnostics.Add(new("surf-pcurve-invalid", $"Coedge {coedge.Id.Value} has no bounded 3D edge curve.", coedge.Id.Value.ToString()));
continue;
}
+ if (bindings.TryGetPcurveBinding(coedge.Id, out var retained))
+ {
+ var residual = MaximumResidual(surface, curve, retained.Pcurve, interval, sampleCount);
+ if (retained.FaceId != face.Id || retained.SurfaceGeometryId != faceBinding.SurfaceGeometryId || residual > tolerance)
+ diagnostics.Add(new("surf-pcurve-invalid", "Retained pcurve has inconsistent ownership or geometry.", coedge.Id.Value.ToString()));
+ maximum = double.Max(maximum, residual); count++; continue;
+ }
var built = Build(surface, curve, interval, tolerance, sampleCount);
if (built.Pcurve is null)
{
@@ -60,6 +68,17 @@ public static class BoundedPcurveBuilder
new(cosinePoint.U - center.U, cosinePoint.V - center.V),
new(sinePoint.U - center.U, sinePoint.V - center.V)), 0d, null);
}
+ if (curve.BSpline3 is { } polynomial)
+ {
+ // Affine projection commutes with B-spline evaluation. The hull bound
+ // certifies the whole 3D curve lies on this support, without fitting.
+ var bound = polynomial.ControlPoints.Max(p => double.Abs((p - plane.Origin).Dot(plane.Normal.ToVector())));
+ if (bound > tolerance) return (null, bound, "Polynomial edge control hull is not on the planar support.");
+ var controls = polynomial.ControlPoints.Select(p => { var uv = PlaneUv(plane, p); return new Point3D(uv.U, uv.V, 0); }).ToArray();
+ var uvCurve = new BSpline3Curve(polynomial.Degree, controls, polynomial.KnotMultiplicities, polynomial.KnotValues,
+ polynomial.CurveForm, polynomial.ClosedCurve, polynomial.SelfIntersect, polynomial.KnotSpec);
+ return (PcurveGeometry.Polynomial(interval, uvCurve), bound, null);
+ }
var lineCandidate = PcurveGeometry.Line(interval, start, end);
var lineResidual = MaximumResidual(surface, curve, lineCandidate, interval, 67);
if (lineResidual <= tolerance) return (lineCandidate, lineResidual, null);
diff --git a/Aetheris.Surfacing/PlanarPlateauContacts.cs b/Aetheris.Surfacing/PlanarPlateauContacts.cs
new file mode 100644
index 00000000..02df8ba8
--- /dev/null
+++ b/Aetheris.Surfacing/PlanarPlateauContacts.cs
@@ -0,0 +1,134 @@
+using Aetheris.Kernel.Core.Brep.EdgeFinishing;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Geometry.Surfaces;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Surfacing;
+
+public sealed record PlanarPlateauContactSpan(string SourceSpanId, string BaseContactId, string TopContactId,
+ BSpline3Curve BaseContact, BSpline3Curve MiddleContact, BSpline3Curve TopContact,
+ IReadOnlyList<BSplineSurfaceWithKnots> Patches, string Exactness = "ExactAffinePolynomial", string ParameterDirection = "SourceForward");
+public sealed record PlanarPlateauContactPlan(string StableId, string BaseSupportId, string TopSupportId,
+ SectionFrame Frame, SectionPoint2D Center, double Height, double Width, double TopScale, string Seam,
+ IReadOnlyList<PlanarPlateauContactSpan> Spans, IReadOnlyList<SectionChainGeometricJoinEvidence> Joins);
+public sealed record PlanarPlateauContactResult(PlanarPlateauContactPlan? Plan, IReadOnlyList<string> Diagnostics)
+{
+ public bool IsSuccess => Plan is not null && Diagnostics.Count == 0;
+}
+
+/// <summary>
+/// Exact homothetic contact band on parallel planes. Width is the inset on the
+/// footprint's shorter bounding-box half-axis; other radial insets scale with it.
+/// This is an explicit affine construction, not an approximation to a normal offset.
+/// </summary>
+public static class PlanarPlateauContacts
+{
+ public static PlanarPlateauContactResult Build(string name, SectionProfile footprint, SectionFrame frame,
+ double height, double width, string baseSupportId, string topSupportId)
+ {
+ PlanarPlateauContactResult Fail(string reason) => new(null, ["plateau-" + reason]);
+ if (!double.IsFinite(width) || width <= 0) return Fail("width-must-be-positive");
+ if (!double.IsFinite(height) || height <= 0) return Fail("height-must-be-positive");
+ if (footprint.Spans.Count < 3 || footprint.Spans.Select(s => s.SpanId).Distinct().Count() != footprint.Spans.Count ||
+ !footprint.Spans.Any(s => s.SpanId == footprint.SeamSpanId)) return Fail("footprint-identity-invalid");
+ if (Math.Abs(frame.XAxis.ToVector().Dot(frame.YAxis.ToVector())) > 1e-12 ||
+ (frame.XAxis.ToVector().Cross(frame.YAxis.ToVector()) - frame.Normal.ToVector()).Length > 1e-12)
+ return Fail("frame-invalid");
+ var curves = new List<BSpline3Curve>();
+ foreach (var span in footprint.Spans)
+ {
+ switch (span.Curve)
+ {
+ case SectionProfileCurve.Line line:
+ curves.Add(new(1, [new(line.Start.X, line.Start.Y, 0), new(line.End.X, line.End.Y, 0)], [2, 2], [0, 1], "UNSPECIFIED", false, false, "UNSPECIFIED")); break;
+ case SectionProfileCurve.PolynomialBSpline spline when spline.Degree is >= 1 and <= 3 &&
+ spline.ControlPoints.Count == spline.Degree + 1 && spline.KnotValues.SequenceEqual(new double[] { 0, 1 }) &&
+ spline.KnotMultiplicities.SequenceEqual(new[] { spline.Degree + 1, spline.Degree + 1 }):
+ curves.Add(new(spline.Degree, spline.ControlPoints.Select(p => new Point3D(p.X, p.Y, 0)).ToArray(),
+ spline.KnotMultiplicities, spline.KnotValues, "UNSPECIFIED", false, false, "UNSPECIFIED")); break;
+ default: return Fail("footprint-curve-unsupported:" + span.SpanId);
+ }
+ }
+ var controls = curves.SelectMany(c => c.ControlPoints).ToArray();
+ if (controls.Any(p => !double.IsFinite(p.X) || !double.IsFinite(p.Y))) return Fail("footprint-nonfinite");
+ var cx = (controls.Min(p => p.X) + controls.Max(p => p.X)) / 2;
+ var cy = (controls.Min(p => p.Y) + controls.Max(p => p.Y)) / 2;
+ var half = Math.Min(controls.Max(p => p.X) - controls.Min(p => p.X), controls.Max(p => p.Y) - controls.Min(p => p.Y)) / 2;
+ if (half <= 1e-8) return Fail("footprint-degenerate");
+ if (width >= half) return Fail("width-collapses-footprint");
+ var center = new Point3D(cx, cy, 0); var winding = 0d;
+ for (var index = 0; index < curves.Count; index++)
+ {
+ var c = curves[index]; var next = curves[(index + 1) % curves.Count];
+ if ((c.ControlPoints[^1] - next.ControlPoints[0]).Length > 1e-8) return Fail("footprint-open");
+ var a = c.ControlPoints[0] - center; var b = c.ControlPoints[^1] - center;
+ var angle = Math.Atan2(a.Cross(b).Z, a.Dot(b));
+ if (angle <= 0 || angle >= Math.PI) return Fail("footprint-not-star-shaped");
+ winding += angle;
+ if (c.ControlPoints.Any(p => a.Cross(p - center).Z < -1e-10 || (p - center).Cross(b).Z < -1e-10))
+ return Fail("footprint-control-hull-outside-sector");
+ // Bernstein coefficients certify positive angular derivative on the whole
+ // span. Together with disjoint angular sectors and one turn this proves
+ // a regular simple loop and nested nonintersecting affine contact rings.
+ var n = c.Degree;
+ for (var k = 0; k <= 2 * n - 1; k++)
+ {
+ var coefficient = 0d;
+ for (var i = 0; i <= n; i++)
+ {
+ var j = k - i; if (j < 0 || j >= n) continue;
+ coefficient += Choose(n, i) * Choose(n - 1, j) / Choose(2 * n - 1, k) *
+ (c.ControlPoints[i] - center).Cross((c.ControlPoints[j + 1] - c.ControlPoints[j]) * n).Z;
+ }
+ if (coefficient <= 1e-12) return Fail("footprint-angular-regularity-unproven:" + footprint.Spans[index].SpanId);
+ }
+ }
+ if (Math.Abs(winding - 2 * Math.PI) > 1e-8) return Fail("footprint-winding-invalid");
+ var scale = 1 - width / half;
+ // Compose the already-qualified quarter twice: concave entry, convex exit.
+ // Affine scaling changes dimensions, not the cross-section law.
+ var laws = new[] {
+ CurvatureContinuousFilletSection.CreateQuarter(new(0, 0, 0), new(.5, .5, 0), new(0, .5, 0)),
+ CurvatureContinuousFilletSection.CreateQuarter(new(.5, .5, 0), new(1, 1, 0), new(1, .5, 0)) };
+ var spans = new List<PlanarPlateauContactSpan>();
+ Point3D World(Point3D p, double inset, double rise) => frame.Transform(new(cx + (p.X - cx) * (1 - inset * (1 - scale)),
+ cy + (p.Y - cy) * (1 - inset * (1 - scale)))) + frame.Normal.ToVector() * (rise * height);
+ foreach (var (curve, index) in curves.Select((c, i) => (c, i)))
+ {
+ BSpline3Curve Contact(double inset, double rise) => new(curve.Degree, curve.ControlPoints.Select(p => World(p, inset, rise)).ToArray(),
+ curve.KnotMultiplicities, curve.KnotValues, "UNSPECIFIED", false, false, "UNSPECIFIED");
+ var patches = laws.Select(law => new BSplineSurfaceWithKnots(curve.Degree, 5,
+ curve.ControlPoints.Select(p => (IReadOnlyList<Point3D>)law.ControlPoints.Select(q => World(p, q.X, q.Y)).ToArray()).ToArray(),
+ "UNSPECIFIED", false, false, false, curve.KnotMultiplicities, [6, 6], curve.KnotValues, [0, 1], "UNSPECIFIED")).ToArray();
+ var id = footprint.Spans[index].SpanId;
+ spans.Add(new(id, name + ".BaseContact." + id, name + ".TopContact." + id, Contact(0, 0), Contact(.5, .5), Contact(1, 1), patches));
+ }
+ var joins = new List<SectionChainGeometricJoinEvidence>();
+ foreach (var (span, index) in spans.Select((s, i) => (s, i)))
+ {
+ var next = spans[(index + 1) % spans.Count];
+ SmoothSectionChainTransitionPatch Patch(BSplineSurfaceWithKnots s) => new(s);
+ joins.Add(SectionChainDifferentialInspection.Measure(name + ".Middle." + span.SourceSpanId, "SectionQuarterJoin", Patch(span.Patches[0]), Patch(span.Patches[1]), true));
+ for (var stage = 0; stage < 2; stage++)
+ joins.Add(SectionChainDifferentialInspection.Measure(name + ".Neighbor." + span.SourceSpanId + "." + stage, "NeighboringFootprintSpans", Patch(span.Patches[stage]), Patch(next.Patches[stage]), false));
+ BSplineSurfaceWithKnots PlanePatch(BSpline3Curve c, bool before)
+ {
+ var worldCenter = frame.Transform(new(cx, cy));
+ return new(c.Degree, 1, c.ControlPoints.Select(p => (IReadOnlyList<Point3D>)(before
+ ? new[] { p + (p - (worldCenter + frame.Normal.ToVector() * (p - worldCenter).Dot(frame.Normal.ToVector()))) * .01, p }
+ : new[] { p, p - (p - (worldCenter + frame.Normal.ToVector() * height)) * .01 })).ToArray(),
+ "UNSPECIFIED", false, false, false, c.KnotMultiplicities, [2, 2], c.KnotValues, [0, 1], "UNSPECIFIED");
+ }
+ joins.Add(SectionChainDifferentialInspection.Measure(span.BaseContactId, "BaseSupport", Patch(PlanePatch(span.BaseContact, true)), Patch(span.Patches[0]), true));
+ joins.Add(SectionChainDifferentialInspection.Measure(span.TopContactId, "TopSupport", Patch(span.Patches[1]), Patch(PlanePatch(span.TopContact, false)), true));
+ }
+ if (joins.Where(j => j.BoundaryKind != "NeighboringFootprintSpans").Any(j => j.Status != "G2WithinSampledTolerance")) return Fail("support-continuity-failed");
+ return new(new(name, baseSupportId, topSupportId, frame, new(cx, cy), height, width, scale,
+ name + ".Seam." + footprint.SeamSpanId, spans, joins), []);
+ }
+
+ private static double Choose(int n, int k)
+ {
+ var value = 1d; for (var i = 1; i <= k; i++) value = value * (n - i + 1) / i; return value;
+ }
+}
diff --git a/Aetheris.Surfacing/PlanarPlateauMaterializer.cs b/Aetheris.Surfacing/PlanarPlateauMaterializer.cs
new file mode 100644
index 00000000..381ce818
--- /dev/null
+++ b/Aetheris.Surfacing/PlanarPlateauMaterializer.cs
@@ -0,0 +1,169 @@
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Geometry.Surfaces;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Topology;
+
+namespace Aetheris.Surfacing;
+
+public sealed record PlanarPlateauFaceIdentity(string Identity, int FaceId, int LoopCount, int EdgeCount);
+public sealed record PlanarPlateauMaterializationResult(BrepBody? Body, BrepPcurveEvidence? Pcurves,
+ IReadOnlyList<PlanarPlateauFaceIdentity> Faces, IReadOnlyList<string> Diagnostics)
+{
+ public bool IsSuccess => Body is not null && Diagnostics.Count == 0;
+}
+
+/// <summary>Local planar-face graft. Retains source topology IDs and adds one hole, the band, and the raised cap.</summary>
+public static class PlanarPlateauMaterializer
+{
+ public static PlanarPlateauMaterializationResult Apply(BrepBody source, FaceId supportFace, PlanarPlateauContactPlan plan)
+ {
+ PlanarPlateauMaterializationResult Fail(string message) => new(null, null, [], ["plateau-" + message]);
+ if (!source.Bindings.TryGetFaceBinding(supportFace, out var supportBinding) || !supportBinding.SameSense ||
+ source.Geometry.GetSurface(supportBinding.SurfaceGeometryId).Plane is not { } plane ||
+ (plane.Normal.ToVector() - plan.Frame.Normal.ToVector()).Length > 1e-10 ||
+ Math.Abs((plan.Frame.Origin - plane.Origin).Dot(plane.Normal.ToVector())) > 1e-8)
+ return Fail("support-plane-mismatch");
+ var support = source.Topology.GetFace(supportFace);
+ if (source.Topology.Shells.Count() != 1 || support.LoopIds.Count != 1) return Fail("support-topology-unsupported");
+ // Retain the source shell's loop convention, including historical clockwise
+ // outer loops. New face loops use that same convention; the hole opposes it.
+ var signedArea = 0d;
+ foreach (var use in source.Topology.GetLoop(support.LoopIds[0]).CoedgeIds.Select(source.Topology.GetCoedge))
+ {
+ var binding = source.Bindings.GetEdgeBinding(use.EdgeId); var geometryCurve = source.Geometry.GetCurve(binding.CurveGeometryId);
+ if (binding.TrimInterval is not { } trim) return Fail("support-trim-missing");
+ var sign = (use.IsReversed ? -1 : 1) * (binding.OrientedEdgeSense ? 1 : -1);
+ (double X, double Y) Uv(Point3D point) { var d = point - plane.Origin; return (d.Dot(plane.UAxis.ToVector()), d.Dot(plane.VAxis.ToVector())); }
+ if (geometryCurve.Line3 is { } line)
+ {
+ var a = Uv(line.Evaluate(trim.Start)); var b = Uv(line.Evaluate(trim.End)); signedArea += sign * (a.X * b.Y - b.X * a.Y) / 2;
+ }
+ else if (geometryCurve.Circle3 is { } arc)
+ {
+ var a = Uv(arc.Evaluate(trim.Start)); var b = Uv(arc.Evaluate(trim.End)); var c = Uv(arc.Center);
+ signedArea += sign * (c.X * (b.Y - a.Y) - c.Y * (b.X - a.X) + arc.Radius * arc.Radius *
+ arc.Normal.ToVector().Dot(plane.Normal.ToVector()) * (trim.End - trim.Start)) / 2;
+ }
+ else return Fail("support-boundary-unsupported");
+ }
+ if (Math.Abs(signedArea) <= 1e-8) return Fail("support-winding-degenerate");
+ var winding = Math.Sign(signedArea);
+ var contacts = plan.Spans.SelectMany(s => s.BaseContact.ControlPoints).ToArray();
+ foreach (var coedge in source.Topology.GetLoop(support.LoopIds[0]).CoedgeIds.Select(source.Topology.GetCoedge))
+ {
+ var edge = source.Bindings.GetEdgeBinding(coedge.EdgeId);
+ var curve = source.Geometry.GetCurve(edge.CurveGeometryId);
+ var sign = (coedge.IsReversed ? -1 : 1) * (edge.OrientedEdgeSense ? 1 : -1);
+ if (curve.Line3 is { } line)
+ {
+ var normal = (line.Direction.ToVector() * (sign * winding)).Cross(plane.Normal.ToVector());
+ if (contacts.Any(p => (p - line.Origin).Dot(normal) >= -1e-7)) return Fail("contact-outside-support");
+ }
+ else if (curve.Circle3 is { } circle && edge.TrimInterval is { } interval)
+ {
+ if (circle.Normal.ToVector().Dot(plane.Normal.ToVector()) * sign * winding <= 0) return Fail("reflex-support-arc-unsupported");
+ foreach (var p in contacts)
+ {
+ var delta = p - circle.Center; var x = delta.Dot(circle.XAxis.ToVector()); var y = delta.Dot(circle.YAxis.ToVector());
+ double Distance(double t) => x * Math.Cos(t) + y * Math.Sin(t);
+ var max = Math.Max(Distance(interval.Start), Distance(interval.End));
+ var angle = Math.Atan2(y, x);
+ var t = angle + Math.Ceiling((interval.Start - angle) / (2 * Math.PI)) * 2 * Math.PI;
+ if (t <= interval.End) max = Math.Max(max, Math.Sqrt(x * x + y * y));
+ if (max >= circle.Radius - 1e-7) return Fail("contact-outside-support");
+ }
+ }
+ else return Fail("support-boundary-unsupported");
+ }
+ var topology = new TopologyModel(); var geometry = new BrepGeometryStore(); var bindings = new BrepBindingModel();
+ foreach (var v in source.Topology.Vertices) topology.AddVertex(v);
+ foreach (var e in source.Topology.Edges) topology.AddEdge(e);
+ foreach (var e in source.Topology.Coedges) topology.AddCoedge(e);
+ foreach (var l in source.Topology.Loops) topology.AddLoop(l);
+ foreach (var f in source.Topology.Faces.Where(f => f.Id != supportFace)) topology.AddFace(f);
+ foreach (var b in source.Topology.Bodies) topology.AddBody(b);
+ foreach (var c in source.Geometry.Curves) geometry.AddCurve(c.Key, c.Value);
+ foreach (var s in source.Geometry.Surfaces) geometry.AddSurface(s.Key, s.Value);
+ foreach (var e in source.Bindings.EdgeBindings) bindings.AddEdgeBinding(e);
+ foreach (var f in source.Bindings.FaceBindings) bindings.AddFaceBinding(f);
+ foreach (var pc in source.Bindings.PcurveBindings) bindings.AddPcurveBinding(pc);
+ var points = source.Topology.Vertices.Where(v => source.TryGetVertexPoint(v.Id, out _)).ToDictionary(v => v.Id,
+ v => { source.TryGetVertexPoint(v.Id, out var p); return p; });
+ var vertexId = source.Topology.Vertices.Max(v => v.Id.Value) + 1;
+ var edgeId = source.Topology.Edges.Max(e => e.Id.Value) + 1;
+ var coedgeId = source.Topology.Coedges.Max(e => e.Id.Value) + 1;
+ var loopId = source.Topology.Loops.Max(l => l.Id.Value) + 1;
+ var faceId = source.Topology.Faces.Max(f => f.Id.Value) + 1;
+ var curveId = source.Geometry.Curves.Max(c => c.Key.Value) + 1;
+ var surfaceId = source.Geometry.Surfaces.Max(s => s.Key.Value) + 1;
+ var count = plan.Spans.Count;
+ var vertices = new VertexId[3][]; var rings = new EdgeId[3][];
+ for (var ring = 0; ring < 3; ring++)
+ {
+ vertices[ring] = new VertexId[count]; rings[ring] = new EdgeId[count];
+ for (var i = 0; i < count; i++)
+ {
+ var id = new VertexId(vertexId++); vertices[ring][i] = id; topology.AddVertex(new(id));
+ points[id] = Contact(i, ring).Evaluate(0);
+ }
+ for (var i = 0; i < count; i++) rings[ring][i] = Edge(vertices[ring][i], vertices[ring][(i + 1) % count], Contact(i, ring));
+ }
+ var addedFaces = new List<FaceId>(); var identities = new List<PlanarPlateauFaceIdentity>();
+ var hole = Loop(rings[0].Reverse().Select(e => (e, true)).ToArray());
+ topology.AddFace(new(supportFace, support.LoopIds.Concat(new[] { hole }).ToArray()));
+ identities.Add(new(plan.BaseSupportId, supportFace.Value, 2, source.Topology.GetLoop(support.LoopIds[0]).CoedgeIds.Count + count));
+ for (var stage = 0; stage < 2; stage++)
+ {
+ var seams = new EdgeId[count];
+ for (var i = 0; i < count; i++) seams[i] = Edge(vertices[stage][i], vertices[stage + 1][i],
+ new BSpline3Curve(5, plan.Spans[i].Patches[stage].ControlPoints[0], [6, 6], [0, 1], "UNSPECIFIED", false, false, "UNSPECIFIED"));
+ for (var i = 0; i < count; i++)
+ {
+ var loop = Loop([(rings[stage][i], false), (seams[(i + 1) % count], false), (rings[stage + 1][i], true), (seams[i], true)]);
+ var face = new FaceId(faceId++); topology.AddFace(new(face, [loop])); addedFaces.Add(face);
+ var id = new SurfaceGeometryId(surfaceId++); geometry.AddSurface(id, SurfaceGeometry.FromBSplineSurfaceWithKnots(plan.Spans[i].Patches[stage])); bindings.AddFaceBinding(new(face, id));
+ var uv = new[] { (new SurfaceParameterPoint(0, 0), new SurfaceParameterPoint(1, 0)),
+ (new SurfaceParameterPoint(1, 0), new SurfaceParameterPoint(1, 1)),
+ (new SurfaceParameterPoint(0, 1), new SurfaceParameterPoint(1, 1)),
+ (new SurfaceParameterPoint(0, 0), new SurfaceParameterPoint(0, 1)) };
+ foreach (var coedge in topology.GetLoop(loop).CoedgeIds)
+ {
+ var edge = topology.GetCoedge(coedge).EdgeId;
+ var k = edge == rings[stage][i] ? 0 : edge == seams[(i + 1) % count] ? 1 : edge == rings[stage + 1][i] ? 2 : 3;
+ bindings.AddPcurveBinding(new(coedge, face, id, PcurveGeometry.Line(new(0, 1), uv[k].Item1, uv[k].Item2)));
+ }
+ identities.Add(new(plan.StableId + ".Blend." + plan.Spans[i].SourceSpanId + "." + stage, face.Value, 1, 4));
+ }
+ }
+ var topLoop = Loop(rings[2].Select(e => (e, false)).ToArray()); var topFace = new FaceId(faceId++);
+ topology.AddFace(new(topFace, [topLoop])); addedFaces.Add(topFace);
+ var topSurface = new SurfaceGeometryId(surfaceId++);
+ geometry.AddSurface(topSurface, SurfaceGeometry.FromPlane(new PlaneSurface(plan.Frame.Origin + plan.Frame.Normal.ToVector() * plan.Height, plan.Frame.Normal, plan.Frame.XAxis)));
+ bindings.AddFaceBinding(new(topFace, topSurface)); identities.Add(new(plan.TopSupportId, topFace.Value, 1, count));
+ var shell = source.Topology.Shells.Single(); topology.AddShell(new(shell.Id, shell.FaceIds.Concat(addedFaces).ToArray()));
+ var body = new BrepBody(topology, geometry, bindings, points);
+ var populated = BoundedPcurveBuilder.Populate(topology, geometry, bindings, 1e-5);
+ if (!populated.IsSuccess) return Fail("pcurve-build:" + string.Join("|", populated.Diagnostics));
+ var evidence = BrepPcurveValidator.Validate(body, 1e-5, requireEveryCoedge: true);
+ if (!evidence.IsValid) return Fail("pcurve-invalid:" + string.Join("|", evidence.Diagnostics));
+ var preflight = BrepExportPreflight.Validate(body);
+ if (!preflight.IsValid) return Fail("brep-invalid:" + string.Join("|", preflight.Diagnostics.Where(d => d.Severity == BrepExportPreflightSeverity.Error).Select(d => d.Message)));
+ return new(body, evidence, identities, []);
+
+ BSpline3Curve Contact(int i, int ring) => ring == 0 ? plan.Spans[i].BaseContact : ring == 1 ? plan.Spans[i].MiddleContact : plan.Spans[i].TopContact;
+ EdgeId Edge(VertexId a, VertexId b, BSpline3Curve curve)
+ {
+ var edge = new EdgeId(edgeId++); topology.AddEdge(new(edge, a, b));
+ var id = new CurveGeometryId(curveId++); geometry.AddCurve(id, CurveGeometry.FromBSpline(curve)); bindings.AddEdgeBinding(new(edge, id, new(0, 1))); return edge;
+ }
+ LoopId Loop(IReadOnlyList<(EdgeId Edge, bool Reversed)> uses)
+ {
+ if (winding < 0) uses = uses.Reverse().Select(use => (use.Edge, !use.Reversed)).ToArray();
+ var id = new LoopId(loopId++); var ids = uses.Select(_ => new CoedgeId(coedgeId++)).ToArray();
+ for (var i = 0; i < ids.Length; i++) topology.AddCoedge(new(ids[i], uses[i].Edge, id, ids[(i + 1) % ids.Length], ids[(i + ids.Length - 1) % ids.Length], uses[i].Reversed));
+ topology.AddLoop(new(id, ids)); return id;
+ }
+ }
+}
diff --git a/Aetheris.Surfacing/SectionChainDifferentialInspection.cs b/Aetheris.Surfacing/SectionChainDifferentialInspection.cs
new file mode 100644
index 00000000..3f4d84dc
--- /dev/null
+++ b/Aetheris.Surfacing/SectionChainDifferentialInspection.cs
@@ -0,0 +1,62 @@
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Geometry.Surfaces;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Surfacing;
+
+public sealed record SectionChainGeometricJoinEvidence(string BoundaryIdentity, string BoundaryKind,
+ double MaximumPositionError, double MaximumNormalAngleDegrees, double? MaximumShapeOperatorResidual,
+ int SampleCount, string Status, string Method);
+
+/// <summary>Geometric inspection of realized polynomial patches, independent of continuity labels.</summary>
+internal static class SectionChainDifferentialInspection
+{
+ public static SectionChainGeometricJoinEvidence Measure(string identity, string kind,
+ SmoothSectionChainTransitionPatch incoming, SmoothSectionChainTransitionPatch outgoing, bool acrossSections)
+ {
+ var position=0d;var angle=0d;var curvature=0d;var regular=true;
+ // Include normalized arc knot boundaries as well as the regular sample grid.
+ var samples=Enumerable.Range(0,33).Select(i=>i/32d)
+ .Concat(acrossSections?incoming.Spline.KnotValuesU:incoming.Spline.KnotValuesV).Distinct().Order().ToArray();
+ foreach(var t in samples)
+ {
+ var a=Jet(incoming.Spline,acrossSections?t:1,acrossSections?1:t);
+ var b=Jet(outgoing.Spline,acrossSections?t:0,acrossSections?0:t);
+ position=Math.Max(position,(a.P-b.P).Length);
+ if (!a.Du.Cross(a.Dv).TryNormalize(out var na) || !b.Du.Cross(b.Dv).TryNormalize(out var nb))
+ { regular=false;continue; }
+ angle=Math.Max(angle,Math.Atan2(na.Cross(nb).Length,na.Dot(nb))*180/Math.PI);
+ var tangent=acrossSections?a.Du:a.Dv;
+ if(!tangent.TryNormalize(out var e1)){regular=false;continue;}
+ var e2=na.Cross(e1);
+ // Compare the second fundamental forms in one orthonormal world tangent basis.
+ // This is invariant to parameter speed; a raw d2/dv2 comparison would not be G2.
+ if (!Form(a,na,e1,e2,out var aa) || !Form(b,nb,e1,e2,out var bb)) {regular=false;continue;}
+ curvature=Math.Max(curvature,Math.Sqrt(Math.Pow(aa.K11-bb.K11,2)+2*Math.Pow(aa.K12-bb.K12,2)+Math.Pow(aa.K22-bb.K22,2)));
+ }
+ var status=!regular?"Singular":position>1e-7?"BelowG0":angle>1e-3?"G0":curvature>1e-6?"G1":"G2WithinSampledTolerance";
+ return new(identity,kind,position,angle,regular?curvature:null,samples.Length,status,
+ "Analytic tensor B-spline first/second derivatives; Frobenius residual of second fundamental forms in a shared orthonormal world tangent basis. Curvature status requires G0/G1 first. Sampling is not a global proof.");
+ }
+
+ private static bool Form(PatchJet j,Vector3D n,Vector3D e1,Vector3D e2,out (double K11,double K12,double K22) form)
+ {
+ form=default;var E=j.Du.Dot(j.Du);var F=j.Du.Dot(j.Dv);var G=j.Dv.Dot(j.Dv);var determinant=E*G-F*F;
+ if(!double.IsFinite(determinant)||determinant<=1e-20)return false;
+ (double U,double V) Map(Vector3D v)=>( (G*j.Du.Dot(v)-F*j.Dv.Dot(v))/determinant, (E*j.Dv.Dot(v)-F*j.Du.Dot(v))/determinant );
+ var a=Map(e1);var b=Map(e2);var l=n.Dot(j.Duu);var m=n.Dot(j.Duv);var r=n.Dot(j.Dvv);
+ double B((double U,double V) x,(double U,double V) y)=>l*x.U*y.U+m*(x.U*y.V+x.V*y.U)+r*x.V*y.V;
+ form=(B(a,a),B(a,b),B(b,b));return double.IsFinite(form.K11)&&double.IsFinite(form.K12)&&double.IsFinite(form.K22);
+ }
+ private static PatchJet Jet(BSplineSurfaceWithKnots s,double u,double v)
+ {
+ BSpline3Curve U(IReadOnlyList<Point3D> controls)=>new(s.DegreeU,controls,s.KnotMultiplicitiesU,s.KnotValuesU,"UNSPECIFIED",false,false,"UNSPECIFIED");
+ var rows=s.ControlPoints.Select(row=>new BSpline3Curve(s.DegreeV,row,s.KnotMultiplicitiesV,s.KnotValuesV,"UNSPECIFIED",false,false,"UNSPECIFIED")).ToArray();
+ var value=U(rows.Select(c=>c.Evaluate(v)).ToArray());
+ var first=U(rows.Select(c=>Point3D.Origin+c.EvaluateTangent(v)).ToArray());
+ var second=U(rows.Select(c=>Point3D.Origin+c.EvaluateSecondDerivative(v)).ToArray());
+ return new(value.Evaluate(u),value.EvaluateTangent(u),first.Evaluate(u)-Point3D.Origin,
+ value.EvaluateSecondDerivative(u),first.EvaluateTangent(u),second.Evaluate(u)-Point3D.Origin);
+ }
+ private sealed record PatchJet(Point3D P,Vector3D Du,Vector3D Dv,Vector3D Duu,Vector3D Duv,Vector3D Dvv);
+}
diff --git a/Aetheris.Surfacing/SectionChains.cs b/Aetheris.Surfacing/SectionChains.cs
index c788201e..f3740ce7 100644
--- a/Aetheris.Surfacing/SectionChains.cs
+++ b/Aetheris.Surfacing/SectionChains.cs
@@ -67,7 +67,8 @@ public sealed record SectionChain(
SectionTermination StartTermination,
SectionTermination EndTermination,
SectionChainContinuity Continuity = SectionChainContinuity.G0,
- SectionChainSmoothPolicy SmoothPolicy = SectionChainSmoothPolicy.Fair);
+ SectionChainSmoothPolicy SmoothPolicy = SectionChainSmoothPolicy.Fair,
+ double ProfileApproximationTolerance = 1e-5);
public static class SectionChainCanonical
{
@@ -84,7 +85,8 @@ public static class SectionChainCanonical
});
return $"{section.SectionId}@{section.Frame.Origin.X:R},{section.Frame.Origin.Y:R},{section.Frame.Origin.Z:R}:{string.Join(',', spans)}";
});
- return string.Join('|', chain.StableId, chain.TransitionPolicy, chain.Continuity, chain.SmoothPolicy, chain.StartTermination, chain.EndTermination, string.Join(';', sections));
+ var fingerprint = string.Join('|', chain.StableId, chain.TransitionPolicy, chain.Continuity, chain.SmoothPolicy, chain.StartTermination, chain.EndTermination, string.Join(';', sections));
+ return chain.ProfileApproximationTolerance == 1e-5 ? fingerprint : fingerprint + "|ApproximationTolerance:" + chain.ProfileApproximationTolerance.ToString("R", System.Globalization.CultureInfo.InvariantCulture);
}
}
@@ -134,6 +136,8 @@ public sealed record SectionChainMaterializationResult(
SectionChainTiming Timing)
{
public bool IsSuccess => Body is not null && Diagnostics.Count == 0;
+ public SectionProfileNormalizationResult? ProfileNormalization { get; init; }
+ public IReadOnlyList<SectionChainGeometricJoinEvidence> GeometricJoins { get; init; } = [];
public SectionChainPcurveEvidence? Pcurves { get; init; }
public SectionChainSelfIntersectionEvidence? SelfIntersection { get; init; }
public SectionChainContinuityEvidence? ContinuityEvidence { get; init; }
@@ -173,13 +177,26 @@ public static class SectionChainEditor
var transitionIndices = source.Continuity == SectionChainContinuity.G1
? tangentIndices.SelectMany(i => new[] { i - 1, i }).Where(i => i >= 0 && i < sections.Length - 1).Distinct().Order().ToArray()
: new[] { index - 1, index }.Where(i => i >= 0 && i < sections.Length - 1).ToArray();
+ var normalizationChanged = false;
+ if (source.TransitionPolicy == SectionTransitionPolicy.SmoothPolynomial && source.Sections.Any(s => s.Profile.Spans.Any(p => p.Curve is SectionProfileCurve.Arc)))
+ {
+ var before = SectionProfileNormalizer.Normalize(source);
+ var after = SectionProfileNormalizer.Normalize(source with { Sections = sections });
+ normalizationChanged = !before.IsSuccess || !after.IsSuccess ||
+ !before.Decisions.Select(d => d.SelectedSegmentCount).SequenceEqual(after.Decisions.Select(d => d.SelectedSegmentCount));
+ if (normalizationChanged)
+ {
+ tangentIndices = Enumerable.Range(0, sections.Length).ToArray();
+ transitionIndices = Enumerable.Range(0, sections.Length - 1).ToArray();
+ }
+ }
var rebuilt = transitionIndices.Select(i => TransitionId(sections[i].SectionId, sections[i + 1].SectionId)).ToList();
var preserved = Enumerable.Range(0, sections.Length - 1)
.Select(i => TransitionId(sections[i].SectionId, sections[i + 1].SectionId))
.Where(id => !rebuilt.Contains(id, StringComparer.Ordinal)).ToArray();
return (source with { Sections = sections }, new(replacement.SectionId,
tangentIndices.Select(i => sections[i].SectionId).ToArray(), rebuilt, preserved,
- ["StartTermination", "EndTermination"]));
+ normalizationChanged ? [] : ["StartTermination", "EndTermination"]));
}
internal static string TransitionId(string source, string target) => $"{source}->{target}";
@@ -198,7 +215,13 @@ public static class SectionChainMaterializer
{
ArgumentNullException.ThrowIfNull(chain);
var profileStarted = Stopwatch.GetTimestamp();
- var prepared = chain.Sections.Select(Prepare).ToArray();
+ PreparedSection[] prepared;
+ try { prepared = chain.Sections.Select(Prepare).ToArray(); }
+ catch (Exception exception) when (exception is ArgumentException or InvalidOperationException or NotSupportedException)
+ {
+ return Failure(chain, [new("section-chain-profile-invalid", exception.Message)],
+ Stopwatch.GetElapsedTime(profileStarted).TotalMilliseconds, 0);
+ }
var profileMs = Stopwatch.GetElapsedTime(profileStarted).TotalMilliseconds;
var correspondenceStarted = Stopwatch.GetTimestamp();
@@ -208,6 +231,16 @@ public static class SectionChainMaterializer
if (diagnostics.Count > 0)
return Failure(chain, diagnostics, profileMs, correspondenceMs);
+ var authoredChain = chain;
+ SectionProfileNormalizationResult? normalization = null;
+ if (chain.TransitionPolicy == SectionTransitionPolicy.SmoothPolynomial)
+ {
+ normalization = SectionProfileNormalizer.Normalize(chain);
+ if (!normalization.IsSuccess)
+ return Failure(chain, normalization.Diagnostics, profileMs, correspondenceMs) with { ProfileNormalization = normalization };
+ chain = normalization.NormalizedChain!;
+ prepared = chain.Sections.Select(Prepare).ToArray();
+ }
var transitionStarted = Stopwatch.GetTimestamp();
var transitionPatches = new List<(PreparedTransition Transition, ISectionChainTransitionPatch[] Patches)>();
SectionChainSmoothSelectionEvidence? smoothSelection = null;
@@ -303,10 +336,30 @@ public static class SectionChainMaterializer
var continuityEvidence = body is null ? null : MeasureContinuity(chain, transitionPatches);
if (chain.Continuity == SectionChainContinuity.G1 && continuityEvidence is { MaximumTangentPlaneAngleDegrees: > 1e-3d })
diagnostics.Add(new("section-chain-g1-verification-failed", $"Maximum tangent-plane discontinuity {continuityEvidence.MaximumTangentPlaneAngleDegrees:R} degrees exceeds 0.001 degrees."));
+ var geometricJoins = new List<SectionChainGeometricJoinEvidence>();
+ if (chain.TransitionPolicy == SectionTransitionPolicy.SmoothPolynomial)
+ {
+ for (var transition = 0; transition < transitionPatches.Count; transition++)
+ {
+ var patches = transitionPatches[transition].Patches;
+ for (var span = 0; span < patches.Length; span++)
+ {
+ var current = (SmoothSectionChainTransitionPatch)patches[span];
+ var next = (SmoothSectionChainTransitionPatch)patches[(span + 1) % patches.Length];
+ geometricJoins.Add(SectionChainDifferentialInspection.Measure(
+ $"{chain.Sections[transition].SectionId}->{chain.Sections[transition+1].SectionId}/{chain.Sections[transition].Profile.Spans[span].SpanId}.End",
+ "NeighboringProfileSpans", current, next, false));
+ if (transition+1 < transitionPatches.Count)
+ geometricJoins.Add(SectionChainDifferentialInspection.Measure(
+ $"{chain.Sections[transition+1].SectionId}/{chain.Sections[transition].Profile.Spans[span].SpanId}",
+ "InternalSection", current, (SmoothSectionChainTransitionPatch)transitionPatches[transition+1].Patches[span], true));
+ }
+ }
+ }
if (diagnostics.Count > 0) body = null;
- return new(chain, body, Structure(chain), evidence, diagnostics,
+ return new(authoredChain, body, Structure(chain), evidence, diagnostics,
new(profileMs, correspondenceMs, transitionMs, stitchMs, validationMs))
- { Pcurves = pcurveEvidence, SelfIntersection = selfIntersection.Evidence, ContinuityEvidence = continuityEvidence,
+ { GeometricJoins = geometricJoins, ProfileNormalization = normalization, Pcurves = pcurveEvidence, SelfIntersection = selfIntersection.Evidence, ContinuityEvidence = continuityEvidence,
SmoothSelection = smoothSelection, PreviewSvg = body is null ? null : BrepWireframeSvgRenderer.Render(body).Svg };
}
diff --git a/Aetheris.Surfacing/SectionProfileNormalization.cs b/Aetheris.Surfacing/SectionProfileNormalization.cs
new file mode 100644
index 00000000..568519e6
--- /dev/null
+++ b/Aetheris.Surfacing/SectionProfileNormalization.cs
@@ -0,0 +1,135 @@
+using System.Globalization;
+using System.Security.Cryptography;
+using System.Text;
+using Aetheris.Kernel.Core.Geometry.Curves;
+using Aetheris.Kernel.Core.Judgment;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Surfacing;
+
+public sealed record SectionProfileNormalizationEvidence(string SourceIdentity, string SourceCurveType,
+ string Representation, int Degree, int PolynomialSpanCount, double RequestedTolerance,
+ double CertifiedDeviationBound, double MaximumSampledDeviation, double EndpointPositionError,
+ double EndpointTangentAngleDegrees, string ControlHash, string ErrorBoundMethod);
+public sealed record SectionProfileNormalizationDecision(string SpanIdentity, int SelectedSegmentCount,
+ IReadOnlyList<int> RejectedSegmentCounts);
+public sealed record SectionProfileNormalizationResult([property: System.Text.Json.Serialization.JsonIgnore] SectionChain? NormalizedChain,
+ IReadOnlyList<SectionProfileNormalizationEvidence> Curves,
+ IReadOnlyList<SectionProfileNormalizationDecision> Decisions,
+ IReadOnlyList<SurfacingDiagnostic> Diagnostics)
+{
+ public bool IsSuccess => NormalizedChain is not null && Diagnostics.Count == 0;
+}
+
+/// <summary>Surfacing-only quintic Hermite normalization. Analytic source profiles remain immutable.</summary>
+public static class SectionProfileNormalizer
+{
+ private static readonly int[] SegmentCounts = [1, 2, 4, 8, 16];
+ public const int Degree = 5;
+ public const int MaximumSegments = 16;
+
+ public static SectionProfileNormalizationResult Normalize(SectionChain chain)
+ {
+ var diagnostics = new List<SurfacingDiagnostic>();
+ var evidence = new List<SectionProfileNormalizationEvidence>();
+ var decisions = new List<SectionProfileNormalizationDecision>();
+ if (!double.IsFinite(chain.ProfileApproximationTolerance) || chain.ProfileApproximationTolerance <= 0)
+ return Fail("section-chain-normalization-tolerance-invalid", "Profile approximation tolerance must be finite and positive.");
+ if (chain.Sections.SelectMany(s => s.Profile.Spans).Any(s => s.Curve is not
+ (SectionProfileCurve.Line or SectionProfileCurve.Arc or SectionProfileCurve.PolynomialBSpline)))
+ return Fail("section-chain-normalization-curve-unsupported", "Only line, circular arc, and polynomial B-spline profiles are admitted.");
+ var sections = chain.Sections.ToArray();
+ if (sections.Length == 0) return new(chain, [], [], []);
+ var count = sections[0].Profile.Spans.Count;
+ if (sections.Any(s => s.Profile.Spans.Count != count))
+ return Fail("section-chain-correspondence-topology-mismatch", "Normalization requires equal ordered semantic span counts.");
+ // The owning SectionChain correspondence validator establishes seam-relative ordering first.
+ for (var span = 0; span < count; span++)
+ {
+ var sourceCurves = sections.Select(s => s.Profile.Spans[span].Curve).ToArray();
+ var arcs = sourceCurves.OfType<SectionProfileCurve.Arc>().ToArray();
+ if (arcs.Length == 0) continue; // Existing polynomial and line-only G1 geometry is unchanged.
+ if (arcs.Any(a => !double.IsFinite(a.Radius) || a.Radius <= 1e-8 ||
+ !double.IsFinite(a.StartAngleRadians) || !double.IsFinite(a.SweepAngleRadians) ||
+ Math.Abs(a.SweepAngleRadians) <= 1e-10 || Math.Abs(a.SweepAngleRadians) > 2*Math.PI ||
+ !double.IsFinite(a.Center.X) || !double.IsFinite(a.Center.Y)))
+ return Fail("section-chain-normalization-arc-invalid", "Arc radius, sweep and center must be finite and nondegenerate, with |sweep| <= 2*pi.");
+ var judged = new JudgmentEngine<SectionProfileCurve.Arc[]>().Evaluate(arcs,
+ SegmentCounts.Select(n => new JudgmentCandidate<SectionProfileCurve.Arc[]>("Segments" + n,
+ a => a.All(arc => Bound(arc,n) <= chain.ProfileApproximationTolerance),
+ _ => 1d/n, _ => "Certified Hermite remainder exceeds the requested tolerance.",
+ TieBreakerPriority: n)).ToArray());
+ if (!judged.IsSuccess)
+ return Fail("section-chain-normalization-tolerance-unmet", $"Span '{sections[0].Profile.Spans[span].SpanId}' cannot meet {chain.ProfileApproximationTolerance:R} mm with degree 5 and at most 16 segments.");
+ var segments = int.Parse(judged.Selection!.Value.Candidate.Name[8..], CultureInfo.InvariantCulture);
+ decisions.Add(new(sections[0].Profile.Spans[span].SpanId, segments,
+ SegmentCounts.Where(n => arcs.Any(a => Bound(a,n) > chain.ProfileApproximationTolerance)).ToArray()));
+ for (var section = 0; section < sections.Length; section++)
+ {
+ var source = sourceCurves[section];
+ SectionProfileCurve.PolynomialBSpline curve;
+ if (source is SectionProfileCurve.Arc arc) curve = Arc(arc, segments);
+ else if (source is SectionProfileCurve.Line line) curve = Line(line, segments);
+ else if (source is SectionProfileCurve.PolynomialBSpline polynomial && polynomial.Degree == Degree &&
+ polynomial.KnotValues.SequenceEqual(Knots(segments)) && polynomial.KnotMultiplicities.SequenceEqual(Multiplicities(segments))) curve = polynomial;
+ else return Fail("section-chain-normalization-correspondence-incompatible", "An arc track accepts lines, arcs, or an already-compatible degree-5 polynomial; arbitrary degree/knot conversion is not inferred.");
+ var identity = sections[section].SectionId + "." + sections[section].Profile.Spans[span].SpanId;
+ var sampled = 0d; var endpoint = 0d; var tangent = 0d;
+ var spline = Spline(curve);
+ if (source is SectionProfileCurve.Arc exact)
+ {
+ for (var i=0; i<=segments*32; i++)
+ {
+ var t=i/(double)(segments*32);
+ sampled=Math.Max(sampled,(spline.Evaluate(t)-Point(exact,t)).Length);
+ }
+ endpoint=Math.Max((spline.Evaluate(0)-Point(exact,0)).Length,(spline.Evaluate(1)-Point(exact,1)).Length);
+ var first = spline.ControlPoints[1]-spline.ControlPoints[0];
+ var last = spline.ControlPoints[^1]-spline.ControlPoints[^2];
+ tangent=Math.Max(Angle(first,Derivative(exact,0)),Angle(last,Derivative(exact,1)));
+ }
+ if (sampled > chain.ProfileApproximationTolerance || endpoint > chain.ProfileApproximationTolerance || tangent > 1e-7)
+ return Fail("section-chain-normalization-numerical-error", $"{identity}: numeric endpoint/tangent or sampled approximation check exceeds policy.");
+ evidence.Add(new(identity,source.GetType().Name,"NonRationalQuinticHermiteBSpline",Degree,segments,
+ chain.ProfileApproximationTolerance,source is SectionProfileCurve.Arc a ? Bound(a,segments) : 0,
+ sampled,endpoint,tangent,Hash(curve),
+ "sqrt(2)*R*abs(segmentSweep)^6/(6!*64), componentwise Hermite remainder plus conservative coordinate-scale roundoff allowance; sampled error is separate"));
+ var spans=sections[section].Profile.Spans.ToArray();
+ spans[span]=spans[span] with { Curve=curve };
+ sections[section]=sections[section] with { Profile=sections[section].Profile with { Spans=spans } };
+ }
+ }
+ return new(chain with { Sections=sections },evidence,decisions,diagnostics);
+
+ SectionProfileNormalizationResult Fail(string code,string message) => new(null,evidence,decisions,[new(code,message)]);
+ }
+
+ private static double Bound(SectionProfileCurve.Arc arc,int segments) =>
+ Math.Sqrt(2)*arc.Radius*Math.Pow(Math.Abs(arc.SweepAngleRadians)/segments,6)/(720*64)
+ + 128 * 2.2204460492503131e-16 * (Math.Abs(arc.Center.X)+Math.Abs(arc.Center.Y)+arc.Radius+1);
+ private static double[] Knots(int segments) => Enumerable.Range(0,segments+1).Select(i=>i/(double)segments).ToArray();
+ private static int[] Multiplicities(int segments) => Enumerable.Range(0,segments+1).Select(i=>i==0||i==segments?6:5).ToArray();
+ private static SectionProfileCurve.PolynomialBSpline Arc(SectionProfileCurve.Arc arc,int segments)
+ {
+ var controls=new List<SectionPoint2D>(); var h=1d/segments;
+ for(var i=0;i<segments;i++)
+ {
+ var a=i*h; var b=(i+1)*h; var p=Point(arc,a);var q=Point(arc,b);
+ var da=Derivative(arc,a)*h;var db=Derivative(arc,b)*h;
+ var aa=Second(arc,a)*(h*h);var ab=Second(arc,b)*(h*h);
+ Point3D[] local=[p,p+da/5,p+da*(2d/5)+aa/20,q-db*(2d/5)+ab/20,q-db/5,q];
+ controls.AddRange(local.Skip(i==0?0:1).Select(v=>new SectionPoint2D(v.X,v.Y)));
+ }
+ return new(Degree,controls,Multiplicities(segments),Knots(segments));
+ }
+ private static SectionProfileCurve.PolynomialBSpline Line(SectionProfileCurve.Line line,int segments) =>
+ new(Degree,Enumerable.Range(0,5*segments+1).Select(i=>new SectionPoint2D(
+ line.Start.X+(line.End.X-line.Start.X)*i/(5*segments),
+ line.Start.Y+(line.End.Y-line.Start.Y)*i/(5*segments))).ToArray(),Multiplicities(segments),Knots(segments));
+ private static Point3D Point(SectionProfileCurve.Arc a,double t) => new(a.Center.X+a.Radius*Math.Cos(a.StartAngleRadians+t*a.SweepAngleRadians),a.Center.Y+a.Radius*Math.Sin(a.StartAngleRadians+t*a.SweepAngleRadians),0);
+ private static Vector3D Derivative(SectionProfileCurve.Arc a,double t) => new(-a.Radius*a.SweepAngleRadians*Math.Sin(a.StartAngleRadians+t*a.SweepAngleRadians),a.Radius*a.SweepAngleRadians*Math.Cos(a.StartAngleRadians+t*a.SweepAngleRadians),0);
+ private static Vector3D Second(SectionProfileCurve.Arc a,double t) => new(-a.Radius*a.SweepAngleRadians*a.SweepAngleRadians*Math.Cos(a.StartAngleRadians+t*a.SweepAngleRadians),-a.Radius*a.SweepAngleRadians*a.SweepAngleRadians*Math.Sin(a.StartAngleRadians+t*a.SweepAngleRadians),0);
+ private static BSpline3Curve Spline(SectionProfileCurve.PolynomialBSpline c) => new(c.Degree,c.ControlPoints.Select(p=>new Point3D(p.X,p.Y,0)).ToArray(),c.KnotMultiplicities,c.KnotValues,"UNSPECIFIED",false,false,"UNSPECIFIED");
+ private static double Angle(Vector3D a,Vector3D b) => a.TryNormalize(out var x)&&b.TryNormalize(out var y)?Math.Atan2(x.Cross(y).Length,x.Dot(y))*180/Math.PI:double.PositiveInfinity;
+ private static string Hash(SectionProfileCurve.PolynomialBSpline c) => Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(string.Join(";",c.ControlPoints.Select(p=>p.X.ToString("R",CultureInfo.InvariantCulture)+","+p.Y.ToString("R",CultureInfo.InvariantCulture)))+"|"+string.Join(",",c.KnotValues.Select(k=>k.ToString("R",CultureInfo.InvariantCulture))))));
+}
diff --git a/docs/public/firmament/boundaries.md b/docs/public/firmament/boundaries.md
index e5cb6ba5..7377d2f8 100644
--- a/docs/public/firmament/boundaries.md
+++ b/docs/public/firmament/boundaries.md
@@ -1,6 +1,6 @@
# Closed 2D boundaries
-`ClosedBoundary2` is the semantic contract for one deterministic, oriented, non-self-intersecting 2D boundary. It is not a public inheritance hierarchy or a sketch solver. Canonical declarations lower through the existing `Point2`, `Line2`, circular/elliptical curve, `Profile`, AIR, and STEP path.
+`ClosedBoundary2` is the semantic contract for one deterministic, oriented, non-self-intersecting 2D boundary. It is not a public inheritance hierarchy or a sketch solver. Canonical declarations lower through the existing `Point2`, `Line2`, circular/elliptical and polynomial curve, `Profile`, AIR, and STEP path.
Use the most semantic available noun:
@@ -16,6 +16,7 @@ Use the most semantic available noun:
| `Ellipse2` | elliptical boundary | `Center`, full `AxisLengths` | center/extrema and one analytic `Boundary` |
| `Slot2` | straight engineering slot | `Center`, overall `Length`, `Width` | `Top`, `EndArc`, `Bottom`, `StartArc` |
| `RoundedRect2` | rounded rectangular region | `Center`, `Size`, `Radius` | four lines and four named corner arcs |
+| `SmoothRoundedRect2` | squircle-style corners with straight sides | `Center`, `Size`, `CornerExtent` | four sides; `BottomRightCornerA/B`, `TopRightCornerA/B`, `TopLeftCornerA/B`, `BottomLeftCornerA/B` |
| `Polygon2<Rhombus>` | diagonal-defined rhombus | `Center`, full `Diagonals` | four compass vertices and derived edges |
| `Polygon2<Parallelogram>` | sheared parallel-sided boundary | `Center`, `Base`, `Height`, `Shear` | four corners and derived edges |
| `Polygon2<Trapezoid>` | centered parallel-sided taper | `Center`, `BottomWidth`, `TopWidth`, `Height` | four corners and derived edges |
@@ -59,3 +60,22 @@ After Template specialization, boundary coordinate and length fields accept boun
`RegularPolygon2<N>` is a bounded built-in structural parameter (`3 <= N <= 1024`), not general const generics. `Polygon2<T>` admits only the documented constrained variants. Add another named polygon variant only when it supplies meaningful geometric constraints or substantially better engineering dimensions than `Polygon2<Explicit>`.
`Polygon2<Explicit>` preserves the source order and names of its `Set<Point2>` entries, rejects duplicates, degenerate area, and self-intersection, and derives stable edge identities from adjacent names.
+
+## Smooth polynomial corners
+
+```firmament
+SmoothRoundedRect2 Outline {
+ Center: [0mm,0mm]
+ Size: [77.98mm,163.43mm]
+ CornerExtent: 19.43mm
+}
+Profile Section { Loop Outer { Outline |> TraceLoop } }
+```
+
+This bounded primitive provides four straight sides and eight cubic B�zier spans. `CornerExtent` is the distance from the sharp envelope corner to each side tangency point, not a circular radius. It must be strictly between zero and half the smaller size. Rotation and dimensional arithmetic work as for the other boundaries. Closure and orientation are constructed internally; users do not author control points.
+
+The fixed corner law is polynomial, inspired by a fourth-power superellipse; it is not an exact Lam� curve or a certified Apple contour. In a unit corner from (0,0) to (1,1), let `b = 2^(-1/4)`, `q = 1-b`, and `a = b-1/2`. The first cubic has controls `(0,0), (a,0), (2a,0), (b,q)`. Reflect it across the corner bisector and reverse traversal for the second half. Endpoint speed is nonzero, collinear endpoint controls give zero side curvature, and reflection gives matching tangent and signed curvature at the midpoint. Monotone convex corner spans remain inside their envelope. Area is integrated exactly; the inspection perimeter is a fixed Simpson quadrature estimate.
+
+The existing Profile binder owns the resolved curves, and ordinary extrusion and SectionChain consume them as polynomial B-splines. No guide body is exported. [The SectionChain witness](../../../fixtures/Canonical/SectionChain/smooth-corner-sections.firmament) checks realized surface position, normals, and geometric curvature at every span and section join. Its straight extrusion has G2 side joins; its planar caps meet the sides with sharp edges. General `Continuity: G2` surface construction and plateau-to-body support matching remain separate work.
+
+Use a smooth boundary as the footprint of a [G2 planar plateau](plateaus.md) to blend a raised region into a planar base.
diff --git a/docs/public/firmament/fillet-profiles.md b/docs/public/firmament/fillet-profiles.md
new file mode 100644
index 00000000..991973f1
--- /dev/null
+++ b/docs/public/firmament/fillet-profiles.md
@@ -0,0 +1,13 @@
+# Bounded concave fillet profiles
+
+The existing concave fillet kernel admits `BoundedFilletProfile.Circular` (default) and `BoundedFilletProfile.CurvatureContinuous`. Both reuse the same trusted-source preflight, selected edges, setback/contact points, source loop, shared edges, and shell construction. The smooth mode replaces the circular quarter-section with a fixed degree-five polynomial and its straight extrusion surface.
+
+The size remains the existing `radius` argument for compatibility. In smooth mode it means the equal setback on both planar supports, not constant curvature radius. No author control cage or equation interpreter is involved. Three collinear controls at each endpoint give zero endpoint normal curvature; the straight axial direction has zero curvature as well. Thus the blend matches both planar supports with G2 continuity along its full contact edges. Its top/bottom termination edges remain sharp.
+
+This mode currently applies to the kernel's existing one/two-edge, orthogonal concave selections on trusted planar source bodies. It does not add support for curved rails, arbitrary face pairs, or circular termination contexts. Unsupported circular termination with smooth mode reports `BoundedFilletSmoothCylindricalTerminationUnsupported`.
+
+The existing explicitly versioned V1 file adapter exposes the mode on `op: fillet` as `profile: CurvatureContinuous`; see [the regression witness](../../../fixtures/Regression/Fillet/concave-curvature-continuous.firmament). This is compatibility-path qualification, not a new recommended V1 authoring surface. Invalid mode names and numeric enum values fail.
+
+The canonical V2 Profile `EdgeFinish` contact-shell path still admits only its circular profile. An explicit `Profile: CurvatureContinuous` request fails with `ProfileBoundaryFilletProfileModeUnsupported:CurvatureContinuous:polynomial-contact-shell-required`. It does not silently perform a circular fillet. [The isolated smooth-loop fixture](../../../fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament) records the still-unsupported implicit EdgeFinish form.
+
+For a raised region on parallel planar supports, use [Plateau](plateaus.md). That operation supplies explicit height, width, and footprint semantics and reuses the same quintic quarter law with polynomial contacts, support-face trims, and closed-loop topology. The implicit EdgeFinish form above remains rejected; it lacks those two-support inputs.
diff --git a/docs/public/firmament/plateaus.md b/docs/public/firmament/plateaus.md
new file mode 100644
index 00000000..2d525468
--- /dev/null
+++ b/docs/public/firmament/plateaus.md
@@ -0,0 +1,36 @@
+# G2 planar plateaus
+
+A `Plateau` modifies the top planar face of one ordinary Profile extrusion. It retains the base shell, trims a hole into the base top face, and adds a transition band and a raised planar center. The contacts and trims share edges; no overlapping solids or cleanup boolean is used.
+
+```firmament
+Model GenericG2Plateau {
+ Units: mm
+ Struct Part {
+ Rect2 BaseBoundary { Center: [0mm,0mm] Size: [100mm,80mm] }
+ Profile BaseSection { Loop Outer { BaseBoundary |> TraceLoop } }
+ Extrude Body { Profile: BaseSection From: 0mm To: 5mm }
+ SmoothRoundedRect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] CornerExtent: 8mm }
+ Profile Footprint { Loop Outer { Outline |> TraceLoop } }
+ Plateau Raised {
+ Base: Body
+ Footprint: Footprint
+ Height: 3mm
+ Width: 2mm
+ Inset: Homothetic
+ Continuity: G2
+ }
+ }
+}
+```
+
+[Runnable example](../../../fixtures/Canonical/Surfacing/g2-planar-plateau.firmament).
+
+The footprint is the **outer/base contact boundary**. `Width` is the inward displacement on its shorter bounding-box half-axis. `Inset: Homothetic` explicitly selects uniform scaling about the footprint bounding-box center: the raised top has scale `1 - Width / min(halfWidth, halfHeight)`. Longer-axis and corner displacements follow that scale. This is an exact polynomial construction, not an approximation to a constant-distance normal offset. Width must be positive and less than the shorter half-axis. Height is measured above the host top face.
+
+The section reuses the qualified quintic fillet quarter twice, with a concave entry and convex exit. Both planar support joins have G2 continuity. Smooth footprint joins retain G2 throughout the band. Sharp corners in a straight-only polygon retain visible G0 creases in the band; support joins still meet their planes with G2 continuity. Source order and span names survive. The seam defaults to the first straight span; `Seam: Bottom` may select another existing span.
+
+X1 admits line and single-span cubic polynomial footprints with provably monotone angular progression around the center. Bernstein control bounds prove regularity, one winding, nonintersection, and nested contacts. Unsupported or unproved footprints fail typed. The host must be one unmodified extrusion with a planar top and one outer trim loop whose boundary consists of lines or convex arcs. Contact control hulls must remain strictly within that face. Existing face/edge IDs outside the new band are retained.
+
+3D contacts retain the footprint degree, knots, parameter direction, and control provenance. Plane pcurves are affine transforms of those controls; band pcurves are exact parameter-domain lines. AP242 writes polynomial pcurves as 2D B-splines. Independent edge-versus-surface checks validate the trims. `aetheris inspect model.firmament --json` and `aetheris build ... --json` expose contacts, patches, support/internal continuity, face identities, pcurve residuals, counts, and timings.
+
+To replace a separate abrupt plateau occurrence, author this operation inside the body Struct, retaining the existing body extrusion and adding the plateau footprint. Remove the old separate plateau occurrence, and keep its height and feature placements consistent with the new top plane. This produces one body with a trimmed surrounding base face. Other assembly occurrences remain separate parts.
diff --git a/docs/public/firmament/section-chains.md b/docs/public/firmament/section-chains.md
index 7acb7561..f8222f06 100644
--- a/docs/public/firmament/section-chains.md
+++ b/docs/public/firmament/section-chains.md
@@ -14,7 +14,7 @@ Continuity intent and transition law are separate. `Continuity: G0` selects the
For G1, Aetheris transforms corresponding polynomial controls into world space and derives a shared tangent field at every section. Interior tangents use a nonuniform three-section quadratic-derivative stencil; cumulative frame-origin chord length is the station metric, and endpoints use a bounded one-sided chord derivative. Three deterministic magnitude policies are qualified for foldover and overshoot before the Judgment Engine compares bending energy and normal variation. Continuity is a hard eligibility constraint, never an aesthetic score.
-Each matched span becomes an exact non-rational cubic transition in the longitudinal direction. Lines are exactly degree-elevated to cubic when needed; compatible polynomial B-splines retain their boundary geometry and knot structure. Circular-arc G1 normalization and mixed incompatible knot structures currently fail with `section-chain-g1-degree-limit`; Aetheris never introduces rational weights or a faceted fallback. The G0 path still preserves exact plane/cylinder/cone recognition where applicable.
+Each matched span becomes an exact non-rational cubic transition in the longitudinal direction. Lines are exactly degree-elevated to cubic when needed; compatible polynomial B-splines retain their boundary geometry and knot structure. Circular arcs used in G1 now enter the bounded surfacing-only normalization described below. Mixed incompatible existing polynomial knot structures still fail with `section-chain-g1-degree-limit`; Aetheris never introduces rational weights or a faceted fallback. The G0 path still preserves exact plane/cylinder/cone recognition where applicable.
Every internal section edge is allocated once. The preceding and following transition faces use that same edge, curve, vertices, and parameter direction. For G0, editing one section rebuilds its two adjacent transitions. G1 has a bounded dependency neighborhood: editing section `i` recomputes tangent fields `i-1..i+1` and may rebuild transitions `i-2->i-1` through `i+1->i+2`. Distant transitions and terminal conditions remain preserved in `SectionChainEditDelta`; there is no global loft solve.
@@ -115,3 +115,17 @@ The current canonical grip qualifies 24 faces, 50 edges, 28 vertices, and 100 pc
The standalone lane has one closed outer loop, no holes, same-topology one-to-one correspondence, G0/G1 pairwise transitions, and Cap/Open terminals. It checks frame handedness, loop closure/orientation, profile self-intersection, physical spacing, semantic mapping order, transition Jacobian foldover, bounded overshoot, non-neighbour crossings, remote cap penetration, pcurves, and realized continuity. The triangle proxy is conservative detection evidence, not a global proof. BodyState composition remains limited to the planar housing support lanes; arbitrary supports, branches, G2, rail lofts, topology-changing correspondence, and arbitrary freeform Boolean composition fail closed.
Stable diagnostic families include `section-chain-correspondence-missing`, `section-chain-correspondence-duplicate`, `section-chain-profile-orientation-mismatch`, `section-chain-transition-foldover`, `section-chain-self-intersection`, and `section-chain-pcurve-error`. `section-chain validate` returns a nonzero exit status and emits no STEP when any of these blocks materialization. Transition identities are formatted `SourceSection->TargetSection` in structured evidence and diagnostic detail.
+
+## Bounded profile normalization and curvature inspection
+
+The [rounded-section fixture](../../../fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament) admits ordinary line/circular-corner profiles to the G1 lane. `ApproximationTolerance: 0.00001mm` is the default optional SectionChain field. Source arcs remain semantic arcs; only the smooth surfacing construction uses their normalized counterparts. Ordinary profile extrusion and the G0 route are unchanged.
+
+Each arc uses degree-5 non-rational Hermite polynomials that match its endpoints, tangents, and second derivatives. The Judgment Engine selects from 1, 2, 4, 8, or 16 segments, admitting only candidates whose error bound meets tolerance, then preferring fewer segments. Corresponding curves share segmentation across the chain. A line corresponding to an arc is represented exactly in the same degree/knot basis. Existing polynomial tracks remain unchanged; an existing polynomial opposite an arc must already have the selected compatible degree and knots. Arbitrary degree/knot conversion is not inferred.
+
+The positional bound is `sqrt(2) * radius * abs(segmentSweep)^6 / (720 * 64)`, plus a coordinate-scale roundoff allowance. This follows the componentwise quintic Hermite remainder; dense sample error is reported separately. Endpoints and endpoint tangent directions are also checked numerically. The hard limit is degree 5 and 16 spans per source arc. A tighter unachievable tolerance fails with `section-chain-normalization-tolerance-unmet`, without STEP or a modified body.
+
+`section-chain inspect`, `validate`, and `build` report `profileNormalization`: source identities/types, degree, segment count, tolerance, bound, sampled deviation, endpoint position/tangent error, control hash, and deterministic segment choices. `geometricJoins` reports both internal section joins and neighboring profile-span seams. It evaluates analytic first/second B-spline derivatives and compares second fundamental forms in a shared orthonormal world tangent basis. The curvature residual has units 1/mm; it is not a comparison of raw second parameter derivatives. G0 and tangent-plane checks must pass before a curvature status is assigned. Caps are not included in this join report.
+
+`G2WithinSampledTolerance` is an inspection result at the reported samples, not a new G2 construction guarantee. The samples include endpoints, 33 regular parameters, and applicable spline knots. The rounded-section fixture measures zero position/normal mismatch but a 0.125/mm curvature jump at its R8 line/arc seams. Those joins are G1. Arc normalization does not smooth away source curvature jumps. `Continuity: G2` remains rejected for SectionChain.
+
+Editing a section normally retains the existing bounded G1 derivative neighborhood. If an edit changes the common normalization segment count, all transitions on that chain must be regenerated; the edit delta truthfully reports this wider dependency and does not claim the terminations are preserved. Source semantic span identities remain stable. See the [SURF-G2-X1 progression report](../../release/SURF-G2-X1.md) for the remaining G2 boundary-condition work.
diff --git a/docs/public/iphone-reconstruction.md b/docs/public/iphone-reconstruction.md
index adafb7f4..efb0f69f 100644
--- a/docs/public/iphone-reconstruction.md
+++ b/docs/public/iphone-reconstruction.md
@@ -19,6 +19,10 @@ Hard references are the body envelope, glass/display extents, Detail D camera/se
Side-control and bottom-detail placements are explicit assembly transforms. For a length variation, update the bottom-detail Y translations along with `ProductLength`; for a width variation update the right-control X translations with `ProductWidth`. This is a known residual coupling, so changing the Record alone does not yet regenerate every exterior detail. Major plate profiles derive directly from the Record.
-The [smooth plateau witness](../../fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament) deliberately fails with `section-chain-g1-degree-limit`. Current public profile authoring supplies lines/arcs; the G1 section-chain materializer requires polynomial normalization for arcs. G2, a refined body, and a refined-versus-blockout comparison are not delivered by this checkpoint.
+The [refined plateau](../../fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament) now uses the generic [G2 planar plateau operation](firmament/plateaus.md). Its body and plateau form one trimmed manifold solid; the other component proxies remain separate. The 72.76 x 43 mm outer contact footprint uses `SmoothRoundedRect2` with 11.5 mm corner extent. The explicit 2 mm homothetic inset preserves the outer envelope and leaves a verified camera clearance above 0.273 mm. The width and corner extent are design assumptions, not recovered Apple spline parameters. See [SURF-G2-LOOP-X1 evidence](../release/SURF-G2-LOOP-X1.md) for continuity, identical-camera comparisons, and variations.
+
+Use `aetheris asm inspect ... --json`, `asm export-ap242 ...`, and `mesh ... --format assembly-json` for this assembly, substituting the refined fixture in the commands above. The earlier [smooth extrusion witness](../../fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament) remains a footprint-only regression.
The supplied PDF remains local. The validated Drawing Notes project is under `artifacts/local/drawing-notes-x1/fresh-agent/notebook/`. Use its canonical `drawing-notes.json` and refreshed Markdown, not stale filtered handoffs. PDF page 2 Detail A supplies corner evidence; Detail D owns the rear layout. Do not infer optical functions from camera numbering.
+
+The [bounded concave fillet profile mode](firmament/fillet-profiles.md) supplies the reused quintic quarter law. The generic Plateau operation now carries that law around polynomial footprints with exact contacts and face-space trims. Exact Apple hidden splines, lens rings, body side-edge refinement, forward sensor partitioning, material keepout union, and manufacturing equivalence remain deferred.
diff --git a/docs/release/FILLET-PROFILE-X1.md b/docs/release/FILLET-PROFILE-X1.md
new file mode 100644
index 00000000..080d196c
--- /dev/null
+++ b/docs/release/FILLET-PROFILE-X1.md
@@ -0,0 +1,30 @@
+# FILLET-PROFILE-X1 � reuse the concave fillet section path
+
+Outcome: meaningful progression. A curvature-continuous section now works in the existing bounded concave fillet kernel. The phone's closed polynomial loop is not yet filleted.
+
+`BoundedFilletProfile.CurvatureContinuous` retains the original contacts, topology allocation, admitted edge selections, and shell builder. It changes circular section edges to quintic B-splines and the cylindrical patch to their degree-five by degree-one extrusion. Circular remains the default. The fixed controls have zero endpoint curvature, nonzero speed, and stay in the existing contact rectangle. There is no general equation solver, alternate executor, or post-build repair.
+
+The real CLI compatibility-path witness exports an enclosed-manifold STEP solid: 11 faces (10 planes and one B-spline), 27 edges, 18 vertices. Its topology counts match the circular baseline. Realized pcurve recovery succeeds with maximum residual 2.02e-12 mm. Kernel tests check the realized section's endpoint curvature, contact position, and oriented support tangent planes at five axial stations for three setback values. Existing circular and chained fillet tests still pass.
+
+The next blocker is now an explicit canonical V2 error: `ProfileBoundaryFilletProfileModeUnsupported:CurvatureContinuous:polynomial-contact-shell-required`. The corresponding invalid fixture produces no STEP. The legacy concave kernel is a straight-edge construction; the V2 closed-loop Profile planner assumes line/arc-derived analytic contact curves and patches. Replacing its section equation alone cannot supply contacts and trims on a cubic footprint. No claim is made that the phone plateau-to-body blend is delivered.
+
+See [the capability and limits](../public/firmament/fillet-profiles.md).
+
+STEP SHA-256: `bdb47dea884d742c7c40cf75870162bb37eb8da8184a8b2123f858f33e0065ee`. The realized top-view wireframe was visually inspected.
+
+## Validation
+
+Release solution build passed with zero warnings/errors. All 20 test-project commands completed serially with exit code zero; 3588 tests passed (FrictionLab reports no tests). Source and report link checks passed. Detailed logs remain under `artifacts/local/fillet-profile-x1/`.
+
+## Reproduce
+
+```powershell
+dotnet build Aetheris.slnx -c Release
+$cli = Resolve-Path Aetheris.CLI/bin/Release/net10.0/aetheris.exe
+& $cli build fixtures/Regression/Fillet/concave-curvature-continuous.firmament --out artifacts/local/fillet-profile-x1/concave.step --json
+& $cli analyze artifacts/local/fillet-profile-x1/concave.step --json
+& $cli wireframe artifacts/local/fillet-profile-x1/concave.step --out artifacts/local/fillet-profile-x1/concave-top.svg --view top --density 2 --samples 128 --json
+& $cli build fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament --out artifacts/local/fillet-profile-x1/unsupported.step --json
+```
+
+The last command must fail without writing `unsupported.step`.
diff --git a/docs/release/SMOOTH-CORNER-X1.md b/docs/release/SMOOTH-CORNER-X1.md
new file mode 100644
index 00000000..ff29aa1e
--- /dev/null
+++ b/docs/release/SMOOTH-CORNER-X1.md
@@ -0,0 +1,34 @@
+# SMOOTH-CORNER-X1 � bounded smooth footprint
+
+Outcome: success for the immediate footprint blocker. `SmoothRoundedRect2` replaces circular corners with a fixed symmetric polynomial law whose curvature matches the straight sides and across each corner midpoint. This does not complete SURF-G2-X1 parent-support surface blending.
+
+The declaration takes `Center`, `Size`, `CornerExtent`, and optional `Rotation`. It produces four lines and eight cubic spans through the ordinary resolved Profile representation. SectionChain converts the existing cubic carrier to degree-three B-splines; ordinary extrusion uses the existing B-rep planner. No equation interpreter, public control cage, alternate executor, or post-B-rep repair was added. See [the law and authoring contract](../public/firmament/boundaries.md#smooth-polynomial-corners).
+
+The shape is a squircle-style polynomial, not an exact superellipse or a fit to Apple's drawing. Its midpoint is derived from the fourth-power superellipse. Its side curvature is analytically zero, and midpoint reflection preserves geometric curvature. General G2 surface construction remains unimplemented; planar caps are sharp joins and excluded from side-join claims.
+
+## Realized evidence
+
+- The 60 x 40 mm, 8 mm corner-extent, three-section fixture has 36 inspected side/section joins, all `G2WithinSampledTolerance`; maximum shape-operator residual is 2.11e-15 /mm. The previous circular fixture measures 0.125 /mm.
+- STEP reimports as one enclosed-manifold solid: 26 faces, 60 edges, 36 vertices; envelope is exactly 60 x 40 x 16 mm in the reimport report.
+- The motivating plateau witness now uses smooth corners, with its existing 72.76 x 43 mm envelope, 11.5 mm proxy corner extent, and 2.55 mm height. All 12 inspected side joins pass; maximum curvature residual is 6.11e-16 /mm. Reimport is enclosed-manifold, 14 faces. Its diagnostic top view was visually inspected from the realized STEP.
+- Tests cover phone envelope dimensions (77.98 x 163.43 mm, extent 19.43 mm), a rotated 64 x 44 mm variant, degenerate extent rejection, and ordinary template-based extrusion. Phone dimensions are a carrier witness, not a contour-fit qualification.
+
+Generic STEP SHA-256: `67A8614CAD3E6E23AA37C89E3FABE41F1AC52A61C9775D97BFDA564E5B718191`.
+Plateau STEP SHA-256: `43AE075C1322E69987E8B704F92B6D7DF1D63986312D3FCE9F66A7D6040DF0D4`.
+
+## Validation
+
+Release solution build: zero warnings and errors. All 20 test-project commands completed serially with exit code zero; 3580 tests passed (FrictionLab reports no tests). Repeated STEP exports are byte-identical. The CLI NuGet package was built. Raw logs and reports remain under `artifacts/local/smooth-corner-x1/`.
+
+## Reproduce
+
+```powershell
+dotnet build Aetheris.slnx -c Release
+$cli = Resolve-Path Aetheris.CLI/bin/Release/net10.0/aetheris.exe
+& $cli section-chain build fixtures/Canonical/SectionChain/smooth-corner-sections.firmament --out artifacts/local/smooth-corner-x1/witness.step --json
+& $cli section-chain build fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament --out artifacts/local/smooth-corner-x1/plateau.step --json
+& $cli analyze artifacts/local/smooth-corner-x1/plateau.step --json
+& $cli wireframe artifacts/local/smooth-corner-x1/plateau.step --out artifacts/local/smooth-corner-x1/plateau-top.svg --view top --density 2 --samples 128 --json
+```
+
+The next isolated blocker is a transverse surface law that matches the supporting faces' tangent planes and geometric curvature. Smooth footprint curvature is now available to that construction through the existing semantic path.
diff --git a/docs/release/SURF-G2-LOOP-X1.md b/docs/release/SURF-G2-LOOP-X1.md
new file mode 100644
index 00000000..83837c3f
--- /dev/null
+++ b/docs/release/SURF-G2-LOOP-X1.md
@@ -0,0 +1,135 @@
+# SURF-G2-LOOP-X1 � Polynomial contacts and trimmed G2 plateaus
+
+## Verdict: Accepted within the explicit X1 construction
+
+Aetheris carries the qualified quintic section around a closed line/polynomial footprint through ordinary Firmament `Plateau` authoring, creates shared trimmed topology, and exports/reimports a manifold STEP solid. The generic witness passes before phone burn-in. The phone body and plateau are now one solid. No Boolean union, phone-specific kernel branch, or redesigned footprint/section law is involved.
+
+The admitted construction is **homothetic**, explicitly selected by `Inset: Homothetic`. Width is the short-axis inset; the long-axis inset scales proportionally. This is exact polynomial geometry, not a constant-normal-distance offset or a recovery of Apple's hidden surface network. The old implicit `EdgeFinish Profile: CurvatureContinuous` diagnostic remains: that syntax does not supply the explicit parallel-support inputs of Plateau.
+
+## Audit and minimum extension
+
+1. **Existing local contacts:** `BrepBoundedFillet` locates the orthogonal concave corner in its occupied planar footprint, computes setback points, creates longitudinal contact edges, and intentionally replaces the selected shell region. The curvature-continuous mode changes the quarter-section and its extrusion surface, retaining the contact/topology path.
+2. **Existing curve authority:** edge geometry already supports lines, circles, ellipses, hyperbolas, and non-rational `BSpline3Curve`. The local concave path uses straight longitudinal contacts; the old Profile contact shell constructs line/arc offsets and analytic components. Neither supplied contacts for a polynomial closed plateau.
+3. **Existing face trims:** `PcurveGeometry` had Line, Circle, Ellipse, and Polyline. Planar polynomial edges fell through to sampled projection. AP242 pcurve export sampled even a polynomial represented indirectly.
+4. **Exact blocker:** a smooth section alone cannot supply the polynomial support contacts, their UV trims, the base-face inner loop, and shared patch topology. The old contact-shell diagnostic correctly rejected that missing construction.
+5. **Reused polynomial authority:** UV curves now reuse `BSpline3Curve` with Z=0, retaining degree, knots, control data, and the 3D edge parameter. There is no second spline evaluator.
+6. **Architectural separation:** `PlanarPlateauContacts` owns 3D contacts and tensor surfaces; `BoundedPcurveBuilder` owns face-space bindings; `PlanarPlateauMaterializer` owns vertices, shared edges, coedges, loops, retained faces, and shell assembly. Display consumes these bindings rather than becoming trim authority.
+7. **Minimum extension implemented:** affine polynomial contacts on two parallel planes, polynomial pcurve bindings/export, and a local planar-face graft. `CurvatureContinuousFilletSection.CreateQuarter` extracts the existing six-control law unchanged and is called by both the local fillet and Plateau. Two copies provide concave entry and convex exit.
+
+No arbitrary SSI, rational construction, post-BRep repair, or sweep-network framework was added. Source `SmoothRoundedRect2` and the G2 section equations were not changed in this milestone.
+
+## Construction, exactness, and identities
+
+For source curve C(u), bounding-box center c, and s = 1 - Width/min(halfWidth,halfHeight), base contact is C(u), raised contact is c+s(C(u)-c). Height supplies the plane separation. The same affine maps act on the existing control points. The two quarter laws create two tensor patches per source span, with degree 1x5 on straight spans and 3x5 on corner spans.
+
+`ExactAffinePolynomial` means no contact fitting error is introduced. Planar pcurves transform those controls into the support plane basis. Patch boundaries are exact isoparametric UV lines. All use forward source parameters [0,1]. Controls and provenance appear in CLI build/inspect JSON.
+
+Representative generic span `BottomRightCornerA`, degree 3, knots [0,1], multiplicities [4,4]:
+
+| Control | Base contact XYZ (mm) | Top contact XYZ (mm) |
+|---|---|---|
+| 0 | (22, -20, 5) | (19.8, -18, 8) |
+| 1 | (24.7271713220, -20, 5) | (22.2544541898, -18, 8) |
+| 2 | (27.4543426441, -20, 5) | (24.7089083797, -18, 8) |
+| 3 | (28.7271713220, -18.7271713220, 5) | (25.8544541898, -16.8544541898, 8) |
+
+Its named contacts are `Raised.BaseContact.BottomRightCornerA` and `Raised.TopContact.BottomRightCornerA`; support identities are `Body.Top` and `Raised.Top`. Band faces retain `Raised.Blend.<source span>.0/1`. The deterministic designated seam is the start of `Bottom`, an existing shared span boundary. There is no duplicated periodic seam edge. Other seam selections designate another source boundary without changing its geometry.
+
+The materializer retains the existing shell/face/edge IDs, adds one inner loop to the base top face, and appends the band and raised cap. Every new ring edge is shared by two incident faces; each longitudinal boundary is allocated once. The source shell's winding convention is retained, with the hole opposing its outer loop. STEP import does not repair coedge orientation.
+
+| Witness | Source spans | Band faces | Total faces | Edges | Vertices | Pcurves |
+|---|---:|---:|---:|---:|---:|---:|
+| Generic | 4 lines + 8 cubics | 24 | 31 | 72 | 44 | 144 |
+| Phone body | 4 lines + 8 cubics | 24 | 35 | 84 | 52 | 168 |
+
+Each band face has one four-edge loop/four pcurves. The top has one 12-edge loop/12 pcurves. The modified generic base face has two loops/16 edges/pcurves; the phone base has two loops/20 edges/pcurves. CLI `faces` reports numeric IDs, semantic identity, loop count, and edge count; the validated all-coedge pcurve coverage supplies the matching per-face pcurve count. Both shells are closed, manifold, and orientation-consistent, with no open trim loops.
+
+## Admission and tolerances
+
+A Bernstein bound on cross(C-c,C') proves positive angular progression; endpoint sectors and exactly one winding prove a simple star-shaped loop. Positive scale gives nested contacts. Monotone section height prevents bands at different section heights from intersecting; source sectors prevent adjacent spans from overlapping. Regularity and distinct positive height/width rule out collapsed patches. Contact control hulls must lie strictly inside the host's line/convex-arc support boundary. Unproved inputs fail typed rather than relying on sewing.
+
+X1 admits one unmodified Profile extrusion, one planar top outer loop, and line/single-span cubic footprint geometry. Holes in the host, reflex support arcs, arbitrary modified hosts, and other support surfaces are not admitted. Straight polygon corners intentionally retain G0 creases between band spans; they do not imply G2 there.
+
+No global sewing tolerance changed. Local identity/closure thresholds are 1e-8 mm, host containment clearance is 1e-7 mm, and existing pcurve verification uses 1e-5 mm. The supported scale tests are 0.1x, 1x, and 10x; extreme-scale universality is not claimed.
+
+## Measured continuity and trim evidence
+
+Analytic B-spline first/second derivatives are evaluated at 33 positions along every join. G1 is normal angle in degrees; G2 is the Frobenius residual of the shape operator in a shared world tangent basis, in 1/mm. Sampling checks the construction; it is not a global numerical certificate.
+
+| Witness / joins | G0 max mm | G1 max degrees | G2 max 1/mm |
+|---|---:|---:|---:|
+| Generic base support (12) | 0 | 0 | 0 |
+| Generic raised support (12) | 0 | 0 | 0 |
+| Generic quarter joins (12) | 0 | 0 | 0 |
+| Generic neighboring spans (24) | 1.005e-14 | 9.441e-13 | 1.408e-14 |
+| Phone base support (12) | 0 | 0 | 0 |
+| Phone raised support (12) | 0 | 0 | 0 |
+| Phone quarter joins (12) | 0 | 0 | 0 |
+| Phone neighboring spans (24) | 1.281e-14 | 7.694e-13 | 2.676e-14 |
+
+Maximum edge-versus-surface deviation: generic 1.005e-14 mm; phone 3.178e-14 mm. UV closure maxima are 1.005e-14 and 1.281e-14 respectively. Every coedge has a valid domain and consistent orientation. Tests additionally compare polynomial pcurve control reconstruction, degree, and knots against the 3D edge controls.
+
+## Phone burn-in and fresh authoring
+
+[Refined source](../../fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament) was written by a fresh agent given only public docs, the generic example, and the reconstruction README. It used ordinary Template/Record/Assembly authoring without kernel edits or manual trims. The body keeps 77.98 x 163.43 x 8.75 mm dimensions. The outer plateau contact remains 72.76 x 43 mm, centered at (38.99,-23.99), with 11.5 mm smooth corner extent and 2.55 mm rise. Width is explicitly 2 mm; the associated X inset is approximately 3.384 mm.
+
+Independent evaluation of exported top-contact curves found minimum camera-circle clearance 0.275579 mm, with a conservative sampling bound above 0.273322 mm. Feature positions, diameters, and the 1.88 mm camera rise remain unchanged. Body plus plateau is one coherent solid; the assembly has 16 definitions and 28 product occurrences (29 including the root).
+
+The fresh test exposed and helped resolve two generic friction points:
+
+- STEP loop classification used only two chords per circular quadrant and falsely rejected an inner contact by 0.03738 mm. Its classification-only angular sampling now uses pi/64; exact circles remain untouched. No winding or topology repair was introduced.
+- Display attempted coarse 3D-to-UV reprojection despite available trim bindings. Assembly display now recovers/verifies pcurves through the existing builder, and the bounded B-spline renderer consumes them. All faces render; the refined assembly contains 11,652 display triangles.
+
+Standalone `inspect` is for the Model witness; assemblies use `asm inspect`. Plateau dispatch no longer mistakes a reusable assembly template for a standalone Model.
+
+The +2 mm length variation updates the 13 explicitly authored bottom-detail translations as documented in the reconstruction README. A +0.1 mm plateau-height variation also passes. Both regenerate 35-face manifold bodies and G2 joins, with maximum pcurve deviation 3.178e-14 mm.
+
+## Identical-camera evidence
+
+The preview script reads CLI-generated meshes; the refined section reads the actual surface control net at Y=-23.99 mm. It does not create CAD geometry. Before remains the untouched blockout. Cameras, crops, neutral color, and illumination are fixed per comparison. The Drawing Notes support the rear stack and feature layout, but do not supply an exact transition-width/profile law; no invented drawing curve is overlaid.
+
+![Generic raised plateau](../../artifacts/local/surf-g2-loop-x1/generic-shaded.png)
+
+![Rear three-quarter before and after](../../artifacts/local/surf-g2-loop-x1/comparison-rear-three-quarter.png)
+
+![Camera close-up before and after](../../artifacts/local/surf-g2-loop-x1/comparison-camera-closeup.png)
+
+![Side profile before and after](../../artifacts/local/surf-g2-loop-x1/comparison-side-profile.png)
+
+![Plateau section before and after](../../artifacts/local/surf-g2-loop-x1/comparison-section.png)
+
+Display triangulation is derived and visibly coarser than the analytic surface. The direct `mesh --format obj/stl` SurfaceMeshIR route still rejects B-spline supports; the qualified preview route is `assembly-json` through the bounded tessellator. This is not a claim of a new watertight export mesh capability.
+
+## STEP, performance, and persistence limits
+
+Standalone body AP242 contains exact 3D B-splines, tensor surfaces, and exact polynomial UV pcurves. The existing product-structure assembly exporter retains the exact surfaces/edges and manifold definitions but does not serialize pcurve associations; these are recovered after import. Full pcurve serialization evidence is therefore the standalone generic and phone-body STEP, not the assembly STEP. Likewise, semantic span/face identities live in the inspection report; AP242 topology IDs may be renumbered on reimport. Product/occurrence identities are retained by assembly export.
+
+| Witness | Contact plan ms | Trim/BRep graft ms | Total including export/reimport ms | Standalone STEP bytes |
+|---|---:|---:|---:|---:|
+| Generic | 111.8 | 117.4 | 352.5 | 104,418 |
+| Phone body | 109.1 | 145.2 | 415.0 | 807,663 |
+
+These are single local cold measurements, not benchmarks. Contact timing includes differential verification; graft timing includes pcurve construction/preflight. Total also includes initial host construction and STEP checks. Retained conic pcurve export uses the existing sampled serialization, accounting for the phone body's larger file. New polynomial contacts do not use it.
+
+Repeated generic builds and freshly installed packaged CLI builds have byte-identical STEP. Packaged phone assembly STEP matches the fresh authoring export. Control data, pcurves, source order, seam selection, and face identities are deterministic by construction and covered by repeated export checks.
+
+## Validation and reproduction
+
+Release solution build: zero warnings/errors. Full serial solution regression: **3,606 passed**, all 20 test projects exited zero (the disabled legacy FrictionLab project has no active tests). This includes existing local circular/G2 fillets, SmoothRoundedRect2, SectionChain G1, STEP classification, display, and prior geometry regressions. The 18 new Plateau cases cover mixed/straight loops, tight corners, three scales, dimensional variations, zero/negative/excessive width, invalid height, outside support, degenerate/self-crossing footprints, retained topology, deterministic export, exact pcurves, and the fresh-authored phone assembly/display.
+
+The isolated packaged CLI 2.0.0-preview.3 build/export checks, repository layout guard, documentation links, generic-code fixture-name scan, and `git diff --check` pass. Full logs and generated evidence are ignored under `artifacts/local/surf-g2-loop-x1/`; images linked above are local run artifacts.
+
+```powershell
+dotnet build Aetheris.slnx -c Release --no-restore
+$cli = Resolve-Path Aetheris.CLI/bin/Release/net10.0/aetheris.exe
+& $cli build fixtures/Canonical/Surfacing/g2-planar-plateau.firmament --out artifacts/local/surf-g2-loop-x1/generic.step --json
+& $cli inspect fixtures/Canonical/Surfacing/g2-planar-plateau.firmament --json
+& $cli asm inspect fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament --json
+& $cli asm export-ap242 fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament --out artifacts/local/surf-g2-loop-x1/refined.step --json
+& $cli mesh fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament --format assembly-json --output artifacts/local/surf-g2-loop-x1/after.mesh.json
+& $cli mesh fixtures/Experiments/IPhone17ProMax/blockout.firmament --format assembly-json --output artifacts/local/surf-g2-loop-x1/before.mesh.json
+```
+
+`qualify-surf-g2-loop-x1.py` renders the generated comparison inputs and the standalone phone-body control report. The latter is built by wrapping the phone declaration catalog in an ordinary Model and applying `Struct Part = BodyPart<Spec: Standard>`, exactly as assembly specialization does. A one-occurrence template wrapper around the generic example supplies `generic.mesh.json`. The script requires numpy, Pillow, and matplotlib.
+
+Deferred: exact Apple hidden splines, lens ring refinement, body side-edge refinement, forward sensor partitioning, exact material keepout union, manufacturing equivalence, arbitrary support surfaces, normal-distance offsets, and the implicit EdgeFinish form. None are required to use the admitted generic Plateau construction.
diff --git a/docs/release/SURF-G2-X1.md b/docs/release/SURF-G2-X1.md
new file mode 100644
index 00000000..6026b3d5
--- /dev/null
+++ b/docs/release/SURF-G2-X1.md
@@ -0,0 +1,102 @@
+# SURF-G2-X1: normalization and geometric continuity evidence
+
+## Executive verdict
+
+**Meaningful progression, not G2 acceptance.** The ordinary Firmament SectionChain path now admits circular arcs to smooth G1 construction through bounded, inspectable, non-rational normalization. A generic mixed line/arc witness exports deterministic AP242, reimports as enclosed-manifold, and exposes its actual geometric curvature discontinuities. The original arc-admission blocker is removed.
+
+No new curvature-constrained transition family is delivered. `Continuity: G2` remains a typed rejection. Planar-step, convex, concave, and rounded-plateau G2 witnesses have not passed; the phone burn-in and fresh-agent plateau-authoring exercise therefore did not run. A successful normalized G1 solid is not substituted for those acceptance requirements.
+
+## Authority audit
+
+| Question | Finding |
+|---|---|
+| Curves entering authored SectionChain | `SectionChainAuthoringParser.Convert` admits ordinary Profile lines and circular arcs. |
+| Smooth G1 inputs before this change | `SmoothSectionChainBuilder.ExtractCurveData` admits lines and compatible polynomial B-splines; matching degree/multiplicities/knots are required. |
+| Arc rejection | `SmoothSectionChainBuilder.ValidateCompatibility` previously emitted `section-chain-g1-degree-limit` because arcs did not have polynomial controls. |
+| Existing polynomial representation | `SectionProfileCurve.PolynomialBSpline`, `BSpline3Curve`, and tensor `BSplineSurfaceWithKnots`; the normal BRep/AP242 path already lowers these without rational weights. |
+| Existing derivative data | The smooth builder derives first derivatives of corresponding world-space controls from a nonuniform three-section stencil, then constructs cubic longitudinal patches. It has no parent-support second-order boundary contract. Curve first/second derivative evaluators already exist and are reused by the new inspection. |
+| Existing G2 authority | `BlendBoundaryOperation` already supports a bounded rectangular crown-to-planar-shoulder polynomial family. `ReplaceRegion` checks its planar boundary contracts; `ConstructionStateReplayer` replays the operation transactionally. This is not a raised flat plateau with curved footprint. |
+| Other continuity utilities | `PanelMateValidator` uses normal-curvature queries; `CurvatureQuery` handles first/second fundamental forms. The new SectionChain inspection uses the same geometric principle on its realized tensor-spline derivatives, rather than comparing raw parameter accelerations. |
+| Semantic location of future G2 | Extend a typed support/boundary contract in the existing transition/construction authority. Do not manufacture G2 intent from normalized curve controls or accept a label in the parser alone. |
+| Minimum remaining representation | A bounded longitudinal second-order boundary law, parent Plane/Cylinder-derived tangent/curvature constraints, selected join identities, and a deliberate treatment of line/arc footprint curvature discontinuities. Parent-face trimming and construction correspondence must accompany the law. |
+
+SURF-X3b's `AddSectionChain` and `RemoveSectionChain` remain bounded housing operations, not arbitrary plateau grafts. The existing `BlendBoundary` generates a polynomial crown which returns to a planar shoulder on four boundaries; it has no flat elevated terminal plateau or rounded outer transition band. Reusing its G2 label would not make it the requested witness.
+
+## Profile normalization
+
+`SectionProfileNormalizer` runs only for smooth SectionChain construction, after semantic correspondence validation. Authored profiles remain unchanged. Prepared edges and transition surfaces both use the same normalized curves, so pcurves and shared topology are not asked to reconcile an exact circle edge with a nearby polynomial surface.
+
+Circular arcs use quintic Hermite polynomials matching endpoint position, first derivative, and second derivative. Segment choices are the fixed set 1, 2, 4, 8, 16. The Judgment Engine first excludes candidates whose bound exceeds tolerance, then prefers the smallest admitted segment count. All sections in a corresponding track use the same segmentation and direction. Lines opposite arcs are represented exactly in that degree/knot basis. Existing polynomial tracks remain unchanged; an existing polynomial opposite an arc must already have compatible quintic knots. Arbitrary knot conversion is rejected.
+
+The optional authored field is:
+
+```firmament
+SectionChain RoundedSections {
+ Continuity: G1
+ ApproximationTolerance: 0.00001mm
+ // ordinary named Sections, Frames and Profiles
+}
+```
+
+The default is 0.00001 mm, degree is fixed at 5, and the maximum is 16 polynomial segments per source arc. The error bound is `sqrt(2) * R * abs(segmentSweep)^6 / (720 * 64)` plus a conservative coordinate-scale floating-point allowance. This follows the componentwise two-endpoint quintic Hermite remainder. Sampled positional deviation and endpoint position/tangent residuals are separately checked and reported. No request is silently relaxed.
+
+The [canonical fixture](../../fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament) has a 60 x 40 mm R8 mixed line/arc profile at three stations, Z=0,8,16. Twelve source arcs normalize to four degree-5 spans each; there are 21 controls per normalized arc. Original semantic span and section identities remain the provenance keys. Internal polynomial knots do not become anonymous author-controlled topology.
+
+| Measured item | Result |
+|---|---:|
+| Requested approximation tolerance | 0.00001 mm |
+| Maximum error bound | 0.0000009004351044 mm |
+| Maximum sampled position deviation | 0.0000006353890202 mm |
+| Endpoint position error | 0 mm |
+| Representative endpoint tangent error | 3.51e-15 degrees |
+| Transition patches | 16 |
+| Transition controls | 800 |
+| Final faces, including planar caps | 18 |
+| STEP size | 2,444,777 bytes |
+
+Representative normalized curve `A.BottomRightCorner` control hash: `0F2C36D6D745D601BC84B724125B413B0091ACE9625DCF82902437188502D9FD`.
+
+STEP SHA-256: `55223460C946AB245A0A44CDD857EA13F081F9C8DC2FD7E82648DCBAD34E666F`. Repeated repository builds and the freshly packaged CLI outside the checkout produced this same value. The measured transition/stitch/validation phases were approximately 432/130/28 ms in one local run; these are observational timings, not deterministic data or a complete end-to-end benchmark. Existing timing buckets exclude normalization and the new differential inspection.
+
+## Geometric evidence and the next blocker
+
+`geometricJoins` inspects realized tensor B-spline patches using analytic first/second derivatives. It reports position mismatch, normal angle, and the Frobenius residual between second fundamental forms expressed in a common orthonormal world tangent basis. Thus different parameter speeds do not by themselves create a curvature mismatch. Curvature status is conditional on successful G0 and G1 checks. Sampling includes endpoints, 33 regular parameters and applicable knots; it is explicitly not a global continuity certificate. Terminal caps are outside this join report.
+
+| Boundary family on canonical fixture | G0 | Normal angle | Curvature residual | Status |
+|---|---:|---:|---:|---|
+| Internal section B, corresponding spans | 0 mm | 0 degrees | 0 /mm | G2 within sampled tolerance for this straight extrusion |
+| Neighboring R8 line/arc transition patches | 0 mm | 0 degrees | 0.125 /mm | G1 |
+
+The second result is the decisive next blocker. A straight source span has zero curvature, while its tangent circular neighbor has curvature 1/8 per mm. Endpoint-preserving normalization retains the jump. A longitudinal quintic law alone cannot remove it from the realized footprint seams. The new tests measure this on the actual surface patches, not just on a drawing or a continuity label.
+
+The [G2 rejection fixture](../../fixtures/Invalid/SectionChain/g2-not-admitted.firmament) returns `section-chain-continuity-invalid:G2` and emits no STEP. The [unachievable tolerance fixture](../../fixtures/Invalid/SectionChain/normalization-tolerance-unmet.firmament) returns `section-chain-normalization-tolerance-unmet` and emits no STEP. This is not yet a planar-step/G2 implementation.
+
+The next implementation must define which parent boundaries must be G2 and derive their support data, then resolve both longitudinal curvature matching and the footprint seam behavior within an explicit error policy. Returning a G1 rounded band or the existing rectangular crown as a completed plateau would conceal these remaining requirements.
+
+## Locality, representation, and failure behavior
+
+- Normalization is surfacing-only. Existing exact non-surfacing circular profiles still use their analytic path, covered by the boundary regression suite. Line-only smooth geometry and explicit G0 generation are unchanged.
+- The existing shared-edge, pcurve, loop/orientation, self-intersection and BRep validation path remains authoritative. No post-build sewing, repair tolerance increase, or separate executor was added.
+- Normalization errors return no body. Invalid tolerances, degenerate arcs, unsupported curve kinds, and incompatible track representations fail typed. G2 requests do not fall back to G1.
+- A changed common segment count changes the whole corresponding track. `SectionChainEditor` therefore reports all transitions/tangent fields as dependent and does not claim unchanged caps in that case. Without a grid change, existing G1 stencil locality remains intact. This is conservative dependency reporting, not a new local BRep graft guarantee.
+- No new `ConstructionState` operation is introduced. Existing replay/locality tests pass; new normalization is reached when an existing SectionChain operation materializes its semantic chain.
+
+## Validation and reproduction
+
+Run [qualify-surf-g2-x1.ps1](../../scripts/qualify-surf-g2-x1.ps1) after a Release build. It runs build/repeat/inspect/validate/reimport through the CLI, checks the normalization error policy and diagnosed curvature jump, and requires transactional failure for the two invalid fixtures. Outputs default to ignored `artifacts/local/surf-g2-x1/qualification/`.
+
+- Release solution build: passed, zero warnings/errors.
+- Full serial solution regression: all 20 test-project commands exited zero; 3,570 tests passed. FrictionLab still reports no discoverable tests. No unrelated failure occurred in this serial run.
+- Focused normalization tests: 16 passed, including dense radial-error sampling, endpoint/internal-knot derivatives, common segmentation, deterministic STEP, line/polynomial preservation, invalid tolerance/arc/type/topology, and widened edit dependencies. Two of these tests were added after the serial run and passed separately.
+- Focused Firmament/analytic-boundary tests: 47 passed, including the new source-to-BRep normalization and geometric-join checks.
+- A 64 x 44 mm R9, 20 mm-high variation also reimported enclosed-manifold with the same 18-face topology.
+- Fresh NuGet tool package installed outside the checkout: `section-chain validate`, `inspect`, `build`, and STEP `analyze` succeeded; STEP hash matched the repository build.
+- Documentation/link checks, repository layout guard and `git diff --check` are part of closure.
+
+The initial G0 circular-section test probe exposed an existing ruled-arc pcurve approximation mismatch, approximately 0.000300 mm against a 0.00001 mm pcurve tolerance. G0 bypasses the new normalizer. That probe was not turned into a G0 capability claim or patched by relaxing tolerance; existing supported G0 tests remain green.
+
+## Acceptance coverage
+
+Profile normalization, error/provenance inspection, deterministic export, manifold reimport, and geometric seam inspection are delivered. New G2 boundary conditions, Plane/Cylinder support extraction, planar-step/convex/concave/rounded-plateau witnesses, Round-versus-G2 comparison, impossible-curvature/width tests, G2 transactional locality, and G2 parameter variation remain unimplemented.
+
+The iPhone geometry and previous +2 mm variant were not modified. Only the old witness comment and public limitation text were refreshed because the original arc-admission diagnosis is now historical. Phone G2 burn-in, the fresh-agent plateau authoring test, and requalification of the phone length variant await the four general witnesses. No G2 before/after image or product claim is supplied.
diff --git a/fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament b/fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament
new file mode 100644
index 00000000..7aad4034
--- /dev/null
+++ b/fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament
@@ -0,0 +1,34 @@
+Model NormalizedRoundedSections {
+ Units: mm
+ Concept Struct Frames {
+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [0,0,1] Up: [0,1,0] }
+ B: Plane { Origin: [0mm,0mm,8mm] Normal: [0,0,1] Up: [0,1,0] }
+ C: Plane { Origin: [0mm,0mm,16mm] Normal: [0,0,1] Up: [0,1,0] }
+ }
+ Construction Plane FA { Trace: Frames.A }
+ Construction Plane FB { Trace: Frames.B }
+ Construction Plane FC { Trace: Frames.C }
+ RoundedRect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] Radius: 8mm }
+ Profile P { Loop Outer { Outline |> TraceLoop } }
+ SectionChain RoundedSections {
+ Continuity: G1
+ ApproximationTolerance: 0.00001mm
+ Section A {
+ Frame: FA
+ Profile: P
+ Seam: Bottom
+ }
+ Section B {
+ Frame: FB
+ Profile: P
+ Seam: Bottom
+ }
+ Section C {
+ Frame: FC
+ Profile: P
+ Seam: Bottom
+ }
+ Start: Cap
+ End: Cap
+ }
+}
diff --git a/fixtures/Canonical/SectionChain/smooth-corner-sections.firmament b/fixtures/Canonical/SectionChain/smooth-corner-sections.firmament
new file mode 100644
index 00000000..314da58a
--- /dev/null
+++ b/fixtures/Canonical/SectionChain/smooth-corner-sections.firmament
@@ -0,0 +1,34 @@
+Model SmoothCornerSections {
+ Units: mm
+ Concept Struct Frames {
+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [0,0,1] Up: [0,1,0] }
+ B: Plane { Origin: [0mm,0mm,8mm] Normal: [0,0,1] Up: [0,1,0] }
+ C: Plane { Origin: [0mm,0mm,16mm] Normal: [0,0,1] Up: [0,1,0] }
+ }
+ Construction Plane FA { Trace: Frames.A }
+ Construction Plane FB { Trace: Frames.B }
+ Construction Plane FC { Trace: Frames.C }
+ SmoothRoundedRect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] CornerExtent: 8mm }
+ Profile P { Loop Outer { Outline |> TraceLoop } }
+ SectionChain RoundedSections {
+ Continuity: G1
+ ApproximationTolerance: 0.00001mm
+ Section A {
+ Frame: FA
+ Profile: P
+ Seam: Bottom
+ }
+ Section B {
+ Frame: FB
+ Profile: P
+ Seam: Bottom
+ }
+ Section C {
+ Frame: FC
+ Profile: P
+ Seam: Bottom
+ }
+ Start: Cap
+ End: Cap
+ }
+}
diff --git a/fixtures/Canonical/Surfacing/g2-planar-plateau.firmament b/fixtures/Canonical/Surfacing/g2-planar-plateau.firmament
new file mode 100644
index 00000000..34944228
--- /dev/null
+++ b/fixtures/Canonical/Surfacing/g2-planar-plateau.firmament
@@ -0,0 +1,18 @@
+Model GenericG2Plateau {
+ Units: mm
+ Struct Part {
+ Rect2 BaseBoundary { Center: [0mm,0mm] Size: [100mm,80mm] }
+ Profile BaseSection { Loop Outer { BaseBoundary |> TraceLoop } }
+ Extrude Body { Profile: BaseSection From: 0mm To: 5mm }
+ SmoothRoundedRect2 Footprint { Center: [0mm,0mm] Size: [60mm,40mm] CornerExtent: 8mm }
+ Profile PlateauFootprint { Loop Outer { Footprint |> TraceLoop } }
+ Plateau Raised {
+ Base: Body
+ Footprint: PlateauFootprint
+ Height: 3mm
+ Width: 2mm
+ Inset: Homothetic
+ Continuity: G2
+ }
+}
+}
diff --git a/fixtures/Canonical/Surfacing/g2-planar-plateau.step b/fixtures/Canonical/Surfacing/g2-planar-plateau.step
new file mode 100644
index 00000000..9975910a
--- /dev/null
+++ b/fixtures/Canonical/Surfacing/g2-planar-plateau.step
@@ -0,0 +1,2159 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('Aetheris AP242 subset export'),'2;1');
+FILE_NAME('aetheris_export.step','1970-01-01T00:00:00',('Aetheris'),('Aetheris'),'Aetheris.Kernel','Aetheris.Kernel','');
+FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'));
+ENDSEC;
+DATA;
+#1=REPRESENTATION_CONTEXT('2D','parameter space');
+#2=CARTESIAN_POINT($,(0,0,0));
+#3=DIRECTION($,(-0,-0,-1));
+#4=DIRECTION($,(1,0,0));
+#5=AXIS2_PLACEMENT_3D($,#2,#3,#4);
+#6=PLANE($,#5);
+#7=CARTESIAN_POINT($,(0,0,5));
+#8=DIRECTION($,(0,0,1));
+#9=DIRECTION($,(1,0,0));
+#10=AXIS2_PLACEMENT_3D($,#7,#8,#9);
+#11=PLANE($,#10);
+#12=CARTESIAN_POINT($,(-50,-40,0));
+#13=DIRECTION($,(0,-1,0));
+#14=DIRECTION($,(0,0,1));
+#15=AXIS2_PLACEMENT_3D($,#12,#13,#14);
+#16=PLANE($,#15);
+#17=CARTESIAN_POINT($,(50,-40,0));
+#18=DIRECTION($,(1,0,0));
+#19=DIRECTION($,(0,0,1));
+#20=AXIS2_PLACEMENT_3D($,#17,#18,#19);
+#21=PLANE($,#20);
+#22=CARTESIAN_POINT($,(50,40,0));
+#23=DIRECTION($,(0,1,0));
+#24=DIRECTION($,(0,0,1));
+#25=AXIS2_PLACEMENT_3D($,#22,#23,#24);
+#26=PLANE($,#25);
+#27=CARTESIAN_POINT($,(-50,40,0));
+#28=DIRECTION($,(-1,0,0));
+#29=DIRECTION($,(0,0,1));
+#30=AXIS2_PLACEMENT_3D($,#27,#28,#29);
+#31=PLANE($,#30);
+#32=CARTESIAN_POINT($,(-22,-20,5));
+#33=CARTESIAN_POINT($,(-21.725,-19.75,5));
+#34=CARTESIAN_POINT($,(-21.45,-19.5,5));
+#35=CARTESIAN_POINT($,(-20.9,-19,5.75));
+#36=CARTESIAN_POINT($,(-20.9,-19,6.125));
+#37=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#38=CARTESIAN_POINT($,(22,-20,5));
+#39=CARTESIAN_POINT($,(21.725,-19.75,5));
+#40=CARTESIAN_POINT($,(21.45,-19.5,5));
+#41=CARTESIAN_POINT($,(20.9,-19,5.75));
+#42=CARTESIAN_POINT($,(20.9,-19,6.125));
+#43=CARTESIAN_POINT($,(20.9,-19,6.5));
+#44=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#32,#33,#34,#35,#36,#37),(#38,#39,#40,#41,#42,#43)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#45=CARTESIAN_POINT($,(22,-20,5));
+#46=CARTESIAN_POINT($,(21.725,-19.75,5));
+#47=CARTESIAN_POINT($,(21.45,-19.5,5));
+#48=CARTESIAN_POINT($,(20.9,-19,5.75));
+#49=CARTESIAN_POINT($,(20.9,-19,6.125));
+#50=CARTESIAN_POINT($,(20.9,-19,6.5));
+#51=CARTESIAN_POINT($,(24.7271713220297,-20,5));
+#52=CARTESIAN_POINT($,(24.4180816805043,-19.75,5));
+#53=CARTESIAN_POINT($,(24.108992038979,-19.5,5));
+#54=CARTESIAN_POINT($,(23.4908127559282,-19,5.75));
+#55=CARTESIAN_POINT($,(23.4908127559282,-19,6.125));
+#56=CARTESIAN_POINT($,(23.4908127559282,-19,6.5));
+#57=CARTESIAN_POINT($,(27.4543426440594,-20,5));
+#58=CARTESIAN_POINT($,(27.1111633610087,-19.75,5));
+#59=CARTESIAN_POINT($,(26.7679840779579,-19.5,5));
+#60=CARTESIAN_POINT($,(26.0816255118565,-19,5.75));
+#61=CARTESIAN_POINT($,(26.0816255118565,-19,6.125));
+#62=CARTESIAN_POINT($,(26.0816255118565,-19,6.5));
+#63=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#64=CARTESIAN_POINT($,(28.3680816805043,-18.4930816805043,5));
+#65=CARTESIAN_POINT($,(28.008992038979,-18.258992038979,5));
+#66=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,5.75));
+#67=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.125));
+#68=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#69=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#45,#46,#47,#48,#49,#50),(#51,#52,#53,#54,#55,#56),(#57,#58,#59,#60,#61,#62),(#63,#64,#65,#66,#67,#68)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#70=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#71=CARTESIAN_POINT($,(28.3680816805043,-18.4930816805043,5));
+#72=CARTESIAN_POINT($,(28.008992038979,-18.258992038979,5));
+#73=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,5.75));
+#74=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.125));
+#75=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#76=CARTESIAN_POINT($,(30,-17.4543426440594,5));
+#77=CARTESIAN_POINT($,(29.625,-17.2361633610087,5));
+#78=CARTESIAN_POINT($,(29.25,-17.0179840779579,5));
+#79=CARTESIAN_POINT($,(28.5,-16.5816255118565,5.75));
+#80=CARTESIAN_POINT($,(28.5,-16.5816255118565,6.125));
+#81=CARTESIAN_POINT($,(28.5,-16.5816255118565,6.5));
+#82=CARTESIAN_POINT($,(30,-14.7271713220297,5));
+#83=CARTESIAN_POINT($,(29.625,-14.5430816805043,5));
+#84=CARTESIAN_POINT($,(29.25,-14.358992038979,5));
+#85=CARTESIAN_POINT($,(28.5,-13.9908127559282,5.75));
+#86=CARTESIAN_POINT($,(28.5,-13.9908127559282,6.125));
+#87=CARTESIAN_POINT($,(28.5,-13.9908127559282,6.5));
+#88=CARTESIAN_POINT($,(30,-12,5));
+#89=CARTESIAN_POINT($,(29.625,-11.85,5));
+#90=CARTESIAN_POINT($,(29.25,-11.7,5));
+#91=CARTESIAN_POINT($,(28.5,-11.4,5.75));
+#92=CARTESIAN_POINT($,(28.5,-11.4,6.125));
+#93=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#94=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#70,#71,#72,#73,#74,#75),(#76,#77,#78,#79,#80,#81),(#82,#83,#84,#85,#86,#87),(#88,#89,#90,#91,#92,#93)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#95=CARTESIAN_POINT($,(30,-12,5));
+#96=CARTESIAN_POINT($,(29.625,-11.85,5));
+#97=CARTESIAN_POINT($,(29.25,-11.7,5));
+#98=CARTESIAN_POINT($,(28.5,-11.4,5.75));
+#99=CARTESIAN_POINT($,(28.5,-11.4,6.125));
+#100=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#101=CARTESIAN_POINT($,(30,12,5));
+#102=CARTESIAN_POINT($,(29.625,11.85,5));
+#103=CARTESIAN_POINT($,(29.25,11.7,5));
+#104=CARTESIAN_POINT($,(28.5,11.4,5.75));
+#105=CARTESIAN_POINT($,(28.5,11.4,6.125));
+#106=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#107=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#95,#96,#97,#98,#99,#100),(#101,#102,#103,#104,#105,#106)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#108=CARTESIAN_POINT($,(30,12,5));
+#109=CARTESIAN_POINT($,(29.625,11.85,5));
+#110=CARTESIAN_POINT($,(29.25,11.7,5));
+#111=CARTESIAN_POINT($,(28.5,11.4,5.75));
+#112=CARTESIAN_POINT($,(28.5,11.4,6.125));
+#113=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#114=CARTESIAN_POINT($,(30,14.7271713220297,5));
+#115=CARTESIAN_POINT($,(29.625,14.5430816805043,5));
+#116=CARTESIAN_POINT($,(29.25,14.358992038979,5));
+#117=CARTESIAN_POINT($,(28.5,13.9908127559282,5.75));
+#118=CARTESIAN_POINT($,(28.5,13.9908127559282,6.125));
+#119=CARTESIAN_POINT($,(28.5,13.9908127559282,6.5));
+#120=CARTESIAN_POINT($,(30,17.4543426440594,5));
+#121=CARTESIAN_POINT($,(29.625,17.2361633610087,5));
+#122=CARTESIAN_POINT($,(29.25,17.0179840779579,5));
+#123=CARTESIAN_POINT($,(28.5,16.5816255118565,5.75));
+#124=CARTESIAN_POINT($,(28.5,16.5816255118565,6.125));
+#125=CARTESIAN_POINT($,(28.5,16.5816255118565,6.5));
+#126=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#127=CARTESIAN_POINT($,(28.3680816805043,18.4930816805043,5));
+#128=CARTESIAN_POINT($,(28.008992038979,18.258992038979,5));
+#129=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,5.75));
+#130=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.125));
+#131=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#132=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#108,#109,#110,#111,#112,#113),(#114,#115,#116,#117,#118,#119),(#120,#121,#122,#123,#124,#125),(#126,#127,#128,#129,#130,#131)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#133=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#134=CARTESIAN_POINT($,(28.3680816805043,18.4930816805043,5));
+#135=CARTESIAN_POINT($,(28.008992038979,18.258992038979,5));
+#136=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,5.75));
+#137=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.125));
+#138=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#139=CARTESIAN_POINT($,(27.4543426440594,20,5));
+#140=CARTESIAN_POINT($,(27.1111633610087,19.75,5));
+#141=CARTESIAN_POINT($,(26.7679840779579,19.5,5));
+#142=CARTESIAN_POINT($,(26.0816255118565,19,5.75));
+#143=CARTESIAN_POINT($,(26.0816255118565,19,6.125));
+#144=CARTESIAN_POINT($,(26.0816255118565,19,6.5));
+#145=CARTESIAN_POINT($,(24.7271713220297,20,5));
+#146=CARTESIAN_POINT($,(24.4180816805043,19.75,5));
+#147=CARTESIAN_POINT($,(24.108992038979,19.5,5));
+#148=CARTESIAN_POINT($,(23.4908127559282,19,5.75));
+#149=CARTESIAN_POINT($,(23.4908127559282,19,6.125));
+#150=CARTESIAN_POINT($,(23.4908127559282,19,6.5));
+#151=CARTESIAN_POINT($,(22,20,5));
+#152=CARTESIAN_POINT($,(21.725,19.75,5));
+#153=CARTESIAN_POINT($,(21.45,19.5,5));
+#154=CARTESIAN_POINT($,(20.9,19,5.75));
+#155=CARTESIAN_POINT($,(20.9,19,6.125));
+#156=CARTESIAN_POINT($,(20.9,19,6.5));
+#157=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#133,#134,#135,#136,#137,#138),(#139,#140,#141,#142,#143,#144),(#145,#146,#147,#148,#149,#150),(#151,#152,#153,#154,#155,#156)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#158=CARTESIAN_POINT($,(22,20,5));
+#159=CARTESIAN_POINT($,(21.725,19.75,5));
+#160=CARTESIAN_POINT($,(21.45,19.5,5));
+#161=CARTESIAN_POINT($,(20.9,19,5.75));
+#162=CARTESIAN_POINT($,(20.9,19,6.125));
+#163=CARTESIAN_POINT($,(20.9,19,6.5));
+#164=CARTESIAN_POINT($,(-22,20,5));
+#165=CARTESIAN_POINT($,(-21.725,19.75,5));
+#166=CARTESIAN_POINT($,(-21.45,19.5,5));
+#167=CARTESIAN_POINT($,(-20.9,19,5.75));
+#168=CARTESIAN_POINT($,(-20.9,19,6.125));
+#169=CARTESIAN_POINT($,(-20.9,19,6.5));
+#170=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#158,#159,#160,#161,#162,#163),(#164,#165,#166,#167,#168,#169)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#171=CARTESIAN_POINT($,(-22,20,5));
+#172=CARTESIAN_POINT($,(-21.725,19.75,5));
+#173=CARTESIAN_POINT($,(-21.45,19.5,5));
+#174=CARTESIAN_POINT($,(-20.9,19,5.75));
+#175=CARTESIAN_POINT($,(-20.9,19,6.125));
+#176=CARTESIAN_POINT($,(-20.9,19,6.5));
+#177=CARTESIAN_POINT($,(-24.7271713220297,20,5));
+#178=CARTESIAN_POINT($,(-24.4180816805043,19.75,5));
+#179=CARTESIAN_POINT($,(-24.108992038979,19.5,5));
+#180=CARTESIAN_POINT($,(-23.4908127559282,19,5.75));
+#181=CARTESIAN_POINT($,(-23.4908127559282,19,6.125));
+#182=CARTESIAN_POINT($,(-23.4908127559282,19,6.5));
+#183=CARTESIAN_POINT($,(-27.4543426440594,20,5));
+#184=CARTESIAN_POINT($,(-27.1111633610087,19.75,5));
+#185=CARTESIAN_POINT($,(-26.7679840779579,19.5,5));
+#186=CARTESIAN_POINT($,(-26.0816255118565,19,5.75));
+#187=CARTESIAN_POINT($,(-26.0816255118565,19,6.125));
+#188=CARTESIAN_POINT($,(-26.0816255118565,19,6.5));
+#189=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#190=CARTESIAN_POINT($,(-28.3680816805043,18.4930816805043,5));
+#191=CARTESIAN_POINT($,(-28.008992038979,18.258992038979,5));
+#192=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,5.75));
+#193=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.125));
+#194=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#195=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#171,#172,#173,#174,#175,#176),(#177,#178,#179,#180,#181,#182),(#183,#184,#185,#186,#187,#188),(#189,#190,#191,#192,#193,#194)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#196=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#197=CARTESIAN_POINT($,(-28.3680816805043,18.4930816805043,5));
+#198=CARTESIAN_POINT($,(-28.008992038979,18.258992038979,5));
+#199=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,5.75));
+#200=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.125));
+#201=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#202=CARTESIAN_POINT($,(-30,17.4543426440594,5));
+#203=CARTESIAN_POINT($,(-29.625,17.2361633610087,5));
+#204=CARTESIAN_POINT($,(-29.25,17.0179840779579,5));
+#205=CARTESIAN_POINT($,(-28.5,16.5816255118565,5.75));
+#206=CARTESIAN_POINT($,(-28.5,16.5816255118565,6.125));
+#207=CARTESIAN_POINT($,(-28.5,16.5816255118565,6.5));
+#208=CARTESIAN_POINT($,(-30,14.7271713220297,5));
+#209=CARTESIAN_POINT($,(-29.625,14.5430816805043,5));
+#210=CARTESIAN_POINT($,(-29.25,14.358992038979,5));
+#211=CARTESIAN_POINT($,(-28.5,13.9908127559282,5.75));
+#212=CARTESIAN_POINT($,(-28.5,13.9908127559282,6.125));
+#213=CARTESIAN_POINT($,(-28.5,13.9908127559282,6.5));
+#214=CARTESIAN_POINT($,(-30,12,5));
+#215=CARTESIAN_POINT($,(-29.625,11.85,5));
+#216=CARTESIAN_POINT($,(-29.25,11.7,5));
+#217=CARTESIAN_POINT($,(-28.5,11.4,5.75));
+#218=CARTESIAN_POINT($,(-28.5,11.4,6.125));
+#219=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#220=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#196,#197,#198,#199,#200,#201),(#202,#203,#204,#205,#206,#207),(#208,#209,#210,#211,#212,#213),(#214,#215,#216,#217,#218,#219)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#221=CARTESIAN_POINT($,(-30,12,5));
+#222=CARTESIAN_POINT($,(-29.625,11.85,5));
+#223=CARTESIAN_POINT($,(-29.25,11.7,5));
+#224=CARTESIAN_POINT($,(-28.5,11.4,5.75));
+#225=CARTESIAN_POINT($,(-28.5,11.4,6.125));
+#226=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#227=CARTESIAN_POINT($,(-30,-12,5));
+#228=CARTESIAN_POINT($,(-29.625,-11.85,5));
+#229=CARTESIAN_POINT($,(-29.25,-11.7,5));
+#230=CARTESIAN_POINT($,(-28.5,-11.4,5.75));
+#231=CARTESIAN_POINT($,(-28.5,-11.4,6.125));
+#232=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#233=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#221,#222,#223,#224,#225,#226),(#227,#228,#229,#230,#231,#232)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#234=CARTESIAN_POINT($,(-30,-12,5));
+#235=CARTESIAN_POINT($,(-29.625,-11.85,5));
+#236=CARTESIAN_POINT($,(-29.25,-11.7,5));
+#237=CARTESIAN_POINT($,(-28.5,-11.4,5.75));
+#238=CARTESIAN_POINT($,(-28.5,-11.4,6.125));
+#239=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#240=CARTESIAN_POINT($,(-30,-14.7271713220297,5));
+#241=CARTESIAN_POINT($,(-29.625,-14.5430816805043,5));
+#242=CARTESIAN_POINT($,(-29.25,-14.358992038979,5));
+#243=CARTESIAN_POINT($,(-28.5,-13.9908127559282,5.75));
+#244=CARTESIAN_POINT($,(-28.5,-13.9908127559282,6.125));
+#245=CARTESIAN_POINT($,(-28.5,-13.9908127559282,6.5));
+#246=CARTESIAN_POINT($,(-30,-17.4543426440594,5));
+#247=CARTESIAN_POINT($,(-29.625,-17.2361633610087,5));
+#248=CARTESIAN_POINT($,(-29.25,-17.0179840779579,5));
+#249=CARTESIAN_POINT($,(-28.5,-16.5816255118565,5.75));
+#250=CARTESIAN_POINT($,(-28.5,-16.5816255118565,6.125));
+#251=CARTESIAN_POINT($,(-28.5,-16.5816255118565,6.5));
+#252=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#253=CARTESIAN_POINT($,(-28.3680816805044,-18.4930816805043,5));
+#254=CARTESIAN_POINT($,(-28.008992038979,-18.258992038979,5));
+#255=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,5.75));
+#256=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.125));
+#257=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#258=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#234,#235,#236,#237,#238,#239),(#240,#241,#242,#243,#244,#245),(#246,#247,#248,#249,#250,#251),(#252,#253,#254,#255,#256,#257)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#259=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#260=CARTESIAN_POINT($,(-28.3680816805044,-18.4930816805043,5));
+#261=CARTESIAN_POINT($,(-28.008992038979,-18.258992038979,5));
+#262=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,5.75));
+#263=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.125));
+#264=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#265=CARTESIAN_POINT($,(-27.4543426440594,-20,5));
+#266=CARTESIAN_POINT($,(-27.1111633610087,-19.75,5));
+#267=CARTESIAN_POINT($,(-26.7679840779579,-19.5,5));
+#268=CARTESIAN_POINT($,(-26.0816255118565,-19,5.75));
+#269=CARTESIAN_POINT($,(-26.0816255118565,-19,6.125));
+#270=CARTESIAN_POINT($,(-26.0816255118565,-19,6.5));
+#271=CARTESIAN_POINT($,(-24.7271713220297,-20,5));
+#272=CARTESIAN_POINT($,(-24.4180816805044,-19.75,5));
+#273=CARTESIAN_POINT($,(-24.108992038979,-19.5,5));
+#274=CARTESIAN_POINT($,(-23.4908127559282,-19,5.75));
+#275=CARTESIAN_POINT($,(-23.4908127559282,-19,6.125));
+#276=CARTESIAN_POINT($,(-23.4908127559282,-19,6.5));
+#277=CARTESIAN_POINT($,(-22,-20,5));
+#278=CARTESIAN_POINT($,(-21.725,-19.75,5));
+#279=CARTESIAN_POINT($,(-21.45,-19.5,5));
+#280=CARTESIAN_POINT($,(-20.9,-19,5.75));
+#281=CARTESIAN_POINT($,(-20.9,-19,6.125));
+#282=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#283=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#259,#260,#261,#262,#263,#264),(#265,#266,#267,#268,#269,#270),(#271,#272,#273,#274,#275,#276),(#277,#278,#279,#280,#281,#282)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#284=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#285=CARTESIAN_POINT($,(-20.9,-19,6.875));
+#286=CARTESIAN_POINT($,(-20.9,-19,7.25));
+#287=CARTESIAN_POINT($,(-20.35,-18.5,8));
+#288=CARTESIAN_POINT($,(-20.075,-18.25,8));
+#289=CARTESIAN_POINT($,(-19.8,-18,8));
+#290=CARTESIAN_POINT($,(20.9,-19,6.5));
+#291=CARTESIAN_POINT($,(20.9,-19,6.875));
+#292=CARTESIAN_POINT($,(20.9,-19,7.25));
+#293=CARTESIAN_POINT($,(20.35,-18.5,8));
+#294=CARTESIAN_POINT($,(20.075,-18.25,8));
+#295=CARTESIAN_POINT($,(19.8,-18,8));
+#296=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#284,#285,#286,#287,#288,#289),(#290,#291,#292,#293,#294,#295)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#297=CARTESIAN_POINT($,(20.9,-19,6.5));
+#298=CARTESIAN_POINT($,(20.9,-19,6.875));
+#299=CARTESIAN_POINT($,(20.9,-19,7.25));
+#300=CARTESIAN_POINT($,(20.35,-18.5,8));
+#301=CARTESIAN_POINT($,(20.075,-18.25,8));
+#302=CARTESIAN_POINT($,(19.8,-18,8));
+#303=CARTESIAN_POINT($,(23.4908127559282,-19,6.5));
+#304=CARTESIAN_POINT($,(23.4908127559282,-19,6.875));
+#305=CARTESIAN_POINT($,(23.4908127559282,-19,7.25));
+#306=CARTESIAN_POINT($,(22.8726334728775,-18.5,8));
+#307=CARTESIAN_POINT($,(22.5635438313521,-18.25,8));
+#308=CARTESIAN_POINT($,(22.2544541898267,-18,8));
+#309=CARTESIAN_POINT($,(26.0816255118565,-19,6.5));
+#310=CARTESIAN_POINT($,(26.0816255118565,-19,6.875));
+#311=CARTESIAN_POINT($,(26.0816255118565,-19,7.25));
+#312=CARTESIAN_POINT($,(25.395266945755,-18.5,8));
+#313=CARTESIAN_POINT($,(25.0520876627042,-18.25,8));
+#314=CARTESIAN_POINT($,(24.7089083796535,-18,8));
+#315=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#316=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.875));
+#317=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,7.25));
+#318=CARTESIAN_POINT($,(26.5726334728775,-17.3226334728775,8));
+#319=CARTESIAN_POINT($,(26.2135438313521,-17.0885438313521,8));
+#320=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#321=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#297,#298,#299,#300,#301,#302),(#303,#304,#305,#306,#307,#308),(#309,#310,#311,#312,#313,#314),(#315,#316,#317,#318,#319,#320)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#322=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#323=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.875));
+#324=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,7.25));
+#325=CARTESIAN_POINT($,(26.5726334728775,-17.3226334728775,8));
+#326=CARTESIAN_POINT($,(26.2135438313521,-17.0885438313521,8));
+#327=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#328=CARTESIAN_POINT($,(28.5,-16.5816255118565,6.5));
+#329=CARTESIAN_POINT($,(28.5,-16.5816255118565,6.875));
+#330=CARTESIAN_POINT($,(28.5,-16.5816255118565,7.25));
+#331=CARTESIAN_POINT($,(27.75,-16.145266945755,8));
+#332=CARTESIAN_POINT($,(27.375,-15.9270876627042,8));
+#333=CARTESIAN_POINT($,(27,-15.7089083796535,8));
+#334=CARTESIAN_POINT($,(28.5,-13.9908127559282,6.5));
+#335=CARTESIAN_POINT($,(28.5,-13.9908127559282,6.875));
+#336=CARTESIAN_POINT($,(28.5,-13.9908127559282,7.25));
+#337=CARTESIAN_POINT($,(27.75,-13.6226334728775,8));
+#338=CARTESIAN_POINT($,(27.375,-13.4385438313521,8));
+#339=CARTESIAN_POINT($,(27,-13.2544541898267,8));
+#340=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#341=CARTESIAN_POINT($,(28.5,-11.4,6.875));
+#342=CARTESIAN_POINT($,(28.5,-11.4,7.25));
+#343=CARTESIAN_POINT($,(27.75,-11.1,8));
+#344=CARTESIAN_POINT($,(27.375,-10.95,8));
+#345=CARTESIAN_POINT($,(27,-10.8,8));
+#346=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#322,#323,#324,#325,#326,#327),(#328,#329,#330,#331,#332,#333),(#334,#335,#336,#337,#338,#339),(#340,#341,#342,#343,#344,#345)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#347=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#348=CARTESIAN_POINT($,(28.5,-11.4,6.875));
+#349=CARTESIAN_POINT($,(28.5,-11.4,7.25));
+#350=CARTESIAN_POINT($,(27.75,-11.1,8));
+#351=CARTESIAN_POINT($,(27.375,-10.95,8));
+#352=CARTESIAN_POINT($,(27,-10.8,8));
+#353=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#354=CARTESIAN_POINT($,(28.5,11.4,6.875));
+#355=CARTESIAN_POINT($,(28.5,11.4,7.25));
+#356=CARTESIAN_POINT($,(27.75,11.1,8));
+#357=CARTESIAN_POINT($,(27.375,10.95,8));
+#358=CARTESIAN_POINT($,(27,10.8,8));
+#359=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#347,#348,#349,#350,#351,#352),(#353,#354,#355,#356,#357,#358)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#360=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#361=CARTESIAN_POINT($,(28.5,11.4,6.875));
+#362=CARTESIAN_POINT($,(28.5,11.4,7.25));
+#363=CARTESIAN_POINT($,(27.75,11.1,8));
+#364=CARTESIAN_POINT($,(27.375,10.95,8));
+#365=CARTESIAN_POINT($,(27,10.8,8));
+#366=CARTESIAN_POINT($,(28.5,13.9908127559282,6.5));
+#367=CARTESIAN_POINT($,(28.5,13.9908127559282,6.875));
+#368=CARTESIAN_POINT($,(28.5,13.9908127559282,7.25));
+#369=CARTESIAN_POINT($,(27.75,13.6226334728775,8));
+#370=CARTESIAN_POINT($,(27.375,13.4385438313521,8));
+#371=CARTESIAN_POINT($,(27,13.2544541898267,8));
+#372=CARTESIAN_POINT($,(28.5,16.5816255118565,6.5));
+#373=CARTESIAN_POINT($,(28.5,16.5816255118565,6.875));
+#374=CARTESIAN_POINT($,(28.5,16.5816255118565,7.25));
+#375=CARTESIAN_POINT($,(27.75,16.145266945755,8));
+#376=CARTESIAN_POINT($,(27.375,15.9270876627042,8));
+#377=CARTESIAN_POINT($,(27,15.7089083796535,8));
+#378=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#379=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.875));
+#380=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,7.25));
+#381=CARTESIAN_POINT($,(26.5726334728775,17.3226334728775,8));
+#382=CARTESIAN_POINT($,(26.2135438313521,17.0885438313521,8));
+#383=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#384=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#360,#361,#362,#363,#364,#365),(#366,#367,#368,#369,#370,#371),(#372,#373,#374,#375,#376,#377),(#378,#379,#380,#381,#382,#383)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#385=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#386=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.875));
+#387=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,7.25));
+#388=CARTESIAN_POINT($,(26.5726334728775,17.3226334728775,8));
+#389=CARTESIAN_POINT($,(26.2135438313521,17.0885438313521,8));
+#390=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#391=CARTESIAN_POINT($,(26.0816255118565,19,6.5));
+#392=CARTESIAN_POINT($,(26.0816255118565,19,6.875));
+#393=CARTESIAN_POINT($,(26.0816255118565,19,7.25));
+#394=CARTESIAN_POINT($,(25.395266945755,18.5,8));
+#395=CARTESIAN_POINT($,(25.0520876627042,18.25,8));
+#396=CARTESIAN_POINT($,(24.7089083796535,18,8));
+#397=CARTESIAN_POINT($,(23.4908127559282,19,6.5));
+#398=CARTESIAN_POINT($,(23.4908127559282,19,6.875));
+#399=CARTESIAN_POINT($,(23.4908127559282,19,7.25));
+#400=CARTESIAN_POINT($,(22.8726334728775,18.5,8));
+#401=CARTESIAN_POINT($,(22.5635438313521,18.25,8));
+#402=CARTESIAN_POINT($,(22.2544541898267,18,8));
+#403=CARTESIAN_POINT($,(20.9,19,6.5));
+#404=CARTESIAN_POINT($,(20.9,19,6.875));
+#405=CARTESIAN_POINT($,(20.9,19,7.25));
+#406=CARTESIAN_POINT($,(20.35,18.5,8));
+#407=CARTESIAN_POINT($,(20.075,18.25,8));
+#408=CARTESIAN_POINT($,(19.8,18,8));
+#409=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#385,#386,#387,#388,#389,#390),(#391,#392,#393,#394,#395,#396),(#397,#398,#399,#400,#401,#402),(#403,#404,#405,#406,#407,#408)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#410=CARTESIAN_POINT($,(20.9,19,6.5));
+#411=CARTESIAN_POINT($,(20.9,19,6.875));
+#412=CARTESIAN_POINT($,(20.9,19,7.25));
+#413=CARTESIAN_POINT($,(20.35,18.5,8));
+#414=CARTESIAN_POINT($,(20.075,18.25,8));
+#415=CARTESIAN_POINT($,(19.8,18,8));
+#416=CARTESIAN_POINT($,(-20.9,19,6.5));
+#417=CARTESIAN_POINT($,(-20.9,19,6.875));
+#418=CARTESIAN_POINT($,(-20.9,19,7.25));
+#419=CARTESIAN_POINT($,(-20.35,18.5,8));
+#420=CARTESIAN_POINT($,(-20.075,18.25,8));
+#421=CARTESIAN_POINT($,(-19.8,18,8));
+#422=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#410,#411,#412,#413,#414,#415),(#416,#417,#418,#419,#420,#421)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#423=CARTESIAN_POINT($,(-20.9,19,6.5));
+#424=CARTESIAN_POINT($,(-20.9,19,6.875));
+#425=CARTESIAN_POINT($,(-20.9,19,7.25));
+#426=CARTESIAN_POINT($,(-20.35,18.5,8));
+#427=CARTESIAN_POINT($,(-20.075,18.25,8));
+#428=CARTESIAN_POINT($,(-19.8,18,8));
+#429=CARTESIAN_POINT($,(-23.4908127559282,19,6.5));
+#430=CARTESIAN_POINT($,(-23.4908127559282,19,6.875));
+#431=CARTESIAN_POINT($,(-23.4908127559282,19,7.25));
+#432=CARTESIAN_POINT($,(-22.8726334728775,18.5,8));
+#433=CARTESIAN_POINT($,(-22.5635438313521,18.25,8));
+#434=CARTESIAN_POINT($,(-22.2544541898267,18,8));
+#435=CARTESIAN_POINT($,(-26.0816255118565,19,6.5));
+#436=CARTESIAN_POINT($,(-26.0816255118565,19,6.875));
+#437=CARTESIAN_POINT($,(-26.0816255118565,19,7.25));
+#438=CARTESIAN_POINT($,(-25.395266945755,18.5,8));
+#439=CARTESIAN_POINT($,(-25.0520876627042,18.25,8));
+#440=CARTESIAN_POINT($,(-24.7089083796535,18,8));
+#441=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#442=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.875));
+#443=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,7.25));
+#444=CARTESIAN_POINT($,(-26.5726334728775,17.3226334728775,8));
+#445=CARTESIAN_POINT($,(-26.2135438313521,17.0885438313521,8));
+#446=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#447=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#423,#424,#425,#426,#427,#428),(#429,#430,#431,#432,#433,#434),(#435,#436,#437,#438,#439,#440),(#441,#442,#443,#444,#445,#446)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#448=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#449=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.875));
+#450=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,7.25));
+#451=CARTESIAN_POINT($,(-26.5726334728775,17.3226334728775,8));
+#452=CARTESIAN_POINT($,(-26.2135438313521,17.0885438313521,8));
+#453=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#454=CARTESIAN_POINT($,(-28.5,16.5816255118565,6.5));
+#455=CARTESIAN_POINT($,(-28.5,16.5816255118565,6.875));
+#456=CARTESIAN_POINT($,(-28.5,16.5816255118565,7.25));
+#457=CARTESIAN_POINT($,(-27.75,16.145266945755,8));
+#458=CARTESIAN_POINT($,(-27.375,15.9270876627042,8));
+#459=CARTESIAN_POINT($,(-27,15.7089083796535,8));
+#460=CARTESIAN_POINT($,(-28.5,13.9908127559282,6.5));
+#461=CARTESIAN_POINT($,(-28.5,13.9908127559282,6.875));
+#462=CARTESIAN_POINT($,(-28.5,13.9908127559282,7.25));
+#463=CARTESIAN_POINT($,(-27.75,13.6226334728775,8));
+#464=CARTESIAN_POINT($,(-27.375,13.4385438313521,8));
+#465=CARTESIAN_POINT($,(-27,13.2544541898267,8));
+#466=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#467=CARTESIAN_POINT($,(-28.5,11.4,6.875));
+#468=CARTESIAN_POINT($,(-28.5,11.4,7.25));
+#469=CARTESIAN_POINT($,(-27.75,11.1,8));
+#470=CARTESIAN_POINT($,(-27.375,10.95,8));
+#471=CARTESIAN_POINT($,(-27,10.8,8));
+#472=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#448,#449,#450,#451,#452,#453),(#454,#455,#456,#457,#458,#459),(#460,#461,#462,#463,#464,#465),(#466,#467,#468,#469,#470,#471)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#473=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#474=CARTESIAN_POINT($,(-28.5,11.4,6.875));
+#475=CARTESIAN_POINT($,(-28.5,11.4,7.25));
+#476=CARTESIAN_POINT($,(-27.75,11.1,8));
+#477=CARTESIAN_POINT($,(-27.375,10.95,8));
+#478=CARTESIAN_POINT($,(-27,10.8,8));
+#479=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#480=CARTESIAN_POINT($,(-28.5,-11.4,6.875));
+#481=CARTESIAN_POINT($,(-28.5,-11.4,7.25));
+#482=CARTESIAN_POINT($,(-27.75,-11.1,8));
+#483=CARTESIAN_POINT($,(-27.375,-10.95,8));
+#484=CARTESIAN_POINT($,(-27,-10.8,8));
+#485=B_SPLINE_SURFACE_WITH_KNOTS($,1,5,((#473,#474,#475,#476,#477,#478),(#479,#480,#481,#482,#483,#484)),.UNSPECIFIED.,.F.,.F.,.F.,(2,2),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#486=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#487=CARTESIAN_POINT($,(-28.5,-11.4,6.875));
+#488=CARTESIAN_POINT($,(-28.5,-11.4,7.25));
+#489=CARTESIAN_POINT($,(-27.75,-11.1,8));
+#490=CARTESIAN_POINT($,(-27.375,-10.95,8));
+#491=CARTESIAN_POINT($,(-27,-10.8,8));
+#492=CARTESIAN_POINT($,(-28.5,-13.9908127559282,6.5));
+#493=CARTESIAN_POINT($,(-28.5,-13.9908127559282,6.875));
+#494=CARTESIAN_POINT($,(-28.5,-13.9908127559282,7.25));
+#495=CARTESIAN_POINT($,(-27.75,-13.6226334728775,8));
+#496=CARTESIAN_POINT($,(-27.375,-13.4385438313521,8));
+#497=CARTESIAN_POINT($,(-27,-13.2544541898267,8));
+#498=CARTESIAN_POINT($,(-28.5,-16.5816255118565,6.5));
+#499=CARTESIAN_POINT($,(-28.5,-16.5816255118565,6.875));
+#500=CARTESIAN_POINT($,(-28.5,-16.5816255118565,7.25));
+#501=CARTESIAN_POINT($,(-27.75,-16.145266945755,8));
+#502=CARTESIAN_POINT($,(-27.375,-15.9270876627042,8));
+#503=CARTESIAN_POINT($,(-27,-15.7089083796535,8));
+#504=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#505=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.875));
+#506=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,7.25));
+#507=CARTESIAN_POINT($,(-26.5726334728775,-17.3226334728775,8));
+#508=CARTESIAN_POINT($,(-26.2135438313521,-17.0885438313521,8));
+#509=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#510=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#486,#487,#488,#489,#490,#491),(#492,#493,#494,#495,#496,#497),(#498,#499,#500,#501,#502,#503),(#504,#505,#506,#507,#508,#509)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#511=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#512=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.875));
+#513=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,7.25));
+#514=CARTESIAN_POINT($,(-26.5726334728775,-17.3226334728775,8));
+#515=CARTESIAN_POINT($,(-26.2135438313521,-17.0885438313521,8));
+#516=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#517=CARTESIAN_POINT($,(-26.0816255118565,-19,6.5));
+#518=CARTESIAN_POINT($,(-26.0816255118565,-19,6.875));
+#519=CARTESIAN_POINT($,(-26.0816255118565,-19,7.25));
+#520=CARTESIAN_POINT($,(-25.395266945755,-18.5,8));
+#521=CARTESIAN_POINT($,(-25.0520876627042,-18.25,8));
+#522=CARTESIAN_POINT($,(-24.7089083796535,-18,8));
+#523=CARTESIAN_POINT($,(-23.4908127559282,-19,6.5));
+#524=CARTESIAN_POINT($,(-23.4908127559282,-19,6.875));
+#525=CARTESIAN_POINT($,(-23.4908127559282,-19,7.25));
+#526=CARTESIAN_POINT($,(-22.8726334728775,-18.5,8));
+#527=CARTESIAN_POINT($,(-22.5635438313521,-18.25,8));
+#528=CARTESIAN_POINT($,(-22.2544541898268,-18,8));
+#529=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#530=CARTESIAN_POINT($,(-20.9,-19,6.875));
+#531=CARTESIAN_POINT($,(-20.9,-19,7.25));
+#532=CARTESIAN_POINT($,(-20.35,-18.5,8));
+#533=CARTESIAN_POINT($,(-20.075,-18.25,8));
+#534=CARTESIAN_POINT($,(-19.8,-18,8));
+#535=B_SPLINE_SURFACE_WITH_KNOTS($,3,5,((#511,#512,#513,#514,#515,#516),(#517,#518,#519,#520,#521,#522),(#523,#524,#525,#526,#527,#528),(#529,#530,#531,#532,#533,#534)),.UNSPECIFIED.,.F.,.F.,.F.,(4,4),(6,6),(0,1),(0,1),.UNSPECIFIED.);
+#536=CARTESIAN_POINT($,(0,0,8));
+#537=DIRECTION($,(0,0,1));
+#538=DIRECTION($,(1,0,0));
+#539=AXIS2_PLACEMENT_3D($,#536,#537,#538);
+#540=PLANE($,#539);
+#541=CARTESIAN_POINT($,(-50,-40,0));
+#542=VERTEX_POINT($,#541);
+#543=CARTESIAN_POINT($,(50,-40,-0));
+#544=VERTEX_POINT($,#543);
+#545=CARTESIAN_POINT($,(-50,-40,0));
+#546=DIRECTION($,(1,0,0));
+#547=VECTOR($,#546,1);
+#548=LINE($,#545,#547);
+#549=CARTESIAN_POINT($,(-50,40));
+#550=CARTESIAN_POINT($,(50,40));
+#551=POLYLINE($,(#549,#550));
+#552=DEFINITIONAL_REPRESENTATION('pcurve',(#551),#1);
+#553=PCURVE($,#6,#552);
+#554=CARTESIAN_POINT($,(0,0));
+#555=CARTESIAN_POINT($,(0,-100));
+#556=POLYLINE($,(#554,#555));
+#557=DEFINITIONAL_REPRESENTATION('pcurve',(#556),#1);
+#558=PCURVE($,#16,#557);
+#559=SURFACE_CURVE($,#548,(#553,#558),.PCURVE_S1.);
+#560=EDGE_CURVE($,#542,#544,#559,.T.);
+#561=ORIENTED_EDGE($,$,$,#560,.T.);
+#562=CARTESIAN_POINT($,(50,40,-0));
+#563=VERTEX_POINT($,#562);
+#564=CARTESIAN_POINT($,(50,-40,-0));
+#565=DIRECTION($,(0,1,0));
+#566=VECTOR($,#565,1);
+#567=LINE($,#564,#566);
+#568=CARTESIAN_POINT($,(50,40));
+#569=CARTESIAN_POINT($,(50,-40));
+#570=POLYLINE($,(#568,#569));
+#571=DEFINITIONAL_REPRESENTATION('pcurve',(#570),#1);
+#572=PCURVE($,#6,#571);
+#573=CARTESIAN_POINT($,(0,0));
+#574=CARTESIAN_POINT($,(0,-80));
+#575=POLYLINE($,(#573,#574));
+#576=DEFINITIONAL_REPRESENTATION('pcurve',(#575),#1);
+#577=PCURVE($,#21,#576);
+#578=SURFACE_CURVE($,#567,(#572,#577),.PCURVE_S1.);
+#579=EDGE_CURVE($,#544,#563,#578,.T.);
+#580=ORIENTED_EDGE($,$,$,#579,.T.);
+#581=CARTESIAN_POINT($,(-50,40,-0));
+#582=VERTEX_POINT($,#581);
+#583=CARTESIAN_POINT($,(50,40,-0));
+#584=DIRECTION($,(-1,0,0));
+#585=VECTOR($,#584,1);
+#586=LINE($,#583,#585);
+#587=CARTESIAN_POINT($,(50,-40));
+#588=CARTESIAN_POINT($,(-50,-40));
+#589=POLYLINE($,(#587,#588));
+#590=DEFINITIONAL_REPRESENTATION('pcurve',(#589),#1);
+#591=PCURVE($,#6,#590);
+#592=CARTESIAN_POINT($,(0,0));
+#593=CARTESIAN_POINT($,(0,-100));
+#594=POLYLINE($,(#592,#593));
+#595=DEFINITIONAL_REPRESENTATION('pcurve',(#594),#1);
+#596=PCURVE($,#26,#595);
+#597=SURFACE_CURVE($,#586,(#591,#596),.PCURVE_S1.);
+#598=EDGE_CURVE($,#563,#582,#597,.T.);
+#599=ORIENTED_EDGE($,$,$,#598,.T.);
+#600=CARTESIAN_POINT($,(-50,40,-0));
+#601=DIRECTION($,(0,-1,0));
+#602=VECTOR($,#601,1);
+#603=LINE($,#600,#602);
+#604=CARTESIAN_POINT($,(-50,-40));
+#605=CARTESIAN_POINT($,(-50,40));
+#606=POLYLINE($,(#604,#605));
+#607=DEFINITIONAL_REPRESENTATION('pcurve',(#606),#1);
+#608=PCURVE($,#6,#607);
+#609=CARTESIAN_POINT($,(0,0));
+#610=CARTESIAN_POINT($,(0,-80));
+#611=POLYLINE($,(#609,#610));
+#612=DEFINITIONAL_REPRESENTATION('pcurve',(#611),#1);
+#613=PCURVE($,#31,#612);
+#614=SURFACE_CURVE($,#603,(#608,#613),.PCURVE_S1.);
+#615=EDGE_CURVE($,#582,#542,#614,.T.);
+#616=ORIENTED_EDGE($,$,$,#615,.T.);
+#617=EDGE_LOOP($,(#561,#580,#599,#616));
+#618=FACE_OUTER_BOUND('',#617,.T.);
+#619=ADVANCED_FACE('',(#618),#6,.T.);
+#620=CARTESIAN_POINT($,(-50,-40,5));
+#621=VERTEX_POINT($,#620);
+#622=CARTESIAN_POINT($,(50,-40,5));
+#623=VERTEX_POINT($,#622);
+#624=CARTESIAN_POINT($,(-50,-40,5));
+#625=DIRECTION($,(1,0,0));
+#626=VECTOR($,#625,1);
+#627=LINE($,#624,#626);
+#628=CARTESIAN_POINT($,(-50,-40));
+#629=CARTESIAN_POINT($,(50,-40));
+#630=POLYLINE($,(#628,#629));
+#631=DEFINITIONAL_REPRESENTATION('pcurve',(#630),#1);
+#632=PCURVE($,#11,#631);
+#633=CARTESIAN_POINT($,(5,0));
+#634=CARTESIAN_POINT($,(5,-100));
+#635=POLYLINE($,(#633,#634));
+#636=DEFINITIONAL_REPRESENTATION('pcurve',(#635),#1);
+#637=PCURVE($,#16,#636);
+#638=SURFACE_CURVE($,#627,(#632,#637),.PCURVE_S1.);
+#639=EDGE_CURVE($,#621,#623,#638,.T.);
+#640=ORIENTED_EDGE($,$,$,#639,.T.);
+#641=CARTESIAN_POINT($,(50,40,5));
+#642=VERTEX_POINT($,#641);
+#643=CARTESIAN_POINT($,(50,-40,5));
+#644=DIRECTION($,(0,1,0));
+#645=VECTOR($,#644,1);
+#646=LINE($,#643,#645);
+#647=CARTESIAN_POINT($,(50,-40));
+#648=CARTESIAN_POINT($,(50,40));
+#649=POLYLINE($,(#647,#648));
+#650=DEFINITIONAL_REPRESENTATION('pcurve',(#649),#1);
+#651=PCURVE($,#11,#650);
+#652=CARTESIAN_POINT($,(5,0));
+#653=CARTESIAN_POINT($,(5,-80));
+#654=POLYLINE($,(#652,#653));
+#655=DEFINITIONAL_REPRESENTATION('pcurve',(#654),#1);
+#656=PCURVE($,#21,#655);
+#657=SURFACE_CURVE($,#646,(#651,#656),.PCURVE_S1.);
+#658=EDGE_CURVE($,#623,#642,#657,.T.);
+#659=ORIENTED_EDGE($,$,$,#658,.T.);
+#660=CARTESIAN_POINT($,(-50,40,5));
+#661=VERTEX_POINT($,#660);
+#662=CARTESIAN_POINT($,(50,40,5));
+#663=DIRECTION($,(-1,0,0));
+#664=VECTOR($,#663,1);
+#665=LINE($,#662,#664);
+#666=CARTESIAN_POINT($,(50,40));
+#667=CARTESIAN_POINT($,(-50,40));
+#668=POLYLINE($,(#666,#667));
+#669=DEFINITIONAL_REPRESENTATION('pcurve',(#668),#1);
+#670=PCURVE($,#11,#669);
+#671=CARTESIAN_POINT($,(5,0));
+#672=CARTESIAN_POINT($,(5,-100));
+#673=POLYLINE($,(#671,#672));
+#674=DEFINITIONAL_REPRESENTATION('pcurve',(#673),#1);
+#675=PCURVE($,#26,#674);
+#676=SURFACE_CURVE($,#665,(#670,#675),.PCURVE_S1.);
+#677=EDGE_CURVE($,#642,#661,#676,.T.);
+#678=ORIENTED_EDGE($,$,$,#677,.T.);
+#679=CARTESIAN_POINT($,(-50,40,5));
+#680=DIRECTION($,(0,-1,0));
+#681=VECTOR($,#680,1);
+#682=LINE($,#679,#681);
+#683=CARTESIAN_POINT($,(-50,40));
+#684=CARTESIAN_POINT($,(-50,-40));
+#685=POLYLINE($,(#683,#684));
+#686=DEFINITIONAL_REPRESENTATION('pcurve',(#685),#1);
+#687=PCURVE($,#11,#686);
+#688=CARTESIAN_POINT($,(5,0));
+#689=CARTESIAN_POINT($,(5,-80));
+#690=POLYLINE($,(#688,#689));
+#691=DEFINITIONAL_REPRESENTATION('pcurve',(#690),#1);
+#692=PCURVE($,#31,#691);
+#693=SURFACE_CURVE($,#682,(#687,#692),.PCURVE_S1.);
+#694=EDGE_CURVE($,#661,#621,#693,.T.);
+#695=ORIENTED_EDGE($,$,$,#694,.T.);
+#696=EDGE_LOOP($,(#640,#659,#678,#695));
+#697=FACE_OUTER_BOUND('',#696,.T.);
+#698=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#699=VERTEX_POINT($,#698);
+#700=CARTESIAN_POINT($,(-22,-20,5));
+#701=VERTEX_POINT($,#700);
+#702=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#703=CARTESIAN_POINT($,(-27.4543426440594,-20,5));
+#704=CARTESIAN_POINT($,(-24.7271713220297,-20,5));
+#705=CARTESIAN_POINT($,(-22,-20,5));
+#706=B_SPLINE_CURVE_WITH_KNOTS($,3,(#702,#703,#704,#705),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#707=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297));
+#708=CARTESIAN_POINT($,(-27.4543426440594,-20));
+#709=CARTESIAN_POINT($,(-24.7271713220297,-20));
+#710=CARTESIAN_POINT($,(-22,-20));
+#711=B_SPLINE_CURVE_WITH_KNOTS($,3,(#707,#708,#709,#710),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#712=DEFINITIONAL_REPRESENTATION('pcurve',(#711),#1);
+#713=PCURVE($,#11,#712);
+#714=CARTESIAN_POINT($,(0,0));
+#715=CARTESIAN_POINT($,(1,0));
+#716=POLYLINE($,(#714,#715));
+#717=DEFINITIONAL_REPRESENTATION('pcurve',(#716),#1);
+#718=PCURVE($,#283,#717);
+#719=SURFACE_CURVE($,#706,(#713,#718),.PCURVE_S1.);
+#720=EDGE_CURVE($,#699,#701,#719,.T.);
+#721=ORIENTED_EDGE($,$,$,#720,.F.);
+#722=CARTESIAN_POINT($,(-30,-12,5));
+#723=VERTEX_POINT($,#722);
+#724=CARTESIAN_POINT($,(-30,-12,5));
+#725=CARTESIAN_POINT($,(-30,-14.7271713220297,5));
+#726=CARTESIAN_POINT($,(-30,-17.4543426440594,5));
+#727=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#728=B_SPLINE_CURVE_WITH_KNOTS($,3,(#724,#725,#726,#727),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#729=CARTESIAN_POINT($,(-30,-12));
+#730=CARTESIAN_POINT($,(-30,-14.7271713220297));
+#731=CARTESIAN_POINT($,(-30,-17.4543426440594));
+#732=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297));
+#733=B_SPLINE_CURVE_WITH_KNOTS($,3,(#729,#730,#731,#732),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#734=DEFINITIONAL_REPRESENTATION('pcurve',(#733),#1);
+#735=PCURVE($,#11,#734);
+#736=CARTESIAN_POINT($,(0,0));
+#737=CARTESIAN_POINT($,(1,0));
+#738=POLYLINE($,(#736,#737));
+#739=DEFINITIONAL_REPRESENTATION('pcurve',(#738),#1);
+#740=PCURVE($,#258,#739);
+#741=SURFACE_CURVE($,#728,(#735,#740),.PCURVE_S1.);
+#742=EDGE_CURVE($,#723,#699,#741,.T.);
+#743=ORIENTED_EDGE($,$,$,#742,.F.);
+#744=CARTESIAN_POINT($,(-30,12,5));
+#745=VERTEX_POINT($,#744);
+#746=CARTESIAN_POINT($,(-30,12,5));
+#747=CARTESIAN_POINT($,(-30,-12,5));
+#748=B_SPLINE_CURVE_WITH_KNOTS($,1,(#746,#747),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#749=CARTESIAN_POINT($,(-30,12));
+#750=CARTESIAN_POINT($,(-30,-12));
+#751=B_SPLINE_CURVE_WITH_KNOTS($,1,(#749,#750),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#752=DEFINITIONAL_REPRESENTATION('pcurve',(#751),#1);
+#753=PCURVE($,#11,#752);
+#754=CARTESIAN_POINT($,(0,0));
+#755=CARTESIAN_POINT($,(1,0));
+#756=POLYLINE($,(#754,#755));
+#757=DEFINITIONAL_REPRESENTATION('pcurve',(#756),#1);
+#758=PCURVE($,#233,#757);
+#759=SURFACE_CURVE($,#748,(#753,#758),.PCURVE_S1.);
+#760=EDGE_CURVE($,#745,#723,#759,.T.);
+#761=ORIENTED_EDGE($,$,$,#760,.F.);
+#762=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#763=VERTEX_POINT($,#762);
+#764=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#765=CARTESIAN_POINT($,(-30,17.4543426440594,5));
+#766=CARTESIAN_POINT($,(-30,14.7271713220297,5));
+#767=CARTESIAN_POINT($,(-30,12,5));
+#768=B_SPLINE_CURVE_WITH_KNOTS($,3,(#764,#765,#766,#767),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#769=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297));
+#770=CARTESIAN_POINT($,(-30,17.4543426440594));
+#771=CARTESIAN_POINT($,(-30,14.7271713220297));
+#772=CARTESIAN_POINT($,(-30,12));
+#773=B_SPLINE_CURVE_WITH_KNOTS($,3,(#769,#770,#771,#772),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#774=DEFINITIONAL_REPRESENTATION('pcurve',(#773),#1);
+#775=PCURVE($,#11,#774);
+#776=CARTESIAN_POINT($,(0,0));
+#777=CARTESIAN_POINT($,(1,0));
+#778=POLYLINE($,(#776,#777));
+#779=DEFINITIONAL_REPRESENTATION('pcurve',(#778),#1);
+#780=PCURVE($,#220,#779);
+#781=SURFACE_CURVE($,#768,(#775,#780),.PCURVE_S1.);
+#782=EDGE_CURVE($,#763,#745,#781,.T.);
+#783=ORIENTED_EDGE($,$,$,#782,.F.);
+#784=CARTESIAN_POINT($,(-22,20,5));
+#785=VERTEX_POINT($,#784);
+#786=CARTESIAN_POINT($,(-22,20,5));
+#787=CARTESIAN_POINT($,(-24.7271713220297,20,5));
+#788=CARTESIAN_POINT($,(-27.4543426440594,20,5));
+#789=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#790=B_SPLINE_CURVE_WITH_KNOTS($,3,(#786,#787,#788,#789),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#791=CARTESIAN_POINT($,(-22,20));
+#792=CARTESIAN_POINT($,(-24.7271713220297,20));
+#793=CARTESIAN_POINT($,(-27.4543426440594,20));
+#794=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297));
+#795=B_SPLINE_CURVE_WITH_KNOTS($,3,(#791,#792,#793,#794),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#796=DEFINITIONAL_REPRESENTATION('pcurve',(#795),#1);
+#797=PCURVE($,#11,#796);
+#798=CARTESIAN_POINT($,(0,0));
+#799=CARTESIAN_POINT($,(1,0));
+#800=POLYLINE($,(#798,#799));
+#801=DEFINITIONAL_REPRESENTATION('pcurve',(#800),#1);
+#802=PCURVE($,#195,#801);
+#803=SURFACE_CURVE($,#790,(#797,#802),.PCURVE_S1.);
+#804=EDGE_CURVE($,#785,#763,#803,.T.);
+#805=ORIENTED_EDGE($,$,$,#804,.F.);
+#806=CARTESIAN_POINT($,(22,20,5));
+#807=VERTEX_POINT($,#806);
+#808=CARTESIAN_POINT($,(22,20,5));
+#809=CARTESIAN_POINT($,(-22,20,5));
+#810=B_SPLINE_CURVE_WITH_KNOTS($,1,(#808,#809),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#811=CARTESIAN_POINT($,(22,20));
+#812=CARTESIAN_POINT($,(-22,20));
+#813=B_SPLINE_CURVE_WITH_KNOTS($,1,(#811,#812),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#814=DEFINITIONAL_REPRESENTATION('pcurve',(#813),#1);
+#815=PCURVE($,#11,#814);
+#816=CARTESIAN_POINT($,(0,0));
+#817=CARTESIAN_POINT($,(1,0));
+#818=POLYLINE($,(#816,#817));
+#819=DEFINITIONAL_REPRESENTATION('pcurve',(#818),#1);
+#820=PCURVE($,#170,#819);
+#821=SURFACE_CURVE($,#810,(#815,#820),.PCURVE_S1.);
+#822=EDGE_CURVE($,#807,#785,#821,.T.);
+#823=ORIENTED_EDGE($,$,$,#822,.F.);
+#824=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#825=VERTEX_POINT($,#824);
+#826=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#827=CARTESIAN_POINT($,(27.4543426440594,20,5));
+#828=CARTESIAN_POINT($,(24.7271713220297,20,5));
+#829=CARTESIAN_POINT($,(22,20,5));
+#830=B_SPLINE_CURVE_WITH_KNOTS($,3,(#826,#827,#828,#829),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#831=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297));
+#832=CARTESIAN_POINT($,(27.4543426440594,20));
+#833=CARTESIAN_POINT($,(24.7271713220297,20));
+#834=CARTESIAN_POINT($,(22,20));
+#835=B_SPLINE_CURVE_WITH_KNOTS($,3,(#831,#832,#833,#834),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#836=DEFINITIONAL_REPRESENTATION('pcurve',(#835),#1);
+#837=PCURVE($,#11,#836);
+#838=CARTESIAN_POINT($,(0,0));
+#839=CARTESIAN_POINT($,(1,0));
+#840=POLYLINE($,(#838,#839));
+#841=DEFINITIONAL_REPRESENTATION('pcurve',(#840),#1);
+#842=PCURVE($,#157,#841);
+#843=SURFACE_CURVE($,#830,(#837,#842),.PCURVE_S1.);
+#844=EDGE_CURVE($,#825,#807,#843,.T.);
+#845=ORIENTED_EDGE($,$,$,#844,.F.);
+#846=CARTESIAN_POINT($,(30,12,5));
+#847=VERTEX_POINT($,#846);
+#848=CARTESIAN_POINT($,(30,12,5));
+#849=CARTESIAN_POINT($,(30,14.7271713220297,5));
+#850=CARTESIAN_POINT($,(30,17.4543426440594,5));
+#851=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#852=B_SPLINE_CURVE_WITH_KNOTS($,3,(#848,#849,#850,#851),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#853=CARTESIAN_POINT($,(30,12));
+#854=CARTESIAN_POINT($,(30,14.7271713220297));
+#855=CARTESIAN_POINT($,(30,17.4543426440594));
+#856=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297));
+#857=B_SPLINE_CURVE_WITH_KNOTS($,3,(#853,#854,#855,#856),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#858=DEFINITIONAL_REPRESENTATION('pcurve',(#857),#1);
+#859=PCURVE($,#11,#858);
+#860=CARTESIAN_POINT($,(0,0));
+#861=CARTESIAN_POINT($,(1,0));
+#862=POLYLINE($,(#860,#861));
+#863=DEFINITIONAL_REPRESENTATION('pcurve',(#862),#1);
+#864=PCURVE($,#132,#863);
+#865=SURFACE_CURVE($,#852,(#859,#864),.PCURVE_S1.);
+#866=EDGE_CURVE($,#847,#825,#865,.T.);
+#867=ORIENTED_EDGE($,$,$,#866,.F.);
+#868=CARTESIAN_POINT($,(30,-12,5));
+#869=VERTEX_POINT($,#868);
+#870=CARTESIAN_POINT($,(30,-12,5));
+#871=CARTESIAN_POINT($,(30,12,5));
+#872=B_SPLINE_CURVE_WITH_KNOTS($,1,(#870,#871),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#873=CARTESIAN_POINT($,(30,-12));
+#874=CARTESIAN_POINT($,(30,12));
+#875=B_SPLINE_CURVE_WITH_KNOTS($,1,(#873,#874),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#876=DEFINITIONAL_REPRESENTATION('pcurve',(#875),#1);
+#877=PCURVE($,#11,#876);
+#878=CARTESIAN_POINT($,(0,0));
+#879=CARTESIAN_POINT($,(1,0));
+#880=POLYLINE($,(#878,#879));
+#881=DEFINITIONAL_REPRESENTATION('pcurve',(#880),#1);
+#882=PCURVE($,#107,#881);
+#883=SURFACE_CURVE($,#872,(#877,#882),.PCURVE_S1.);
+#884=EDGE_CURVE($,#869,#847,#883,.T.);
+#885=ORIENTED_EDGE($,$,$,#884,.F.);
+#886=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#887=VERTEX_POINT($,#886);
+#888=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#889=CARTESIAN_POINT($,(30,-17.4543426440594,5));
+#890=CARTESIAN_POINT($,(30,-14.7271713220297,5));
+#891=CARTESIAN_POINT($,(30,-12,5));
+#892=B_SPLINE_CURVE_WITH_KNOTS($,3,(#888,#889,#890,#891),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#893=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297));
+#894=CARTESIAN_POINT($,(30,-17.4543426440594));
+#895=CARTESIAN_POINT($,(30,-14.7271713220297));
+#896=CARTESIAN_POINT($,(30,-12));
+#897=B_SPLINE_CURVE_WITH_KNOTS($,3,(#893,#894,#895,#896),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#898=DEFINITIONAL_REPRESENTATION('pcurve',(#897),#1);
+#899=PCURVE($,#11,#898);
+#900=CARTESIAN_POINT($,(0,0));
+#901=CARTESIAN_POINT($,(1,0));
+#902=POLYLINE($,(#900,#901));
+#903=DEFINITIONAL_REPRESENTATION('pcurve',(#902),#1);
+#904=PCURVE($,#94,#903);
+#905=SURFACE_CURVE($,#892,(#899,#904),.PCURVE_S1.);
+#906=EDGE_CURVE($,#887,#869,#905,.T.);
+#907=ORIENTED_EDGE($,$,$,#906,.F.);
+#908=CARTESIAN_POINT($,(22,-20,5));
+#909=VERTEX_POINT($,#908);
+#910=CARTESIAN_POINT($,(22,-20,5));
+#911=CARTESIAN_POINT($,(24.7271713220297,-20,5));
+#912=CARTESIAN_POINT($,(27.4543426440594,-20,5));
+#913=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#914=B_SPLINE_CURVE_WITH_KNOTS($,3,(#910,#911,#912,#913),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#915=CARTESIAN_POINT($,(22,-20));
+#916=CARTESIAN_POINT($,(24.7271713220297,-20));
+#917=CARTESIAN_POINT($,(27.4543426440594,-20));
+#918=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297));
+#919=B_SPLINE_CURVE_WITH_KNOTS($,3,(#915,#916,#917,#918),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#920=DEFINITIONAL_REPRESENTATION('pcurve',(#919),#1);
+#921=PCURVE($,#11,#920);
+#922=CARTESIAN_POINT($,(0,0));
+#923=CARTESIAN_POINT($,(1,0));
+#924=POLYLINE($,(#922,#923));
+#925=DEFINITIONAL_REPRESENTATION('pcurve',(#924),#1);
+#926=PCURVE($,#69,#925);
+#927=SURFACE_CURVE($,#914,(#921,#926),.PCURVE_S1.);
+#928=EDGE_CURVE($,#909,#887,#927,.T.);
+#929=ORIENTED_EDGE($,$,$,#928,.F.);
+#930=CARTESIAN_POINT($,(-22,-20,5));
+#931=CARTESIAN_POINT($,(22,-20,5));
+#932=B_SPLINE_CURVE_WITH_KNOTS($,1,(#930,#931),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#933=CARTESIAN_POINT($,(-22,-20));
+#934=CARTESIAN_POINT($,(22,-20));
+#935=B_SPLINE_CURVE_WITH_KNOTS($,1,(#933,#934),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#936=DEFINITIONAL_REPRESENTATION('pcurve',(#935),#1);
+#937=PCURVE($,#11,#936);
+#938=CARTESIAN_POINT($,(0,0));
+#939=CARTESIAN_POINT($,(1,0));
+#940=POLYLINE($,(#938,#939));
+#941=DEFINITIONAL_REPRESENTATION('pcurve',(#940),#1);
+#942=PCURVE($,#44,#941);
+#943=SURFACE_CURVE($,#932,(#937,#942),.PCURVE_S1.);
+#944=EDGE_CURVE($,#701,#909,#943,.T.);
+#945=ORIENTED_EDGE($,$,$,#944,.F.);
+#946=EDGE_LOOP($,(#721,#743,#761,#783,#805,#823,#845,#867,#885,#907,#929,#945));
+#947=FACE_BOUND('',#946,.T.);
+#948=ADVANCED_FACE('',(#697,#947),#11,.T.);
+#949=ORIENTED_EDGE($,$,$,#560,.T.);
+#950=CARTESIAN_POINT($,(50,-40,-0));
+#951=DIRECTION($,(0,0,1));
+#952=VECTOR($,#951,1);
+#953=LINE($,#950,#952);
+#954=CARTESIAN_POINT($,(0,-100));
+#955=CARTESIAN_POINT($,(5,-100));
+#956=POLYLINE($,(#954,#955));
+#957=DEFINITIONAL_REPRESENTATION('pcurve',(#956),#1);
+#958=PCURVE($,#16,#957);
+#959=CARTESIAN_POINT($,(0,0));
+#960=CARTESIAN_POINT($,(5,0));
+#961=POLYLINE($,(#959,#960));
+#962=DEFINITIONAL_REPRESENTATION('pcurve',(#961),#1);
+#963=PCURVE($,#21,#962);
+#964=SURFACE_CURVE($,#953,(#958,#963),.PCURVE_S1.);
+#965=EDGE_CURVE($,#544,#623,#964,.T.);
+#966=ORIENTED_EDGE($,$,$,#965,.T.);
+#967=ORIENTED_EDGE($,$,$,#639,.F.);
+#968=CARTESIAN_POINT($,(-50,-40,0));
+#969=DIRECTION($,(0,0,1));
+#970=VECTOR($,#969,1);
+#971=LINE($,#968,#970);
+#972=CARTESIAN_POINT($,(0,0));
+#973=CARTESIAN_POINT($,(5,0));
+#974=POLYLINE($,(#972,#973));
+#975=DEFINITIONAL_REPRESENTATION('pcurve',(#974),#1);
+#976=PCURVE($,#16,#975);
+#977=CARTESIAN_POINT($,(0,-80));
+#978=CARTESIAN_POINT($,(5,-80));
+#979=POLYLINE($,(#977,#978));
+#980=DEFINITIONAL_REPRESENTATION('pcurve',(#979),#1);
+#981=PCURVE($,#31,#980);
+#982=SURFACE_CURVE($,#971,(#976,#981),.PCURVE_S1.);
+#983=EDGE_CURVE($,#542,#621,#982,.T.);
+#984=ORIENTED_EDGE($,$,$,#983,.F.);
+#985=EDGE_LOOP($,(#949,#966,#967,#984));
+#986=FACE_OUTER_BOUND('',#985,.T.);
+#987=ADVANCED_FACE('',(#986),#16,.T.);
+#988=ORIENTED_EDGE($,$,$,#579,.T.);
+#989=CARTESIAN_POINT($,(50,40,-0));
+#990=DIRECTION($,(0,0,1));
+#991=VECTOR($,#990,1);
+#992=LINE($,#989,#991);
+#993=CARTESIAN_POINT($,(0,-80));
+#994=CARTESIAN_POINT($,(5,-80));
+#995=POLYLINE($,(#993,#994));
+#996=DEFINITIONAL_REPRESENTATION('pcurve',(#995),#1);
+#997=PCURVE($,#21,#996);
+#998=CARTESIAN_POINT($,(0,0));
+#999=CARTESIAN_POINT($,(5,0));
+#1000=POLYLINE($,(#998,#999));
+#1001=DEFINITIONAL_REPRESENTATION('pcurve',(#1000),#1);
+#1002=PCURVE($,#26,#1001);
+#1003=SURFACE_CURVE($,#992,(#997,#1002),.PCURVE_S1.);
+#1004=EDGE_CURVE($,#563,#642,#1003,.T.);
+#1005=ORIENTED_EDGE($,$,$,#1004,.T.);
+#1006=ORIENTED_EDGE($,$,$,#658,.F.);
+#1007=ORIENTED_EDGE($,$,$,#965,.F.);
+#1008=EDGE_LOOP($,(#988,#1005,#1006,#1007));
+#1009=FACE_OUTER_BOUND('',#1008,.T.);
+#1010=ADVANCED_FACE('',(#1009),#21,.T.);
+#1011=ORIENTED_EDGE($,$,$,#598,.T.);
+#1012=CARTESIAN_POINT($,(-50,40,-0));
+#1013=DIRECTION($,(0,0,1));
+#1014=VECTOR($,#1013,1);
+#1015=LINE($,#1012,#1014);
+#1016=CARTESIAN_POINT($,(0,-100));
+#1017=CARTESIAN_POINT($,(5,-100));
+#1018=POLYLINE($,(#1016,#1017));
+#1019=DEFINITIONAL_REPRESENTATION('pcurve',(#1018),#1);
+#1020=PCURVE($,#26,#1019);
+#1021=CARTESIAN_POINT($,(0,0));
+#1022=CARTESIAN_POINT($,(5,0));
+#1023=POLYLINE($,(#1021,#1022));
+#1024=DEFINITIONAL_REPRESENTATION('pcurve',(#1023),#1);
+#1025=PCURVE($,#31,#1024);
+#1026=SURFACE_CURVE($,#1015,(#1020,#1025),.PCURVE_S1.);
+#1027=EDGE_CURVE($,#582,#661,#1026,.T.);
+#1028=ORIENTED_EDGE($,$,$,#1027,.T.);
+#1029=ORIENTED_EDGE($,$,$,#677,.F.);
+#1030=ORIENTED_EDGE($,$,$,#1004,.F.);
+#1031=EDGE_LOOP($,(#1011,#1028,#1029,#1030));
+#1032=FACE_OUTER_BOUND('',#1031,.T.);
+#1033=ADVANCED_FACE('',(#1032),#26,.T.);
+#1034=ORIENTED_EDGE($,$,$,#615,.T.);
+#1035=ORIENTED_EDGE($,$,$,#983,.T.);
+#1036=ORIENTED_EDGE($,$,$,#694,.F.);
+#1037=ORIENTED_EDGE($,$,$,#1027,.F.);
+#1038=EDGE_LOOP($,(#1034,#1035,#1036,#1037));
+#1039=FACE_OUTER_BOUND('',#1038,.T.);
+#1040=ADVANCED_FACE('',(#1039),#31,.T.);
+#1041=ORIENTED_EDGE($,$,$,#944,.T.);
+#1042=CARTESIAN_POINT($,(20.9,-19,6.5));
+#1043=VERTEX_POINT($,#1042);
+#1044=CARTESIAN_POINT($,(22,-20,5));
+#1045=CARTESIAN_POINT($,(21.725,-19.75,5));
+#1046=CARTESIAN_POINT($,(21.45,-19.5,5));
+#1047=CARTESIAN_POINT($,(20.9,-19,5.75));
+#1048=CARTESIAN_POINT($,(20.9,-19,6.125));
+#1049=CARTESIAN_POINT($,(20.9,-19,6.5));
+#1050=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1044,#1045,#1046,#1047,#1048,#1049),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1051=CARTESIAN_POINT($,(1,0));
+#1052=CARTESIAN_POINT($,(1,1));
+#1053=POLYLINE($,(#1051,#1052));
+#1054=DEFINITIONAL_REPRESENTATION('pcurve',(#1053),#1);
+#1055=PCURVE($,#44,#1054);
+#1056=CARTESIAN_POINT($,(0,0));
+#1057=CARTESIAN_POINT($,(0,1));
+#1058=POLYLINE($,(#1056,#1057));
+#1059=DEFINITIONAL_REPRESENTATION('pcurve',(#1058),#1);
+#1060=PCURVE($,#69,#1059);
+#1061=SURFACE_CURVE($,#1050,(#1055,#1060),.PCURVE_S1.);
+#1062=EDGE_CURVE($,#909,#1043,#1061,.T.);
+#1063=ORIENTED_EDGE($,$,$,#1062,.T.);
+#1064=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#1065=VERTEX_POINT($,#1064);
+#1066=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#1067=CARTESIAN_POINT($,(20.9,-19,6.5));
+#1068=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1066,#1067),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1069=CARTESIAN_POINT($,(0,1));
+#1070=CARTESIAN_POINT($,(1,1));
+#1071=POLYLINE($,(#1069,#1070));
+#1072=DEFINITIONAL_REPRESENTATION('pcurve',(#1071),#1);
+#1073=PCURVE($,#44,#1072);
+#1074=CARTESIAN_POINT($,(0,0));
+#1075=CARTESIAN_POINT($,(1,0));
+#1076=POLYLINE($,(#1074,#1075));
+#1077=DEFINITIONAL_REPRESENTATION('pcurve',(#1076),#1);
+#1078=PCURVE($,#296,#1077);
+#1079=SURFACE_CURVE($,#1068,(#1073,#1078),.PCURVE_S1.);
+#1080=EDGE_CURVE($,#1065,#1043,#1079,.T.);
+#1081=ORIENTED_EDGE($,$,$,#1080,.F.);
+#1082=CARTESIAN_POINT($,(-22,-20,5));
+#1083=CARTESIAN_POINT($,(-21.725,-19.75,5));
+#1084=CARTESIAN_POINT($,(-21.45,-19.5,5));
+#1085=CARTESIAN_POINT($,(-20.9,-19,5.75));
+#1086=CARTESIAN_POINT($,(-20.9,-19,6.125));
+#1087=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#1088=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1082,#1083,#1084,#1085,#1086,#1087),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1089=CARTESIAN_POINT($,(0,0));
+#1090=CARTESIAN_POINT($,(0,1));
+#1091=POLYLINE($,(#1089,#1090));
+#1092=DEFINITIONAL_REPRESENTATION('pcurve',(#1091),#1);
+#1093=PCURVE($,#44,#1092);
+#1094=CARTESIAN_POINT($,(1,0));
+#1095=CARTESIAN_POINT($,(1,1));
+#1096=POLYLINE($,(#1094,#1095));
+#1097=DEFINITIONAL_REPRESENTATION('pcurve',(#1096),#1);
+#1098=PCURVE($,#283,#1097);
+#1099=SURFACE_CURVE($,#1088,(#1093,#1098),.PCURVE_S1.);
+#1100=EDGE_CURVE($,#701,#1065,#1099,.T.);
+#1101=ORIENTED_EDGE($,$,$,#1100,.F.);
+#1102=EDGE_LOOP($,(#1041,#1063,#1081,#1101));
+#1103=FACE_OUTER_BOUND('',#1102,.T.);
+#1104=ADVANCED_FACE('',(#1103),#44,.T.);
+#1105=ORIENTED_EDGE($,$,$,#928,.T.);
+#1106=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#1107=VERTEX_POINT($,#1106);
+#1108=CARTESIAN_POINT($,(28.7271713220297,-18.7271713220297,5));
+#1109=CARTESIAN_POINT($,(28.3680816805043,-18.4930816805043,5));
+#1110=CARTESIAN_POINT($,(28.008992038979,-18.258992038979,5));
+#1111=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,5.75));
+#1112=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.125));
+#1113=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#1114=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1108,#1109,#1110,#1111,#1112,#1113),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1115=CARTESIAN_POINT($,(1,0));
+#1116=CARTESIAN_POINT($,(1,1));
+#1117=POLYLINE($,(#1115,#1116));
+#1118=DEFINITIONAL_REPRESENTATION('pcurve',(#1117),#1);
+#1119=PCURVE($,#69,#1118);
+#1120=CARTESIAN_POINT($,(0,0));
+#1121=CARTESIAN_POINT($,(0,1));
+#1122=POLYLINE($,(#1120,#1121));
+#1123=DEFINITIONAL_REPRESENTATION('pcurve',(#1122),#1);
+#1124=PCURVE($,#94,#1123);
+#1125=SURFACE_CURVE($,#1114,(#1119,#1124),.PCURVE_S1.);
+#1126=EDGE_CURVE($,#887,#1107,#1125,.T.);
+#1127=ORIENTED_EDGE($,$,$,#1126,.T.);
+#1128=CARTESIAN_POINT($,(20.9,-19,6.5));
+#1129=CARTESIAN_POINT($,(23.4908127559282,-19,6.5));
+#1130=CARTESIAN_POINT($,(26.0816255118565,-19,6.5));
+#1131=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#1132=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1128,#1129,#1130,#1131),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1133=CARTESIAN_POINT($,(0,1));
+#1134=CARTESIAN_POINT($,(1,1));
+#1135=POLYLINE($,(#1133,#1134));
+#1136=DEFINITIONAL_REPRESENTATION('pcurve',(#1135),#1);
+#1137=PCURVE($,#69,#1136);
+#1138=CARTESIAN_POINT($,(0,0));
+#1139=CARTESIAN_POINT($,(1,0));
+#1140=POLYLINE($,(#1138,#1139));
+#1141=DEFINITIONAL_REPRESENTATION('pcurve',(#1140),#1);
+#1142=PCURVE($,#321,#1141);
+#1143=SURFACE_CURVE($,#1132,(#1137,#1142),.PCURVE_S1.);
+#1144=EDGE_CURVE($,#1043,#1107,#1143,.T.);
+#1145=ORIENTED_EDGE($,$,$,#1144,.F.);
+#1146=ORIENTED_EDGE($,$,$,#1062,.F.);
+#1147=EDGE_LOOP($,(#1105,#1127,#1145,#1146));
+#1148=FACE_OUTER_BOUND('',#1147,.T.);
+#1149=ADVANCED_FACE('',(#1148),#69,.T.);
+#1150=ORIENTED_EDGE($,$,$,#906,.T.);
+#1151=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#1152=VERTEX_POINT($,#1151);
+#1153=CARTESIAN_POINT($,(30,-12,5));
+#1154=CARTESIAN_POINT($,(29.625,-11.85,5));
+#1155=CARTESIAN_POINT($,(29.25,-11.7,5));
+#1156=CARTESIAN_POINT($,(28.5,-11.4,5.75));
+#1157=CARTESIAN_POINT($,(28.5,-11.4,6.125));
+#1158=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#1159=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1153,#1154,#1155,#1156,#1157,#1158),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1160=CARTESIAN_POINT($,(1,0));
+#1161=CARTESIAN_POINT($,(1,1));
+#1162=POLYLINE($,(#1160,#1161));
+#1163=DEFINITIONAL_REPRESENTATION('pcurve',(#1162),#1);
+#1164=PCURVE($,#94,#1163);
+#1165=CARTESIAN_POINT($,(0,0));
+#1166=CARTESIAN_POINT($,(0,1));
+#1167=POLYLINE($,(#1165,#1166));
+#1168=DEFINITIONAL_REPRESENTATION('pcurve',(#1167),#1);
+#1169=PCURVE($,#107,#1168);
+#1170=SURFACE_CURVE($,#1159,(#1164,#1169),.PCURVE_S1.);
+#1171=EDGE_CURVE($,#869,#1152,#1170,.T.);
+#1172=ORIENTED_EDGE($,$,$,#1171,.T.);
+#1173=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#1174=CARTESIAN_POINT($,(28.5,-16.5816255118565,6.5));
+#1175=CARTESIAN_POINT($,(28.5,-13.9908127559282,6.5));
+#1176=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#1177=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1173,#1174,#1175,#1176),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1178=CARTESIAN_POINT($,(0,1));
+#1179=CARTESIAN_POINT($,(1,1));
+#1180=POLYLINE($,(#1178,#1179));
+#1181=DEFINITIONAL_REPRESENTATION('pcurve',(#1180),#1);
+#1182=PCURVE($,#94,#1181);
+#1183=CARTESIAN_POINT($,(0,0));
+#1184=CARTESIAN_POINT($,(1,0));
+#1185=POLYLINE($,(#1183,#1184));
+#1186=DEFINITIONAL_REPRESENTATION('pcurve',(#1185),#1);
+#1187=PCURVE($,#346,#1186);
+#1188=SURFACE_CURVE($,#1177,(#1182,#1187),.PCURVE_S1.);
+#1189=EDGE_CURVE($,#1107,#1152,#1188,.T.);
+#1190=ORIENTED_EDGE($,$,$,#1189,.F.);
+#1191=ORIENTED_EDGE($,$,$,#1126,.F.);
+#1192=EDGE_LOOP($,(#1150,#1172,#1190,#1191));
+#1193=FACE_OUTER_BOUND('',#1192,.T.);
+#1194=ADVANCED_FACE('',(#1193),#94,.T.);
+#1195=ORIENTED_EDGE($,$,$,#884,.T.);
+#1196=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#1197=VERTEX_POINT($,#1196);
+#1198=CARTESIAN_POINT($,(30,12,5));
+#1199=CARTESIAN_POINT($,(29.625,11.85,5));
+#1200=CARTESIAN_POINT($,(29.25,11.7,5));
+#1201=CARTESIAN_POINT($,(28.5,11.4,5.75));
+#1202=CARTESIAN_POINT($,(28.5,11.4,6.125));
+#1203=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#1204=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1198,#1199,#1200,#1201,#1202,#1203),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1205=CARTESIAN_POINT($,(1,0));
+#1206=CARTESIAN_POINT($,(1,1));
+#1207=POLYLINE($,(#1205,#1206));
+#1208=DEFINITIONAL_REPRESENTATION('pcurve',(#1207),#1);
+#1209=PCURVE($,#107,#1208);
+#1210=CARTESIAN_POINT($,(0,0));
+#1211=CARTESIAN_POINT($,(0,1));
+#1212=POLYLINE($,(#1210,#1211));
+#1213=DEFINITIONAL_REPRESENTATION('pcurve',(#1212),#1);
+#1214=PCURVE($,#132,#1213);
+#1215=SURFACE_CURVE($,#1204,(#1209,#1214),.PCURVE_S1.);
+#1216=EDGE_CURVE($,#847,#1197,#1215,.T.);
+#1217=ORIENTED_EDGE($,$,$,#1216,.T.);
+#1218=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#1219=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#1220=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1218,#1219),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1221=CARTESIAN_POINT($,(0,1));
+#1222=CARTESIAN_POINT($,(1,1));
+#1223=POLYLINE($,(#1221,#1222));
+#1224=DEFINITIONAL_REPRESENTATION('pcurve',(#1223),#1);
+#1225=PCURVE($,#107,#1224);
+#1226=CARTESIAN_POINT($,(0,0));
+#1227=CARTESIAN_POINT($,(1,0));
+#1228=POLYLINE($,(#1226,#1227));
+#1229=DEFINITIONAL_REPRESENTATION('pcurve',(#1228),#1);
+#1230=PCURVE($,#359,#1229);
+#1231=SURFACE_CURVE($,#1220,(#1225,#1230),.PCURVE_S1.);
+#1232=EDGE_CURVE($,#1152,#1197,#1231,.T.);
+#1233=ORIENTED_EDGE($,$,$,#1232,.F.);
+#1234=ORIENTED_EDGE($,$,$,#1171,.F.);
+#1235=EDGE_LOOP($,(#1195,#1217,#1233,#1234));
+#1236=FACE_OUTER_BOUND('',#1235,.T.);
+#1237=ADVANCED_FACE('',(#1236),#107,.T.);
+#1238=ORIENTED_EDGE($,$,$,#866,.T.);
+#1239=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#1240=VERTEX_POINT($,#1239);
+#1241=CARTESIAN_POINT($,(28.7271713220297,18.7271713220297,5));
+#1242=CARTESIAN_POINT($,(28.3680816805043,18.4930816805043,5));
+#1243=CARTESIAN_POINT($,(28.008992038979,18.258992038979,5));
+#1244=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,5.75));
+#1245=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.125));
+#1246=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#1247=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1241,#1242,#1243,#1244,#1245,#1246),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1248=CARTESIAN_POINT($,(1,0));
+#1249=CARTESIAN_POINT($,(1,1));
+#1250=POLYLINE($,(#1248,#1249));
+#1251=DEFINITIONAL_REPRESENTATION('pcurve',(#1250),#1);
+#1252=PCURVE($,#132,#1251);
+#1253=CARTESIAN_POINT($,(0,0));
+#1254=CARTESIAN_POINT($,(0,1));
+#1255=POLYLINE($,(#1253,#1254));
+#1256=DEFINITIONAL_REPRESENTATION('pcurve',(#1255),#1);
+#1257=PCURVE($,#157,#1256);
+#1258=SURFACE_CURVE($,#1247,(#1252,#1257),.PCURVE_S1.);
+#1259=EDGE_CURVE($,#825,#1240,#1258,.T.);
+#1260=ORIENTED_EDGE($,$,$,#1259,.T.);
+#1261=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#1262=CARTESIAN_POINT($,(28.5,13.9908127559282,6.5));
+#1263=CARTESIAN_POINT($,(28.5,16.5816255118565,6.5));
+#1264=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#1265=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1261,#1262,#1263,#1264),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1266=CARTESIAN_POINT($,(0,1));
+#1267=CARTESIAN_POINT($,(1,1));
+#1268=POLYLINE($,(#1266,#1267));
+#1269=DEFINITIONAL_REPRESENTATION('pcurve',(#1268),#1);
+#1270=PCURVE($,#132,#1269);
+#1271=CARTESIAN_POINT($,(0,0));
+#1272=CARTESIAN_POINT($,(1,0));
+#1273=POLYLINE($,(#1271,#1272));
+#1274=DEFINITIONAL_REPRESENTATION('pcurve',(#1273),#1);
+#1275=PCURVE($,#384,#1274);
+#1276=SURFACE_CURVE($,#1265,(#1270,#1275),.PCURVE_S1.);
+#1277=EDGE_CURVE($,#1197,#1240,#1276,.T.);
+#1278=ORIENTED_EDGE($,$,$,#1277,.F.);
+#1279=ORIENTED_EDGE($,$,$,#1216,.F.);
+#1280=EDGE_LOOP($,(#1238,#1260,#1278,#1279));
+#1281=FACE_OUTER_BOUND('',#1280,.T.);
+#1282=ADVANCED_FACE('',(#1281),#132,.T.);
+#1283=ORIENTED_EDGE($,$,$,#844,.T.);
+#1284=CARTESIAN_POINT($,(20.9,19,6.5));
+#1285=VERTEX_POINT($,#1284);
+#1286=CARTESIAN_POINT($,(22,20,5));
+#1287=CARTESIAN_POINT($,(21.725,19.75,5));
+#1288=CARTESIAN_POINT($,(21.45,19.5,5));
+#1289=CARTESIAN_POINT($,(20.9,19,5.75));
+#1290=CARTESIAN_POINT($,(20.9,19,6.125));
+#1291=CARTESIAN_POINT($,(20.9,19,6.5));
+#1292=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1286,#1287,#1288,#1289,#1290,#1291),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1293=CARTESIAN_POINT($,(1,0));
+#1294=CARTESIAN_POINT($,(1,1));
+#1295=POLYLINE($,(#1293,#1294));
+#1296=DEFINITIONAL_REPRESENTATION('pcurve',(#1295),#1);
+#1297=PCURVE($,#157,#1296);
+#1298=CARTESIAN_POINT($,(0,0));
+#1299=CARTESIAN_POINT($,(0,1));
+#1300=POLYLINE($,(#1298,#1299));
+#1301=DEFINITIONAL_REPRESENTATION('pcurve',(#1300),#1);
+#1302=PCURVE($,#170,#1301);
+#1303=SURFACE_CURVE($,#1292,(#1297,#1302),.PCURVE_S1.);
+#1304=EDGE_CURVE($,#807,#1285,#1303,.T.);
+#1305=ORIENTED_EDGE($,$,$,#1304,.T.);
+#1306=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#1307=CARTESIAN_POINT($,(26.0816255118565,19,6.5));
+#1308=CARTESIAN_POINT($,(23.4908127559282,19,6.5));
+#1309=CARTESIAN_POINT($,(20.9,19,6.5));
+#1310=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1306,#1307,#1308,#1309),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1311=CARTESIAN_POINT($,(0,1));
+#1312=CARTESIAN_POINT($,(1,1));
+#1313=POLYLINE($,(#1311,#1312));
+#1314=DEFINITIONAL_REPRESENTATION('pcurve',(#1313),#1);
+#1315=PCURVE($,#157,#1314);
+#1316=CARTESIAN_POINT($,(0,0));
+#1317=CARTESIAN_POINT($,(1,0));
+#1318=POLYLINE($,(#1316,#1317));
+#1319=DEFINITIONAL_REPRESENTATION('pcurve',(#1318),#1);
+#1320=PCURVE($,#409,#1319);
+#1321=SURFACE_CURVE($,#1310,(#1315,#1320),.PCURVE_S1.);
+#1322=EDGE_CURVE($,#1240,#1285,#1321,.T.);
+#1323=ORIENTED_EDGE($,$,$,#1322,.F.);
+#1324=ORIENTED_EDGE($,$,$,#1259,.F.);
+#1325=EDGE_LOOP($,(#1283,#1305,#1323,#1324));
+#1326=FACE_OUTER_BOUND('',#1325,.T.);
+#1327=ADVANCED_FACE('',(#1326),#157,.T.);
+#1328=ORIENTED_EDGE($,$,$,#822,.T.);
+#1329=CARTESIAN_POINT($,(-20.9,19,6.5));
+#1330=VERTEX_POINT($,#1329);
+#1331=CARTESIAN_POINT($,(-22,20,5));
+#1332=CARTESIAN_POINT($,(-21.725,19.75,5));
+#1333=CARTESIAN_POINT($,(-21.45,19.5,5));
+#1334=CARTESIAN_POINT($,(-20.9,19,5.75));
+#1335=CARTESIAN_POINT($,(-20.9,19,6.125));
+#1336=CARTESIAN_POINT($,(-20.9,19,6.5));
+#1337=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1331,#1332,#1333,#1334,#1335,#1336),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1338=CARTESIAN_POINT($,(1,0));
+#1339=CARTESIAN_POINT($,(1,1));
+#1340=POLYLINE($,(#1338,#1339));
+#1341=DEFINITIONAL_REPRESENTATION('pcurve',(#1340),#1);
+#1342=PCURVE($,#170,#1341);
+#1343=CARTESIAN_POINT($,(0,0));
+#1344=CARTESIAN_POINT($,(0,1));
+#1345=POLYLINE($,(#1343,#1344));
+#1346=DEFINITIONAL_REPRESENTATION('pcurve',(#1345),#1);
+#1347=PCURVE($,#195,#1346);
+#1348=SURFACE_CURVE($,#1337,(#1342,#1347),.PCURVE_S1.);
+#1349=EDGE_CURVE($,#785,#1330,#1348,.T.);
+#1350=ORIENTED_EDGE($,$,$,#1349,.T.);
+#1351=CARTESIAN_POINT($,(20.9,19,6.5));
+#1352=CARTESIAN_POINT($,(-20.9,19,6.5));
+#1353=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1351,#1352),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1354=CARTESIAN_POINT($,(0,1));
+#1355=CARTESIAN_POINT($,(1,1));
+#1356=POLYLINE($,(#1354,#1355));
+#1357=DEFINITIONAL_REPRESENTATION('pcurve',(#1356),#1);
+#1358=PCURVE($,#170,#1357);
+#1359=CARTESIAN_POINT($,(0,0));
+#1360=CARTESIAN_POINT($,(1,0));
+#1361=POLYLINE($,(#1359,#1360));
+#1362=DEFINITIONAL_REPRESENTATION('pcurve',(#1361),#1);
+#1363=PCURVE($,#422,#1362);
+#1364=SURFACE_CURVE($,#1353,(#1358,#1363),.PCURVE_S1.);
+#1365=EDGE_CURVE($,#1285,#1330,#1364,.T.);
+#1366=ORIENTED_EDGE($,$,$,#1365,.F.);
+#1367=ORIENTED_EDGE($,$,$,#1304,.F.);
+#1368=EDGE_LOOP($,(#1328,#1350,#1366,#1367));
+#1369=FACE_OUTER_BOUND('',#1368,.T.);
+#1370=ADVANCED_FACE('',(#1369),#170,.T.);
+#1371=ORIENTED_EDGE($,$,$,#804,.T.);
+#1372=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#1373=VERTEX_POINT($,#1372);
+#1374=CARTESIAN_POINT($,(-28.7271713220297,18.7271713220297,5));
+#1375=CARTESIAN_POINT($,(-28.3680816805043,18.4930816805043,5));
+#1376=CARTESIAN_POINT($,(-28.008992038979,18.258992038979,5));
+#1377=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,5.75));
+#1378=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.125));
+#1379=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#1380=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1374,#1375,#1376,#1377,#1378,#1379),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1381=CARTESIAN_POINT($,(1,0));
+#1382=CARTESIAN_POINT($,(1,1));
+#1383=POLYLINE($,(#1381,#1382));
+#1384=DEFINITIONAL_REPRESENTATION('pcurve',(#1383),#1);
+#1385=PCURVE($,#195,#1384);
+#1386=CARTESIAN_POINT($,(0,0));
+#1387=CARTESIAN_POINT($,(0,1));
+#1388=POLYLINE($,(#1386,#1387));
+#1389=DEFINITIONAL_REPRESENTATION('pcurve',(#1388),#1);
+#1390=PCURVE($,#220,#1389);
+#1391=SURFACE_CURVE($,#1380,(#1385,#1390),.PCURVE_S1.);
+#1392=EDGE_CURVE($,#763,#1373,#1391,.T.);
+#1393=ORIENTED_EDGE($,$,$,#1392,.T.);
+#1394=CARTESIAN_POINT($,(-20.9,19,6.5));
+#1395=CARTESIAN_POINT($,(-23.4908127559282,19,6.5));
+#1396=CARTESIAN_POINT($,(-26.0816255118565,19,6.5));
+#1397=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#1398=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1394,#1395,#1396,#1397),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1399=CARTESIAN_POINT($,(0,1));
+#1400=CARTESIAN_POINT($,(1,1));
+#1401=POLYLINE($,(#1399,#1400));
+#1402=DEFINITIONAL_REPRESENTATION('pcurve',(#1401),#1);
+#1403=PCURVE($,#195,#1402);
+#1404=CARTESIAN_POINT($,(0,0));
+#1405=CARTESIAN_POINT($,(1,0));
+#1406=POLYLINE($,(#1404,#1405));
+#1407=DEFINITIONAL_REPRESENTATION('pcurve',(#1406),#1);
+#1408=PCURVE($,#447,#1407);
+#1409=SURFACE_CURVE($,#1398,(#1403,#1408),.PCURVE_S1.);
+#1410=EDGE_CURVE($,#1330,#1373,#1409,.T.);
+#1411=ORIENTED_EDGE($,$,$,#1410,.F.);
+#1412=ORIENTED_EDGE($,$,$,#1349,.F.);
+#1413=EDGE_LOOP($,(#1371,#1393,#1411,#1412));
+#1414=FACE_OUTER_BOUND('',#1413,.T.);
+#1415=ADVANCED_FACE('',(#1414),#195,.T.);
+#1416=ORIENTED_EDGE($,$,$,#782,.T.);
+#1417=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#1418=VERTEX_POINT($,#1417);
+#1419=CARTESIAN_POINT($,(-30,12,5));
+#1420=CARTESIAN_POINT($,(-29.625,11.85,5));
+#1421=CARTESIAN_POINT($,(-29.25,11.7,5));
+#1422=CARTESIAN_POINT($,(-28.5,11.4,5.75));
+#1423=CARTESIAN_POINT($,(-28.5,11.4,6.125));
+#1424=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#1425=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1419,#1420,#1421,#1422,#1423,#1424),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1426=CARTESIAN_POINT($,(1,0));
+#1427=CARTESIAN_POINT($,(1,1));
+#1428=POLYLINE($,(#1426,#1427));
+#1429=DEFINITIONAL_REPRESENTATION('pcurve',(#1428),#1);
+#1430=PCURVE($,#220,#1429);
+#1431=CARTESIAN_POINT($,(0,0));
+#1432=CARTESIAN_POINT($,(0,1));
+#1433=POLYLINE($,(#1431,#1432));
+#1434=DEFINITIONAL_REPRESENTATION('pcurve',(#1433),#1);
+#1435=PCURVE($,#233,#1434);
+#1436=SURFACE_CURVE($,#1425,(#1430,#1435),.PCURVE_S1.);
+#1437=EDGE_CURVE($,#745,#1418,#1436,.T.);
+#1438=ORIENTED_EDGE($,$,$,#1437,.T.);
+#1439=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#1440=CARTESIAN_POINT($,(-28.5,16.5816255118565,6.5));
+#1441=CARTESIAN_POINT($,(-28.5,13.9908127559282,6.5));
+#1442=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#1443=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1439,#1440,#1441,#1442),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1444=CARTESIAN_POINT($,(0,1));
+#1445=CARTESIAN_POINT($,(1,1));
+#1446=POLYLINE($,(#1444,#1445));
+#1447=DEFINITIONAL_REPRESENTATION('pcurve',(#1446),#1);
+#1448=PCURVE($,#220,#1447);
+#1449=CARTESIAN_POINT($,(0,0));
+#1450=CARTESIAN_POINT($,(1,0));
+#1451=POLYLINE($,(#1449,#1450));
+#1452=DEFINITIONAL_REPRESENTATION('pcurve',(#1451),#1);
+#1453=PCURVE($,#472,#1452);
+#1454=SURFACE_CURVE($,#1443,(#1448,#1453),.PCURVE_S1.);
+#1455=EDGE_CURVE($,#1373,#1418,#1454,.T.);
+#1456=ORIENTED_EDGE($,$,$,#1455,.F.);
+#1457=ORIENTED_EDGE($,$,$,#1392,.F.);
+#1458=EDGE_LOOP($,(#1416,#1438,#1456,#1457));
+#1459=FACE_OUTER_BOUND('',#1458,.T.);
+#1460=ADVANCED_FACE('',(#1459),#220,.T.);
+#1461=ORIENTED_EDGE($,$,$,#760,.T.);
+#1462=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#1463=VERTEX_POINT($,#1462);
+#1464=CARTESIAN_POINT($,(-30,-12,5));
+#1465=CARTESIAN_POINT($,(-29.625,-11.85,5));
+#1466=CARTESIAN_POINT($,(-29.25,-11.7,5));
+#1467=CARTESIAN_POINT($,(-28.5,-11.4,5.75));
+#1468=CARTESIAN_POINT($,(-28.5,-11.4,6.125));
+#1469=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#1470=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1464,#1465,#1466,#1467,#1468,#1469),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1471=CARTESIAN_POINT($,(1,0));
+#1472=CARTESIAN_POINT($,(1,1));
+#1473=POLYLINE($,(#1471,#1472));
+#1474=DEFINITIONAL_REPRESENTATION('pcurve',(#1473),#1);
+#1475=PCURVE($,#233,#1474);
+#1476=CARTESIAN_POINT($,(0,0));
+#1477=CARTESIAN_POINT($,(0,1));
+#1478=POLYLINE($,(#1476,#1477));
+#1479=DEFINITIONAL_REPRESENTATION('pcurve',(#1478),#1);
+#1480=PCURVE($,#258,#1479);
+#1481=SURFACE_CURVE($,#1470,(#1475,#1480),.PCURVE_S1.);
+#1482=EDGE_CURVE($,#723,#1463,#1481,.T.);
+#1483=ORIENTED_EDGE($,$,$,#1482,.T.);
+#1484=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#1485=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#1486=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1484,#1485),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1487=CARTESIAN_POINT($,(0,1));
+#1488=CARTESIAN_POINT($,(1,1));
+#1489=POLYLINE($,(#1487,#1488));
+#1490=DEFINITIONAL_REPRESENTATION('pcurve',(#1489),#1);
+#1491=PCURVE($,#233,#1490);
+#1492=CARTESIAN_POINT($,(0,0));
+#1493=CARTESIAN_POINT($,(1,0));
+#1494=POLYLINE($,(#1492,#1493));
+#1495=DEFINITIONAL_REPRESENTATION('pcurve',(#1494),#1);
+#1496=PCURVE($,#485,#1495);
+#1497=SURFACE_CURVE($,#1486,(#1491,#1496),.PCURVE_S1.);
+#1498=EDGE_CURVE($,#1418,#1463,#1497,.T.);
+#1499=ORIENTED_EDGE($,$,$,#1498,.F.);
+#1500=ORIENTED_EDGE($,$,$,#1437,.F.);
+#1501=EDGE_LOOP($,(#1461,#1483,#1499,#1500));
+#1502=FACE_OUTER_BOUND('',#1501,.T.);
+#1503=ADVANCED_FACE('',(#1502),#233,.T.);
+#1504=ORIENTED_EDGE($,$,$,#742,.T.);
+#1505=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#1506=VERTEX_POINT($,#1505);
+#1507=CARTESIAN_POINT($,(-28.7271713220297,-18.7271713220297,5));
+#1508=CARTESIAN_POINT($,(-28.3680816805044,-18.4930816805043,5));
+#1509=CARTESIAN_POINT($,(-28.008992038979,-18.258992038979,5));
+#1510=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,5.75));
+#1511=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.125));
+#1512=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#1513=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1507,#1508,#1509,#1510,#1511,#1512),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1514=CARTESIAN_POINT($,(1,0));
+#1515=CARTESIAN_POINT($,(1,1));
+#1516=POLYLINE($,(#1514,#1515));
+#1517=DEFINITIONAL_REPRESENTATION('pcurve',(#1516),#1);
+#1518=PCURVE($,#258,#1517);
+#1519=CARTESIAN_POINT($,(0,0));
+#1520=CARTESIAN_POINT($,(0,1));
+#1521=POLYLINE($,(#1519,#1520));
+#1522=DEFINITIONAL_REPRESENTATION('pcurve',(#1521),#1);
+#1523=PCURVE($,#283,#1522);
+#1524=SURFACE_CURVE($,#1513,(#1518,#1523),.PCURVE_S1.);
+#1525=EDGE_CURVE($,#699,#1506,#1524,.T.);
+#1526=ORIENTED_EDGE($,$,$,#1525,.T.);
+#1527=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#1528=CARTESIAN_POINT($,(-28.5,-13.9908127559282,6.5));
+#1529=CARTESIAN_POINT($,(-28.5,-16.5816255118565,6.5));
+#1530=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#1531=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1527,#1528,#1529,#1530),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1532=CARTESIAN_POINT($,(0,1));
+#1533=CARTESIAN_POINT($,(1,1));
+#1534=POLYLINE($,(#1532,#1533));
+#1535=DEFINITIONAL_REPRESENTATION('pcurve',(#1534),#1);
+#1536=PCURVE($,#258,#1535);
+#1537=CARTESIAN_POINT($,(0,0));
+#1538=CARTESIAN_POINT($,(1,0));
+#1539=POLYLINE($,(#1537,#1538));
+#1540=DEFINITIONAL_REPRESENTATION('pcurve',(#1539),#1);
+#1541=PCURVE($,#510,#1540);
+#1542=SURFACE_CURVE($,#1531,(#1536,#1541),.PCURVE_S1.);
+#1543=EDGE_CURVE($,#1463,#1506,#1542,.T.);
+#1544=ORIENTED_EDGE($,$,$,#1543,.F.);
+#1545=ORIENTED_EDGE($,$,$,#1482,.F.);
+#1546=EDGE_LOOP($,(#1504,#1526,#1544,#1545));
+#1547=FACE_OUTER_BOUND('',#1546,.T.);
+#1548=ADVANCED_FACE('',(#1547),#258,.T.);
+#1549=ORIENTED_EDGE($,$,$,#720,.T.);
+#1550=ORIENTED_EDGE($,$,$,#1100,.T.);
+#1551=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#1552=CARTESIAN_POINT($,(-26.0816255118565,-19,6.5));
+#1553=CARTESIAN_POINT($,(-23.4908127559282,-19,6.5));
+#1554=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#1555=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1551,#1552,#1553,#1554),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1556=CARTESIAN_POINT($,(0,1));
+#1557=CARTESIAN_POINT($,(1,1));
+#1558=POLYLINE($,(#1556,#1557));
+#1559=DEFINITIONAL_REPRESENTATION('pcurve',(#1558),#1);
+#1560=PCURVE($,#283,#1559);
+#1561=CARTESIAN_POINT($,(0,0));
+#1562=CARTESIAN_POINT($,(1,0));
+#1563=POLYLINE($,(#1561,#1562));
+#1564=DEFINITIONAL_REPRESENTATION('pcurve',(#1563),#1);
+#1565=PCURVE($,#535,#1564);
+#1566=SURFACE_CURVE($,#1555,(#1560,#1565),.PCURVE_S1.);
+#1567=EDGE_CURVE($,#1506,#1065,#1566,.T.);
+#1568=ORIENTED_EDGE($,$,$,#1567,.F.);
+#1569=ORIENTED_EDGE($,$,$,#1525,.F.);
+#1570=EDGE_LOOP($,(#1549,#1550,#1568,#1569));
+#1571=FACE_OUTER_BOUND('',#1570,.T.);
+#1572=ADVANCED_FACE('',(#1571),#283,.T.);
+#1573=ORIENTED_EDGE($,$,$,#1080,.T.);
+#1574=CARTESIAN_POINT($,(19.8,-18,8));
+#1575=VERTEX_POINT($,#1574);
+#1576=CARTESIAN_POINT($,(20.9,-19,6.5));
+#1577=CARTESIAN_POINT($,(20.9,-19,6.875));
+#1578=CARTESIAN_POINT($,(20.9,-19,7.25));
+#1579=CARTESIAN_POINT($,(20.35,-18.5,8));
+#1580=CARTESIAN_POINT($,(20.075,-18.25,8));
+#1581=CARTESIAN_POINT($,(19.8,-18,8));
+#1582=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1576,#1577,#1578,#1579,#1580,#1581),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1583=CARTESIAN_POINT($,(1,0));
+#1584=CARTESIAN_POINT($,(1,1));
+#1585=POLYLINE($,(#1583,#1584));
+#1586=DEFINITIONAL_REPRESENTATION('pcurve',(#1585),#1);
+#1587=PCURVE($,#296,#1586);
+#1588=CARTESIAN_POINT($,(0,0));
+#1589=CARTESIAN_POINT($,(0,1));
+#1590=POLYLINE($,(#1588,#1589));
+#1591=DEFINITIONAL_REPRESENTATION('pcurve',(#1590),#1);
+#1592=PCURVE($,#321,#1591);
+#1593=SURFACE_CURVE($,#1582,(#1587,#1592),.PCURVE_S1.);
+#1594=EDGE_CURVE($,#1043,#1575,#1593,.T.);
+#1595=ORIENTED_EDGE($,$,$,#1594,.T.);
+#1596=CARTESIAN_POINT($,(-19.8,-18,8));
+#1597=VERTEX_POINT($,#1596);
+#1598=CARTESIAN_POINT($,(-19.8,-18,8));
+#1599=CARTESIAN_POINT($,(19.8,-18,8));
+#1600=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1598,#1599),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1601=CARTESIAN_POINT($,(0,1));
+#1602=CARTESIAN_POINT($,(1,1));
+#1603=POLYLINE($,(#1601,#1602));
+#1604=DEFINITIONAL_REPRESENTATION('pcurve',(#1603),#1);
+#1605=PCURVE($,#296,#1604);
+#1606=CARTESIAN_POINT($,(-19.8,-18));
+#1607=CARTESIAN_POINT($,(19.8,-18));
+#1608=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1606,#1607),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1609=DEFINITIONAL_REPRESENTATION('pcurve',(#1608),#1);
+#1610=PCURVE($,#540,#1609);
+#1611=SURFACE_CURVE($,#1600,(#1605,#1610),.PCURVE_S1.);
+#1612=EDGE_CURVE($,#1597,#1575,#1611,.T.);
+#1613=ORIENTED_EDGE($,$,$,#1612,.F.);
+#1614=CARTESIAN_POINT($,(-20.9,-19,6.5));
+#1615=CARTESIAN_POINT($,(-20.9,-19,6.875));
+#1616=CARTESIAN_POINT($,(-20.9,-19,7.25));
+#1617=CARTESIAN_POINT($,(-20.35,-18.5,8));
+#1618=CARTESIAN_POINT($,(-20.075,-18.25,8));
+#1619=CARTESIAN_POINT($,(-19.8,-18,8));
+#1620=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1614,#1615,#1616,#1617,#1618,#1619),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1621=CARTESIAN_POINT($,(0,0));
+#1622=CARTESIAN_POINT($,(0,1));
+#1623=POLYLINE($,(#1621,#1622));
+#1624=DEFINITIONAL_REPRESENTATION('pcurve',(#1623),#1);
+#1625=PCURVE($,#296,#1624);
+#1626=CARTESIAN_POINT($,(1,0));
+#1627=CARTESIAN_POINT($,(1,1));
+#1628=POLYLINE($,(#1626,#1627));
+#1629=DEFINITIONAL_REPRESENTATION('pcurve',(#1628),#1);
+#1630=PCURVE($,#535,#1629);
+#1631=SURFACE_CURVE($,#1620,(#1625,#1630),.PCURVE_S1.);
+#1632=EDGE_CURVE($,#1065,#1597,#1631,.T.);
+#1633=ORIENTED_EDGE($,$,$,#1632,.F.);
+#1634=EDGE_LOOP($,(#1573,#1595,#1613,#1633));
+#1635=FACE_OUTER_BOUND('',#1634,.T.);
+#1636=ADVANCED_FACE('',(#1635),#296,.T.);
+#1637=ORIENTED_EDGE($,$,$,#1144,.T.);
+#1638=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#1639=VERTEX_POINT($,#1638);
+#1640=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.5));
+#1641=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,6.875));
+#1642=CARTESIAN_POINT($,(27.2908127559282,-17.7908127559282,7.25));
+#1643=CARTESIAN_POINT($,(26.5726334728775,-17.3226334728775,8));
+#1644=CARTESIAN_POINT($,(26.2135438313521,-17.0885438313521,8));
+#1645=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#1646=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1640,#1641,#1642,#1643,#1644,#1645),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1647=CARTESIAN_POINT($,(1,0));
+#1648=CARTESIAN_POINT($,(1,1));
+#1649=POLYLINE($,(#1647,#1648));
+#1650=DEFINITIONAL_REPRESENTATION('pcurve',(#1649),#1);
+#1651=PCURVE($,#321,#1650);
+#1652=CARTESIAN_POINT($,(0,0));
+#1653=CARTESIAN_POINT($,(0,1));
+#1654=POLYLINE($,(#1652,#1653));
+#1655=DEFINITIONAL_REPRESENTATION('pcurve',(#1654),#1);
+#1656=PCURVE($,#346,#1655);
+#1657=SURFACE_CURVE($,#1646,(#1651,#1656),.PCURVE_S1.);
+#1658=EDGE_CURVE($,#1107,#1639,#1657,.T.);
+#1659=ORIENTED_EDGE($,$,$,#1658,.T.);
+#1660=CARTESIAN_POINT($,(19.8,-18,8));
+#1661=CARTESIAN_POINT($,(22.2544541898267,-18,8));
+#1662=CARTESIAN_POINT($,(24.7089083796535,-18,8));
+#1663=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#1664=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1660,#1661,#1662,#1663),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1665=CARTESIAN_POINT($,(0,1));
+#1666=CARTESIAN_POINT($,(1,1));
+#1667=POLYLINE($,(#1665,#1666));
+#1668=DEFINITIONAL_REPRESENTATION('pcurve',(#1667),#1);
+#1669=PCURVE($,#321,#1668);
+#1670=CARTESIAN_POINT($,(19.8,-18));
+#1671=CARTESIAN_POINT($,(22.2544541898267,-18));
+#1672=CARTESIAN_POINT($,(24.7089083796535,-18));
+#1673=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267));
+#1674=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1670,#1671,#1672,#1673),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1675=DEFINITIONAL_REPRESENTATION('pcurve',(#1674),#1);
+#1676=PCURVE($,#540,#1675);
+#1677=SURFACE_CURVE($,#1664,(#1669,#1676),.PCURVE_S1.);
+#1678=EDGE_CURVE($,#1575,#1639,#1677,.T.);
+#1679=ORIENTED_EDGE($,$,$,#1678,.F.);
+#1680=ORIENTED_EDGE($,$,$,#1594,.F.);
+#1681=EDGE_LOOP($,(#1637,#1659,#1679,#1680));
+#1682=FACE_OUTER_BOUND('',#1681,.T.);
+#1683=ADVANCED_FACE('',(#1682),#321,.T.);
+#1684=ORIENTED_EDGE($,$,$,#1189,.T.);
+#1685=CARTESIAN_POINT($,(27,-10.8,8));
+#1686=VERTEX_POINT($,#1685);
+#1687=CARTESIAN_POINT($,(28.5,-11.4,6.5));
+#1688=CARTESIAN_POINT($,(28.5,-11.4,6.875));
+#1689=CARTESIAN_POINT($,(28.5,-11.4,7.25));
+#1690=CARTESIAN_POINT($,(27.75,-11.1,8));
+#1691=CARTESIAN_POINT($,(27.375,-10.95,8));
+#1692=CARTESIAN_POINT($,(27,-10.8,8));
+#1693=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1687,#1688,#1689,#1690,#1691,#1692),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1694=CARTESIAN_POINT($,(1,0));
+#1695=CARTESIAN_POINT($,(1,1));
+#1696=POLYLINE($,(#1694,#1695));
+#1697=DEFINITIONAL_REPRESENTATION('pcurve',(#1696),#1);
+#1698=PCURVE($,#346,#1697);
+#1699=CARTESIAN_POINT($,(0,0));
+#1700=CARTESIAN_POINT($,(0,1));
+#1701=POLYLINE($,(#1699,#1700));
+#1702=DEFINITIONAL_REPRESENTATION('pcurve',(#1701),#1);
+#1703=PCURVE($,#359,#1702);
+#1704=SURFACE_CURVE($,#1693,(#1698,#1703),.PCURVE_S1.);
+#1705=EDGE_CURVE($,#1152,#1686,#1704,.T.);
+#1706=ORIENTED_EDGE($,$,$,#1705,.T.);
+#1707=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267,8));
+#1708=CARTESIAN_POINT($,(27,-15.7089083796535,8));
+#1709=CARTESIAN_POINT($,(27,-13.2544541898267,8));
+#1710=CARTESIAN_POINT($,(27,-10.8,8));
+#1711=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1707,#1708,#1709,#1710),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1712=CARTESIAN_POINT($,(0,1));
+#1713=CARTESIAN_POINT($,(1,1));
+#1714=POLYLINE($,(#1712,#1713));
+#1715=DEFINITIONAL_REPRESENTATION('pcurve',(#1714),#1);
+#1716=PCURVE($,#346,#1715);
+#1717=CARTESIAN_POINT($,(25.8544541898267,-16.8544541898267));
+#1718=CARTESIAN_POINT($,(27,-15.7089083796535));
+#1719=CARTESIAN_POINT($,(27,-13.2544541898267));
+#1720=CARTESIAN_POINT($,(27,-10.8));
+#1721=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1717,#1718,#1719,#1720),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1722=DEFINITIONAL_REPRESENTATION('pcurve',(#1721),#1);
+#1723=PCURVE($,#540,#1722);
+#1724=SURFACE_CURVE($,#1711,(#1716,#1723),.PCURVE_S1.);
+#1725=EDGE_CURVE($,#1639,#1686,#1724,.T.);
+#1726=ORIENTED_EDGE($,$,$,#1725,.F.);
+#1727=ORIENTED_EDGE($,$,$,#1658,.F.);
+#1728=EDGE_LOOP($,(#1684,#1706,#1726,#1727));
+#1729=FACE_OUTER_BOUND('',#1728,.T.);
+#1730=ADVANCED_FACE('',(#1729),#346,.T.);
+#1731=ORIENTED_EDGE($,$,$,#1232,.T.);
+#1732=CARTESIAN_POINT($,(27,10.8,8));
+#1733=VERTEX_POINT($,#1732);
+#1734=CARTESIAN_POINT($,(28.5,11.4,6.5));
+#1735=CARTESIAN_POINT($,(28.5,11.4,6.875));
+#1736=CARTESIAN_POINT($,(28.5,11.4,7.25));
+#1737=CARTESIAN_POINT($,(27.75,11.1,8));
+#1738=CARTESIAN_POINT($,(27.375,10.95,8));
+#1739=CARTESIAN_POINT($,(27,10.8,8));
+#1740=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1734,#1735,#1736,#1737,#1738,#1739),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1741=CARTESIAN_POINT($,(1,0));
+#1742=CARTESIAN_POINT($,(1,1));
+#1743=POLYLINE($,(#1741,#1742));
+#1744=DEFINITIONAL_REPRESENTATION('pcurve',(#1743),#1);
+#1745=PCURVE($,#359,#1744);
+#1746=CARTESIAN_POINT($,(0,0));
+#1747=CARTESIAN_POINT($,(0,1));
+#1748=POLYLINE($,(#1746,#1747));
+#1749=DEFINITIONAL_REPRESENTATION('pcurve',(#1748),#1);
+#1750=PCURVE($,#384,#1749);
+#1751=SURFACE_CURVE($,#1740,(#1745,#1750),.PCURVE_S1.);
+#1752=EDGE_CURVE($,#1197,#1733,#1751,.T.);
+#1753=ORIENTED_EDGE($,$,$,#1752,.T.);
+#1754=CARTESIAN_POINT($,(27,-10.8,8));
+#1755=CARTESIAN_POINT($,(27,10.8,8));
+#1756=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1754,#1755),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1757=CARTESIAN_POINT($,(0,1));
+#1758=CARTESIAN_POINT($,(1,1));
+#1759=POLYLINE($,(#1757,#1758));
+#1760=DEFINITIONAL_REPRESENTATION('pcurve',(#1759),#1);
+#1761=PCURVE($,#359,#1760);
+#1762=CARTESIAN_POINT($,(27,-10.8));
+#1763=CARTESIAN_POINT($,(27,10.8));
+#1764=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1762,#1763),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1765=DEFINITIONAL_REPRESENTATION('pcurve',(#1764),#1);
+#1766=PCURVE($,#540,#1765);
+#1767=SURFACE_CURVE($,#1756,(#1761,#1766),.PCURVE_S1.);
+#1768=EDGE_CURVE($,#1686,#1733,#1767,.T.);
+#1769=ORIENTED_EDGE($,$,$,#1768,.F.);
+#1770=ORIENTED_EDGE($,$,$,#1705,.F.);
+#1771=EDGE_LOOP($,(#1731,#1753,#1769,#1770));
+#1772=FACE_OUTER_BOUND('',#1771,.T.);
+#1773=ADVANCED_FACE('',(#1772),#359,.T.);
+#1774=ORIENTED_EDGE($,$,$,#1277,.T.);
+#1775=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#1776=VERTEX_POINT($,#1775);
+#1777=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.5));
+#1778=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,6.875));
+#1779=CARTESIAN_POINT($,(27.2908127559282,17.7908127559282,7.25));
+#1780=CARTESIAN_POINT($,(26.5726334728775,17.3226334728775,8));
+#1781=CARTESIAN_POINT($,(26.2135438313521,17.0885438313521,8));
+#1782=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#1783=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1777,#1778,#1779,#1780,#1781,#1782),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1784=CARTESIAN_POINT($,(1,0));
+#1785=CARTESIAN_POINT($,(1,1));
+#1786=POLYLINE($,(#1784,#1785));
+#1787=DEFINITIONAL_REPRESENTATION('pcurve',(#1786),#1);
+#1788=PCURVE($,#384,#1787);
+#1789=CARTESIAN_POINT($,(0,0));
+#1790=CARTESIAN_POINT($,(0,1));
+#1791=POLYLINE($,(#1789,#1790));
+#1792=DEFINITIONAL_REPRESENTATION('pcurve',(#1791),#1);
+#1793=PCURVE($,#409,#1792);
+#1794=SURFACE_CURVE($,#1783,(#1788,#1793),.PCURVE_S1.);
+#1795=EDGE_CURVE($,#1240,#1776,#1794,.T.);
+#1796=ORIENTED_EDGE($,$,$,#1795,.T.);
+#1797=CARTESIAN_POINT($,(27,10.8,8));
+#1798=CARTESIAN_POINT($,(27,13.2544541898267,8));
+#1799=CARTESIAN_POINT($,(27,15.7089083796535,8));
+#1800=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#1801=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1797,#1798,#1799,#1800),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1802=CARTESIAN_POINT($,(0,1));
+#1803=CARTESIAN_POINT($,(1,1));
+#1804=POLYLINE($,(#1802,#1803));
+#1805=DEFINITIONAL_REPRESENTATION('pcurve',(#1804),#1);
+#1806=PCURVE($,#384,#1805);
+#1807=CARTESIAN_POINT($,(27,10.8));
+#1808=CARTESIAN_POINT($,(27,13.2544541898267));
+#1809=CARTESIAN_POINT($,(27,15.7089083796535));
+#1810=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267));
+#1811=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1807,#1808,#1809,#1810),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1812=DEFINITIONAL_REPRESENTATION('pcurve',(#1811),#1);
+#1813=PCURVE($,#540,#1812);
+#1814=SURFACE_CURVE($,#1801,(#1806,#1813),.PCURVE_S1.);
+#1815=EDGE_CURVE($,#1733,#1776,#1814,.T.);
+#1816=ORIENTED_EDGE($,$,$,#1815,.F.);
+#1817=ORIENTED_EDGE($,$,$,#1752,.F.);
+#1818=EDGE_LOOP($,(#1774,#1796,#1816,#1817));
+#1819=FACE_OUTER_BOUND('',#1818,.T.);
+#1820=ADVANCED_FACE('',(#1819),#384,.T.);
+#1821=ORIENTED_EDGE($,$,$,#1322,.T.);
+#1822=CARTESIAN_POINT($,(19.8,18,8));
+#1823=VERTEX_POINT($,#1822);
+#1824=CARTESIAN_POINT($,(20.9,19,6.5));
+#1825=CARTESIAN_POINT($,(20.9,19,6.875));
+#1826=CARTESIAN_POINT($,(20.9,19,7.25));
+#1827=CARTESIAN_POINT($,(20.35,18.5,8));
+#1828=CARTESIAN_POINT($,(20.075,18.25,8));
+#1829=CARTESIAN_POINT($,(19.8,18,8));
+#1830=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1824,#1825,#1826,#1827,#1828,#1829),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1831=CARTESIAN_POINT($,(1,0));
+#1832=CARTESIAN_POINT($,(1,1));
+#1833=POLYLINE($,(#1831,#1832));
+#1834=DEFINITIONAL_REPRESENTATION('pcurve',(#1833),#1);
+#1835=PCURVE($,#409,#1834);
+#1836=CARTESIAN_POINT($,(0,0));
+#1837=CARTESIAN_POINT($,(0,1));
+#1838=POLYLINE($,(#1836,#1837));
+#1839=DEFINITIONAL_REPRESENTATION('pcurve',(#1838),#1);
+#1840=PCURVE($,#422,#1839);
+#1841=SURFACE_CURVE($,#1830,(#1835,#1840),.PCURVE_S1.);
+#1842=EDGE_CURVE($,#1285,#1823,#1841,.T.);
+#1843=ORIENTED_EDGE($,$,$,#1842,.T.);
+#1844=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267,8));
+#1845=CARTESIAN_POINT($,(24.7089083796535,18,8));
+#1846=CARTESIAN_POINT($,(22.2544541898267,18,8));
+#1847=CARTESIAN_POINT($,(19.8,18,8));
+#1848=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1844,#1845,#1846,#1847),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1849=CARTESIAN_POINT($,(0,1));
+#1850=CARTESIAN_POINT($,(1,1));
+#1851=POLYLINE($,(#1849,#1850));
+#1852=DEFINITIONAL_REPRESENTATION('pcurve',(#1851),#1);
+#1853=PCURVE($,#409,#1852);
+#1854=CARTESIAN_POINT($,(25.8544541898267,16.8544541898267));
+#1855=CARTESIAN_POINT($,(24.7089083796535,18));
+#1856=CARTESIAN_POINT($,(22.2544541898267,18));
+#1857=CARTESIAN_POINT($,(19.8,18));
+#1858=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1854,#1855,#1856,#1857),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1859=DEFINITIONAL_REPRESENTATION('pcurve',(#1858),#1);
+#1860=PCURVE($,#540,#1859);
+#1861=SURFACE_CURVE($,#1848,(#1853,#1860),.PCURVE_S1.);
+#1862=EDGE_CURVE($,#1776,#1823,#1861,.T.);
+#1863=ORIENTED_EDGE($,$,$,#1862,.F.);
+#1864=ORIENTED_EDGE($,$,$,#1795,.F.);
+#1865=EDGE_LOOP($,(#1821,#1843,#1863,#1864));
+#1866=FACE_OUTER_BOUND('',#1865,.T.);
+#1867=ADVANCED_FACE('',(#1866),#409,.T.);
+#1868=ORIENTED_EDGE($,$,$,#1365,.T.);
+#1869=CARTESIAN_POINT($,(-19.8,18,8));
+#1870=VERTEX_POINT($,#1869);
+#1871=CARTESIAN_POINT($,(-20.9,19,6.5));
+#1872=CARTESIAN_POINT($,(-20.9,19,6.875));
+#1873=CARTESIAN_POINT($,(-20.9,19,7.25));
+#1874=CARTESIAN_POINT($,(-20.35,18.5,8));
+#1875=CARTESIAN_POINT($,(-20.075,18.25,8));
+#1876=CARTESIAN_POINT($,(-19.8,18,8));
+#1877=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1871,#1872,#1873,#1874,#1875,#1876),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1878=CARTESIAN_POINT($,(1,0));
+#1879=CARTESIAN_POINT($,(1,1));
+#1880=POLYLINE($,(#1878,#1879));
+#1881=DEFINITIONAL_REPRESENTATION('pcurve',(#1880),#1);
+#1882=PCURVE($,#422,#1881);
+#1883=CARTESIAN_POINT($,(0,0));
+#1884=CARTESIAN_POINT($,(0,1));
+#1885=POLYLINE($,(#1883,#1884));
+#1886=DEFINITIONAL_REPRESENTATION('pcurve',(#1885),#1);
+#1887=PCURVE($,#447,#1886);
+#1888=SURFACE_CURVE($,#1877,(#1882,#1887),.PCURVE_S1.);
+#1889=EDGE_CURVE($,#1330,#1870,#1888,.T.);
+#1890=ORIENTED_EDGE($,$,$,#1889,.T.);
+#1891=CARTESIAN_POINT($,(19.8,18,8));
+#1892=CARTESIAN_POINT($,(-19.8,18,8));
+#1893=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1891,#1892),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1894=CARTESIAN_POINT($,(0,1));
+#1895=CARTESIAN_POINT($,(1,1));
+#1896=POLYLINE($,(#1894,#1895));
+#1897=DEFINITIONAL_REPRESENTATION('pcurve',(#1896),#1);
+#1898=PCURVE($,#422,#1897);
+#1899=CARTESIAN_POINT($,(19.8,18));
+#1900=CARTESIAN_POINT($,(-19.8,18));
+#1901=B_SPLINE_CURVE_WITH_KNOTS($,1,(#1899,#1900),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#1902=DEFINITIONAL_REPRESENTATION('pcurve',(#1901),#1);
+#1903=PCURVE($,#540,#1902);
+#1904=SURFACE_CURVE($,#1893,(#1898,#1903),.PCURVE_S1.);
+#1905=EDGE_CURVE($,#1823,#1870,#1904,.T.);
+#1906=ORIENTED_EDGE($,$,$,#1905,.F.);
+#1907=ORIENTED_EDGE($,$,$,#1842,.F.);
+#1908=EDGE_LOOP($,(#1868,#1890,#1906,#1907));
+#1909=FACE_OUTER_BOUND('',#1908,.T.);
+#1910=ADVANCED_FACE('',(#1909),#422,.T.);
+#1911=ORIENTED_EDGE($,$,$,#1410,.T.);
+#1912=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#1913=VERTEX_POINT($,#1912);
+#1914=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.5));
+#1915=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,6.875));
+#1916=CARTESIAN_POINT($,(-27.2908127559282,17.7908127559282,7.25));
+#1917=CARTESIAN_POINT($,(-26.5726334728775,17.3226334728775,8));
+#1918=CARTESIAN_POINT($,(-26.2135438313521,17.0885438313521,8));
+#1919=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#1920=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1914,#1915,#1916,#1917,#1918,#1919),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1921=CARTESIAN_POINT($,(1,0));
+#1922=CARTESIAN_POINT($,(1,1));
+#1923=POLYLINE($,(#1921,#1922));
+#1924=DEFINITIONAL_REPRESENTATION('pcurve',(#1923),#1);
+#1925=PCURVE($,#447,#1924);
+#1926=CARTESIAN_POINT($,(0,0));
+#1927=CARTESIAN_POINT($,(0,1));
+#1928=POLYLINE($,(#1926,#1927));
+#1929=DEFINITIONAL_REPRESENTATION('pcurve',(#1928),#1);
+#1930=PCURVE($,#472,#1929);
+#1931=SURFACE_CURVE($,#1920,(#1925,#1930),.PCURVE_S1.);
+#1932=EDGE_CURVE($,#1373,#1913,#1931,.T.);
+#1933=ORIENTED_EDGE($,$,$,#1932,.T.);
+#1934=CARTESIAN_POINT($,(-19.8,18,8));
+#1935=CARTESIAN_POINT($,(-22.2544541898267,18,8));
+#1936=CARTESIAN_POINT($,(-24.7089083796535,18,8));
+#1937=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#1938=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1934,#1935,#1936,#1937),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1939=CARTESIAN_POINT($,(0,1));
+#1940=CARTESIAN_POINT($,(1,1));
+#1941=POLYLINE($,(#1939,#1940));
+#1942=DEFINITIONAL_REPRESENTATION('pcurve',(#1941),#1);
+#1943=PCURVE($,#447,#1942);
+#1944=CARTESIAN_POINT($,(-19.8,18));
+#1945=CARTESIAN_POINT($,(-22.2544541898267,18));
+#1946=CARTESIAN_POINT($,(-24.7089083796535,18));
+#1947=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267));
+#1948=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1944,#1945,#1946,#1947),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1949=DEFINITIONAL_REPRESENTATION('pcurve',(#1948),#1);
+#1950=PCURVE($,#540,#1949);
+#1951=SURFACE_CURVE($,#1938,(#1943,#1950),.PCURVE_S1.);
+#1952=EDGE_CURVE($,#1870,#1913,#1951,.T.);
+#1953=ORIENTED_EDGE($,$,$,#1952,.F.);
+#1954=ORIENTED_EDGE($,$,$,#1889,.F.);
+#1955=EDGE_LOOP($,(#1911,#1933,#1953,#1954));
+#1956=FACE_OUTER_BOUND('',#1955,.T.);
+#1957=ADVANCED_FACE('',(#1956),#447,.T.);
+#1958=ORIENTED_EDGE($,$,$,#1455,.T.);
+#1959=CARTESIAN_POINT($,(-27,10.8,8));
+#1960=VERTEX_POINT($,#1959);
+#1961=CARTESIAN_POINT($,(-28.5,11.4,6.5));
+#1962=CARTESIAN_POINT($,(-28.5,11.4,6.875));
+#1963=CARTESIAN_POINT($,(-28.5,11.4,7.25));
+#1964=CARTESIAN_POINT($,(-27.75,11.1,8));
+#1965=CARTESIAN_POINT($,(-27.375,10.95,8));
+#1966=CARTESIAN_POINT($,(-27,10.8,8));
+#1967=B_SPLINE_CURVE_WITH_KNOTS($,5,(#1961,#1962,#1963,#1964,#1965,#1966),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#1968=CARTESIAN_POINT($,(1,0));
+#1969=CARTESIAN_POINT($,(1,1));
+#1970=POLYLINE($,(#1968,#1969));
+#1971=DEFINITIONAL_REPRESENTATION('pcurve',(#1970),#1);
+#1972=PCURVE($,#472,#1971);
+#1973=CARTESIAN_POINT($,(0,0));
+#1974=CARTESIAN_POINT($,(0,1));
+#1975=POLYLINE($,(#1973,#1974));
+#1976=DEFINITIONAL_REPRESENTATION('pcurve',(#1975),#1);
+#1977=PCURVE($,#485,#1976);
+#1978=SURFACE_CURVE($,#1967,(#1972,#1977),.PCURVE_S1.);
+#1979=EDGE_CURVE($,#1418,#1960,#1978,.T.);
+#1980=ORIENTED_EDGE($,$,$,#1979,.T.);
+#1981=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267,8));
+#1982=CARTESIAN_POINT($,(-27,15.7089083796535,8));
+#1983=CARTESIAN_POINT($,(-27,13.2544541898267,8));
+#1984=CARTESIAN_POINT($,(-27,10.8,8));
+#1985=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1981,#1982,#1983,#1984),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1986=CARTESIAN_POINT($,(0,1));
+#1987=CARTESIAN_POINT($,(1,1));
+#1988=POLYLINE($,(#1986,#1987));
+#1989=DEFINITIONAL_REPRESENTATION('pcurve',(#1988),#1);
+#1990=PCURVE($,#472,#1989);
+#1991=CARTESIAN_POINT($,(-25.8544541898267,16.8544541898267));
+#1992=CARTESIAN_POINT($,(-27,15.7089083796535));
+#1993=CARTESIAN_POINT($,(-27,13.2544541898267));
+#1994=CARTESIAN_POINT($,(-27,10.8));
+#1995=B_SPLINE_CURVE_WITH_KNOTS($,3,(#1991,#1992,#1993,#1994),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#1996=DEFINITIONAL_REPRESENTATION('pcurve',(#1995),#1);
+#1997=PCURVE($,#540,#1996);
+#1998=SURFACE_CURVE($,#1985,(#1990,#1997),.PCURVE_S1.);
+#1999=EDGE_CURVE($,#1913,#1960,#1998,.T.);
+#2000=ORIENTED_EDGE($,$,$,#1999,.F.);
+#2001=ORIENTED_EDGE($,$,$,#1932,.F.);
+#2002=EDGE_LOOP($,(#1958,#1980,#2000,#2001));
+#2003=FACE_OUTER_BOUND('',#2002,.T.);
+#2004=ADVANCED_FACE('',(#2003),#472,.T.);
+#2005=ORIENTED_EDGE($,$,$,#1498,.T.);
+#2006=CARTESIAN_POINT($,(-27,-10.8,8));
+#2007=VERTEX_POINT($,#2006);
+#2008=CARTESIAN_POINT($,(-28.5,-11.4,6.5));
+#2009=CARTESIAN_POINT($,(-28.5,-11.4,6.875));
+#2010=CARTESIAN_POINT($,(-28.5,-11.4,7.25));
+#2011=CARTESIAN_POINT($,(-27.75,-11.1,8));
+#2012=CARTESIAN_POINT($,(-27.375,-10.95,8));
+#2013=CARTESIAN_POINT($,(-27,-10.8,8));
+#2014=B_SPLINE_CURVE_WITH_KNOTS($,5,(#2008,#2009,#2010,#2011,#2012,#2013),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#2015=CARTESIAN_POINT($,(1,0));
+#2016=CARTESIAN_POINT($,(1,1));
+#2017=POLYLINE($,(#2015,#2016));
+#2018=DEFINITIONAL_REPRESENTATION('pcurve',(#2017),#1);
+#2019=PCURVE($,#485,#2018);
+#2020=CARTESIAN_POINT($,(0,0));
+#2021=CARTESIAN_POINT($,(0,1));
+#2022=POLYLINE($,(#2020,#2021));
+#2023=DEFINITIONAL_REPRESENTATION('pcurve',(#2022),#1);
+#2024=PCURVE($,#510,#2023);
+#2025=SURFACE_CURVE($,#2014,(#2019,#2024),.PCURVE_S1.);
+#2026=EDGE_CURVE($,#1463,#2007,#2025,.T.);
+#2027=ORIENTED_EDGE($,$,$,#2026,.T.);
+#2028=CARTESIAN_POINT($,(-27,10.8,8));
+#2029=CARTESIAN_POINT($,(-27,-10.8,8));
+#2030=B_SPLINE_CURVE_WITH_KNOTS($,1,(#2028,#2029),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#2031=CARTESIAN_POINT($,(0,1));
+#2032=CARTESIAN_POINT($,(1,1));
+#2033=POLYLINE($,(#2031,#2032));
+#2034=DEFINITIONAL_REPRESENTATION('pcurve',(#2033),#1);
+#2035=PCURVE($,#485,#2034);
+#2036=CARTESIAN_POINT($,(-27,10.8));
+#2037=CARTESIAN_POINT($,(-27,-10.8));
+#2038=B_SPLINE_CURVE_WITH_KNOTS($,1,(#2036,#2037),.UNSPECIFIED.,.F.,.F.,(2,2),(0,1),.UNSPECIFIED.);
+#2039=DEFINITIONAL_REPRESENTATION('pcurve',(#2038),#1);
+#2040=PCURVE($,#540,#2039);
+#2041=SURFACE_CURVE($,#2030,(#2035,#2040),.PCURVE_S1.);
+#2042=EDGE_CURVE($,#1960,#2007,#2041,.T.);
+#2043=ORIENTED_EDGE($,$,$,#2042,.F.);
+#2044=ORIENTED_EDGE($,$,$,#1979,.F.);
+#2045=EDGE_LOOP($,(#2005,#2027,#2043,#2044));
+#2046=FACE_OUTER_BOUND('',#2045,.T.);
+#2047=ADVANCED_FACE('',(#2046),#485,.T.);
+#2048=ORIENTED_EDGE($,$,$,#1543,.T.);
+#2049=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#2050=VERTEX_POINT($,#2049);
+#2051=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.5));
+#2052=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,6.875));
+#2053=CARTESIAN_POINT($,(-27.2908127559282,-17.7908127559282,7.25));
+#2054=CARTESIAN_POINT($,(-26.5726334728775,-17.3226334728775,8));
+#2055=CARTESIAN_POINT($,(-26.2135438313521,-17.0885438313521,8));
+#2056=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#2057=B_SPLINE_CURVE_WITH_KNOTS($,5,(#2051,#2052,#2053,#2054,#2055,#2056),.UNSPECIFIED.,.F.,.F.,(6,6),(0,1),.UNSPECIFIED.);
+#2058=CARTESIAN_POINT($,(1,0));
+#2059=CARTESIAN_POINT($,(1,1));
+#2060=POLYLINE($,(#2058,#2059));
+#2061=DEFINITIONAL_REPRESENTATION('pcurve',(#2060),#1);
+#2062=PCURVE($,#510,#2061);
+#2063=CARTESIAN_POINT($,(0,0));
+#2064=CARTESIAN_POINT($,(0,1));
+#2065=POLYLINE($,(#2063,#2064));
+#2066=DEFINITIONAL_REPRESENTATION('pcurve',(#2065),#1);
+#2067=PCURVE($,#535,#2066);
+#2068=SURFACE_CURVE($,#2057,(#2062,#2067),.PCURVE_S1.);
+#2069=EDGE_CURVE($,#1506,#2050,#2068,.T.);
+#2070=ORIENTED_EDGE($,$,$,#2069,.T.);
+#2071=CARTESIAN_POINT($,(-27,-10.8,8));
+#2072=CARTESIAN_POINT($,(-27,-13.2544541898267,8));
+#2073=CARTESIAN_POINT($,(-27,-15.7089083796535,8));
+#2074=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#2075=B_SPLINE_CURVE_WITH_KNOTS($,3,(#2071,#2072,#2073,#2074),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#2076=CARTESIAN_POINT($,(0,1));
+#2077=CARTESIAN_POINT($,(1,1));
+#2078=POLYLINE($,(#2076,#2077));
+#2079=DEFINITIONAL_REPRESENTATION('pcurve',(#2078),#1);
+#2080=PCURVE($,#510,#2079);
+#2081=CARTESIAN_POINT($,(-27,-10.8));
+#2082=CARTESIAN_POINT($,(-27,-13.2544541898267));
+#2083=CARTESIAN_POINT($,(-27,-15.7089083796535));
+#2084=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267));
+#2085=B_SPLINE_CURVE_WITH_KNOTS($,3,(#2081,#2082,#2083,#2084),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#2086=DEFINITIONAL_REPRESENTATION('pcurve',(#2085),#1);
+#2087=PCURVE($,#540,#2086);
+#2088=SURFACE_CURVE($,#2075,(#2080,#2087),.PCURVE_S1.);
+#2089=EDGE_CURVE($,#2007,#2050,#2088,.T.);
+#2090=ORIENTED_EDGE($,$,$,#2089,.F.);
+#2091=ORIENTED_EDGE($,$,$,#2026,.F.);
+#2092=EDGE_LOOP($,(#2048,#2070,#2090,#2091));
+#2093=FACE_OUTER_BOUND('',#2092,.T.);
+#2094=ADVANCED_FACE('',(#2093),#510,.T.);
+#2095=ORIENTED_EDGE($,$,$,#1567,.T.);
+#2096=ORIENTED_EDGE($,$,$,#1632,.T.);
+#2097=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267,8));
+#2098=CARTESIAN_POINT($,(-24.7089083796535,-18,8));
+#2099=CARTESIAN_POINT($,(-22.2544541898268,-18,8));
+#2100=CARTESIAN_POINT($,(-19.8,-18,8));
+#2101=B_SPLINE_CURVE_WITH_KNOTS($,3,(#2097,#2098,#2099,#2100),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#2102=CARTESIAN_POINT($,(0,1));
+#2103=CARTESIAN_POINT($,(1,1));
+#2104=POLYLINE($,(#2102,#2103));
+#2105=DEFINITIONAL_REPRESENTATION('pcurve',(#2104),#1);
+#2106=PCURVE($,#535,#2105);
+#2107=CARTESIAN_POINT($,(-25.8544541898267,-16.8544541898267));
+#2108=CARTESIAN_POINT($,(-24.7089083796535,-18));
+#2109=CARTESIAN_POINT($,(-22.2544541898268,-18));
+#2110=CARTESIAN_POINT($,(-19.8,-18));
+#2111=B_SPLINE_CURVE_WITH_KNOTS($,3,(#2107,#2108,#2109,#2110),.UNSPECIFIED.,.F.,.F.,(4,4),(0,1),.UNSPECIFIED.);
+#2112=DEFINITIONAL_REPRESENTATION('pcurve',(#2111),#1);
+#2113=PCURVE($,#540,#2112);
+#2114=SURFACE_CURVE($,#2101,(#2106,#2113),.PCURVE_S1.);
+#2115=EDGE_CURVE($,#2050,#1597,#2114,.T.);
+#2116=ORIENTED_EDGE($,$,$,#2115,.F.);
+#2117=ORIENTED_EDGE($,$,$,#2069,.F.);
+#2118=EDGE_LOOP($,(#2095,#2096,#2116,#2117));
+#2119=FACE_OUTER_BOUND('',#2118,.T.);
+#2120=ADVANCED_FACE('',(#2119),#535,.T.);
+#2121=ORIENTED_EDGE($,$,$,#1612,.T.);
+#2122=ORIENTED_EDGE($,$,$,#1678,.T.);
+#2123=ORIENTED_EDGE($,$,$,#1725,.T.);
+#2124=ORIENTED_EDGE($,$,$,#1768,.T.);
+#2125=ORIENTED_EDGE($,$,$,#1815,.T.);
+#2126=ORIENTED_EDGE($,$,$,#1862,.T.);
+#2127=ORIENTED_EDGE($,$,$,#1905,.T.);
+#2128=ORIENTED_EDGE($,$,$,#1952,.T.);
+#2129=ORIENTED_EDGE($,$,$,#1999,.T.);
+#2130=ORIENTED_EDGE($,$,$,#2042,.T.);
+#2131=ORIENTED_EDGE($,$,$,#2089,.T.);
+#2132=ORIENTED_EDGE($,$,$,#2115,.T.);
+#2133=EDGE_LOOP($,(#2121,#2122,#2123,#2124,#2125,#2126,#2127,#2128,#2129,#2130,#2131,#2132));
+#2134=FACE_OUTER_BOUND('',#2133,.T.);
+#2135=ADVANCED_FACE('',(#2134),#540,.T.);
+#2136=CLOSED_SHELL($,(#619,#948,#987,#1010,#1033,#1040,#1104,#1149,#1194,#1237,#1282,#1327,#1370,#1415,#1460,#1503,#1548,#1572,#1636,#1683,#1730,#1773,#1820,#1867,#1910,#1957,#2004,#2047,#2094,#2120,#2135));
+#2137=MANIFOLD_SOLID_BREP('Raised',#2136);
+#2138=APPLICATION_CONTEXT('mechanical design');
+#2139=PRODUCT_CONTEXT('',#2138,'mechanical');
+#2140=PRODUCT('AETHERIS','Raised','',(#2139));
+#2141=PRODUCT_DEFINITION_FORMATION('','',#2140);
+#2142=PRODUCT_DEFINITION_CONTEXT('design',#2138,'design');
+#2143=PRODUCT_DEFINITION('','',#2141,#2142);
+#2144=PRODUCT_DEFINITION_SHAPE('','',#2143);
+#2145=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
+#2146=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#2147=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
+#2148=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNIT_ASSIGNED_CONTEXT((#2145,#2146,#2147))REPRESENTATION_CONTEXT('3','3D'));
+#2149=SHAPE_REPRESENTATION('Raised',(#2137),#2148);
+#2150=SHAPE_DEFINITION_REPRESENTATION(#2144,#2149);
+ENDSEC;
+END-ISO-10303-21;
diff --git a/fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament b/fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament
new file mode 100644
index 00000000..d060b0a3
--- /dev/null
+++ b/fixtures/Experiments/IPhone17ProMax/refined-plateau.firmament
@@ -0,0 +1,187 @@
+// Refined plateau authoring witness. Width 2mm is an explicit design assumption, not drawing evidence. Homothetic inset preserves the outer 72.76 x 43mm footprint; smooth corner extent 11.5mm replaces the circular proxy for G2 continuity. Remaining dimensions and occurrences match Pass A. Rear-view datum: X right, Y up, Z toward rear.
+Record PhoneSpec {
+ ProductWidth: Length
+ ProductLength: Length
+ ProductThickness: Length
+ BodyCornerRadius: Length
+ CameraPlateauWidth: Length
+ CameraPlateauHeight: Length
+ CameraPlateauRise: Length
+ CameraGlassRise: Length
+ CameraDiameter: Length
+ CameraLeftX: Length
+ CameraMiddleX: Length
+ CameraRightX: Length
+}
+Static Standard: PhoneSpec = PhoneSpec {
+ ProductWidth: 77.98mm
+ ProductLength: 163.43mm
+ ProductThickness: 8.75mm
+ BodyCornerRadius: 13.90mm
+ CameraPlateauWidth: 72.76mm
+ CameraPlateauHeight: 43mm
+ CameraPlateauRise: 2.55mm
+ CameraGlassRise: 1.88mm
+ CameraDiameter: 16.20mm
+ CameraLeftX: 14.37mm
+ CameraMiddleX: 32.36mm
+ CameraRightX: 64.16mm
+}
+
+Template < Spec: PhoneSpec > Struct BodyPart {
+ RoundedRect2 Outline { Center: [Spec.ProductWidth / 2,-Spec.ProductLength / 2] Size: [Spec.ProductWidth,Spec.ProductLength] Radius: Spec.BodyCornerRadius }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: 0mm To: Spec.ProductThickness }
+ SmoothRoundedRect2 PlateauOutline { Center: [Spec.ProductWidth / 2,-23.99mm] Size: [Spec.CameraPlateauWidth,Spec.CameraPlateauHeight] CornerExtent: 11.5mm }
+ Profile PlateauFootprint { Loop Outer { PlateauOutline |> TraceLoop } }
+ Plateau CameraPlateau {
+ Base: Solid
+ Footprint: PlateauFootprint
+ Height: Spec.CameraPlateauRise
+ Width: 2mm
+ Inset: Homothetic
+ Continuity: G2
+ }
+}
+Template < Spec: PhoneSpec > Struct FrontGlassPart {
+ RoundedRect2 Outline { Center: [Spec.ProductWidth / 2,-Spec.ProductLength / 2] Size: [Spec.ProductWidth - 2.40mm,Spec.ProductLength - 2.40mm] Radius: Spec.BodyCornerRadius - 1.20mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: 0mm To: 0.10mm }
+}
+Template < Spec: PhoneSpec > Struct DisplayPart {
+ RoundedRect2 Outline { Center: [Spec.ProductWidth / 2,-Spec.ProductLength / 2] Size: [Spec.ProductWidth - 5.12mm,Spec.ProductLength - 5.12mm] Radius: Spec.BodyCornerRadius - 2.56mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: 0mm To: 0.05mm }
+}
+Template < Spec: PhoneSpec > Struct FrontSensorPart {
+ Slot2 Outline { Center: [Spec.ProductWidth / 2,-7.91mm] Length: 20.76mm Width: 6.07mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: 0mm To: 0.02mm }
+}
+Template < Spec: PhoneSpec > Struct RearCamera1Part {
+ Circle2 Outline { Center: [Spec.CameraLeftX,-14.37mm] Diameter: Spec.CameraDiameter }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + Spec.CameraGlassRise }
+}
+Template < Spec: PhoneSpec > Struct RearCamera2Part {
+ Circle2 Outline { Center: [Spec.CameraLeftX,-33.61mm] Diameter: Spec.CameraDiameter }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + Spec.CameraGlassRise }
+}
+Template < Spec: PhoneSpec > Struct RearCamera3Part {
+ Circle2 Outline { Center: [Spec.CameraMiddleX,-23.99mm] Diameter: Spec.CameraDiameter }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + Spec.CameraGlassRise }
+}
+Template < Spec: PhoneSpec > Struct FlashPart {
+ Circle2 Outline { Center: [Spec.CameraRightX,-13.82mm] Diameter: 6.80mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + 0.02mm }
+}
+Template < Spec: PhoneSpec > Struct RearSensorPart {
+ Circle2 Outline { Center: [Spec.CameraRightX,-34.16mm] Diameter: 6.65mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + 0.02mm }
+}
+Template < Spec: PhoneSpec > Struct RearMicPart {
+ Circle2 Outline { Center: [Spec.CameraRightX,-23.99mm] Diameter: 1.15mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: Spec.ProductThickness + Spec.CameraPlateauRise To: Spec.ProductThickness + Spec.CameraPlateauRise + 0.02mm }
+}
+// Simple side controls and dark opening proxies; local XY maps onto the side face.
+Template < L: Length, W: Length, T: Length > Struct SideDetail {
+ Slot2 Outline { Center: [0mm,0mm] Length: L Width: W }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Solid { Profile: Section From: 0mm To: T }
+}
+Assembly IPhone17ProMax {
+ <Assembly IPhone17ProMax>
+ <Part Body = BodyPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part FrontGlass = FrontGlassPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part Display = DisplayPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part FrontSensor = FrontSensorPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part RearCamera1 = RearCamera1Part<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part RearCamera2 = RearCamera2Part<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part RearCamera3 = RearCamera3Part<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part Flash = FlashPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part RearSensor = RearSensorPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part RearMic = RearMicPart<Spec: Standard>>
+ Placement LegacyExplicit = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];
+ </Part>
+ <Part ActionButton = SideDetail<L: 6.9mm, W: 2.66mm, T: 0.45mm>>
+ Placement LegacyExplicit = [0,-1,0,0,0,0,1,0,-1,0,0,0,0,-34.28,4.375,1];
+ </Part>
+ <Part VolumeUp = SideDetail<L: 11.2mm, W: 2.66mm, T: 0.45mm>>
+ Placement LegacyExplicit = [0,-1,0,0,0,0,1,0,-1,0,0,0,0,-48.43,4.375,1];
+ </Part>
+ <Part VolumeDown = SideDetail<L: 11.2mm, W: 2.66mm, T: 0.45mm>>
+ Placement LegacyExplicit = [0,-1,0,0,0,0,1,0,-1,0,0,0,0,-62.63,4.375,1];
+ </Part>
+ <Part SideButton = SideDetail<L: 17.7mm, W: 2.66mm, T: 0.45mm>>
+ Placement LegacyExplicit = [0,1,0,0,0,0,1,0,1,0,0,0,77.98,-55.53,4.375,1];
+ </Part>
+ <Part CameraControl = SideDetail<L: 17.1mm, W: 3.13mm, T: 0.02mm>>
+ Placement LegacyExplicit = [0,1,0,0,0,0,1,0,1,0,0,0,77.98,-111.82,4.375,1];
+ </Part>
+ <Part ConnectorOpeningProxy = SideDetail<L: 9.0mm, W: 3.12mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,38.99,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy1 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,15.48,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy2 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,17.96,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy3 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,20.44,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy4 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,22.92,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy5 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,25.4,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy6 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,32.09,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy7 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,45.08,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy8 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,51.3,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy9 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,53.56,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy10 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,55.81,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy11 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,58.07,-163.43,4.375,1];
+ </Part>
+ <Part PortOpeningProxy12 = SideDetail<L: 1.53mm, W: 1.53mm, T: 0.02mm>>
+ Placement LegacyExplicit = [1,0,0,0,0,0,1,0,0,-1,0,0,60.32,-163.43,4.375,1];
+ </Part>
+ </Assembly>
+ Anchor: IPhone17ProMax;
+}
+
+
diff --git a/fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament b/fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament
index a49cac05..7f788a74 100644
--- a/fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament
+++ b/fixtures/Experiments/IPhone17ProMax/smooth-plateau-witness.firmament
@@ -1,4 +1,4 @@
-// Minimal public-authoring probe: expected section-chain-g1-degree-limit.
+// Smooth footprint witness: polynomial corners remove the line/arc curvature jump.
// No claim that this is the phone's finished plateau or a G2 transition.
Model SmoothPlateauWitness {
Units: mm
@@ -8,7 +8,7 @@ Model SmoothPlateauWitness {
}
Construction Plane BaseFrame { Trace: Frames.Base }
Construction Plane TopFrame { Trace: Frames.Top }
- RoundedRect2 BaseOutline { Center: [0mm,0mm] Size: [72.76mm,43mm] Radius: 11.5mm }
+ SmoothRoundedRect2 BaseOutline { Center: [0mm,0mm] Size: [72.76mm,43mm] CornerExtent: 11.5mm }
Profile BaseProfile { Loop Outer { BaseOutline |> TraceLoop } }
SectionChain Transition {
Continuity: G1
diff --git a/fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament b/fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament
new file mode 100644
index 00000000..cf48a5f1
--- /dev/null
+++ b/fixtures/Invalid/Fillet/smooth-loop-contact-shell.firmament
@@ -0,0 +1,16 @@
+// Isolates the next blocker: a source-bound polynomial contact shell.
+Model SmoothLoopContactShell {
+ Units: mm
+ SmoothRoundedRect2 Outline { Center: [0mm,0mm] Size: [72.76mm,43mm] CornerExtent: 11.5mm }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Extrude Body { Profile: Section From: 0mm To: 2.55mm }
+ Modify Body {
+ EdgeFinish Rim {
+ Target: Section.Outer
+ On: Top
+ Kind: Fillet
+ Radius: 1mm
+ Profile: CurvatureContinuous
+ }
+ }
+}
diff --git a/fixtures/Invalid/SectionChain/g2-not-admitted.firmament b/fixtures/Invalid/SectionChain/g2-not-admitted.firmament
new file mode 100644
index 00000000..6e4e94d0
--- /dev/null
+++ b/fixtures/Invalid/SectionChain/g2-not-admitted.firmament
@@ -0,0 +1,34 @@
+Model NormalizedRoundedSections {
+ Units: mm
+ Concept Struct Frames {
+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [0,0,1] Up: [0,1,0] }
+ B: Plane { Origin: [0mm,0mm,8mm] Normal: [0,0,1] Up: [0,1,0] }
+ C: Plane { Origin: [0mm,0mm,16mm] Normal: [0,0,1] Up: [0,1,0] }
+ }
+ Construction Plane FA { Trace: Frames.A }
+ Construction Plane FB { Trace: Frames.B }
+ Construction Plane FC { Trace: Frames.C }
+ RoundedRect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] Radius: 8mm }
+ Profile P { Loop Outer { Outline |> TraceLoop } }
+ SectionChain RoundedSections {
+ Continuity: G2
+ ApproximationTolerance: 0.00001mm
+ Section A {
+ Frame: FA
+ Profile: P
+ Seam: Bottom
+ }
+ Section B {
+ Frame: FB
+ Profile: P
+ Seam: Bottom
+ }
+ Section C {
+ Frame: FC
+ Profile: P
+ Seam: Bottom
+ }
+ Start: Cap
+ End: Cap
+ }
+}
diff --git a/fixtures/Invalid/SectionChain/normalization-tolerance-unmet.firmament b/fixtures/Invalid/SectionChain/normalization-tolerance-unmet.firmament
new file mode 100644
index 00000000..19471038
--- /dev/null
+++ b/fixtures/Invalid/SectionChain/normalization-tolerance-unmet.firmament
@@ -0,0 +1,34 @@
+Model NormalizedRoundedSections {
+ Units: mm
+ Concept Struct Frames {
+ A: Plane { Origin: [0mm,0mm,0mm] Normal: [0,0,1] Up: [0,1,0] }
+ B: Plane { Origin: [0mm,0mm,8mm] Normal: [0,0,1] Up: [0,1,0] }
+ C: Plane { Origin: [0mm,0mm,16mm] Normal: [0,0,1] Up: [0,1,0] }
+ }
+ Construction Plane FA { Trace: Frames.A }
+ Construction Plane FB { Trace: Frames.B }
+ Construction Plane FC { Trace: Frames.C }
+ RoundedRect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] Radius: 8mm }
+ Profile P { Loop Outer { Outline |> TraceLoop } }
+ SectionChain RoundedSections {
+ Continuity: G1
+ ApproximationTolerance: 0.00000000000000000001mm
+ Section A {
+ Frame: FA
+ Profile: P
+ Seam: Bottom
+ }
+ Section B {
+ Frame: FB
+ Profile: P
+ Seam: Bottom
+ }
+ Section C {
+ Frame: FC
+ Profile: P
+ Seam: Bottom
+ }
+ Start: Cap
+ End: Cap
+ }
+}
diff --git a/fixtures/Regression/Fillet/concave-curvature-continuous.firmament b/fixtures/Regression/Fillet/concave-curvature-continuous.firmament
new file mode 100644
index 00000000..ab3dd732
--- /dev/null
+++ b/fixtures/Regression/Fillet/concave-curvature-continuous.firmament
@@ -0,0 +1,39 @@
+firmament:
+ version: 1
+
+model:
+ name: m5b_valid_fillet_concave_overlap_lroot
+ units: mm
+
+ops[3]:
+ -
+ op: box
+ id: base
+ size[3]:
+ 30
+ 20
+ 10
+ -
+ op: add
+ id: lroot
+ to: base
+ with:
+ op: box
+ size[3]:
+ 20
+ 10
+ 10
+ place:
+ on: origin
+ offset[3]:
+ 20
+ 10
+ 0
+ -
+ op: fillet
+ id: inner_edge_fillet
+ from: lroot
+ edges[1]:
+ inner_x_max_y_max
+ radius: 1
+ profile: CurvatureContinuous
diff --git a/scripts/qualify-surf-g2-loop-x1.py b/scripts/qualify-surf-g2-loop-x1.py
new file mode 100644
index 00000000..786f1eda
--- /dev/null
+++ b/scripts/qualify-surf-g2-loop-x1.py
@@ -0,0 +1,114 @@
+"""Neutral comparisons from authoritative CLI assembly meshes. No CAD reconstruction."""
+import argparse, json
+from pathlib import Path
+import numpy as np
+from PIL import Image, ImageDraw
+import matplotlib
+matplotlib.use('Agg')
+import matplotlib.pyplot as plt
+parser=argparse.ArgumentParser()
+parser.add_argument('--out',type=Path,default=Path('artifacts/local/surf-g2-loop-x1'))
+out=parser.parse_args().out
+def render(label, direction, crop=None, front=False):
+ forward=np.array(direction,dtype=float); forward/=np.linalg.norm(forward)
+ up=np.array([0.,1.,0.])
+ right=np.cross(up,forward); right/=np.linalg.norm(right)
+ up=np.cross(forward,right)
+ tri=triangles.copy(); col=colors.copy()
+ # Front component slabs overlap by design in this blockout. Show their exposed
+ # front faces in declared display order; all vertices still come from CLI geometry.
+ mask=np.ones(len(tri),dtype=bool)
+ if front:
+ mask &= ~np.isin(names,['CameraPlateau','RearCamera1','RearCamera2','RearCamera3','Flash','RearMic','RearSensor'])
+ tri=tri[mask]; col=col[mask]; ns=names[mask]
+ [email protected]([right,up,forward]).T
+ lo=q[:,:,:2].min(axis=(0,1)); hi=q[:,:,:2].max(axis=(0,1))
+ if crop is not None: lo=np.array(crop[:2]); hi=np.array(crop[2:])
+ size=np.array([1000,780] if "closeup" in label else [850,1050]); scale=min((size-80)/(hi-lo)); center=(hi+lo)/2
+ q[:,:,:2]=(q[:,:,:2]-center)*scale+size/2
+ q[:,:,1]=size[1]-q[:,:,1]
+ depth=np.full((size[1],size[0]),-np.inf); pixels=np.full((size[1],size[0],3),247,dtype=np.uint8)
+ for t,c,name in zip(q,col,ns):
+ mn=np.maximum(0,np.floor(t[:,:2].min(axis=0)).astype(int)); mx=np.minimum(size-1,np.ceil(t[:,:2].max(axis=0)).astype(int))
+ if np.any(mx<mn): continue
+ a,b,d=t
+ den=(b[1]-d[1])*(a[0]-d[0])+(d[0]-b[0])*(a[1]-d[1])
+ if abs(den)<1e-9: continue
+ xx,yy=np.meshgrid(np.arange(mn[0],mx[0]+1)+.5,np.arange(mn[1],mx[1]+1)+.5)
+ u=((b[1]-d[1])*(xx-d[0])+(d[0]-b[0])*(yy-d[1]))/den
+ v=((d[1]-a[1])*(xx-d[0])+(a[0]-d[0])*(yy-d[1]))/den
+ w=1-u-v; z=u*a[2]+v*b[2]+w*d[2]
+ if front: z=z+{'FrontGlass':.001,'Display':.002,'FrontSensor':.003}.get(name,0)
+ region=depth[mn[1]:mx[1]+1,mn[0]:mx[0]+1]
+ visible=(u>=0)&(v>=0)&(w>=0)&(z>region)
+ region[visible]=z[visible]
+ pixels[mn[1]:mx[1]+1,mn[0]:mx[0]+1][visible]=np.clip(c*255,0,255).astype(np.uint8)
+ im=Image.fromarray(pixels); draw=ImageDraw.Draw(im)
+ draw.text((20,15),label+' | CLI-derived geometry',fill='#30363b')
+ im.save(out/(label+'.png'))
+
+
+for variant in ['before','after','generic']:
+ mesh=json.loads((out/(variant+'.mesh.json')).read_text())
+ definitions={d['id']: d for d in mesh['definitions']}
+ triangles=[]; colors=[]; names=[]
+ for occurrence in mesh['occurrences']:
+ if occurrence.get('definitionId') not in definitions: continue
+ d=definitions[occurrence['definitionId']]
+ v=np.array(d['positions']).reshape(-1,3)
+ m=np.array(occurrence['transform']).reshape(4,4)
+ v=(np.c_[v,np.ones(len(v))]@m)[:,:3]
+ ts=v[np.array(d['indices']).reshape(-1,3)]
+ name=occurrence['path'].split('.')[-1]
+ color=('#25323b' if name.startswith('RearCamera') or name in ['RearSensor','RearMic','FrontSensor'] or 'Proxy' in name
+ else '#33434d' if name=='Display' else '#cdd1d4' if name=='CameraPlateau'
+ else '#f3f0df' if name=='Flash' else '#cdd1d4')
+ rgb=np.array(tuple(bytes.fromhex(color[1:])))/255
+ normals=np.cross(ts[:,1]-ts[:,0],ts[:,2]-ts[:,0])
+ lengths=np.linalg.norm(normals,axis=1)
+ normals=normals/np.maximum(lengths[:,None],1e-12)
+ light=np.array([.3,.4,1.]); light/=np.linalg.norm(light)
+ shade=.70+.30*np.abs(normals@light)
+ triangles.extend(ts); colors.extend(rgb[None,:]*shade[:,None]); names.extend([name]*len(ts))
+ triangles=np.array(triangles); colors=np.array(colors); names=np.array(names)
+
+
+ if variant=='generic':
+ render('generic-shaded',[1,-.8,1.8])
+ continue
+ render(variant+'-rear-three-quarter',[1,-.65,2],[-5,-170,115,15])
+ render(variant+'-camera-closeup',[.45,-.45,2],[-2,-59,91,10])
+ render(variant+'-side-profile',[1,0,0],[-14,-169,3,3])
+ # Intersect display triangles with the identical physical Y plane.
+ section=[]
+ for triangle,name in zip(triangles,names):
+ if name not in ['Body','CameraPlateau']: continue
+ points=[]
+ for a,b in zip(triangle,np.roll(triangle,-1,axis=0)):
+ da=a[1]+23.99; db=b[1]+23.99
+ if da*db<0:
+ p=a+(b-a)*(-da)/(db-da); points.append(p[[0,2]])
+ if len(points)==2: section.append(np.array(points))
+ if variant=='after':
+ # Exact isoparametric section of the exported operation's surface control net.
+ report=json.loads((out/'phone-body-build.json').read_text())['plateau']
+ span=next(s for s in report['contacts']['spans'] if s['sourceSpanId']=='Left')
+ section=[]
+ for patch in span['patches']:
+ net=np.array([[[p['x'],p['y'],p['z']] for p in row] for row in patch['controlPoints']])
+ controls=net.mean(axis=0) # degree-U one, at u=0.5, Y=-23.99
+ samples=[]
+ for t in np.linspace(0,1,257):
+ q=controls.copy()
+ while len(q)>1: q=q[:-1]*(1-t)+q[1:]*t
+ samples.append(q[0][[0,2]])
+ section.append(np.array(samples))
+ section.insert(0,np.array([[0,8.75],section[0][0]]))
+ section.append(np.array([section[-1][-1],[12,11.3]]))
+ fig,ax=plt.subplots(figsize=(8,4))
+ for line in section: ax.plot(line[:,0],line[:,1],color='#475e6b',lw=1.6)
+ ax.set(xlim=(0,12),ylim=(7.8,12),xlabel='X from left envelope (mm)',ylabel='Rear Z (mm)',title=variant+' | CAD section at Y=-23.99 mm',aspect='equal')
+ ax.grid(alpha=.2);fig.tight_layout();fig.savefig(out/(variant+'-section.png'),dpi=150);plt.close(fig)
+for view in ['rear-three-quarter','camera-closeup','side-profile','section']:
+ a=Image.open(out/('before-'+view+'.png'));b=Image.open(out/('after-'+view+'.png'))
+ result=Image.new('RGB',(a.width+b.width,max(a.height,b.height)),(247,247,247));result.paste(a,(0,0));result.paste(b,(a.width,0));result.save(out/('comparison-'+view+'.png'))
diff --git a/scripts/qualify-surf-g2-x1.ps1 b/scripts/qualify-surf-g2-x1.ps1
new file mode 100644
index 00000000..ec0fce50
--- /dev/null
+++ b/scripts/qualify-surf-g2-x1.ps1
@@ -0,0 +1,45 @@
+param(
+ [string]$Cli = (Join-Path $PSScriptRoot '../Aetheris.CLI/bin/Release/net10.0/aetheris.exe'),
+ [string]$OutputDirectory = (Join-Path $PSScriptRoot '../artifacts/local/surf-g2-x1/qualification')
+)
+$ErrorActionPreference = 'Stop'
+$surfRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
+$Cli = [IO.Path]::GetFullPath($Cli)
+$OutputDirectory = [IO.Path]::GetFullPath($OutputDirectory)
+New-Item -ItemType Directory -Force $OutputDirectory | Out-Null
+$surfSource = Join-Path $surfRoot 'fixtures/Canonical/SectionChain/normalized-rounded-sections.firmament'
+function Invoke-SurfCli([string[]]$Arguments, [string]$Log) {
+ $surfText = & $Cli @Arguments
+ $surfExit = $LASTEXITCODE
+ $surfText | Set-Content -LiteralPath (Join-Path $OutputDirectory $Log)
+ if ($surfExit -ne 0) { throw "CLI failed ($surfExit): $($Arguments -join ' ')" }
+ return ($surfText -join "`n" | ConvertFrom-Json)
+}
+$surfBuild = Invoke-SurfCli @('section-chain','build',$surfSource,'--out',(Join-Path $OutputDirectory 'rounded.step'),'--json') 'build.json'
+$surfRepeat = Invoke-SurfCli @('section-chain','build',$surfSource,'--out',(Join-Path $OutputDirectory 'repeat.step'),'--json') 'repeat.json'
+$surfInspect = Invoke-SurfCli @('section-chain','inspect',$surfSource,'--json') 'inspect.json'
+$surfValidate = Invoke-SurfCli @('section-chain','validate',$surfSource,'--json') 'validate.json'
+$surfAnalysis = Invoke-SurfCli @('analyze',(Join-Path $OutputDirectory 'rounded.step'),'--json') 'analysis.json'
+if ($surfBuild.sha256 -ne $surfRepeat.sha256) { throw 'STEP is not deterministic.' }
+if ($surfAnalysis.summary.structuralAssessment -ne 'enclosed-manifold') { throw 'Reimport is not enclosed-manifold.' }
+if (!$surfBuild.stepReimport.success) { throw 'STEP reimport failed.' }
+if (($surfBuild.profileNormalization.curves | Where-Object { $_.certifiedDeviationBound -gt $_.requestedTolerance }).Count) { throw 'Normalization bound failed.' }
+if (($surfBuild.geometricJoins | Where-Object { $_.boundaryKind -eq 'NeighboringProfileSpans' -and $_.status -ne 'G1' }).Count) { throw 'Expected line/arc curvature jump is not diagnosed.' }
+foreach ($surfInvalid in @('normalization-tolerance-unmet','g2-not-admitted')) {
+ $surfInput = Join-Path $surfRoot "fixtures/Invalid/SectionChain/$surfInvalid.firmament"
+ $surfInvalidOutput = Join-Path $OutputDirectory "$surfInvalid.step"
+ if (Test-Path -LiteralPath $surfInvalidOutput) { throw "Invalid-output path already exists: $surfInvalidOutput" }
+ & $Cli section-chain build $surfInput --out $surfInvalidOutput --json | Set-Content -LiteralPath (Join-Path $OutputDirectory "$surfInvalid.json")
+ if ($LASTEXITCODE -eq 0 -or (Test-Path -LiteralPath $surfInvalidOutput)) { throw 'Invalid construction did not fail transactionally.' }
+}
+[pscustomobject]@{
+ verdict = 'Meaningful progression; no new G2 transition'
+ stepSha256 = $surfBuild.sha256
+ manifold = $surfAnalysis.summary.structuralAssessment
+ normalizedArcs = $surfBuild.profileNormalization.curves.Count
+ maxBoundMm = ($surfBuild.profileNormalization.curves.certifiedDeviationBound | Measure-Object -Maximum).Maximum
+ maxSampleErrorMm = ($surfBuild.profileNormalization.curves.maximumSampledDeviation | Measure-Object -Maximum).Maximum
+ lineArcCurvatureJumpPerMm = ($surfBuild.geometricJoins.maximumShapeOperatorResidual | Measure-Object -Maximum).Maximum
+ faces = $surfBuild.topology.faces
+ stepBytes = (Get-Item -LiteralPath (Join-Path $OutputDirectory 'rounded.step')).Length
+} | ConvertTo-Json | Tee-Object -FilePath (Join-Path $OutputDirectory 'summary.json')