Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Validate lattice fill parsing and DFM constraints

Yuechen Li20c90942929c
diff --git a/Aetheris.Kernel.Core.Tests/Air/LatticeFillM9Tests.cs b/Aetheris.Kernel.Core.Tests/Air/LatticeFillM9Tests.cs
new file mode 100644
index 00000000..c207a8e1
--- /dev/null
+++ b/Aetheris.Kernel.Core.Tests/Air/LatticeFillM9Tests.cs
@@ -0,0 +1,61 @@
+using Aetheris.Kernel.Core.Air;
+using Aetheris.Kernel.Core.Brep.Boolean;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Tests.Air;
+
+public sealed class LatticeFillM9Tests
+{
+ [Fact]
+ public void OctetTruss_UsesDeterministicSharedNodesMembersAndBondWitnesses()
+ {
+ var construction = LatticeFillM9.Construct(CreateFeature());
+
+ Assert.Equal(18, construction.CellDomain.Count);
+ Assert.Equal(123, construction.NodeInstances.Count);
+ Assert.Equal(300, construction.MemberInstances.Count);
+ Assert.NotEmpty(construction.BoundaryIncidents);
+ Assert.Equal(construction.BoundaryIncidents.Count, construction.AttachmentWitnesses.Count);
+ Assert.All(construction.MemberInstances, member => Assert.True(string.CompareOrdinal(member.StartNodeId, member.EndNodeId) < 0));
+ Assert.All(construction.AttachmentWitnesses, witness => Assert.Equal(1.6d, witness.ContactDiameter, 8));
+ Assert.Equal(construction.Signature, LatticeFillM9.Construct(CreateFeature()).Signature);
+ }
+
+ [Fact]
+ public void Validation_RejectsRegionIntersectingTheProtectedThroughHole()
+ {
+ var feature = CreateFeature() with
+ {
+ Region = new LatticeFillRegion("Bad", new AxisAlignedBoxExtents(-4, 20, -12, 12, -8, 8), "test")
+ };
+
+ var diagnostics = LatticeFillM9.Validate(feature, Host(), 12d, Point3D.Origin);
+
+ Assert.Contains(LatticeFillM9.FillRegionIntersectsVoid, diagnostics);
+ }
+
+ [Fact]
+ public void Validation_ReportsTypedAdditiveDfmFailures()
+ {
+ var feature = CreateFeature() with
+ {
+ StrutRadius = 0.4d,
+ AdditiveContext = CreateFeature().AdditiveContext with { MinimumStrutDiameter = 1d, MinimumBondDiameter = 1d }
+ };
+
+ var diagnostics = LatticeFillM9.Validate(feature, Host(), 1d, Point3D.Origin);
+
+ Assert.Contains(diagnostics, d => d.StartsWith(LatticeFillM9.MinimumStrutDiameterViolation, StringComparison.Ordinal));
+ Assert.Contains(diagnostics, d => d.StartsWith(LatticeFillM9.MinimumBondDiameterViolation, StringComparison.Ordinal));
+ Assert.Contains(diagnostics, d => d.StartsWith(LatticeFillM9.MinimumHoleDiameterViolation, StringComparison.Ordinal));
+ }
+
+ private static LatticeFillFeature CreateFeature() => new(
+ "Body.LightweightCore", "Body",
+ new LatticeFillRegion("LightweightCore", new AxisAlignedBoxExtents(10, 34, -12, 12, -8, 8), "test"),
+ LatticePatternKind.OctetTruss, 8d, 0.8d, LatticeBoundaryPolicy.Bond,
+ new AdditiveManufacturingContext("PolymerPrototype", "FDM", 1.2d, 1d, 1.2d, 2d, "test"),
+ new LatticeFillProvenance("test", "LightweightCore", "0:1", []));
+
+ private static AxisAlignedBoxExtents Host() => new(-40, 40, -25, 25, -10, 10);
+}
diff --git a/Aetheris.Kernel.Core/Air/LatticeFillFeature.cs b/Aetheris.Kernel.Core/Air/LatticeFillFeature.cs
new file mode 100644
index 00000000..b6ca99d0
--- /dev/null
+++ b/Aetheris.Kernel.Core/Air/LatticeFillFeature.cs
@@ -0,0 +1,173 @@
+using System.Globalization;
+using System.Security.Cryptography;
+using System.Text;
+using Aetheris.Kernel.Core.Brep.Boolean;
+using Aetheris.Kernel.Core.Math;
+
+namespace Aetheris.Kernel.Core.Air;
+
+/// <summary>Bounded M9 authority model. A fill region is never inferred from wall distances or topology.</summary>
+public sealed record LatticeFillRegion(string RegionId, AxisAlignedBoxExtents Bounds, string Provenance)
+{
+ public double Width => Bounds.MaxX - Bounds.MinX;
+ public double Depth => Bounds.MaxY - Bounds.MinY;
+ public double Height => Bounds.MaxZ - Bounds.MinZ;
+}
+
+public enum LatticePatternKind { OctetTruss }
+public enum LatticeBoundaryPolicy { Bond }
+
+public sealed record AdditiveManufacturingContext(
+ string Template,
+ string Process,
+ double MinimumWallThickness,
+ double MinimumStrutDiameter,
+ double MinimumBondDiameter,
+ double MinimumHoleDiameter,
+ string Provenance);
+
+public sealed record LatticeFillProvenance(string SourceKind, string SourceSymbol, string SourceSpan, IReadOnlyList<string> Notes);
+
+/// <summary>Feature AIR remains semantic; it deliberately does not contain one source feature per cylinder.</summary>
+public sealed record LatticeFillFeature(
+ string FeatureId,
+ string HostId,
+ LatticeFillRegion Region,
+ LatticePatternKind Pattern,
+ double CellSize,
+ double StrutRadius,
+ LatticeBoundaryPolicy BoundaryPolicy,
+ AdditiveManufacturingContext AdditiveContext,
+ LatticeFillProvenance Provenance);
+
+public sealed record LatticeNodeInstance(string Id, Point3D Position, string Role);
+public sealed record LatticeMemberInstance(string Id, string StartNodeId, string EndNodeId, Point3D Start, Point3D End, string Role);
+public sealed record LatticeBoundaryIncident(string MemberId, string NodeId, string BoundaryPlane, Point3D Point);
+public sealed record LatticeAttachmentWitness(string Id, string MemberId, string BoundaryPlane, Point3D Point, double ContactDiameter, string RetainedHostOwner);
+
+/// <summary>Hierarchical construction evidence for M9. Geometry lowering is intentionally a later, authoritative-plan stage.</summary>
+public sealed record LatticeFillConstruction(
+ LatticeFillFeature Feature,
+ IReadOnlyList<(int X, int Y, int Z)> CellDomain,
+ IReadOnlyList<LatticeNodeInstance> NodeInstances,
+ IReadOnlyList<LatticeMemberInstance> MemberInstances,
+ IReadOnlyList<LatticeBoundaryIncident> BoundaryIncidents,
+ IReadOnlyList<LatticeAttachmentWitness> AttachmentWitnesses,
+ string Signature,
+ IReadOnlyList<string> Diagnostics)
+{
+ public int JunctionCount => NodeInstances.Count(n => MemberInstances.Count(m => m.StartNodeId == n.Id || m.EndNodeId == n.Id) > 1);
+}
+
+public static class LatticeFillM9
+{
+ public const string FillRegionDegenerate = "fill-region-degenerate";
+ public const string FillRegionOutsideHost = "fill-region-outside-host";
+ public const string FillRegionIntersectsExterior = "fill-region-intersects-exterior";
+ public const string FillRegionIntersectsVoid = "fill-region-intersects-void";
+ public const string UnsupportedFillRegionGeometry = "unsupported-fill-region-geometry";
+ public const string CellSizeInvalid = "lattice-cell-size-invalid";
+ public const string StrutRadiusInvalid = "lattice-strut-radius-invalid";
+ public const string RegionTooSmall = "lattice-region-too-small";
+ public const string MinimumStrutDiameterViolation = "additive-minimum-strut-diameter-violation";
+ public const string MinimumWallThicknessViolation = "additive-minimum-wall-thickness-violation";
+ public const string MinimumHoleDiameterViolation = "additive-minimum-hole-diameter-violation";
+ public const string MinimumBondDiameterViolation = "additive-minimum-bond-diameter-violation";
+
+ public static IReadOnlyList<string> Validate(
+ LatticeFillFeature feature,
+ AxisAlignedBoxExtents host,
+ double throughHoleDiameter,
+ Point3D throughHoleCenter)
+ {
+ var d = new List<string>();
+ var r = feature.Region.Bounds;
+ const double eps = 1e-9;
+ if (feature.Pattern != LatticePatternKind.OctetTruss) d.Add(UnsupportedFillRegionGeometry);
+ if (r.MaxX - r.MinX <= eps || r.MaxY - r.MinY <= eps || r.MaxZ - r.MinZ <= eps) d.Add(FillRegionDegenerate);
+ if (!host.Contains(r, Numerics.ToleranceContext.Default)) d.Add(FillRegionOutsideHost);
+ if (r.MinX <= host.MinX + eps || r.MaxX >= host.MaxX - eps || r.MinY <= host.MinY + eps || r.MaxY >= host.MaxY - eps || r.MinZ <= host.MinZ + eps || r.MaxZ >= host.MaxZ - eps) d.Add(FillRegionIntersectsExterior);
+ if (IntersectsZThroughHole(r, throughHoleCenter, throughHoleDiameter / 2d, eps)) d.Add(FillRegionIntersectsVoid);
+ if (!double.IsFinite(feature.CellSize) || feature.CellSize <= eps) d.Add(CellSizeInvalid);
+ if (!double.IsFinite(feature.StrutRadius) || feature.StrutRadius <= eps) d.Add(StrutRadiusInvalid);
+ if (feature.CellSize > eps && (feature.Region.Width < feature.CellSize || feature.Region.Depth < feature.CellSize || feature.Region.Height < feature.CellSize)) d.Add(RegionTooSmall);
+
+ var c = feature.AdditiveContext;
+ if (2d * feature.StrutRadius + eps < c.MinimumStrutDiameter) d.Add($"{MinimumStrutDiameterViolation}: template '{c.Template}', feature '{feature.FeatureId}', actual {2d * feature.StrutRadius:R}mm, required {c.MinimumStrutDiameter:R}mm.");
+ if (throughHoleDiameter + eps < c.MinimumHoleDiameter) d.Add($"{MinimumHoleDiameterViolation}: template '{c.Template}', host hole actual {throughHoleDiameter:R}mm, required {c.MinimumHoleDiameter:R}mm.");
+ var clearances = new[] { r.MinX - host.MinX, host.MaxX - r.MaxX, r.MinY - host.MinY, host.MaxY - r.MaxY, r.MinZ - host.MinZ, host.MaxZ - r.MaxZ };
+ if (clearances.Any(v => v + eps < c.MinimumWallThickness)) d.Add($"{MinimumWallThicknessViolation}: template '{c.Template}', actual {clearances.Min():R}mm, required {c.MinimumWallThickness:R}mm.");
+ if (2d * feature.StrutRadius + eps < c.MinimumBondDiameter) d.Add($"{MinimumBondDiameterViolation}: template '{c.Template}', terminal contact actual {2d * feature.StrutRadius:R}mm, required {c.MinimumBondDiameter:R}mm.");
+ return d;
+ }
+
+ public static LatticeFillConstruction Construct(LatticeFillFeature feature)
+ {
+ if (feature.Pattern != LatticePatternKind.OctetTruss) throw new ArgumentOutOfRangeException(nameof(feature));
+ var r = feature.Region.Bounds;
+ var nx = (int)System.Math.Floor((r.MaxX - r.MinX) / feature.CellSize + 1e-9);
+ var ny = (int)System.Math.Floor((r.MaxY - r.MinY) / feature.CellSize + 1e-9);
+ var nz = (int)System.Math.Floor((r.MaxZ - r.MinZ) / feature.CellSize + 1e-9);
+ if (nx < 1 || ny < 1 || nz < 1) throw new ArgumentException(RegionTooSmall, nameof(feature));
+
+ var cells = new List<(int X, int Y, int Z)>();
+ var nodes = new Dictionary<string, LatticeNodeInstance>(StringComparer.Ordinal);
+ var members = new Dictionary<string, LatticeMemberInstance>(StringComparer.Ordinal);
+ for (var x = 0; x < nx; x++) for (var y = 0; y < ny; y++) for (var z = 0; z < nz; z++)
+ {
+ cells.Add((x, y, z));
+ var corners = new[] { (0,0,0), (1,0,0), (1,1,0), (0,1,0), (0,0,1), (1,0,1), (1,1,1), (0,1,1) };
+ // The six face-centres and their four face corners are the tetrahedral-octahedral (octet) cell graph.
+ var faces = new[] { ("-X", new[]{0,3,7,4}), ("+X", new[]{1,2,6,5}), ("-Y", new[]{0,1,5,4}), ("+Y", new[]{3,2,6,7}), ("-Z", new[]{0,1,2,3}), ("+Z", new[]{4,5,6,7}) };
+ var point = (int a, int b, int c) => new Point3D(r.MinX + (x + a) * feature.CellSize, r.MinY + (y + b) * feature.CellSize, r.MinZ + (z + c) * feature.CellSize);
+ var cornerIds = corners.Select(c => Node("C", x + c.Item1, y + c.Item2, z + c.Item3, point(c.Item1, c.Item2, c.Item3))).ToArray();
+ foreach (var (role, indices) in faces)
+ {
+ var center = new Point3D(indices.Select(i => nodes[cornerIds[i]].Position.X).Average(), indices.Select(i => nodes[cornerIds[i]].Position.Y).Average(), indices.Select(i => nodes[cornerIds[i]].Position.Z).Average());
+ // Face-centres are shared by the two cells on either side of an internal face.
+ // The axis family and doubled lattice coordinates identify the geometric node;
+ // the local +/- face role must not leak into identity.
+ var faceId = Node("F" + role[1], x * 2 + (role is "+X" ? 2 : role is "-X" ? 0 : 1), y * 2 + (role is "+Y" ? 2 : role is "-Y" ? 0 : 1), z * 2 + (role is "+Z" ? 2 : role is "-Z" ? 0 : 1), center);
+ foreach (var corner in indices) Member(faceId, cornerIds[corner], $"cell:{x},{y},{z}:{role}");
+ }
+ }
+ var boundary = new List<LatticeBoundaryIncident>();
+ foreach (var member in members.Values)
+ foreach (var nodeId in new[] { member.StartNodeId, member.EndNodeId })
+ {
+ var p = nodes[nodeId].Position;
+ var plane = BoundaryPlane(p, r);
+ if (plane is not null) boundary.Add(new(member.Id, nodeId, plane, p));
+ }
+ boundary = boundary.DistinctBy(b => (b.MemberId, b.NodeId, b.BoundaryPlane)).OrderBy(b => b.MemberId, StringComparer.Ordinal).ThenBy(b => b.NodeId, StringComparer.Ordinal).ToList();
+ var attachments = boundary.Select((b, i) => new LatticeAttachmentWitness($"bond:{i:D4}", b.MemberId, b.BoundaryPlane, b.Point, 2d * feature.StrutRadius, feature.HostId)).ToArray();
+ var signatureText = string.Join("|", cells) + ";" + string.Join("|", nodes.Keys.Order()) + ";" + string.Join("|", members.Keys.Order());
+ var signature = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(signatureText))).ToLowerInvariant();
+ return new(feature, cells, nodes.Values.OrderBy(n => n.Id, StringComparer.Ordinal).ToArray(), members.Values.OrderBy(m => m.Id, StringComparer.Ordinal).ToArray(), boundary, attachments, signature, []);
+
+ string Node(string role, int x, int y, int z, Point3D p)
+ {
+ var id = string.Create(CultureInfo.InvariantCulture, $"octet:{role}:{x}:{y}:{z}");
+ nodes.TryAdd(id, new LatticeNodeInstance(id, p, role));
+ return id;
+ }
+ void Member(string a, string b, string role)
+ {
+ var (start, end) = string.CompareOrdinal(a, b) <= 0 ? (a, b) : (b, a);
+ var id = $"octet:member:{start}:{end}";
+ members.TryAdd(id, new LatticeMemberInstance(id, start, end, nodes[start].Position, nodes[end].Position, role));
+ }
+ }
+
+ private static string? BoundaryPlane(Point3D p, AxisAlignedBoxExtents b) =>
+ System.Math.Abs(p.X - b.MinX) < 1e-9 ? "XMin" : System.Math.Abs(p.X - b.MaxX) < 1e-9 ? "XMax" :
+ System.Math.Abs(p.Y - b.MinY) < 1e-9 ? "YMin" : System.Math.Abs(p.Y - b.MaxY) < 1e-9 ? "YMax" :
+ System.Math.Abs(p.Z - b.MinZ) < 1e-9 ? "ZMin" : System.Math.Abs(p.Z - b.MaxZ) < 1e-9 ? "ZMax" : null;
+
+ private static bool IntersectsZThroughHole(AxisAlignedBoxExtents region, Point3D center, double radius, double eps)
+ {
+ var dx = center.X < region.MinX ? region.MinX - center.X : center.X > region.MaxX ? center.X - region.MaxX : 0d;
+ var dy = center.Y < region.MinY ? region.MinY - center.Y : center.Y > region.MaxY ? center.Y - region.MaxY : 0d;
+ return dx * dx + dy * dy < (radius + eps) * (radius + eps);
+ }
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentV2LatticeFillTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentV2LatticeFillTests.cs
new file mode 100644
index 00000000..31907cd3
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentV2LatticeFillTests.cs
@@ -0,0 +1,54 @@
+using Aetheris.Kernel.Firmament.FirmamentV2;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class FirmamentV2LatticeFillTests
+{
+ [Fact]
+ public void Parse_ExplicitBoxRegionAndOctetFill_PreservesSemanticParameters()
+ {
+ var parse = FirmamentV2Parser.Parse(Source());
+
+ Assert.True(parse.IsSuccess, string.Join(Environment.NewLine, parse.Diagnostics));
+ var fill = Assert.Single(parse.Document!.LatticeFills!);
+ Assert.Equal("Body", fill.Host);
+ Assert.Equal("OctetTruss", fill.Pattern);
+ Assert.Equal(8d, fill.CellSize);
+ Assert.Equal(0.8d, fill.StrutRadius);
+ Assert.Equal("Bond", fill.BoundaryPolicy);
+ Assert.Equal(new[] { 24d, 24d, 16d }, fill.Region.Size);
+ }
+
+ [Fact]
+ public void Parse_RejectsUnsupportedMultipleFills()
+ {
+ var parse = FirmamentV2Parser.Parse(Source() + "\nregion Second { box { size: [8, 8, 8] center: [20, 15, 0] } }\nfill Second { host: Body pattern: OctetTruss { cellSize: 8mm strutRadius: 0.8mm } boundaryPolicy: Bond }");
+
+ Assert.False(parse.IsSuccess);
+ Assert.Contains(FirmamentV2Parser.FillMultipleUnsupported, parse.Diagnostics);
+ }
+
+ private static string Source() => """
+ model LightweightBracket {
+ units mm
+ template<Additive> PolymerPrototype {
+ concept MinimumWallThickness: 1.2mm
+ concept MinimumStrutDiameter: 1.0mm
+ concept MinimumBondDiameter: 1.2mm
+ concept MinimumHoleDiameter: 2.0mm
+ }
+ solid Body: Box { size: [80, 50, 20] }
+ modify Body {
+ hole<Shaft> MountHole { on: face(+Z) center: [0, 0] diameter: 12 end: throughAll }
+ }
+ region LightweightCore {
+ box { size: [24mm, 24mm, 16mm] center: [22mm, 0mm, 0mm] }
+ }
+ fill LightweightCore {
+ host: Body
+ pattern: OctetTruss { cellSize: 8mm strutRadius: 0.8mm }
+ boundaryPolicy: Bond
+ }
+ }
+ """;
+}
diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
index 5f8b2118..507fb4e5 100644
--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
@@ -57,6 +57,18 @@ public static class FirmamentBuildAndExport
return KernelResult<FirmamentStepExportResult>.Failure(dfm.Diagnostics);
}
+ // Do not let the existing semantic-hole route silently export the unmodified host.
+ // M9 has an explicit AIR/graph contract, but the authoritative single-body merge
+ // (retained box-with-void plus analytic struts/nodes/bonds) is not yet materialized.
+ if (v2Parse.Document.LatticeFills is { Count: > 0 })
+ {
+ return KernelResult<FirmamentStepExportResult>.Failure([new Kernel.Core.Diagnostics.KernelDiagnostic(
+ Kernel.Core.Diagnostics.KernelDiagnosticCode.NotImplemented,
+ Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error,
+ "lattice-fill-brep-plan-not-materialized: M9 parsed and DFM-validated the explicit FillRegion, but the current BRep backend cannot emit the required single authoritative body combining an internal box cavity, a preserved through-hole, and bonded analytic lattice members. No STEP artifact was emitted.",
+ "FirmamentV2.LatticeFill")]);
+ }
+
if (TryExportV2AirChamferBody(v2Parse.Document) is { } airChamferExport)
{
return airChamferExport;
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
index 730f8c55..2458cc14 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Ast.cs
@@ -1,6 +1,6 @@
namespace Aetheris.Kernel.Firmament.FirmamentV2;
-public sealed record FirmamentV2Document(string ModelName, string Units, IReadOnlyList<FirmamentV2SolidBinding> Solids, IReadOnlyList<FirmamentV2ModifyBlock>? ModifyBlocks = null, IReadOnlyList<FirmamentV2TemplateDecl>? Templates = null, IReadOnlyList<FirmamentV2PmiDecl>? Pmi = null, IReadOnlyList<FirmamentV2RecognizedRegion>? RecognizedRegions = null, IReadOnlyList<FirmamentV2ReplacementDecl>? Replacements = null, IReadOnlyList<FirmamentV2LetDeclaration>? Lets = null, IReadOnlyList<FirmamentV2BoundLet>? BoundLets = null, IReadOnlyList<FirmamentV2LetRecordDeclaration>? LetRecords = null, IReadOnlyList<FirmamentV2BoundLetRecord>? BoundLetRecords = null, IReadOnlyList<FirmamentV2ManufacturingConceptDeclaration>? ManufacturingConcepts = null, IReadOnlyList<FirmamentV2FeatureConceptDeclaration>? FeatureConcepts = null, FirmamentV2PmiBlock? PmiBlock = null, FirmamentV2BoundPmiBlock? BoundPmi = null, ConceptIrDocument? ConceptIr = null)
+public sealed record FirmamentV2Document(string ModelName, string Units, IReadOnlyList<FirmamentV2SolidBinding> Solids, IReadOnlyList<FirmamentV2ModifyBlock>? ModifyBlocks = null, IReadOnlyList<FirmamentV2TemplateDecl>? Templates = null, IReadOnlyList<FirmamentV2PmiDecl>? Pmi = null, IReadOnlyList<FirmamentV2RecognizedRegion>? RecognizedRegions = null, IReadOnlyList<FirmamentV2ReplacementDecl>? Replacements = null, IReadOnlyList<FirmamentV2LetDeclaration>? Lets = null, IReadOnlyList<FirmamentV2BoundLet>? BoundLets = null, IReadOnlyList<FirmamentV2LetRecordDeclaration>? LetRecords = null, IReadOnlyList<FirmamentV2BoundLetRecord>? BoundLetRecords = null, IReadOnlyList<FirmamentV2ManufacturingConceptDeclaration>? ManufacturingConcepts = null, IReadOnlyList<FirmamentV2FeatureConceptDeclaration>? FeatureConcepts = null, FirmamentV2PmiBlock? PmiBlock = null, FirmamentV2BoundPmiBlock? BoundPmi = null, ConceptIrDocument? ConceptIr = null, IReadOnlyList<FirmamentV2LatticeFillDecl>? LatticeFills = null)
{
public FirmamentV2SolidBinding Solid => Solids[^1];
public FirmamentV2SideHoleIntent? SideHoleIntent => ModifyBlocks?.SelectMany(m => m.Regions.Select(r =>
@@ -167,6 +167,8 @@ public sealed record FirmamentV2BoundPmiBlock(IReadOnlyList<FirmamentV2BoundPmiR
public sealed record FirmamentV2BoundPmiRecord(FirmamentV2PmiKind Kind, string Name, IReadOnlyList<string> Targets, FirmamentV2LiteralValue? DimensionValue, FirmamentV2Tolerance? DimensionTolerance, FirmamentV2LiteralValue? ControlTolerance, IReadOnlyList<string> DatumRefs, FirmamentV2SourceSpan SourceSpan);
public sealed record FirmamentV2ConceptDecl(string Name, string RawValue, double NumericValue, string? Unit);
public sealed record FirmamentV2TemplateDecl(string Process, string Name, IReadOnlyList<FirmamentV2ConceptDecl> Concepts);
+public sealed record FirmamentV2FillRegionDecl(string Name, IReadOnlyList<double> Size, IReadOnlyList<double> Center, FirmamentV2SourceSpan SourceSpan);
+public sealed record FirmamentV2LatticeFillDecl(string Name, string Host, FirmamentV2FillRegionDecl Region, string Pattern, double CellSize, double StrutRadius, string BoundaryPolicy, FirmamentV2SourceSpan SourceSpan);
public sealed record FirmamentV2ParseResult(bool IsSuccess, FirmamentV2Document? Document, IReadOnlyList<string> Diagnostics)
{
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2DfmEnforcement.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2DfmEnforcement.cs
index 5576879b..8667064b 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2DfmEnforcement.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2DfmEnforcement.cs
@@ -1,5 +1,8 @@
using Aetheris.Kernel.Core.Diagnostics;
using Aetheris.Kernel.Core.Results;
+using Aetheris.Kernel.Core.Air;
+using Aetheris.Kernel.Core.Brep.Boolean;
+using Aetheris.Kernel.Core.Math;
namespace Aetheris.Kernel.Firmament.FirmamentV2;
@@ -31,6 +34,55 @@ internal static class FirmamentV2DfmEnforcement
}
}
+ foreach (var fill in document.LatticeFills ?? [])
+ {
+ var host = document.Solids.SingleOrDefault(s => string.Equals(s.Name, fill.Host, StringComparison.Ordinal));
+ if (host?.Box is null || host.Box.Size.Count != 3)
+ {
+ diagnostics.Add(Error("lattice-fill-history-known-host-required: M9 admits one history-known Box host; imported STEP bodies remain deferred."));
+ continue;
+ }
+
+ var template = (document.Templates ?? []).SingleOrDefault(t => string.Equals(t.Process, "Additive", StringComparison.OrdinalIgnoreCase));
+ if (template is null)
+ {
+ diagnostics.Add(Error("additive-template-required: Lattice Fill requires one Template<Additive> manufacturing context."));
+ continue;
+ }
+
+ double Concept(string name)
+ {
+ var concept = template.Concepts.SingleOrDefault(c => string.Equals(c.Name, name, StringComparison.OrdinalIgnoreCase));
+ if (concept is null || !string.Equals(concept.Unit, document.Units, StringComparison.OrdinalIgnoreCase))
+ {
+ diagnostics.Add(Error($"additive-concept-required: template '{template.Name}' requires typed length concept '{name}' in '{document.Units}'."));
+ return double.NaN;
+ }
+ return concept.NumericValue;
+ }
+
+ var context = new AdditiveManufacturingContext(template.Name, template.Process,
+ Concept("MinimumWallThickness"), Concept("MinimumStrutDiameter"), Concept("MinimumBondDiameter"), Concept("MinimumHoleDiameter"),
+ $"Template<{template.Process}> {template.Name}");
+ if (!double.IsFinite(context.MinimumWallThickness) || !double.IsFinite(context.MinimumStrutDiameter) || !double.IsFinite(context.MinimumBondDiameter) || !double.IsFinite(context.MinimumHoleDiameter)) continue;
+
+ var hole = (document.ModifyBlocks ?? []).Where(m => string.Equals(m.TargetSolid, fill.Host, StringComparison.Ordinal)).SelectMany(m => m.SemanticHoles).SingleOrDefault(h => h.EndCondition.Kind == FirmamentV2SemanticHoleEndKind.ThroughAll && h.EntryFace.Axis is "+Z" or "-Z");
+ if (hole is null)
+ {
+ diagnostics.Add(Error("lattice-fill-through-hole-required: M9 history-known proof route requires exactly one Z through-hole."));
+ continue;
+ }
+
+ var r = fill.Region;
+ var bounds = new AxisAlignedBoxExtents(r.Center[0] - r.Size[0] / 2d, r.Center[0] + r.Size[0] / 2d, r.Center[1] - r.Size[1] / 2d, r.Center[1] + r.Size[1] / 2d, r.Center[2] - r.Size[2] / 2d, r.Center[2] + r.Size[2] / 2d);
+ var hostBounds = new AxisAlignedBoxExtents(-host.Box.Size[0] / 2d, host.Box.Size[0] / 2d, -host.Box.Size[1] / 2d, host.Box.Size[1] / 2d, -host.Box.Size[2] / 2d, host.Box.Size[2] / 2d);
+ var feature = new LatticeFillFeature($"{fill.Host}.{fill.Name}", fill.Host, new LatticeFillRegion(fill.Name, bounds, $"{fill.Name}@{fill.SourceSpan.Start}"), LatticePatternKind.OctetTruss, fill.CellSize, fill.StrutRadius, LatticeBoundaryPolicy.Bond, context, new LatticeFillProvenance("FirmamentV2", fill.Name, $"{fill.SourceSpan.Start}:{fill.SourceSpan.Length}", []));
+ foreach (var diagnostic in LatticeFillM9.Validate(feature, hostBounds, hole.ShaftDiameter, new Point3D(hole.Center.U, hole.Center.V, 0d)))
+ {
+ diagnostics.Add(Error(diagnostic));
+ }
+ }
+
return diagnostics.Count == 0
? KernelResult<object>.Success(new object())
: KernelResult<object>.Failure(diagnostics);
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
index c31286c1..81843360 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
@@ -39,6 +39,14 @@ public static class FirmamentV2Parser
public const string DfmConceptUnitMismatch = "firmament-v2-dfm-concept-unit-mismatch";
public const string DfmMinimumToolRadiusViolation = "firmament-v2-dfm-minimum-tool-radius-violation";
public const string Phase3EdgeFinishSyntaxInvalid = "firmament-v2-phase3-edge-finish-syntax-invalid";
+ public const string FillRegionInvalid = "firmament-v2-fill-region-invalid";
+ public const string FillUnknownRegion = "firmament-v2-fill-unknown-region";
+ public const string FillUnknownHost = "firmament-v2-fill-unknown-host";
+ public const string FillUnsupportedPattern = "firmament-v2-fill-unsupported-pattern";
+ public const string FillInvalidCellSize = "firmament-v2-fill-invalid-cell-size";
+ public const string FillInvalidStrutRadius = "firmament-v2-fill-invalid-strut-radius";
+ public const string FillUnsupportedBoundaryPolicy = "firmament-v2-fill-unsupported-boundary-policy";
+ public const string FillMultipleUnsupported = "firmament-v2-fill-multiple-unsupported";
public const string ConceptUnknownFamily = "firmament-v2-concept-unknown-family";
public const string ConceptUnknownConcept = "firmament-v2-concept-unknown-concept";
@@ -211,6 +219,8 @@ public static class FirmamentV2Parser
private static readonly Regex TemplateHeaderRegex = new(@"\btemplate\s*<\s*(?<process>[A-Za-z_][A-Za-z0-9_]*)\s*>\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
private static readonly Regex ConceptRegex = new(@"\bconcept\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*:\s*(?<value>[-+0-9.eE]+)\s*(?<unit>[A-Za-z_][A-Za-z0-9_]*)?", RegexOptions.CultureInvariant);
private static readonly Regex PathRegex = new("\\bpath\\s*:\\s*\"(?<path>[^\"]+)\"", RegexOptions.CultureInvariant);
+ private static readonly Regex FillRegionHeaderRegex = new(@"\bregion\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
+ private static readonly Regex FillHeaderRegex = new(@"\bfill\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant);
public static FirmamentV2ParseResult Parse(string sourceText) => Parse(sourceText, null, null);
@@ -285,14 +295,15 @@ public static class FirmamentV2Parser
var modifyBlocks = ParseModifyBlocks(source, byName, diagnostics);
var templates = ParseTemplates(source, diagnostics);
+ var latticeFills = ParseLatticeFills(source, byName, diagnostics);
var recognizedRegions = ParseRecognizedRegions(source, byName, diagnostics);
var replacements = ParseReplacements(source, byName, recognizedRegions, diagnostics);
var (pmi, pmiBlock, boundPmi) = ParsePmi(source, byName, modifyBlocks, recognizedRegions, boundLets, boundLetRecords, diagnostics);
var (manufacturingConcepts, featureConcepts) = ParseConceptApplications(source, boundLets, boundLetRecords, conceptCatalog, diagnostics);
FirmamentV2Document? document = null;
- if (modelMatch.Success && unitsMatch.Success && solids.Count > 0)
- document = new FirmamentV2Document(modelMatch.Groups["name"].Value, unitsMatch.Groups["units"].Value, solids, modifyBlocks, templates, pmi, recognizedRegions, replacements, lets, boundLets, letRecords, boundLetRecords, manufacturingConcepts, featureConcepts, pmiBlock, boundPmi);
+ if (modelMatch.Success && unitsMatch.Success && solids.Count > 0 && !diagnostics.Any(d => d.StartsWith("firmament-v2-fill-", StringComparison.Ordinal)))
+ document = new FirmamentV2Document(modelMatch.Groups["name"].Value, unitsMatch.Groups["units"].Value, solids, modifyBlocks, templates, pmi, recognizedRegions, replacements, lets, boundLets, letRecords, boundLetRecords, manufacturingConcepts, featureConcepts, pmiBlock, boundPmi, null, latticeFills);
var hasFatalDiagnostics = diagnostics.Any(IsFatalDiagnosticCode);
diagnostics.Add(document is null || hasFatalDiagnostics ? "firmament-v2-parse-failed" : "firmament-v2-parse-succeeded");
@@ -1267,6 +1278,79 @@ public static class FirmamentV2Parser
return templates;
}
+ // M9's region and fill declarations are top-level authority declarations. They do not reuse
+ // Modify/Region, whose existing meaning is a face-attached side-hole construction island.
+ private static IReadOnlyList<FirmamentV2LatticeFillDecl> ParseLatticeFills(string source, Dictionary<string, FirmamentV2SolidBinding> solids, List<string> diagnostics)
+ {
+ var regions = new Dictionary<string, FirmamentV2FillRegionDecl>(StringComparer.Ordinal);
+ foreach (Match match in FillRegionHeaderRegex.Matches(source))
+ {
+ var open = source.IndexOf('{', match.Index);
+ var close = FindMatchingBrace(source, open);
+ if (close < 0) { diagnostics.Add(FillRegionInvalid); continue; }
+ var body = source[(open + 1)..close];
+ // Do not interpret the legacy `region X on face(...)` syntax as a FillRegion.
+ if (Regex.IsMatch(source.Substring(match.Index, open - match.Index), @"\bon\s+", RegexOptions.CultureInvariant)) continue;
+ var box = Regex.Match(body, @"\bbox\s*\{", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ // Recognition regions also use the word `region`; without an explicit Box they are
+ // unrelated metadata and must not be reinterpreted as a material-authority boundary.
+ if (!box.Success) continue;
+ var boxOpen = body.IndexOf('{', box.Index);
+ var boxClose = FindMatchingBrace(body, boxOpen);
+ if (boxClose < 0) { diagnostics.Add(FillRegionInvalid); continue; }
+ var boxBody = body[(boxOpen + 1)..boxClose];
+ var size = Regex.Match(boxBody, @"\bsize\s*:\s*\[(?<v>[^\]]+)\]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ var center = Regex.Match(boxBody, @"\bcenter\s*:\s*\[(?<v>[^\]]+)\]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ if (!size.Success || !center.Success || !TryParseLatticeTriple(size.Groups["v"].Value, positive: true, out var sizeValues) || !TryParseLatticeTriple(center.Groups["v"].Value, positive: false, out var centerValues)) { diagnostics.Add(FillRegionInvalid); continue; }
+ if (!regions.TryAdd(match.Groups["name"].Value, new(match.Groups["name"].Value, sizeValues, centerValues, new(match.Index, close - match.Index + 1)))) diagnostics.Add(FillRegionInvalid);
+ }
+
+ var fills = new List<FirmamentV2LatticeFillDecl>();
+ foreach (Match match in FillHeaderRegex.Matches(source))
+ {
+ var open = source.IndexOf('{', match.Index);
+ var close = FindMatchingBrace(source, open);
+ if (close < 0) { diagnostics.Add(FillRegionInvalid); continue; }
+ var body = source[(open + 1)..close];
+ if (!regions.TryGetValue(match.Groups["name"].Value, out var region)) { diagnostics.Add(FillUnknownRegion); continue; }
+ var host = Regex.Match(body, @"\bhost\s*:\s*(?<v>[A-Za-z_][A-Za-z0-9_]*)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ if (!host.Success || !solids.ContainsKey(host.Groups["v"].Value)) { diagnostics.Add(FillUnknownHost); continue; }
+ var pattern = Regex.Match(body, @"\bpattern\s*:\s*(?<v>[A-Za-z_][A-Za-z0-9_]*)\s*\{", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ if (!pattern.Success || !string.Equals(pattern.Groups["v"].Value, "OctetTruss", StringComparison.OrdinalIgnoreCase)) { diagnostics.Add(FillUnsupportedPattern); continue; }
+ var patternOpen = body.IndexOf('{', pattern.Index);
+ var patternClose = FindMatchingBrace(body, patternOpen);
+ var patternBody = patternClose < 0 ? string.Empty : body[(patternOpen + 1)..patternClose];
+ if (!TryReadLatticePositive(patternBody, "cellSize", out var cellSize)) { diagnostics.Add(FillInvalidCellSize); continue; }
+ if (!TryReadLatticePositive(patternBody, "strutRadius", out var strutRadius)) { diagnostics.Add(FillInvalidStrutRadius); continue; }
+ var policy = Regex.Match(body, @"\bboundaryPolicy\s*:\s*(?<v>[A-Za-z_][A-Za-z0-9_]*)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ if (!policy.Success || !string.Equals(policy.Groups["v"].Value, "Bond", StringComparison.OrdinalIgnoreCase)) { diagnostics.Add(FillUnsupportedBoundaryPolicy); continue; }
+ fills.Add(new(match.Groups["name"].Value, host.Groups["v"].Value, region, "OctetTruss", cellSize, strutRadius, "Bond", new(match.Index, close - match.Index + 1)));
+ }
+ if (fills.Count > 1) diagnostics.Add(FillMultipleUnsupported);
+ return fills;
+ }
+
+ private static bool TryReadLatticePositive(string body, string name, out double value)
+ {
+ value = 0d;
+ var match = Regex.Match(body, $@"\b{name}\s*:\s*(?<v>[-+0-9.eE]+)\s*(?:mm)?", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
+ return match.Success && double.TryParse(match.Groups["v"].Value, NumberStyles.Float, CultureInfo.InvariantCulture, out value) && double.IsFinite(value) && value > 0d;
+ }
+
+ private static bool TryParseLatticeTriple(string text, bool positive, out IReadOnlyList<double> values)
+ {
+ var parts = text.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
+ var parsed = new List<double>(3);
+ foreach (var part in parts)
+ {
+ var raw = part.EndsWith("mm", StringComparison.OrdinalIgnoreCase) ? part[..^2] : part;
+ if (!double.TryParse(raw, NumberStyles.Float, CultureInfo.InvariantCulture, out var value) || !double.IsFinite(value) || (positive && value <= 0d)) { values = []; return false; }
+ parsed.Add(value);
+ }
+ values = parsed;
+ return parsed.Count == 3;
+ }
+
private static IReadOnlyList<FirmamentV2RecognizedRegion> ParseRecognizedRegions(string source, Dictionary<string, FirmamentV2SolidBinding> solids, List<string> diagnostics)
{
@@ -1620,7 +1704,7 @@ public static class FirmamentV2Parser
}
private static bool ContainsUnsupportedConstruct(string source) =>
- Regex.IsMatch(source, @"\b(PMI|where|add|shell|fillet|chamfer|regions|profile|pattern)\b|<\s*Process\s*>", RegexOptions.CultureInvariant);
+ Regex.IsMatch(source, @"\b(PMI|where|add|shell|fillet|chamfer|regions|profile)\b|<\s*Process\s*>", RegexOptions.CultureInvariant);
private static bool ContainsRawBackendId(string source) =>
Regex.IsMatch(source, @"\b(brep|backend|coedge)\s*\.|STEP\s*#", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
diff --git a/docs/air/air-lattice-fill-m9.md b/docs/air/air-lattice-fill-m9.md
new file mode 100644
index 00000000..2741aace
--- /dev/null
+++ b/docs/air/air-lattice-fill-m9.md
@@ -0,0 +1,66 @@
+# AIR-LATTICE-FILL-M9 — explicit-region lattice-fill foundation
+
+> Aetheris does not guess which material is expendable.
+>
+> The FillRegion is an explicit engineering authority boundary.
+
+M9 introduces the semantic foundation for a production lattice-fill route. It is deliberately bounded to one history-known, axis-aligned Box host with one Z-axis through-hole, one closed axis-aligned box FillRegion, `OctetTruss`, and `BoundaryPolicy: Bond`. Imported STEP hosts are **deferred**: this change does not claim imported-body lightweighting.
+
+## Firmament V2 source shape
+
+The existing lower-case V2 parser convention is used (length units are accepted in the Fill declarations):
+
+```firmament
+model LightweightBracket {
+ units mm
+ template<Additive> PolymerPrototype {
+ concept MinimumWallThickness: 1.2mm
+ concept MinimumStrutDiameter: 1.0mm
+ concept MinimumBondDiameter: 1.2mm
+ concept MinimumHoleDiameter: 2.0mm
+ }
+ solid Body: Box { size: [80, 50, 20] }
+ modify Body {
+ hole<Shaft> MountHole { on: face(+Z) center: [0, 0] diameter: 12 end: throughAll }
+ }
+ region LightweightCore {
+ box { size: [24mm, 24mm, 16mm] center: [22mm, 0mm, 0mm] }
+ }
+ fill LightweightCore {
+ host: Body
+ pattern: OctetTruss { cellSize: 8mm strutRadius: 0.8mm }
+ boundaryPolicy: Bond
+ }
+}
+```
+
+The 24 × 24 × 16 mm region is intentional: the prompt's 48 × 26 × 12 example cannot be both fully internal and clear of a centered Ø12 hole in the stated 80 × 50 host. This admitted fixture has a three-by-three-by-two cell domain, 2 mm top/bottom retained walls, and a 4 mm direct clearance to the hole.
+
+## AIR and construction contract
+
+`LatticeFillFeature` preserves host identity, explicit region bounds, `OctetTruss` parameters, `Bond`, typed additive context, and source provenance. `LatticeFillM9.Construct` turns that into `LatticeFillConstruction` with deterministic cell indices, shared node instances, canonical-endpoint member instances, boundary incidents, and bond witnesses.
+
+An octet cell contains eight corner nodes and six face-centre nodes. Each face-centre connects to its four face corners. Shared corners and shared face-centres are deduplicated from coordinates/roles; members are deduplicated by lexically canonical endpoint pairs. The finite cell domain is the floor of each declared region extent divided by cell size. This is mathematical graph generation, not source-level repetition.
+
+Every boundary incident produces a `LatticeAttachmentWitness` with member identity, planar boundary name, intersection/node point, contact diameter (`2 × StrutRadius`), and retained-host owner. The chosen node-junction contract is a future exact spherical junction with radius at least the strut radius; it is not a claim of G1 blending.
+
+## Additive DFM
+
+The parser captures `Template<Additive>` concepts. Before emission the M9 validator requires and checks:
+
+- `MinimumWallThickness` against directly derived Box/FillRegion clearance;
+- `MinimumStrutDiameter` against `2 × StrutRadius`;
+- `MinimumBondDiameter` against terminal contact diameter;
+- `MinimumHoleDiameter` against the semantic through-hole.
+
+The diagnostics are `additive-minimum-wall-thickness-violation`, `additive-minimum-strut-diameter-violation`, `additive-minimum-bond-diameter-violation`, and `additive-minimum-hole-diameter-violation`, with template, feature, actual, and required values where applicable. Region parsing additionally rejects missing/invalid boxes, unknown regions/hosts, non-positive cell size and radius, unsupported patterns/policies, and more than one fill.
+
+## Current authoritative-BRep boundary — honest status
+
+The exact graph and DFM contracts are implemented and tested. The final `LatticeFilledBodyBRepPlan` and STEP result are **not** implemented, so no hash, size, topology count, material volume, mass-reduction percentage, or M8 verification evidence is reported. The build/export path deliberately returns `lattice-fill-brep-plan-not-materialized` after DFM validation rather than exporting the unmodified host.
+
+The concrete blocker is the current single-body BRep pipeline: it cannot construct one valid authoritative topology containing (1) the retained Box material around an internal rectangular cavity, (2) the pre-existing cylindrical through-hole, and (3) exact analytic cylindrical struts, spherical nodes, and planar bonded attachments. The current STEP exporter only accepts one BRep body; exporting independently built lattice solids would violate the required final material semantics. This is why no automatic skinning, Boolean spray, mesh/SDF extraction, or assembly workaround is claimed.
+
+## Deferred work
+
+The next convergent implementation should add one plan-driven exact merge family for this bounded topology: retained Box-minus-rectangular-region plus one preserved Z through-hole, then analytic cylinder/sphere/bond attachments merged into one closed shell with explicit face/edge/loop ownership. Only after that should the compiler emit a STEP artifact and run M8 independent volume, topology, serialization, and external CAD checks.
diff --git a/fixtures/FirmamentV2/Lattice/future/explicit-octet-fill-m9.firmament b/fixtures/FirmamentV2/Lattice/future/explicit-octet-fill-m9.firmament
new file mode 100644
index 00000000..6ea510ee
--- /dev/null
+++ b/fixtures/FirmamentV2/Lattice/future/explicit-octet-fill-m9.firmament
@@ -0,0 +1,25 @@
+model LightweightBracket {
+ units mm
+
+ template<Additive> PolymerPrototype {
+ concept MinimumWallThickness: 1.2mm
+ concept MinimumStrutDiameter: 1.0mm
+ concept MinimumBondDiameter: 1.2mm
+ concept MinimumHoleDiameter: 2.0mm
+ }
+
+ solid Body: Box { size: [80, 50, 20] }
+ modify Body {
+ hole<Shaft> MountHole { on: face(+Z) center: [0, 0] diameter: 12 end: throughAll }
+ }
+
+ region LightweightCore {
+ box { size: [24mm, 24mm, 16mm] center: [22mm, 0mm, 0mm] }
+ }
+
+ fill LightweightCore {
+ host: Body
+ pattern: OctetTruss { cellSize: 8mm strutRadius: 0.8mm }
+ boundaryPolicy: Bond
+ }
+}