Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

F1: add bounded orthogonal box union support for bracket/rib shapes

Yuechen Li8346610b3d18
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Boolean/BrepBooleanTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Boolean/BrepBooleanTests.cs
index 3192ec79..08f25a98 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/Boolean/BrepBooleanTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/Boolean/BrepBooleanTests.cs
@@ -110,17 +110,30 @@ public sealed class BrepBooleanTests
}
[Fact]
- public void Union_LShapedOverlap_DoesNotReturnBoundingBox()
+ public void Union_LShapedOverlap_Rebuilds_BoundedOrthogonalUnion()
{
var left = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(0d, 2d, 0d, 4d, 0d, 2d)).Value;
var right = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(2d, 4d, 0d, 2d, 0d, 2d)).Value;
var result = BrepBoolean.Union(left, right);
- Assert.False(result.IsSuccess);
- var diagnostic = Assert.Single(result.Diagnostics);
- Assert.Equal(KernelDiagnosticCode.NotImplemented, diagnostic.Code);
- Assert.Contains("not a single box", diagnostic.Message, StringComparison.Ordinal);
+ Assert.True(result.IsSuccess);
+ Assert.False(BrepBooleanBoxRecognition.TryRecognizeAxisAlignedBox(result.Value, ToleranceContext.Default, out _, out _));
+ var validation = BrepBindingValidator.Validate(result.Value, requireAllEdgeAndFaceBindings: true);
+ Assert.True(validation.IsSuccess);
+ }
+
+ [Fact]
+ public void Union_RibWallLikeAdd_Rebuilds_BoundedOrthogonalUnion()
+ {
+ var basePlate = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(0d, 6d, 0d, 4d, 0d, 1d)).Value;
+ var ribWall = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(2d, 4d, 0d, 4d, 1d, 4d)).Value;
+
+ var result = BrepBoolean.Union(basePlate, ribWall);
+
+ Assert.True(result.IsSuccess);
+ var validation = BrepBindingValidator.Validate(result.Value, requireAllEdgeAndFaceBindings: true);
+ Assert.True(validation.IsSuccess);
}
[Fact]
@@ -137,6 +150,20 @@ public sealed class BrepBooleanTests
Assert.Equal("Boolean Union: disjoint box union is multi-body and not supported in M13.", diagnostic.Message);
}
+ [Fact]
+ public void Union_ConnectedButOutsideBoundedFamily_ReturnsNotImplemented()
+ {
+ var left = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(0d, 3d, 0d, 2d, 0d, 2d)).Value;
+ var right = BrepBooleanBoxRecognition.CreateBoxFromExtents(new AxisAlignedBoxExtents(1d, 4d, 1d, 3d, 1d, 3d)).Value;
+
+ var result = BrepBoolean.Union(left, right);
+
+ Assert.False(result.IsSuccess);
+ var diagnostic = Assert.Single(result.Diagnostics);
+ Assert.Equal(KernelDiagnosticCode.NotImplemented, diagnostic.Code);
+ Assert.Contains("bounded F1 additive family", diagnostic.Message, StringComparison.Ordinal);
+ }
+
[Fact]
public void Subtract_NoOverlap_ReturnsLeftBox()
{
diff --git a/Aetheris.Kernel.Core.Tests/Brep/HardeningRegressionCorpusTests.cs b/Aetheris.Kernel.Core.Tests/Brep/HardeningRegressionCorpusTests.cs
index e2c884a7..dc0e0a0a 100644
--- a/Aetheris.Kernel.Core.Tests/Brep/HardeningRegressionCorpusTests.cs
+++ b/Aetheris.Kernel.Core.Tests/Brep/HardeningRegressionCorpusTests.cs
@@ -56,7 +56,7 @@ public sealed class HardeningRegressionCorpusTests
Assert.True(BrepBoolean.Intersect(left, overlapRight).IsSuccess);
Assert.False(BrepBoolean.Intersect(left, touchingRight).IsSuccess);
- Assert.False(BrepBoolean.Union(lShapeLeft, lShapeRight).IsSuccess);
+ Assert.True(BrepBoolean.Union(lShapeLeft, lShapeRight).IsSuccess);
var containmentUnion = BrepBoolean.Union(left, contained);
Assert.True(containmentUnion.IsSuccess);
diff --git a/Aetheris.Kernel.Core/Brep/Boolean/BrepBoolean.cs b/Aetheris.Kernel.Core/Brep/Boolean/BrepBoolean.cs
index 09507117..4737ba74 100644
--- a/Aetheris.Kernel.Core/Brep/Boolean/BrepBoolean.cs
+++ b/Aetheris.Kernel.Core/Brep/Boolean/BrepBoolean.cs
@@ -59,6 +59,7 @@ public sealed record BooleanClassificationData(
AxisAlignedBoxExtents? SingleBoxResult,
SafeBooleanComposition? SafeCompositionResult,
string? UnsupportedReason,
+ IReadOnlyList<AxisAlignedBoxExtents>? OrthogonalUnionCells = null,
BooleanDiagnostic? Diagnostic = null);
public sealed record BooleanRebuildData(
@@ -327,7 +328,19 @@ public static class BrepBoolean
return new BooleanClassificationData(intersections, IsComputed: true, FragmentCount: 0, SingleBoxResult: null, SafeCompositionResult: null, UnsupportedReason: $"Boolean {operation}: disjoint box union is multi-body and not supported in M13.");
}
- return new BooleanClassificationData(intersections, IsComputed: true, FragmentCount: 0, SingleBoxResult: null, SafeCompositionResult: null, UnsupportedReason: $"Boolean {operation}: box union is not a single box in M13 (for example L-shaped unions)." );
+ if (TryClassifyBoundedOrthogonalUnion(left, right, tolerance, out var unionCells, out var unsupportedReason))
+ {
+ return new BooleanClassificationData(
+ intersections,
+ IsComputed: true,
+ FragmentCount: 1,
+ SingleBoxResult: null,
+ SafeCompositionResult: null,
+ UnsupportedReason: null,
+ OrthogonalUnionCells: unionCells);
+ }
+
+ return new BooleanClassificationData(intersections, IsComputed: true, FragmentCount: 0, SingleBoxResult: null, SafeCompositionResult: null, UnsupportedReason: unsupportedReason ?? $"Boolean {operation}: box union is outside the bounded connected orthogonal additive family for F1.");
}
if (!left.OverlapsWithPositiveVolume(right, tolerance))
@@ -372,6 +385,14 @@ public static class BrepBoolean
: new BooleanRebuildData(classification, RebuiltBody: null, Diagnostics: rebuiltThroughHole.Diagnostics);
}
+ if (classification.OrthogonalUnionCells is not null)
+ {
+ var rebuiltOrthogonalUnion = BrepBooleanOrthogonalUnionBuilder.BuildFromCells(classification.OrthogonalUnionCells);
+ return rebuiltOrthogonalUnion.IsSuccess
+ ? new BooleanRebuildData(classification, rebuiltOrthogonalUnion.Value, rebuiltOrthogonalUnion.Diagnostics)
+ : new BooleanRebuildData(classification, RebuiltBody: null, Diagnostics: rebuiltOrthogonalUnion.Diagnostics);
+ }
+
if (classification.UnsupportedReason is not null)
{
return new BooleanRebuildData(
@@ -462,6 +483,104 @@ public static class BrepBoolean
return false;
}
+ private static bool TryClassifyBoundedOrthogonalUnion(
+ AxisAlignedBoxExtents left,
+ AxisAlignedBoxExtents right,
+ ToleranceContext tolerance,
+ out IReadOnlyList<AxisAlignedBoxExtents> occupiedCells,
+ out string? unsupportedReason)
+ {
+ occupiedCells = Array.Empty<AxisAlignedBoxExtents>();
+ unsupportedReason = null;
+
+ var sharedAxisSpanCount = 0;
+ if (ToleranceMath.AlmostEqual(left.MinX, right.MinX, tolerance) && ToleranceMath.AlmostEqual(left.MaxX, right.MaxX, tolerance))
+ {
+ sharedAxisSpanCount++;
+ }
+
+ if (ToleranceMath.AlmostEqual(left.MinY, right.MinY, tolerance) && ToleranceMath.AlmostEqual(left.MaxY, right.MaxY, tolerance))
+ {
+ sharedAxisSpanCount++;
+ }
+
+ if (ToleranceMath.AlmostEqual(left.MinZ, right.MinZ, tolerance) && ToleranceMath.AlmostEqual(left.MaxZ, right.MaxZ, tolerance))
+ {
+ sharedAxisSpanCount++;
+ }
+
+ if (sharedAxisSpanCount == 0)
+ {
+ unsupportedReason = "Boolean Union: box union is connected but outside the bounded F1 additive family because the operands do not share a full span on any primary axis.";
+ return false;
+ }
+
+ var intersection = AxisAlignedBoxExtents.Intersection(left, right);
+ if (intersection is null)
+ {
+ unsupportedReason = "Boolean Union: disjoint box union is multi-body and not supported in M13.";
+ return false;
+ }
+
+ var connectedByVolume = intersection.Value.HasPositiveVolume(tolerance);
+ var connectedByFace = IsPositiveAreaFaceContact(left, right, tolerance);
+ if (!connectedByVolume && !connectedByFace)
+ {
+ unsupportedReason = "Boolean Union: edge-only or point-only contact is non-manifold and outside the bounded F1 additive family.";
+ return false;
+ }
+
+ var splitX = new[] { left.MinX, left.MaxX, right.MinX, right.MaxX }.Distinct().OrderBy(v => v).ToArray();
+ var splitY = new[] { left.MinY, left.MaxY, right.MinY, right.MaxY }.Distinct().OrderBy(v => v).ToArray();
+ var splitZ = new[] { left.MinZ, left.MaxZ, right.MinZ, right.MaxZ }.Distinct().OrderBy(v => v).ToArray();
+ var cells = new List<AxisAlignedBoxExtents>();
+ for (var ix = 0; ix < splitX.Length - 1; ix++)
+ {
+ for (var iy = 0; iy < splitY.Length - 1; iy++)
+ {
+ for (var iz = 0; iz < splitZ.Length - 1; iz++)
+ {
+ var candidate = new AxisAlignedBoxExtents(splitX[ix], splitX[ix + 1], splitY[iy], splitY[iy + 1], splitZ[iz], splitZ[iz + 1]);
+ if (!candidate.HasPositiveVolume(tolerance))
+ {
+ continue;
+ }
+
+ if (left.Contains(candidate, tolerance) || right.Contains(candidate, tolerance))
+ {
+ cells.Add(candidate);
+ }
+ }
+ }
+ }
+
+ if (cells.Count == 0)
+ {
+ unsupportedReason = "Boolean Union: bounded orthogonal reconstruction produced no occupied cells.";
+ return false;
+ }
+
+ occupiedCells = cells;
+ return true;
+ }
+
+ private static bool IsPositiveAreaFaceContact(AxisAlignedBoxExtents left, AxisAlignedBoxExtents right, ToleranceContext tolerance)
+ {
+ var xFaceTouch = (ToleranceMath.AlmostEqual(left.MaxX, right.MinX, tolerance) || ToleranceMath.AlmostEqual(right.MaxX, left.MinX, tolerance))
+ && PositiveOverlap(left.MinY, left.MaxY, right.MinY, right.MaxY, tolerance)
+ && PositiveOverlap(left.MinZ, left.MaxZ, right.MinZ, right.MaxZ, tolerance);
+ var yFaceTouch = (ToleranceMath.AlmostEqual(left.MaxY, right.MinY, tolerance) || ToleranceMath.AlmostEqual(right.MaxY, left.MinY, tolerance))
+ && PositiveOverlap(left.MinX, left.MaxX, right.MinX, right.MaxX, tolerance)
+ && PositiveOverlap(left.MinZ, left.MaxZ, right.MinZ, right.MaxZ, tolerance);
+ var zFaceTouch = (ToleranceMath.AlmostEqual(left.MaxZ, right.MinZ, tolerance) || ToleranceMath.AlmostEqual(right.MaxZ, left.MinZ, tolerance))
+ && PositiveOverlap(left.MinX, left.MaxX, right.MinX, right.MaxX, tolerance)
+ && PositiveOverlap(left.MinY, left.MaxY, right.MinY, right.MaxY, tolerance);
+ return xFaceTouch || yFaceTouch || zFaceTouch;
+ }
+
+ private static bool PositiveOverlap(double minA, double maxA, double minB, double maxB, ToleranceContext tolerance)
+ => (System.Math.Min(maxA, maxB) - System.Math.Max(minA, minB)) > tolerance.Linear;
+
private static KernelResult<BrepBody> ValidateOutput(BrepBody body, IReadOnlyList<KernelDiagnostic> diagnostics)
{
var validation = BrepBindingValidator.Validate(body, requireAllEdgeAndFaceBindings: true);
diff --git a/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanOrthogonalUnionBuilder.cs b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanOrthogonalUnionBuilder.cs
new file mode 100644
index 00000000..68f86ce4
--- /dev/null
+++ b/Aetheris.Kernel.Core/Brep/Boolean/BrepBooleanOrthogonalUnionBuilder.cs
@@ -0,0 +1,310 @@
+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.Numerics;
+using Aetheris.Kernel.Core.Results;
+using Aetheris.Kernel.Core.Topology;
+using Aetheris.Kernel.Core.Diagnostics;
+
+namespace Aetheris.Kernel.Core.Brep.Boolean;
+
+public static class BrepBooleanOrthogonalUnionBuilder
+{
+ public static KernelResult<BrepBody> BuildFromCells(IReadOnlyList<AxisAlignedBoxExtents> cells)
+ {
+ ArgumentNullException.ThrowIfNull(cells);
+ if (cells.Count == 0)
+ {
+ return KernelResult<BrepBody>.Failure([
+ new KernelDiagnostic(
+ KernelDiagnosticCode.InvalidArgument,
+ KernelDiagnosticSeverity.Error,
+ "Orthogonal union builder requires at least one occupied cell.",
+ "BrepBooleanOrthogonalUnionBuilder.BuildFromCells"),
+ ]);
+ }
+
+ var faceRects = CollectBoundaryFaceRectangles(cells);
+ if (faceRects.Count == 0)
+ {
+ return KernelResult<BrepBody>.Failure([
+ new KernelDiagnostic(
+ KernelDiagnosticCode.NotImplemented,
+ KernelDiagnosticSeverity.Error,
+ "Orthogonal union builder could not recover boundary rectangles from occupied cells.",
+ "BrepBooleanOrthogonalUnionBuilder.BuildFromCells"),
+ ]);
+ }
+
+ var builder = new TopologyBuilder();
+ var vertexLookup = new Dictionary<PointKey, VertexId>();
+ var vertexPoints = new Dictionary<VertexId, Point3D>();
+ var edgeLookup = new Dictionary<EdgeKey, EdgeId>();
+ var edgeEndpoints = new Dictionary<EdgeId, EdgeKey>();
+ var edgeBindings = new List<EdgeGeometryBinding>();
+ var faceBindings = new List<(FaceId FaceId, SurfaceGeometryId SurfaceId)>();
+ var geometry = new BrepGeometryStore();
+
+ var curveId = 1;
+ var surfaceId = 1;
+
+ foreach (var rect in faceRects.OrderBy(r => r.Axis).ThenBy(r => r.Fixed).ThenBy(r => r.MinA).ThenBy(r => r.MinB))
+ {
+ var corners = rect.GetOrientedCorners();
+ var edges = new EdgeId[4];
+ for (var i = 0; i < 4; i++)
+ {
+ var start = corners[i];
+ var end = corners[(i + 1) % 4];
+ var startVertex = GetOrCreateVertex(start);
+ var endVertex = GetOrCreateVertex(end);
+ var edgeKey = EdgeKey.Create(start, end);
+ if (!edgeLookup.TryGetValue(edgeKey, out var edgeId))
+ {
+ edgeId = builder.AddEdge(startVertex, endVertex);
+ edgeLookup[edgeKey] = edgeId;
+ edgeEndpoints[edgeId] = edgeKey;
+ }
+
+ edges[i] = edgeId;
+ }
+
+ var uses = new[]
+ {
+ OrientEdgeUse(edges[0], corners[0], corners[1]),
+ OrientEdgeUse(edges[1], corners[1], corners[2]),
+ OrientEdgeUse(edges[2], corners[2], corners[3]),
+ OrientEdgeUse(edges[3], corners[3], corners[0]),
+ };
+
+ var faceId = AddFaceWithLoop(builder, uses);
+ var rectSurfaceId = new SurfaceGeometryId(surfaceId);
+ geometry.AddSurface(rectSurfaceId, SurfaceGeometry.FromPlane(rect.ToPlaneSurface()));
+ faceBindings.Add((faceId, rectSurfaceId));
+ surfaceId++;
+ }
+
+ foreach (var (edgeId, endpoints) in edgeEndpoints.OrderBy(kvp => kvp.Key.Value))
+ {
+ var start = endpoints.Start.ToPoint3D();
+ var end = endpoints.End.ToPoint3D();
+ var direction = new Vector3D(end.X - start.X, end.Y - start.Y, end.Z - start.Z);
+ var length = System.Math.Sqrt((direction.X * direction.X) + (direction.Y * direction.Y) + (direction.Z * direction.Z));
+ if (length <= 0d)
+ {
+ return KernelResult<BrepBody>.Failure([
+ new KernelDiagnostic(
+ KernelDiagnosticCode.InternalError,
+ KernelDiagnosticSeverity.Error,
+ "Orthogonal union builder produced a degenerate edge.",
+ "BrepBooleanOrthogonalUnionBuilder.BuildFromCells"),
+ ]);
+ }
+
+ geometry.AddCurve(new CurveGeometryId(curveId), CurveGeometry.FromLine(new Line3Curve(start, Direction3D.Create(direction))));
+ edgeBindings.Add(new EdgeGeometryBinding(edgeId, new CurveGeometryId(curveId), new ParameterInterval(0d, 1d)));
+ curveId++;
+ }
+
+ var faces = builder.Model.Faces.OrderBy(f => f.Id.Value).Select(f => f.Id).ToArray();
+ var shell = builder.AddShell(faces);
+ builder.AddBody([shell]);
+
+ var bindings = new BrepBindingModel();
+ foreach (var edgeBinding in edgeBindings.OrderBy(binding => binding.EdgeId.Value))
+ {
+ bindings.AddEdgeBinding(edgeBinding);
+ }
+
+ foreach (var (faceId, surfaceGeometryId) in faceBindings.OrderBy(binding => binding.FaceId.Value))
+ {
+ bindings.AddFaceBinding(new FaceGeometryBinding(faceId, surfaceGeometryId));
+ }
+
+ var body = new BrepBody(builder.Model, geometry, bindings, vertexPoints, safeBooleanComposition: null);
+ var validation = BrepBindingValidator.Validate(body, requireAllEdgeAndFaceBindings: true);
+ return validation.IsSuccess
+ ? KernelResult<BrepBody>.Success(body, validation.Diagnostics)
+ : KernelResult<BrepBody>.Failure(validation.Diagnostics);
+
+ VertexId GetOrCreateVertex(in PointKey point)
+ {
+ if (vertexLookup.TryGetValue(point, out var id))
+ {
+ return id;
+ }
+
+ id = builder.AddVertex();
+ vertexLookup[point] = id;
+ vertexPoints[id] = point.ToPoint3D();
+ return id;
+ }
+ }
+
+ private static EdgeUse OrientEdgeUse(EdgeId edgeId, in PointKey start, in PointKey end)
+ {
+ var canonical = EdgeKey.Create(start, end);
+ return canonical.Start.Equals(start) && canonical.End.Equals(end)
+ ? EdgeUse.Forward(edgeId)
+ : EdgeUse.Reversed(edgeId);
+ }
+
+ private static FaceId AddFaceWithLoop(TopologyBuilder builder, IReadOnlyList<EdgeUse> edgeUses)
+ {
+ var loopId = builder.AllocateLoopId();
+ var coedgeIds = new CoedgeId[edgeUses.Count];
+ for (var i = 0; i < edgeUses.Count; i++)
+ {
+ coedgeIds[i] = builder.AllocateCoedgeId();
+ }
+
+ for (var i = 0; i < edgeUses.Count; i++)
+ {
+ var next = coedgeIds[(i + 1) % edgeUses.Count];
+ var prev = coedgeIds[(i + edgeUses.Count - 1) % edgeUses.Count];
+ builder.AddCoedge(new Coedge(coedgeIds[i], edgeUses[i].EdgeId, loopId, next, prev, edgeUses[i].IsReversed));
+ }
+
+ builder.AddLoop(new Loop(loopId, coedgeIds));
+ return builder.AddFace([loopId]);
+ }
+
+ private static List<FaceRect> CollectBoundaryFaceRectangles(IReadOnlyList<AxisAlignedBoxExtents> cells)
+ {
+ var faces = new List<FaceRect>();
+
+ foreach (var cell in cells)
+ {
+ var key = CellKey.FromExtents(cell);
+ TryAddFace(cells, faces, key, AxisKind.X, key.MinX, isPositiveNormal: false);
+ TryAddFace(cells, faces, key, AxisKind.X, key.MaxX, isPositiveNormal: true);
+ TryAddFace(cells, faces, key, AxisKind.Y, key.MinY, isPositiveNormal: false);
+ TryAddFace(cells, faces, key, AxisKind.Y, key.MaxY, isPositiveNormal: true);
+ TryAddFace(cells, faces, key, AxisKind.Z, key.MinZ, isPositiveNormal: false);
+ TryAddFace(cells, faces, key, AxisKind.Z, key.MaxZ, isPositiveNormal: true);
+ }
+
+ return faces;
+ }
+
+ private static void TryAddFace(IReadOnlyList<AxisAlignedBoxExtents> cells, List<FaceRect> faces, CellKey cell, AxisKind axis, double fixedValue, bool isPositiveNormal)
+ {
+ var coveredByNeighbor = cells.Any(other =>
+ {
+ var otherCell = CellKey.FromExtents(other);
+ if (otherCell.Equals(cell))
+ {
+ return false;
+ }
+
+ return axis switch
+ {
+ AxisKind.X when isPositiveNormal => otherCell.MinX <= fixedValue && fixedValue < otherCell.MaxX
+ && otherCell.MinY <= cell.MinY && otherCell.MaxY >= cell.MaxY
+ && otherCell.MinZ <= cell.MinZ && otherCell.MaxZ >= cell.MaxZ,
+ AxisKind.X => otherCell.MinX < fixedValue && fixedValue <= otherCell.MaxX
+ && otherCell.MinY <= cell.MinY && otherCell.MaxY >= cell.MaxY
+ && otherCell.MinZ <= cell.MinZ && otherCell.MaxZ >= cell.MaxZ,
+ AxisKind.Y when isPositiveNormal => otherCell.MinY <= fixedValue && fixedValue < otherCell.MaxY
+ && otherCell.MinX <= cell.MinX && otherCell.MaxX >= cell.MaxX
+ && otherCell.MinZ <= cell.MinZ && otherCell.MaxZ >= cell.MaxZ,
+ AxisKind.Y => otherCell.MinY < fixedValue && fixedValue <= otherCell.MaxY
+ && otherCell.MinX <= cell.MinX && otherCell.MaxX >= cell.MaxX
+ && otherCell.MinZ <= cell.MinZ && otherCell.MaxZ >= cell.MaxZ,
+ AxisKind.Z when isPositiveNormal => otherCell.MinZ <= fixedValue && fixedValue < otherCell.MaxZ
+ && otherCell.MinX <= cell.MinX && otherCell.MaxX >= cell.MaxX
+ && otherCell.MinY <= cell.MinY && otherCell.MaxY >= cell.MaxY,
+ _ => otherCell.MinZ < fixedValue && fixedValue <= otherCell.MaxZ
+ && otherCell.MinX <= cell.MinX && otherCell.MaxX >= cell.MaxX
+ && otherCell.MinY <= cell.MinY && otherCell.MaxY >= cell.MaxY,
+ };
+ });
+
+ if (coveredByNeighbor)
+ {
+ return;
+ }
+
+ faces.Add(axis switch
+ {
+ AxisKind.X => new FaceRect(axis, fixedValue, cell.MinY, cell.MaxY, cell.MinZ, cell.MaxZ, isPositiveNormal),
+ AxisKind.Y => new FaceRect(axis, fixedValue, cell.MinX, cell.MaxX, cell.MinZ, cell.MaxZ, isPositiveNormal),
+ _ => new FaceRect(axis, fixedValue, cell.MinX, cell.MaxX, cell.MinY, cell.MaxY, isPositiveNormal),
+ });
+ }
+
+ private enum AxisKind
+ {
+ X,
+ Y,
+ Z,
+ }
+
+ private readonly record struct CellKey(double MinX, double MaxX, double MinY, double MaxY, double MinZ, double MaxZ)
+ {
+ public static CellKey FromExtents(AxisAlignedBoxExtents extents)
+ => new(extents.MinX, extents.MaxX, extents.MinY, extents.MaxY, extents.MinZ, extents.MaxZ);
+ }
+
+ private readonly record struct FaceRect(AxisKind Axis, double Fixed, double MinA, double MaxA, double MinB, double MaxB, bool IsPositiveNormal)
+ {
+ public PointKey[] GetOrientedCorners()
+ => Axis switch
+ {
+ AxisKind.X when IsPositiveNormal => [new PointKey(Fixed, MinA, MinB), new PointKey(Fixed, MaxA, MinB), new PointKey(Fixed, MaxA, MaxB), new PointKey(Fixed, MinA, MaxB)],
+ AxisKind.X => [new PointKey(Fixed, MinA, MinB), new PointKey(Fixed, MinA, MaxB), new PointKey(Fixed, MaxA, MaxB), new PointKey(Fixed, MaxA, MinB)],
+ AxisKind.Y when IsPositiveNormal => [new PointKey(MinA, Fixed, MinB), new PointKey(MinA, Fixed, MaxB), new PointKey(MaxA, Fixed, MaxB), new PointKey(MaxA, Fixed, MinB)],
+ AxisKind.Y => [new PointKey(MinA, Fixed, MinB), new PointKey(MaxA, Fixed, MinB), new PointKey(MaxA, Fixed, MaxB), new PointKey(MinA, Fixed, MaxB)],
+ AxisKind.Z when IsPositiveNormal => [new PointKey(MinA, MinB, Fixed), new PointKey(MaxA, MinB, Fixed), new PointKey(MaxA, MaxB, Fixed), new PointKey(MinA, MaxB, Fixed)],
+ _ => [new PointKey(MinA, MinB, Fixed), new PointKey(MinA, MaxB, Fixed), new PointKey(MaxA, MaxB, Fixed), new PointKey(MaxA, MinB, Fixed)],
+ };
+
+ public PlaneSurface ToPlaneSurface()
+ => Axis switch
+ {
+ AxisKind.X when IsPositiveNormal => new PlaneSurface(new Point3D(Fixed, 0d, 0d), Direction3D.Create(new Vector3D(1d, 0d, 0d)), Direction3D.Create(new Vector3D(0d, 1d, 0d))),
+ AxisKind.X => new PlaneSurface(new Point3D(Fixed, 0d, 0d), Direction3D.Create(new Vector3D(-1d, 0d, 0d)), Direction3D.Create(new Vector3D(0d, 1d, 0d))),
+ AxisKind.Y when IsPositiveNormal => new PlaneSurface(new Point3D(0d, Fixed, 0d), Direction3D.Create(new Vector3D(0d, 1d, 0d)), Direction3D.Create(new Vector3D(-1d, 0d, 0d))),
+ AxisKind.Y => new PlaneSurface(new Point3D(0d, Fixed, 0d), Direction3D.Create(new Vector3D(0d, -1d, 0d)), Direction3D.Create(new Vector3D(1d, 0d, 0d))),
+ AxisKind.Z when IsPositiveNormal => new PlaneSurface(new Point3D(0d, 0d, Fixed), Direction3D.Create(new Vector3D(0d, 0d, 1d)), Direction3D.Create(new Vector3D(1d, 0d, 0d))),
+ _ => new PlaneSurface(new Point3D(0d, 0d, Fixed), Direction3D.Create(new Vector3D(0d, 0d, -1d)), Direction3D.Create(new Vector3D(1d, 0d, 0d))),
+ };
+ }
+
+ private readonly record struct PointKey(double X, double Y, double Z)
+ {
+ public Point3D ToPoint3D() => new(X, Y, Z);
+ }
+
+ private readonly record struct EdgeKey(PointKey Start, PointKey End)
+ {
+ public static EdgeKey Create(in PointKey a, in PointKey b)
+ => Compare(a, b) <= 0
+ ? new EdgeKey(a, b)
+ : new EdgeKey(b, a);
+
+ private static int Compare(in PointKey a, in PointKey b)
+ {
+ var x = a.X.CompareTo(b.X);
+ if (x != 0)
+ {
+ return x;
+ }
+
+ var y = a.Y.CompareTo(b.Y);
+ if (y != 0)
+ {
+ return y;
+ }
+
+ return a.Z.CompareTo(b.Z);
+ }
+ }
+
+ private readonly record struct EdgeUse(EdgeId EdgeId, bool IsReversed)
+ {
+ public static EdgeUse Forward(EdgeId edgeId) => new(edgeId, IsReversed: false);
+ public static EdgeUse Reversed(EdgeId edgeId) => new(edgeId, IsReversed: true);
+ }
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentBuildAndExportTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentBuildAndExportTests.cs
index a48cedac..9a1d5552 100644
--- a/Aetheris.Kernel.Firmament.Tests/FirmamentBuildAndExportTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentBuildAndExportTests.cs
@@ -185,6 +185,18 @@ public sealed class FirmamentBuildAndExportTests
"subtract");
}
+ [Fact]
+ public void Run_RibbedSupportF1Example_Writes_Default_Export_Artifact()
+ {
+ AssertExampleBuildAndExport(
+ "testdata/firmament/examples/ribbed_support_f1.firmament",
+ "ribbed_support_f1.step",
+ "wall",
+ 1,
+ "boolean",
+ "add");
+ }
+
[Fact]
public void Run_UnsupportedBoxWithCylinderHoleFixture_Fails_And_Does_Not_Write_Fallback_Export()
{
diff --git a/testdata/firmament/examples/README.md b/testdata/firmament/examples/README.md
index 83b7d42f..3ce0b6e3 100644
--- a/testdata/firmament/examples/README.md
+++ b/testdata/firmament/examples/README.md
@@ -13,6 +13,7 @@ Other combinations may fail and are intentionally not supported yet.
- `torus_basic.firmament` — minimal single-torus export example using the canonical `major_radius` / `minor_radius` surface; helper export paths: `testdata/firmament/exports/torus_basic.step` and the milestone proof artifact `testdata/firmament/exports/m10g2-torus.step`.
- `box_add_basic.firmament` — minimal supported box-plus-box boolean add example; helper export path: `testdata/firmament/exports/box_add_basic.step`.
- `boolean_add_basic.firmament` — canonical proven boolean add example for the current box/box single-box subset; helper export path: `testdata/firmament/exports/boolean_add_basic.step`.
+- `ribbed_support_f1.firmament` — bounded F1 connected orthogonal add family example for rib/wall-like parts; helper export path: `testdata/firmament/exports/ribbed_support_f1.step`.
- `boolean_subtract_basic.firmament` — canonical proven boolean subtract example for the current box/box single-box subset; helper export path: `testdata/firmament/exports/boolean_subtract_basic.step`.
- `boolean_intersect_basic.firmament` — canonical proven boolean intersect example for the current box/box single-box subset; helper export path: `testdata/firmament/exports/boolean_intersect_basic.step`.
- `boolean_box_cylinder_hole.firmament` — the only supported box+cylinder boolean case: subtracting a Z-aligned cylinder that cleanly spans the full box height to form a single box-with-through-hole solid; helper export path: `testdata/firmament/exports/boolean_box_cylinder_hole.step`.
diff --git a/testdata/firmament/examples/ribbed_support_f1.firmament b/testdata/firmament/examples/ribbed_support_f1.firmament
new file mode 100644
index 00000000..b72da707
--- /dev/null
+++ b/testdata/firmament/examples/ribbed_support_f1.firmament
@@ -0,0 +1,32 @@
+firmament:
+ version: 1
+
+model:
+ name: ribbed_support_f1
+ units: mm
+
+ops[2]:
+ -
+ op: box
+ id: base
+ size[3]:
+ 80
+ 40
+ 8
+
+ -
+ op: add
+ id: wall
+ to: base
+ with:
+ op: box
+ size[3]:
+ 8
+ 40
+ 36
+ place:
+ on: origin
+ offset[3]:
+ 36
+ 0
+ 22
diff --git a/testdata/firmament/exports/ribbed_support_f1.step b/testdata/firmament/exports/ribbed_support_f1.step
new file mode 100644
index 00000000..9951f167
--- /dev/null
+++ b/testdata/firmament/exports/ribbed_support_f1.step
@@ -0,0 +1,556 @@
+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=CARTESIAN_POINT($,(-4,0,22));
+#2=DIRECTION($,(-1,0,0));
+#3=DIRECTION($,(0,1,0));
+#4=AXIS2_PLACEMENT_3D($,#1,#2,#3);
+#5=PLANE($,#4);
+#6=CARTESIAN_POINT($,(-4,-20,18));
+#7=VERTEX_POINT($,#6);
+#8=CARTESIAN_POINT($,(-4,-20,26));
+#9=VERTEX_POINT($,#8);
+#10=CARTESIAN_POINT($,(-4,-20,18));
+#11=DIRECTION($,(0,0,1));
+#12=VECTOR($,#11,1);
+#13=LINE($,#10,#12);
+#14=EDGE_CURVE($,#7,#9,#13,.T.);
+#15=ORIENTED_EDGE($,$,$,#14,.T.);
+#16=CARTESIAN_POINT($,(-4,20,26));
+#17=VERTEX_POINT($,#16);
+#18=CARTESIAN_POINT($,(-4,-20,26));
+#19=DIRECTION($,(0,1,0));
+#20=VECTOR($,#19,1);
+#21=LINE($,#18,#20);
+#22=EDGE_CURVE($,#9,#17,#21,.T.);
+#23=ORIENTED_EDGE($,$,$,#22,.T.);
+#24=CARTESIAN_POINT($,(-4,20,18));
+#25=VERTEX_POINT($,#24);
+#26=CARTESIAN_POINT($,(-4,20,26));
+#27=DIRECTION($,(0,0,1));
+#28=VECTOR($,#27,1);
+#29=LINE($,#26,#28);
+#30=EDGE_CURVE($,#17,#25,#29,.T.);
+#31=ORIENTED_EDGE($,$,$,#30,.F.);
+#32=CARTESIAN_POINT($,(-4,20,18));
+#33=DIRECTION($,(0,1,0));
+#34=VECTOR($,#33,1);
+#35=LINE($,#32,#34);
+#36=EDGE_CURVE($,#25,#7,#35,.T.);
+#37=ORIENTED_EDGE($,$,$,#36,.F.);
+#38=EDGE_LOOP($,(#15,#23,#31,#37));
+#39=FACE_OUTER_BOUND('',#38,.T.);
+#40=ADVANCED_FACE('',(#39),#5,.T.);
+#41=CARTESIAN_POINT($,(32,0,22));
+#42=DIRECTION($,(-1,0,0));
+#43=DIRECTION($,(0,1,0));
+#44=AXIS2_PLACEMENT_3D($,#41,#42,#43);
+#45=PLANE($,#44);
+#46=CARTESIAN_POINT($,(32,-20,4));
+#47=VERTEX_POINT($,#46);
+#48=CARTESIAN_POINT($,(32,-20,18));
+#49=VERTEX_POINT($,#48);
+#50=CARTESIAN_POINT($,(32,-20,4));
+#51=DIRECTION($,(0,0,1));
+#52=VECTOR($,#51,1);
+#53=LINE($,#50,#52);
+#54=EDGE_CURVE($,#47,#49,#53,.T.);
+#55=ORIENTED_EDGE($,$,$,#54,.T.);
+#56=CARTESIAN_POINT($,(32,20,18));
+#57=VERTEX_POINT($,#56);
+#58=CARTESIAN_POINT($,(32,-20,18));
+#59=DIRECTION($,(0,1,0));
+#60=VECTOR($,#59,1);
+#61=LINE($,#58,#60);
+#62=EDGE_CURVE($,#49,#57,#61,.T.);
+#63=ORIENTED_EDGE($,$,$,#62,.T.);
+#64=CARTESIAN_POINT($,(32,20,4));
+#65=VERTEX_POINT($,#64);
+#66=CARTESIAN_POINT($,(32,20,18));
+#67=DIRECTION($,(0,0,1));
+#68=VECTOR($,#67,1);
+#69=LINE($,#66,#68);
+#70=EDGE_CURVE($,#57,#65,#69,.T.);
+#71=ORIENTED_EDGE($,$,$,#70,.F.);
+#72=CARTESIAN_POINT($,(32,20,4));
+#73=DIRECTION($,(0,1,0));
+#74=VECTOR($,#73,1);
+#75=LINE($,#72,#74);
+#76=EDGE_CURVE($,#65,#47,#75,.T.);
+#77=ORIENTED_EDGE($,$,$,#76,.F.);
+#78=EDGE_LOOP($,(#55,#63,#71,#77));
+#79=FACE_OUTER_BOUND('',#78,.T.);
+#80=ADVANCED_FACE('',(#79),#45,.T.);
+#81=CARTESIAN_POINT($,(32,0,22));
+#82=DIRECTION($,(-1,0,0));
+#83=DIRECTION($,(0,1,0));
+#84=AXIS2_PLACEMENT_3D($,#81,#82,#83);
+#85=PLANE($,#84);
+#86=CARTESIAN_POINT($,(32,-20,26));
+#87=VERTEX_POINT($,#86);
+#88=CARTESIAN_POINT($,(32,-20,40));
+#89=VERTEX_POINT($,#88);
+#90=CARTESIAN_POINT($,(32,-20,26));
+#91=DIRECTION($,(0,0,1));
+#92=VECTOR($,#91,1);
+#93=LINE($,#90,#92);
+#94=EDGE_CURVE($,#87,#89,#93,.T.);
+#95=ORIENTED_EDGE($,$,$,#94,.T.);
+#96=CARTESIAN_POINT($,(32,20,40));
+#97=VERTEX_POINT($,#96);
+#98=CARTESIAN_POINT($,(32,-20,40));
+#99=DIRECTION($,(0,1,0));
+#100=VECTOR($,#99,1);
+#101=LINE($,#98,#100);
+#102=EDGE_CURVE($,#89,#97,#101,.T.);
+#103=ORIENTED_EDGE($,$,$,#102,.T.);
+#104=CARTESIAN_POINT($,(32,20,26));
+#105=VERTEX_POINT($,#104);
+#106=CARTESIAN_POINT($,(32,20,40));
+#107=DIRECTION($,(0,0,1));
+#108=VECTOR($,#107,1);
+#109=LINE($,#106,#108);
+#110=EDGE_CURVE($,#97,#105,#109,.T.);
+#111=ORIENTED_EDGE($,$,$,#110,.F.);
+#112=CARTESIAN_POINT($,(32,20,26));
+#113=DIRECTION($,(0,1,0));
+#114=VECTOR($,#113,1);
+#115=LINE($,#112,#114);
+#116=EDGE_CURVE($,#105,#87,#115,.T.);
+#117=ORIENTED_EDGE($,$,$,#116,.F.);
+#118=EDGE_LOOP($,(#95,#103,#111,#117));
+#119=FACE_OUTER_BOUND('',#118,.T.);
+#120=ADVANCED_FACE('',(#119),#85,.T.);
+#121=CARTESIAN_POINT($,(40,0,22));
+#122=DIRECTION($,(1,0,0));
+#123=DIRECTION($,(0,1,0));
+#124=AXIS2_PLACEMENT_3D($,#121,#122,#123);
+#125=PLANE($,#124);
+#126=CARTESIAN_POINT($,(40,-20,4));
+#127=VERTEX_POINT($,#126);
+#128=CARTESIAN_POINT($,(40,20,4));
+#129=VERTEX_POINT($,#128);
+#130=CARTESIAN_POINT($,(40,-20,4));
+#131=DIRECTION($,(0,1,0));
+#132=VECTOR($,#131,1);
+#133=LINE($,#130,#132);
+#134=EDGE_CURVE($,#127,#129,#133,.T.);
+#135=ORIENTED_EDGE($,$,$,#134,.T.);
+#136=CARTESIAN_POINT($,(40,20,18));
+#137=VERTEX_POINT($,#136);
+#138=CARTESIAN_POINT($,(40,20,4));
+#139=DIRECTION($,(0,0,1));
+#140=VECTOR($,#139,1);
+#141=LINE($,#138,#140);
+#142=EDGE_CURVE($,#129,#137,#141,.T.);
+#143=ORIENTED_EDGE($,$,$,#142,.T.);
+#144=CARTESIAN_POINT($,(40,-20,18));
+#145=VERTEX_POINT($,#144);
+#146=CARTESIAN_POINT($,(40,20,18));
+#147=DIRECTION($,(0,1,0));
+#148=VECTOR($,#147,1);
+#149=LINE($,#146,#148);
+#150=EDGE_CURVE($,#137,#145,#149,.T.);
+#151=ORIENTED_EDGE($,$,$,#150,.F.);
+#152=CARTESIAN_POINT($,(40,-20,18));
+#153=DIRECTION($,(0,0,1));
+#154=VECTOR($,#153,1);
+#155=LINE($,#152,#154);
+#156=EDGE_CURVE($,#145,#127,#155,.T.);
+#157=ORIENTED_EDGE($,$,$,#156,.F.);
+#158=EDGE_LOOP($,(#135,#143,#151,#157));
+#159=FACE_OUTER_BOUND('',#158,.T.);
+#160=ADVANCED_FACE('',(#159),#125,.T.);
+#161=CARTESIAN_POINT($,(40,0,22));
+#162=DIRECTION($,(1,0,0));
+#163=DIRECTION($,(0,1,0));
+#164=AXIS2_PLACEMENT_3D($,#161,#162,#163);
+#165=PLANE($,#164);
+#166=CARTESIAN_POINT($,(40,-20,26));
+#167=VERTEX_POINT($,#166);
+#168=CARTESIAN_POINT($,(40,20,26));
+#169=VERTEX_POINT($,#168);
+#170=CARTESIAN_POINT($,(40,-20,26));
+#171=DIRECTION($,(0,1,0));
+#172=VECTOR($,#171,1);
+#173=LINE($,#170,#172);
+#174=EDGE_CURVE($,#167,#169,#173,.T.);
+#175=ORIENTED_EDGE($,$,$,#174,.T.);
+#176=CARTESIAN_POINT($,(40,20,40));
+#177=VERTEX_POINT($,#176);
+#178=CARTESIAN_POINT($,(40,20,26));
+#179=DIRECTION($,(0,0,1));
+#180=VECTOR($,#179,1);
+#181=LINE($,#178,#180);
+#182=EDGE_CURVE($,#169,#177,#181,.T.);
+#183=ORIENTED_EDGE($,$,$,#182,.T.);
+#184=CARTESIAN_POINT($,(40,-20,40));
+#185=VERTEX_POINT($,#184);
+#186=CARTESIAN_POINT($,(40,20,40));
+#187=DIRECTION($,(0,1,0));
+#188=VECTOR($,#187,1);
+#189=LINE($,#186,#188);
+#190=EDGE_CURVE($,#177,#185,#189,.T.);
+#191=ORIENTED_EDGE($,$,$,#190,.F.);
+#192=CARTESIAN_POINT($,(40,-20,40));
+#193=DIRECTION($,(0,0,1));
+#194=VECTOR($,#193,1);
+#195=LINE($,#192,#194);
+#196=EDGE_CURVE($,#185,#167,#195,.T.);
+#197=ORIENTED_EDGE($,$,$,#196,.F.);
+#198=EDGE_LOOP($,(#175,#183,#191,#197));
+#199=FACE_OUTER_BOUND('',#198,.T.);
+#200=ADVANCED_FACE('',(#199),#165,.T.);
+#201=CARTESIAN_POINT($,(76,0,22));
+#202=DIRECTION($,(1,0,0));
+#203=DIRECTION($,(0,1,0));
+#204=AXIS2_PLACEMENT_3D($,#201,#202,#203);
+#205=PLANE($,#204);
+#206=CARTESIAN_POINT($,(76,-20,18));
+#207=VERTEX_POINT($,#206);
+#208=CARTESIAN_POINT($,(76,20,18));
+#209=VERTEX_POINT($,#208);
+#210=CARTESIAN_POINT($,(76,-20,18));
+#211=DIRECTION($,(0,1,0));
+#212=VECTOR($,#211,1);
+#213=LINE($,#210,#212);
+#214=EDGE_CURVE($,#207,#209,#213,.T.);
+#215=ORIENTED_EDGE($,$,$,#214,.T.);
+#216=CARTESIAN_POINT($,(76,20,26));
+#217=VERTEX_POINT($,#216);
+#218=CARTESIAN_POINT($,(76,20,18));
+#219=DIRECTION($,(0,0,1));
+#220=VECTOR($,#219,1);
+#221=LINE($,#218,#220);
+#222=EDGE_CURVE($,#209,#217,#221,.T.);
+#223=ORIENTED_EDGE($,$,$,#222,.T.);
+#224=CARTESIAN_POINT($,(76,-20,26));
+#225=VERTEX_POINT($,#224);
+#226=CARTESIAN_POINT($,(76,20,26));
+#227=DIRECTION($,(0,1,0));
+#228=VECTOR($,#227,1);
+#229=LINE($,#226,#228);
+#230=EDGE_CURVE($,#217,#225,#229,.T.);
+#231=ORIENTED_EDGE($,$,$,#230,.F.);
+#232=CARTESIAN_POINT($,(76,-20,26));
+#233=DIRECTION($,(0,0,1));
+#234=VECTOR($,#233,1);
+#235=LINE($,#232,#234);
+#236=EDGE_CURVE($,#225,#207,#235,.T.);
+#237=ORIENTED_EDGE($,$,$,#236,.F.);
+#238=EDGE_LOOP($,(#215,#223,#231,#237));
+#239=FACE_OUTER_BOUND('',#238,.T.);
+#240=ADVANCED_FACE('',(#239),#205,.T.);
+#241=CARTESIAN_POINT($,(36,-20,22));
+#242=DIRECTION($,(0,-1,0));
+#243=DIRECTION($,(1,0,0));
+#244=AXIS2_PLACEMENT_3D($,#241,#242,#243);
+#245=PLANE($,#244);
+#246=CARTESIAN_POINT($,(-4,-20,18));
+#247=DIRECTION($,(1,0,0));
+#248=VECTOR($,#247,1);
+#249=LINE($,#246,#248);
+#250=EDGE_CURVE($,#7,#49,#249,.T.);
+#251=ORIENTED_EDGE($,$,$,#250,.T.);
+#252=CARTESIAN_POINT($,(32,-20,18));
+#253=DIRECTION($,(0,0,1));
+#254=VECTOR($,#253,1);
+#255=LINE($,#252,#254);
+#256=EDGE_CURVE($,#49,#87,#255,.T.);
+#257=ORIENTED_EDGE($,$,$,#256,.T.);
+#258=CARTESIAN_POINT($,(32,-20,26));
+#259=DIRECTION($,(1,0,0));
+#260=VECTOR($,#259,1);
+#261=LINE($,#258,#260);
+#262=EDGE_CURVE($,#87,#9,#261,.T.);
+#263=ORIENTED_EDGE($,$,$,#262,.F.);
+#264=ORIENTED_EDGE($,$,$,#14,.F.);
+#265=EDGE_LOOP($,(#251,#257,#263,#264));
+#266=FACE_OUTER_BOUND('',#265,.T.);
+#267=ADVANCED_FACE('',(#266),#245,.T.);
+#268=CARTESIAN_POINT($,(36,-20,22));
+#269=DIRECTION($,(0,-1,0));
+#270=DIRECTION($,(1,0,0));
+#271=AXIS2_PLACEMENT_3D($,#268,#269,#270);
+#272=PLANE($,#271);
+#273=CARTESIAN_POINT($,(32,-20,4));
+#274=DIRECTION($,(1,0,0));
+#275=VECTOR($,#274,1);
+#276=LINE($,#273,#275);
+#277=EDGE_CURVE($,#47,#127,#276,.T.);
+#278=ORIENTED_EDGE($,$,$,#277,.T.);
+#279=ORIENTED_EDGE($,$,$,#156,.T.);
+#280=CARTESIAN_POINT($,(40,-20,18));
+#281=DIRECTION($,(1,0,0));
+#282=VECTOR($,#281,1);
+#283=LINE($,#280,#282);
+#284=EDGE_CURVE($,#145,#49,#283,.T.);
+#285=ORIENTED_EDGE($,$,$,#284,.F.);
+#286=ORIENTED_EDGE($,$,$,#54,.F.);
+#287=EDGE_LOOP($,(#278,#279,#285,#286));
+#288=FACE_OUTER_BOUND('',#287,.T.);
+#289=ADVANCED_FACE('',(#288),#272,.T.);
+#290=CARTESIAN_POINT($,(36,-20,22));
+#291=DIRECTION($,(0,-1,0));
+#292=DIRECTION($,(1,0,0));
+#293=AXIS2_PLACEMENT_3D($,#290,#291,#292);
+#294=PLANE($,#293);
+#295=ORIENTED_EDGE($,$,$,#284,.T.);
+#296=CARTESIAN_POINT($,(40,-20,18));
+#297=DIRECTION($,(0,0,1));
+#298=VECTOR($,#297,1);
+#299=LINE($,#296,#298);
+#300=EDGE_CURVE($,#145,#167,#299,.T.);
+#301=ORIENTED_EDGE($,$,$,#300,.T.);
+#302=CARTESIAN_POINT($,(40,-20,26));
+#303=DIRECTION($,(1,0,0));
+#304=VECTOR($,#303,1);
+#305=LINE($,#302,#304);
+#306=EDGE_CURVE($,#167,#87,#305,.T.);
+#307=ORIENTED_EDGE($,$,$,#306,.F.);
+#308=ORIENTED_EDGE($,$,$,#256,.F.);
+#309=EDGE_LOOP($,(#295,#301,#307,#308));
+#310=FACE_OUTER_BOUND('',#309,.T.);
+#311=ADVANCED_FACE('',(#310),#294,.T.);
+#312=CARTESIAN_POINT($,(36,-20,22));
+#313=DIRECTION($,(0,-1,0));
+#314=DIRECTION($,(1,0,0));
+#315=AXIS2_PLACEMENT_3D($,#312,#313,#314);
+#316=PLANE($,#315);
+#317=ORIENTED_EDGE($,$,$,#306,.T.);
+#318=ORIENTED_EDGE($,$,$,#196,.T.);
+#319=CARTESIAN_POINT($,(40,-20,40));
+#320=DIRECTION($,(1,0,0));
+#321=VECTOR($,#320,1);
+#322=LINE($,#319,#321);
+#323=EDGE_CURVE($,#185,#89,#322,.T.);
+#324=ORIENTED_EDGE($,$,$,#323,.F.);
+#325=ORIENTED_EDGE($,$,$,#94,.F.);
+#326=EDGE_LOOP($,(#317,#318,#324,#325));
+#327=FACE_OUTER_BOUND('',#326,.T.);
+#328=ADVANCED_FACE('',(#327),#316,.T.);
+#329=CARTESIAN_POINT($,(36,-20,22));
+#330=DIRECTION($,(0,-1,0));
+#331=DIRECTION($,(1,0,0));
+#332=AXIS2_PLACEMENT_3D($,#329,#330,#331);
+#333=PLANE($,#332);
+#334=CARTESIAN_POINT($,(40,-20,18));
+#335=DIRECTION($,(1,0,0));
+#336=VECTOR($,#335,1);
+#337=LINE($,#334,#336);
+#338=EDGE_CURVE($,#145,#207,#337,.T.);
+#339=ORIENTED_EDGE($,$,$,#338,.T.);
+#340=ORIENTED_EDGE($,$,$,#236,.T.);
+#341=CARTESIAN_POINT($,(76,-20,26));
+#342=DIRECTION($,(1,0,0));
+#343=VECTOR($,#342,1);
+#344=LINE($,#341,#343);
+#345=EDGE_CURVE($,#225,#167,#344,.T.);
+#346=ORIENTED_EDGE($,$,$,#345,.F.);
+#347=ORIENTED_EDGE($,$,$,#300,.F.);
+#348=EDGE_LOOP($,(#339,#340,#346,#347));
+#349=FACE_OUTER_BOUND('',#348,.T.);
+#350=ADVANCED_FACE('',(#349),#333,.T.);
+#351=CARTESIAN_POINT($,(36,20,22));
+#352=DIRECTION($,(0,1,0));
+#353=DIRECTION($,(-1,0,0));
+#354=AXIS2_PLACEMENT_3D($,#351,#352,#353);
+#355=PLANE($,#354);
+#356=ORIENTED_EDGE($,$,$,#30,.T.);
+#357=CARTESIAN_POINT($,(-4,20,26));
+#358=DIRECTION($,(1,0,0));
+#359=VECTOR($,#358,1);
+#360=LINE($,#357,#359);
+#361=EDGE_CURVE($,#17,#105,#360,.T.);
+#362=ORIENTED_EDGE($,$,$,#361,.T.);
+#363=CARTESIAN_POINT($,(32,20,26));
+#364=DIRECTION($,(0,0,1));
+#365=VECTOR($,#364,1);
+#366=LINE($,#363,#365);
+#367=EDGE_CURVE($,#105,#57,#366,.T.);
+#368=ORIENTED_EDGE($,$,$,#367,.F.);
+#369=CARTESIAN_POINT($,(32,20,18));
+#370=DIRECTION($,(1,0,0));
+#371=VECTOR($,#370,1);
+#372=LINE($,#369,#371);
+#373=EDGE_CURVE($,#57,#25,#372,.T.);
+#374=ORIENTED_EDGE($,$,$,#373,.F.);
+#375=EDGE_LOOP($,(#356,#362,#368,#374));
+#376=FACE_OUTER_BOUND('',#375,.T.);
+#377=ADVANCED_FACE('',(#376),#355,.T.);
+#378=CARTESIAN_POINT($,(36,20,22));
+#379=DIRECTION($,(0,1,0));
+#380=DIRECTION($,(-1,0,0));
+#381=AXIS2_PLACEMENT_3D($,#378,#379,#380);
+#382=PLANE($,#381);
+#383=ORIENTED_EDGE($,$,$,#70,.T.);
+#384=CARTESIAN_POINT($,(32,20,18));
+#385=DIRECTION($,(1,0,0));
+#386=VECTOR($,#385,1);
+#387=LINE($,#384,#386);
+#388=EDGE_CURVE($,#57,#137,#387,.T.);
+#389=ORIENTED_EDGE($,$,$,#388,.T.);
+#390=ORIENTED_EDGE($,$,$,#142,.F.);
+#391=CARTESIAN_POINT($,(40,20,4));
+#392=DIRECTION($,(1,0,0));
+#393=VECTOR($,#392,1);
+#394=LINE($,#391,#393);
+#395=EDGE_CURVE($,#129,#65,#394,.T.);
+#396=ORIENTED_EDGE($,$,$,#395,.F.);
+#397=EDGE_LOOP($,(#383,#389,#390,#396));
+#398=FACE_OUTER_BOUND('',#397,.T.);
+#399=ADVANCED_FACE('',(#398),#382,.T.);
+#400=CARTESIAN_POINT($,(36,20,22));
+#401=DIRECTION($,(0,1,0));
+#402=DIRECTION($,(-1,0,0));
+#403=AXIS2_PLACEMENT_3D($,#400,#401,#402);
+#404=PLANE($,#403);
+#405=ORIENTED_EDGE($,$,$,#367,.T.);
+#406=CARTESIAN_POINT($,(32,20,26));
+#407=DIRECTION($,(1,0,0));
+#408=VECTOR($,#407,1);
+#409=LINE($,#406,#408);
+#410=EDGE_CURVE($,#105,#169,#409,.T.);
+#411=ORIENTED_EDGE($,$,$,#410,.T.);
+#412=CARTESIAN_POINT($,(40,20,26));
+#413=DIRECTION($,(0,0,1));
+#414=VECTOR($,#413,1);
+#415=LINE($,#412,#414);
+#416=EDGE_CURVE($,#169,#137,#415,.T.);
+#417=ORIENTED_EDGE($,$,$,#416,.F.);
+#418=ORIENTED_EDGE($,$,$,#388,.F.);
+#419=EDGE_LOOP($,(#405,#411,#417,#418));
+#420=FACE_OUTER_BOUND('',#419,.T.);
+#421=ADVANCED_FACE('',(#420),#404,.T.);
+#422=CARTESIAN_POINT($,(36,20,22));
+#423=DIRECTION($,(0,1,0));
+#424=DIRECTION($,(-1,0,0));
+#425=AXIS2_PLACEMENT_3D($,#422,#423,#424);
+#426=PLANE($,#425);
+#427=ORIENTED_EDGE($,$,$,#110,.T.);
+#428=CARTESIAN_POINT($,(32,20,40));
+#429=DIRECTION($,(1,0,0));
+#430=VECTOR($,#429,1);
+#431=LINE($,#428,#430);
+#432=EDGE_CURVE($,#97,#177,#431,.T.);
+#433=ORIENTED_EDGE($,$,$,#432,.T.);
+#434=ORIENTED_EDGE($,$,$,#182,.F.);
+#435=ORIENTED_EDGE($,$,$,#410,.F.);
+#436=EDGE_LOOP($,(#427,#433,#434,#435));
+#437=FACE_OUTER_BOUND('',#436,.T.);
+#438=ADVANCED_FACE('',(#437),#426,.T.);
+#439=CARTESIAN_POINT($,(36,20,22));
+#440=DIRECTION($,(0,1,0));
+#441=DIRECTION($,(-1,0,0));
+#442=AXIS2_PLACEMENT_3D($,#439,#440,#441);
+#443=PLANE($,#442);
+#444=ORIENTED_EDGE($,$,$,#416,.T.);
+#445=CARTESIAN_POINT($,(40,20,26));
+#446=DIRECTION($,(1,0,0));
+#447=VECTOR($,#446,1);
+#448=LINE($,#445,#447);
+#449=EDGE_CURVE($,#169,#217,#448,.T.);
+#450=ORIENTED_EDGE($,$,$,#449,.T.);
+#451=ORIENTED_EDGE($,$,$,#222,.F.);
+#452=CARTESIAN_POINT($,(76,20,18));
+#453=DIRECTION($,(1,0,0));
+#454=VECTOR($,#453,1);
+#455=LINE($,#452,#454);
+#456=EDGE_CURVE($,#209,#137,#455,.T.);
+#457=ORIENTED_EDGE($,$,$,#456,.F.);
+#458=EDGE_LOOP($,(#444,#450,#451,#457));
+#459=FACE_OUTER_BOUND('',#458,.T.);
+#460=ADVANCED_FACE('',(#459),#443,.T.);
+#461=CARTESIAN_POINT($,(36,0,4));
+#462=DIRECTION($,(0,0,-1));
+#463=DIRECTION($,(1,0,0));
+#464=AXIS2_PLACEMENT_3D($,#461,#462,#463);
+#465=PLANE($,#464);
+#466=ORIENTED_EDGE($,$,$,#76,.T.);
+#467=ORIENTED_EDGE($,$,$,#395,.T.);
+#468=ORIENTED_EDGE($,$,$,#134,.F.);
+#469=ORIENTED_EDGE($,$,$,#277,.F.);
+#470=EDGE_LOOP($,(#466,#467,#468,#469));
+#471=FACE_OUTER_BOUND('',#470,.T.);
+#472=ADVANCED_FACE('',(#471),#465,.T.);
+#473=CARTESIAN_POINT($,(36,0,18));
+#474=DIRECTION($,(0,0,-1));
+#475=DIRECTION($,(1,0,0));
+#476=AXIS2_PLACEMENT_3D($,#473,#474,#475);
+#477=PLANE($,#476);
+#478=ORIENTED_EDGE($,$,$,#36,.T.);
+#479=ORIENTED_EDGE($,$,$,#373,.T.);
+#480=ORIENTED_EDGE($,$,$,#62,.F.);
+#481=ORIENTED_EDGE($,$,$,#250,.F.);
+#482=EDGE_LOOP($,(#478,#479,#480,#481));
+#483=FACE_OUTER_BOUND('',#482,.T.);
+#484=ADVANCED_FACE('',(#483),#477,.T.);
+#485=CARTESIAN_POINT($,(36,0,18));
+#486=DIRECTION($,(0,0,-1));
+#487=DIRECTION($,(1,0,0));
+#488=AXIS2_PLACEMENT_3D($,#485,#486,#487);
+#489=PLANE($,#488);
+#490=ORIENTED_EDGE($,$,$,#150,.T.);
+#491=ORIENTED_EDGE($,$,$,#456,.T.);
+#492=ORIENTED_EDGE($,$,$,#214,.F.);
+#493=ORIENTED_EDGE($,$,$,#338,.F.);
+#494=EDGE_LOOP($,(#490,#491,#492,#493));
+#495=FACE_OUTER_BOUND('',#494,.T.);
+#496=ADVANCED_FACE('',(#495),#489,.T.);
+#497=CARTESIAN_POINT($,(36,0,26));
+#498=DIRECTION($,(0,0,1));
+#499=DIRECTION($,(1,0,0));
+#500=AXIS2_PLACEMENT_3D($,#497,#498,#499);
+#501=PLANE($,#500);
+#502=ORIENTED_EDGE($,$,$,#262,.T.);
+#503=ORIENTED_EDGE($,$,$,#116,.T.);
+#504=ORIENTED_EDGE($,$,$,#361,.F.);
+#505=ORIENTED_EDGE($,$,$,#22,.F.);
+#506=EDGE_LOOP($,(#502,#503,#504,#505));
+#507=FACE_OUTER_BOUND('',#506,.T.);
+#508=ADVANCED_FACE('',(#507),#501,.T.);
+#509=CARTESIAN_POINT($,(36,0,26));
+#510=DIRECTION($,(0,0,1));
+#511=DIRECTION($,(1,0,0));
+#512=AXIS2_PLACEMENT_3D($,#509,#510,#511);
+#513=PLANE($,#512);
+#514=ORIENTED_EDGE($,$,$,#345,.T.);
+#515=ORIENTED_EDGE($,$,$,#230,.T.);
+#516=ORIENTED_EDGE($,$,$,#449,.F.);
+#517=ORIENTED_EDGE($,$,$,#174,.F.);
+#518=EDGE_LOOP($,(#514,#515,#516,#517));
+#519=FACE_OUTER_BOUND('',#518,.T.);
+#520=ADVANCED_FACE('',(#519),#513,.T.);
+#521=CARTESIAN_POINT($,(36,0,40));
+#522=DIRECTION($,(0,0,1));
+#523=DIRECTION($,(1,0,0));
+#524=AXIS2_PLACEMENT_3D($,#521,#522,#523);
+#525=PLANE($,#524);
+#526=ORIENTED_EDGE($,$,$,#323,.T.);
+#527=ORIENTED_EDGE($,$,$,#190,.T.);
+#528=ORIENTED_EDGE($,$,$,#432,.F.);
+#529=ORIENTED_EDGE($,$,$,#102,.F.);
+#530=EDGE_LOOP($,(#526,#527,#528,#529));
+#531=FACE_OUTER_BOUND('',#530,.T.);
+#532=ADVANCED_FACE('',(#531),#525,.T.);
+#533=CLOSED_SHELL($,(#40,#80,#120,#160,#200,#240,#267,#289,#311,#328,#350,#377,#399,#421,#438,#460,#472,#484,#496,#508,#520,#532));
+#534=MANIFOLD_SOLID_BREP('AetherisBody',#533);
+#535=APPLICATION_CONTEXT('mechanical design');
+#536=PRODUCT_CONTEXT('',#535,'mechanical');
+#537=PRODUCT('AETHERIS','AetherisBody','',(#536));
+#538=PRODUCT_DEFINITION_FORMATION('','',#537);
+#539=PRODUCT_DEFINITION_CONTEXT('design',#535,'design');
+#540=PRODUCT_DEFINITION('','',#538,#539);
+#541=PRODUCT_DEFINITION_SHAPE('','',#540);
+#542=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
+#543=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#544=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
+#545=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNIT_ASSIGNED_CONTEXT((#542,#543,#544))REPRESENTATION_CONTEXT('3','3D'));
+#546=SHAPE_REPRESENTATION('AetherisBody',(#534),#545);
+#547=SHAPE_DEFINITION_REPRESENTATION(#541,#546);
+ENDSEC;
+END-ISO-10303-21;