← back to pin list

4. Lead-in/out + cut-order optimization

kerfmaster pin list · Big capabilities

intentmixedWhat we want to build. Never claimed the present, so it cannot be stale — and must never be read as a description of the code.

Content last changed 2026-08-12 — computed from the item itself, not typed.

Contract — Starts & leads stage

This contract describes a stage we intend to build — it is NOT a description of the code.

takes healed-geometrytopologymaterial-table

makes boundaries-with-starts

fails if A lead crossing geometry; a pierce whose clear air is under the standoff and is not reported; comp side inferred from geometry rather than declared.

Contract last changed 2026-08-06 — computed, not typed. Dated separately from the text above, so neither date can speak for the other.

Once the geometry is clean and bridged, each contour needs a lead, a kerf side, and a place in the cut sequence.

Correction, 2026-08-02: "today the post emits all G41" is false and was probably never true of our output. Counted in the current post: 182 G40, 1 G41, 0 G42 — the same census as the master NC, word for word. The all-G41 file that this line came from was the shop's FIRST DRAFT of the master, which they themselves corrected. Side selection is live in emit._comp_side(); the choice this stage still has to make is which boundaries are comp-on at all, and that is a declaration, not a measurement (item 4b).

Kerf side (G41 vs G42)

Cutter comp offsets the beam half a kerf to one side so the part comes out on-size. The side depends on travel direction and whether it’s an outer boundary (part is outside the cut) or an inner hole (part is inside). The post picks G41/G42 per contour from direction + inside/outside — built, emit._comp_side(): G41 iff (travelled CCW) != (boundary is an outer profile), so the offset always lands on the scrap side. Normalised to the shop convention (holes CCW, outer CW), which is why their programs contain no G42 and neither do ours.

Lead-in / lead-out

Each contour gets a short ramp on and off so the pierce (beam plunge) sits off the finished edge, not on it — the pierce scar must not land on the part. A lead can be a line or an arc; length and style are shop preference. A lead / pierce must never land inside a bridge, tab or slug-tab span.

Cut order

Sequence the contours sensibly — typically inner features / holes before the outer boundary (so the part stays anchored while detail is cut), minimise rapid travel and heat build-up, and respect tabs.

Ordering — corrected 2026-08-03. This paragraph read "this whole stage runs AFTER tabs (item 2b)", which got it wrong twice. Item 2b is bridges, and those do come first. But the slug-retention tab (item 3b) is not fixed before the lead: in emit._choose() the start point, the tab and the lead are chosen together, because the cut starts where the tab lands and where the pierce goes — one decision fixes all three. Picking the flat first and the lead afterwards produced boundaries that pierced with no lead at all. Cut order is planned afterwards, against the start points actually used. A nest-time tab (item 3a) would follow this stage, not precede it.

⚑ Jordan: your lead style + length, pierce practice, and any cut-order rules you follow by habit.

2026-08-12 — the whole stage ran on a NEST for the first time (post_nest.py, a thin runner: read the split stage's nest sheet back with the same chain walk that built it, drop its 48 drawn lead-in marks as annotation, post through the unchanged write_gcode_macrob). TL-1016-61, 48 parts + 239 holes, 287 boundaries, MSO7,0.075: tipping-weighted safe order came back with 3 rapids crossing a held slug (summed moment 0.528), 3 slug tabs / 236 omitted under drop-through, pierce clear-air re-measured from the posted NC at 0.004 in (the writer's internal 8-chord flattening had cried wolf on 254 pierces; true count materially under standoff: 2, both features too narrow to ever give 0.150). KNOWN LIMIT, unchanged: rapids among the final severed outer profiles are not scored against already-cut parts — nest-stage part tabs (3a) do not exist yet, so every severed part sits loose. Build: viewer/builds/036-tl101661-post.

2026-08-12 — G-code audit is now a STANDING GATE (Jordan, ruling), and nc_audit.py is built. MetaCam posted two G42 outers from our own -61 nest DXF (direction kept from the drawing, comp side flipped — geometrically correct, against the shop's G41-only norm; cause unknown his end, “it should not have happened”): “Let's make this a rule … always run a test once you generate gcode compared to the file and look for these anomalies.” nc_audit re-reads the posted NC and checks: M-code structure (M98/M199 per boundary, one M121, M101 flagged as settled-removable), comp side geometrically in scrap AND on norm, tab sanity in both directions (needless sub-drop tab; untabbed over-drop slug with later rapids crossing — the traffic rule, 3b), pierce clear-air from the NC at 0.004 in, and every cut move on the source geometry by exact point-to-arc distance (gate 0.005 in). Wired into post_nest so every generated program self-checks; runs standalone against third-party NCs (that is how it was born).