Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

CTC-01: shape-based outline, templated notch deltas, traced lugs

Claudeec910b90ceab
diff --git a/Aetheris.CLI.Tests/DrilledHoleCliTests.cs b/Aetheris.CLI.Tests/DrilledHoleCliTests.cs
index 2d6e5a26..b0036893 100644
--- a/Aetheris.CLI.Tests/DrilledHoleCliTests.cs
+++ b/Aetheris.CLI.Tests/DrilledHoleCliTests.cs
@@ -50,6 +50,16 @@ public sealed class DrilledHoleCliTests
Assert.Equal(expected.OrderBy(a => a).ToArray(), apexes);
}
+ [Fact]
+ public void ANamedProfileEdgeSweepsTheDrillPlane()
+ {
+ var body = BuildAndImport("fixtures/Regression/Hole/valid/profile-edge-plane-drill.firmament");
+ var cone = Assert.Single(Cones(body));
+ Assert.Equal(10d, cone.Apex.X, 9);
+ Assert.Equal(-15d + 10d + Tip(2d, 118d), cone.Apex.Y, 9);
+ Assert.Equal(-4d, cone.Apex.Z, 9);
+ }
+
[Theory]
[InlineData("drill-envelopes-touch.firmament", "SectionStackBlindDrillToolEnvelopesIntersect")]
[InlineData("plane-drill-flat.firmament", "a flat floor from a plane is not supported")]
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
index a28ac2c7..33ae2de4 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
@@ -541,29 +541,54 @@ public static class ProfileAuthoringParser
};
/// <summary>
- /// The plane a straight Path step sweeps when its closed Path is extruded along the sketch normal, written as
- /// the explicit Concept plane an author would declare: origin at the foot of the sketch origin on the step's line,
- /// normal pointing into the material (to the left of a counter-clockwise loop), up along +Z. It is computed from
- /// source alone, so the plane moves with the Path and never refers to a body face.
+ /// The plane a straight Path step, or a named straight outer edge of a traced Profile, sweeps when extruded along
+ /// the sketch normal, written as the explicit Concept plane an author would declare: origin at the foot of the
+ /// sketch origin on the edge's line, normal pointing into the material (to the left of a counter-clockwise loop),
+ /// up along +Z. It is computed from source alone, so the plane moves with the outline and never refers to a body
+ /// face.
/// </summary>
internal static bool TryDerivePathStepPlane(string source, string path, string step, out ConceptIrPlaneValue? plane, out string? diagnostic)
{
plane = null; diagnostic = null;
var diagnostics = new List<string>();
var paths = BindPaths(source, new(StringComparer.Ordinal), new(StringComparer.Ordinal), diagnostics);
- if (!paths.TryGetValue(path, out var bound)) { diagnostic = $"path-step-plane-path-unknown:{path}.{step}: '{path}' is not a Path in this model."; return false; }
- var boundStep = bound.Steps.FirstOrDefault(s => s.Name == step);
- if (boundStep is null) { diagnostic = $"path-step-plane-step-unknown:{path}.{step}: Path '{path}' has no step '{step}'."; return false; }
- if (boundStep.Curves is not [LineArcLineSegment2D line]) { diagnostic = $"path-step-plane-not-straight:{path}.{step}: only a straight Line step sweeps a plane."; return false; }
- var curves = bound.Steps.SelectMany(s => s.Curves).ToArray();
- if (!IsClosed(curves)) { diagnostic = $"path-step-plane-path-open:{path}.{step}: the Path must be closed for its inside to be known."; return false; }
+ if (paths.TryGetValue(path, out var bound))
+ {
+ var boundStep = bound.Steps.FirstOrDefault(s => s.Name == step);
+ if (boundStep is null) { diagnostic = $"path-step-plane-step-unknown:{path}.{step}: Path '{path}' has no step '{step}'."; return false; }
+ if (boundStep.Curves is not [LineArcLineSegment2D pathLine]) { diagnostic = $"path-step-plane-not-straight:{path}.{step}: only a straight Line step sweeps a plane."; return false; }
+ var pathCurves = bound.Steps.SelectMany(s => s.Curves).ToArray();
+ if (!IsClosed(pathCurves)) { diagnostic = $"path-step-plane-path-open:{path}.{step}: the Path must be closed for its inside to be known."; return false; }
+ plane = SweptPlane(pathLine, SignedArea(pathCurves) > 0, $"Path step {path}.{step}", $"path-step:{path}.{step}");
+ return true;
+ }
+
+ // A named straight edge of a closed Profile's outer loop (for example one traced with `as Front`)
+ // sweeps the same plane; the Profile must lie in the XY sketch, as an extruded Path does.
+ var profiles = BindPathDerivedProfiles(source, diagnostics);
+ if (!profiles.TryGetValue(path, out var profile))
+ { diagnostic = $"path-step-plane-path-unknown:{path}.{step}: '{path}' is not a Path or a traced Profile in this model."; return false; }
+ if (profile.ConstructionPlane is { } frame && frame != ConstructionPlane.WorldXY)
+ { diagnostic = $"path-step-plane-profile-not-xy:{path}.{step}: only a Profile in the XY sketch sweeps a plane along +Z."; return false; }
+ var outer = profile.Loops.FirstOrDefault(l => l.IsOuter);
+ var segment = outer?.Segments.FirstOrDefault(s => s.Name == step);
+ if (outer is null || segment is null)
+ { diagnostic = $"path-step-plane-step-unknown:{path}.{step}: Profile '{path}' has no outer-loop edge named '{step}'."; return false; }
+ if (segment.Geometry is not LineArcLineSegment2D edgeLine) { diagnostic = $"path-step-plane-not-straight:{path}.{step}: only a straight edge sweeps a plane."; return false; }
+ plane = SweptPlane(edgeLine, SignedArea(outer.Segments.Select(s => s.Geometry)) > 0, $"Profile edge {path}.{step}", $"profile-edge:{path}.{step}");
+ return true;
+ }
+
+ /// <summary>The plane a straight edge sweeps along +Z: origin at the foot of the sketch origin on the edge's line,
+ /// normal into the material (left of a counter-clockwise loop), up +Z.</summary>
+ private static ConceptIrPlaneValue SweptPlane(LineArcLineSegment2D line, bool counterClockwise, string provenance, string stableId)
+ {
var dx = line.End.X - line.Start.X; var dy = line.End.Y - line.Start.Y; var length = Math.Sqrt(dx * dx + dy * dy);
dx /= length; dy /= length;
- var inward = SignedArea(curves) > 0 ? (X: -dy, Y: dx) : (X: dy, Y: -dx);
+ var inward = counterClockwise ? (X: -dy, Y: dx) : (X: dy, Y: -dx);
var along = -(line.Start.X * dx + line.Start.Y * dy);
var foot = (X: line.Start.X + dx * along, Y: line.Start.Y + dy * along);
- plane = new ConceptIrPlaneValue($"path-step:{path}.{step}", new(foot.X, foot.Y, 0d), new(inward.X, inward.Y, 0d), $"derived from Path step {path}.{step}", new(0d, 0d, 1d));
- return true;
+ return new ConceptIrPlaneValue(stableId, new(foot.X, foot.Y, 0d), new(inward.X, inward.Y, 0d), $"derived from {provenance}", new(0d, 0d, 1d));
}
private static IReadOnlyDictionary<string, BoundPath> BindPaths(string source, Dictionary<string, (double X, double Y)> points, Dictionary<string, LineArcProfileCurve2D> guides, List<string> diagnostics)
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileBoundaryAuthoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileBoundaryAuthoring.cs
index 30f81dc2..d77b6337 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileBoundaryAuthoring.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileBoundaryAuthoring.cs
@@ -179,7 +179,8 @@ internal static class ProfileBoundaryAuthoring
{
if (!ids.Add(apply)) { diagnostics.Add($"profile-edit-duplicate-name:{name}.{apply}"); continue; }
var matches = deltas.Deltas.Where(d => d.Delta.Name == apply).ToArray();
- if (matches.Length != 1) { diagnostics.Add($"profile-edit-apply-unresolved:{apply}"); continue; }
+ if (matches.Length == 0) { diagnostics.Add($"profile-edit-apply-unresolved:{apply}: no ProfileDelta named '{apply}' is declared."); continue; }
+ if (matches.Length > 1) { diagnostics.Add($"profile-edit-apply-ambiguous:{apply}: {matches.Length} ProfileDelta declarations are named '{apply}'; give each a unique name."); continue; }
var delta = matches[0];
var index = FindMember(segments, delta.OwnerPath, owner, localFrom);
if (index < 0 || segments[index].Geometry is not LineArcLineSegment2D line)
diff --git a/docs/development/reports/2026-11/CTC-01-DECOMPILE.md b/docs/development/reports/2026-11/CTC-01-DECOMPILE.md
index 3d1155e3..ad6e0aa1 100644
--- a/docs/development/reports/2026-11/CTC-01-DECOMPILE.md
+++ b/docs/development/reports/2026-11/CTC-01-DECOMPILE.md
@@ -138,6 +138,40 @@ foot R5.
`analyze compare --shape` also skips rays with an odd crossing count, near cone apexes and seams, on both
sides. It used to read them as empty, which showed about 1100 mm³ of false difference per drill tip.
+## Follow-up: shape-based outline, delta notches, traced lugs
+
+The fixture no longer turtle-paths the outline. The model now follows the part's own structure:
+- **Outline:** two `RoundedRect2` ends (R50) and a `Rect2` bridge in a Concept Struct, joined by four R25
+ waist `Arc2`s, with the back-right corner replaced by a chamfer `Line2`, all traced with `|>`.
+- **Notches:** `Template<Center, Owner> ProfileDelta`s for the V-notch and the slot notch, applied four times
+ to the traced `Front` and `Back` edges.
+- **Lugs:** traced from the end shapes themselves, so corner radii and the chamfer are stated once; three are
+ mirrors of one.
+- **Side drills:** `from: Plate.Front`. Planes can now come from a named straight edge of a traced Profile,
+ as well as from a Path step.
+
+The result is identical to the turtle version: 75/85 carriers, 0 extra, IoU 0.9989. Against the turtle plate
+alone, the shape-built plate matches all 37 carriers at IoU 1.0.
+
+What this showed about the language:
+
+| Finding | Effect |
+| --- | --- |
+| The V-notch tip **is** expressible: `Diagonal` flanks plus concave `Round` transitions give the exact R10 tip | Corrects item 3 above |
+| `Round` needs `Concave: true` for both the V tip and the slot floor corners; the wrong value builds a plausible wrong outline with no diagnostic | Only `compare --shape` caught it; add a check that a round is tangent to its neighbours, or a clearer default |
+| Each waist needs 3 `Point2`s and an `Arc2` (16 lines for four R25 waists) | A corner-round stage in traced loops (`|> Round 25mm`, filleting the junction of the stages either side) would replace them; it would also give Path vertex rounding |
+| `RoundedRect2` publishes no tangent points; they exist only as internal `Name_Path.Step.End` names | Publish them (for example `LeftEnd.Right.Start`); four `Point2`s here only restate them |
+| A partial span needs both `from` and `to`; `edge to P` alone is a stage-type error | `to`-only continuing from the current point would read naturally |
+| Edges from two shapes collide (`Bottom`, `Left`, ...), so every stage needs `as` | Acceptable; the error names the collision |
+| A delta's `CenteredAt` is a distance from the edge's start, not a coordinate | Notch centres become 115/335/75/375 mm, not x = ±110/±150 |
+| Template arguments take scalars but not inline record literals (`P: Spec { Center: 115mm }`) | Use scalar parameters or a named Static |
+| A `Feature` cannot return `Add`, and `Boss` only grows up from a top | No reusable lug/foot feature under a plate; lug reuse happens at Profile level |
+| Two `ProfileDelta`s with one name reported `apply-unresolved` | Now reported as `profile-edit-apply-ambiguous`, naming the count |
+
+`Template<…> Feature` is not a form. Features are already parameterized (`Feature X(params) -> Kind`); Templates
+specialize Struct/Model/Concept Struct/Panel/SheetMetal/Profile/ProfileDelta, plus the separate record-array
+feature-template form used by `Pattern … over`. For CTC-01 the useful reuse was `Template<…> ProfileDelta`.
+
## Verdict
Meaningful progression. CTC-01 builds with every feature Firmament can express, and the comparison
diff --git a/docs/public/reference/language/solids-and-features.md b/docs/public/reference/language/solids-and-features.md
index a15c1587..7f7be45b 100644
--- a/docs/public/reference/language/solids-and-features.md
+++ b/docs/public/reference/language/solids-and-features.md
@@ -123,7 +123,9 @@ reference.
`from` replaces `on` to drill from a plane instead of a host face. Name an
explicit `Construction Plane` (Box and Compose bodies), or, on a Compose body, a
-straight step of a closed Path, normally the Path its Profile is traced from:
+straight step of a closed Path or a named straight edge of a traced Profile's
+outer loop (for example one traced with `as Front`), normally the outline the
+body is built from:
```firmament
Hole<Shaft> SideDrill { from: Outline.FrontMiddle; center: Point2(-30mm, -25mm); diameter: 20mm; end: Blind 45mm }
@@ -131,7 +133,7 @@ Mirrored Feature SideDrillMirror from SideDrill { across: CenterPlane }
```
`Outline.FrontMiddle` is shorthand for the plane that step sweeps when the Path is
-extruded. It is computed from the Path alone, so it moves when the Path changes
+extruded; `Plate.Front` is the same for a Profile edge. It is computed from the Path alone, so it moves when the Path changes
and never refers to a body face. Written out, it is
`Plane { origin: <foot of the sketch origin on the step's line>; normal: <into the material>; up: [0, 0, 1] }`.
`center` is in that plane's frame: v runs along the extrusion (+Z), the hole runs
@@ -154,7 +156,8 @@ Rules:
envelope through the point must stay in material, and envelopes of different
drills must not touch.
- A Path-step plane needs a straight `Line` step of a closed Path in the XY
- sketch.
+ sketch; a Profile-edge plane needs a straight, named outer-loop edge of a
+ Profile in the XY sketch.
In a Compose body, all three variants are supported on the `+Z` support with
`end: ThroughAll`:
diff --git a/fixtures/Regression/Decompile/ctc-01.firmament b/fixtures/Regression/Decompile/ctc-01.firmament
index 4c8bd991..8f20322d 100644
--- a/fixtures/Regression/Decompile/ctc-01.firmament
+++ b/fixtures/Regression/Decompile/ctc-01.firmament
@@ -1,6 +1,6 @@
// NIST CTC-01 (testdata/step242/nist/CTC/nist_ctc_01_asme1_ap242-e1.stp) reconstructed as design intent:
-// a dog-bone plate with four corner lugs underneath, a hexagonal boss on top, through holes and slots, and
-// notches in the long edges. Compare against the original with
+// a dog-bone plate (two rounded ends and a bridge) with four lugs underneath, a hexagonal boss on top,
+// through holes, slots, side drills, and notches in the long edges. Compare against the original with
// aetheris analyze compare <original.stp> <this.step> --shape
// Not expressible yet, and therefore absent here:
// - the R5 fillet at the hex boss's foot (a second finish on the body, and a concave boss foot);
@@ -16,93 +16,153 @@ Model Ctc01 {
Construction Plane CenterPlane { Trace: Datums.Center }
Construction Plane MidPlane { Trace: Datums.Midline }
- // V-notch: 60° included angle, R10 tip whose centre is 30 mm in from the edge. Lengths follow from the angle.
+ // A 60° V-notch with an R10 tip whose centre is 30 mm in from the edge. The flanks meet the tip circle
+ // 35 mm in; flank and tip runs follow from the angle.
Static vTip: Length = 10mm
- Static vTipCentre: Length = 30mm
- Static vHalfMouth: Length = (vTipCentre + 2 * vTip) / Tan(60deg)
- Static vFlank: Length = (vTipCentre + vTip / 2) * 2 / Tan(60deg)
- Static vX: Length = 110mm
- Static chamfer: Length = 50mm * Sqrt(2)
+ Static vTipDepth: Length = 30mm + vTip
+ Static vTangentDepth: Length = 30mm + vTip * Sin(30deg)
+ Static vTipRun: Length = vTip * Cos(30deg)
+ Static vFlankRun: Length = vTangentDepth / Tan(60deg)
+ Template<Center: Length, Owner: ProfilePath>
+ ProfileDelta VNotch {
+ On: Owner
+ Anchor: CenteredAt Center
+ Side: Inward
+ Level Edge { Offset: 0mm; }
+ Level Tangent { Offset: vTangentDepth; }
+ Level Tip { Offset: vTipDepth; }
+ Transition FlankIn { Kind: Diagonal; Run: vFlankRun; To: Tangent; }
+ Transition TipIn { Kind: Round; Run: vTipRun; To: Tip; Radius: vTip; Concave: true; }
+ Transition TipOut { Kind: Round; Run: vTipRun; To: Tangent; Radius: vTip; Concave: true; }
+ Transition FlankOut { Kind: Diagonal; Run: vFlankRun; To: Edge; }
+ }
- // Plate silhouette, counterclockwise from the bottom-left lug. The long edges carry two 60° V-notches
- // (y = -125, R10 tips at x = ±110) and two rectangular notches (y = +125, 85 wide, 25 deep, R10 corners).
- Path Outline {
- start: Point2(-350mm, -225mm)
- heading: 0deg
- Line LugFootLeft { length: 50mm }
- Arc LugCornerLeft { radius: 50mm; turn: 90deg }
- Line LugInnerLeft { length: 25mm }
- Arc WaistLeft { radius: 25mm; turn: -90deg }
- Line FrontLeft { length: 115mm - vHalfMouth }
- Line VLeftIn { turn: 60deg; length: vFlank }
- Arc VLeftTip { radius: 10mm; turn: -120deg }
- Line VLeftOut { length: vFlank }
- Line FrontMiddle { turn: 60deg; length: 2 * (vX - vHalfMouth) }
- Line VRightIn { turn: 60deg; length: vFlank }
- Arc VRightTip { radius: 10mm; turn: -120deg }
- Line VRightOut { length: vFlank }
- Line FrontRight { turn: 60deg; length: 115mm - vHalfMouth }
- Arc WaistFrontRight { radius: 25mm; turn: -90deg }
- Line LugInnerFrontRight { length: 25mm }
- Arc LugCornerFrontRight { radius: 50mm; turn: 90deg }
- Line LugFootFrontRight { length: 50mm }
- Arc LugOuterFrontRight { radius: 50mm; turn: 90deg }
- Line EndRight { length: 350mm }
- Line Chamfer { turn: 45deg; length: chamfer }
- Line LugFootBackRight { turn: 45deg; length: 50mm }
- Arc LugCornerBackRight { radius: 50mm; turn: 90deg }
- Line LugInnerBackRight { length: 25mm }
- Arc WaistBackRight { radius: 25mm; turn: -90deg }
- Line BackRight { length: 32.5mm }
- Line NotchRightIn { turn: 90deg; length: 15mm }
- Arc NotchRightCornerA { radius: 10mm; turn: -90deg }
- Line NotchRightFloor { length: 65mm }
- Arc NotchRightCornerB { radius: 10mm; turn: -90deg }
- Line NotchRightOut { length: 15mm }
- Line BackMiddle { turn: 90deg; length: 215mm }
- Line NotchLeftIn { turn: 90deg; length: 15mm }
- Arc NotchLeftCornerA { radius: 10mm; turn: -90deg }
- Line NotchLeftFloor { length: 65mm }
- Arc NotchLeftCornerB { radius: 10mm; turn: -90deg }
- Line NotchLeftOut { length: 15mm }
- Line BackLeft { turn: 90deg; length: 32.5mm }
- Arc WaistBackLeft { radius: 25mm; turn: -90deg }
- Line LugInnerBackLeft { length: 25mm }
- Arc LugCornerBackLeft { radius: 50mm; turn: 90deg }
- Line LugFootBackLeft { length: 50mm }
- Arc LugOuterBackLeft { radius: 50mm; turn: 90deg }
- Line EndLeft { length: 350mm }
- Arc LugOuterFrontLeft { radius: 50mm; turn: 90deg }
- Close Done
+ // An 85 mm wide, 25 mm deep notch with R10 corners at its floor.
+ Template<Center: Length, Owner: ProfilePath>
+ ProfileDelta SlotNotch {
+ On: Owner
+ Anchor: CenteredAt Center
+ Side: Inward
+ Level Edge { Offset: 0mm; }
+ Level Shoulder { Offset: 15mm; }
+ Level Floor { Offset: 25mm; }
+ Transition WallIn { Kind: Step; To: Shoulder; }
+ Transition CornerIn { Kind: Round; Run: 10mm; To: Floor; Radius: 10mm; Concave: true; }
+ Span Bottom { Run: 65mm; At: Floor; }
+ Transition CornerOut { Kind: Round; Run: 10mm; To: Shoulder; Radius: 10mm; Concave: true; }
+ Transition WallOut { Kind: Step; To: Edge; }
}
- Profile Plate from Outline
- // A lug below the plate: the end's footprint beyond the waist, rounded on its outer edge.
- Path LugPath {
- start: Point2(-400mm, 125mm)
- heading: 0deg
- Line Inner { length: 150mm }
- Line Side { turn: 90deg; length: 50mm }
- Arc InnerCorner { radius: 50mm; turn: 90deg }
- Line Foot { length: 50mm }
- Arc OuterCorner { radius: 50mm; turn: 90deg }
- Close Outer
+ Concept Struct Layout on XY {
+ RoundedRect2 LeftEnd { center: [-325mm, 0mm]; size: [150mm, 450mm]; radius: 50mm }
+ RoundedRect2 RightEnd { center: [325mm, 0mm]; size: [150mm, 450mm]; radius: 50mm }
+ Rect2 Bridge { center: [0mm, 0mm]; size: [500mm, 250mm] }
+
+ // Waists: R25 arcs from an end's inner side to the bridge edge.
+ Point2 FrontLeftWaistCenter { position: [-225mm, -150mm] }
+ Point2 FrontLeftWaistEnd { position: [-250mm, -150mm] }
+ Point2 FrontLeftWaistBridge { position: [-225mm, -125mm] }
+ Arc2 FrontLeftWaist { center: FrontLeftWaistCenter; from: FrontLeftWaistBridge; to: FrontLeftWaistEnd }
+ Point2 FrontRightWaistCenter { position: [225mm, -150mm] }
+ Point2 FrontRightWaistEnd { position: [250mm, -150mm] }
+ Point2 FrontRightWaistBridge { position: [225mm, -125mm] }
+ Arc2 FrontRightWaist { center: FrontRightWaistCenter; from: FrontRightWaistEnd; to: FrontRightWaistBridge }
+ Point2 BackRightWaistCenter { position: [225mm, 150mm] }
+ Point2 BackRightWaistEnd { position: [250mm, 150mm] }
+ Point2 BackRightWaistBridge { position: [225mm, 125mm] }
+ Arc2 BackRightWaist { center: BackRightWaistCenter; from: BackRightWaistBridge; to: BackRightWaistEnd }
+ Point2 BackLeftWaistCenter { position: [-225mm, 150mm] }
+ Point2 BackLeftWaistEnd { position: [-250mm, 150mm] }
+ Point2 BackLeftWaistBridge { position: [-225mm, 125mm] }
+ Arc2 BackLeftWaist { center: BackLeftWaistCenter; from: BackLeftWaistEnd; to: BackLeftWaistBridge }
+
+ // Where each end's inner straight side meets its R50 corners (RoundedRect2 publishes no tangent points).
+ Point2 LeftEndInnerFront { position: [-250mm, -175mm] }
+ Point2 LeftEndInnerBack { position: [-250mm, 175mm] }
+ Point2 RightEndInnerFront { position: [250mm, -175mm] }
+ Point2 RightEndInnerBack { position: [250mm, 175mm] }
+
+ // The back-right corner is cut at 45 degrees between the right end's straight sides.
+ Point2 ChamferStart { position: [400mm, 175mm] }
+ Point2 ChamferEnd { position: [350mm, 225mm] }
+ Line2 Chamfer { from: ChamferStart; to: ChamferEnd }
+
+ // Lugs hang below each end where it overhangs the bridge, cut off along the bridge's long edges.
+ Point2 LeftEndOuterBack { position: [-400mm, 175mm] }
+ Point2 LeftLugCutBack { position: [-400mm, 125mm] }
+ Line2 BackLeftLugCut { from: Bridge.TopLeft; to: LeftLugCutBack }
+ Point2 RightLugCutBack { position: [400mm, 125mm] }
+ Line2 BackRightLugCut { from: Bridge.TopRight; to: RightLugCutBack }
}
- Profile LugBackLeft from LugPath
- Mirrored Profile LugFrontLeft from LugBackLeft { across: MidPlane }
- Mirrored Profile LugFrontRight from LugFrontLeft { across: CenterPlane }
- // The back-right lug's outer corner is a 50 mm chamfer, not a radius.
- Path LugChamferedPath {
- start: Point2(250mm, 125mm)
- heading: 0deg
- Line Inner { length: 150mm }
- Line Side { turn: 90deg; length: 50mm }
- Line Chamfer { turn: 45deg; length: chamfer }
- Line Foot { turn: 45deg; length: 50mm }
- Arc InnerCorner { radius: 50mm; turn: 90deg }
- Close Outer
+
+ Profile Plate using Layout {
+ Loop Outer {
+ LeftEnd.Left as LeftOuter
+ |> LeftEnd.BottomLeftCorner as LeftFrontOuterCorner
+ |> LeftEnd.Bottom as LeftFront
+ |> LeftEnd.BottomRightCorner as LeftFrontInnerCorner
+ |> LeftEnd.Right from LeftEndInnerFront to FrontLeftWaistEnd as LeftInnerFront
+ |> FrontLeftWaist
+ |> Bridge.Bottom from FrontLeftWaistBridge to FrontRightWaistBridge as Front
+ |> FrontRightWaist
+ |> RightEnd.Left from FrontRightWaistEnd to RightEndInnerFront as RightInnerFront
+ |> RightEnd.BottomLeftCorner as RightFrontInnerCorner
+ |> RightEnd.Bottom as RightFront
+ |> RightEnd.BottomRightCorner as RightFrontOuterCorner
+ |> RightEnd.Right as RightOuter
+ |> Chamfer
+ |> RightEnd.Top as RightBack
+ |> RightEnd.TopLeftCorner as RightBackInnerCorner
+ |> RightEnd.Left from RightEndInnerBack to BackRightWaistEnd as RightInnerBack
+ |> BackRightWaist
+ |> Bridge.Top from BackRightWaistBridge to BackLeftWaistBridge as Back
+ |> BackLeftWaist
+ |> LeftEnd.Right from BackLeftWaistEnd to LeftEndInnerBack as LeftInnerBack
+ |> LeftEnd.TopRightCorner as LeftBackInnerCorner
+ |> LeftEnd.Top as LeftBack
+ |> LeftEnd.TopLeftCorner as LeftBackOuterCorner
+ |> Close
+ }
+ }
+ // Notches in the bridge's long edges. Front runs from x = -225 to +225 and Back from +225 to -225;
+ // centers are measured from each edge's start.
+ ProfileDelta FrontLeftV = VNotch<Center: 115mm, Owner: Plate.Front>
+ ProfileDelta FrontRightV = VNotch<Center: 335mm, Owner: Plate.Front>
+ ProfileDelta BackRightSlot = SlotNotch<Center: 75mm, Owner: Plate.Back>
+ ProfileDelta BackLeftSlot = SlotNotch<Center: 375mm, Owner: Plate.Back>
+ Profile Notched {
+ From: Plate
+ Apply FrontLeftV
+ Apply FrontRightV
+ Apply BackRightSlot
+ Apply BackLeftSlot
+ }
+
+ // Each lug is traced from its end's own outline, so the end's corners and chamfer are stated once.
+ Profile BackLeftLugOutline using Layout {
+ Loop Outer {
+ LeftEnd.Right from Bridge.TopLeft to LeftEndInnerBack as Inner
+ |> LeftEnd.TopRightCorner as InnerCorner
+ |> LeftEnd.Top as Back
+ |> LeftEnd.TopLeftCorner as OuterCorner
+ |> LeftEnd.Left from LeftEndOuterBack to LeftLugCutBack as Outer
+ |> BackLeftLugCut as Cut
+ |> Close
+ }
+ }
+ Mirrored Profile FrontLeftLugOutline from BackLeftLugOutline { across: MidPlane }
+ Mirrored Profile FrontRightLugOutline from FrontLeftLugOutline { across: CenterPlane }
+ Profile BackRightLugOutline using Layout {
+ Loop Outer {
+ BackRightLugCut as Cut
+ |> RightEnd.Right from RightLugCutBack to ChamferStart as Outer
+ |> Chamfer as Chamfer
+ |> RightEnd.Top as Back
+ |> RightEnd.TopLeftCorner as InnerCorner
+ |> RightEnd.Left from RightEndInnerBack to Bridge.TopRight as Inner
+ |> Close
+ }
}
- Profile LugBackRight from LugChamferedPath
Profile HexBoss = RegularPolygon2<6> { center: [0mm, 0mm]; acrossFlats: 100mm; rotation: 30deg }
Profile Obround = Slot2 { center: [-285mm, 0mm]; length: 120mm; width: 40mm }
@@ -110,11 +170,11 @@ Model Ctc01 {
Struct Part {
Compose Body {
- Base PlateStock { profile: Plate; from: -50mm; to: 0mm; role: Stock }
- Add BackLeftLug { profile: LugBackLeft; from: -100mm; to: -50mm; role: Pad }
- Add FrontLeftLug { profile: LugFrontLeft; from: -100mm; to: -50mm; role: Pad }
- Add FrontRightLug { profile: LugFrontRight; from: -100mm; to: -50mm; role: Pad }
- Add BackRightLug { profile: LugBackRight; from: -100mm; to: -50mm; role: Pad }
+ Base PlateStock { profile: Notched; from: -50mm; to: 0mm; role: Stock }
+ Add BackLeftLug { profile: BackLeftLugOutline; from: -100mm; to: -50mm; role: Pad }
+ Add FrontLeftLug { profile: FrontLeftLugOutline; from: -100mm; to: -50mm; role: Pad }
+ Add FrontRightLug { profile: FrontRightLugOutline; from: -100mm; to: -50mm; role: Pad }
+ Add BackRightLug { profile: BackRightLugOutline; from: -100mm; to: -50mm; role: Pad }
Boss Hex { on: Top; profile: HexBoss; height: 50mm }
Pocket ObroundSlot { on: Top; profile: Obround; end: ThroughAll }
Pocket RectWindow { on: Top; profile: Window; end: ThroughAll }
@@ -131,8 +191,8 @@ Model Ctc01 {
Mirrored Feature LugHoleFrontLeft from LugHoleBackLeft { across: MidPlane }
Mirrored Feature LugHoleFrontRight from LugHoleBackRight { across: MidPlane }
// Two Ø20 blind drilled holes into the front face, 45 mm full-diameter depth with the default 118° point.
- // The plane is the one the Outline's FrontMiddle step sweeps; its u axis runs along world -X.
- Hole<Shaft> SideDrillRight { from: Outline.FrontMiddle; center: Point2(-30mm, -25mm); diameter: 20mm; end: Blind 45mm }
+ // The plane is the one the Plate outline's Front edge sweeps; its u axis runs along world -X.
+ Hole<Shaft> SideDrillRight { from: Plate.Front; center: Point2(-30mm, -25mm); diameter: 20mm; end: Blind 45mm }
Mirrored Feature SideDrillLeft from SideDrillRight { across: CenterPlane }
EdgeFinish<Chamfer> HexTop { on: Top; target: HexBoss.Outer; distance: 5mm }
}
diff --git a/fixtures/Regression/Hole/valid/profile-edge-plane-drill.firmament b/fixtures/Regression/Hole/valid/profile-edge-plane-drill.firmament
new file mode 100644
index 00000000..83b6e614
--- /dev/null
+++ b/fixtures/Regression/Hole/valid/profile-edge-plane-drill.firmament
@@ -0,0 +1,21 @@
+// A blind drill from the plane a traced Profile's named edge sweeps. The front edge runs along +X, so the
+// plane's u axis is world -X and v is +Z; the hole enters at x = 10, z = -4 and runs along +Y.
+Model ProfileEdgePlaneDrill {
+ units: mm
+ Concept Struct Layout on XY {
+ Rect2 Blank { center: [0mm, 0mm]; size: [60mm, 30mm] }
+ }
+ Profile Plate using Layout {
+ Loop Outer {
+ Blank.Bottom as Front
+ |> Blank.Right as Right
+ |> Blank.Top as Back
+ |> Blank.Left as Left
+ |> Close
+ }
+ }
+ Compose Body { Base Stock { profile: Plate; from: -8mm; to: 0mm; role: Stock } }
+ Modify Body {
+ Hole<Shaft> Drill { from: Plate.Front; center: Point2(-10mm, -4mm); diameter: 4mm; end: Blind 10mm }
+ }
+}