← back to pin listHealing rules (dirty CAD → clean arcs)
kerfmaster pin list · The spec — what we build to
rulingmixedd11A decision by Aristide or Jordan. True because it was decided; it can be superseded, but it cannot be stale.
Content last changed 2026-08-06 — computed from the item itself, not typed.
Contract — Heal stage
This contract states a decision, not an implementation.
takes raw-geometry
makes healed-geometry
fails if A fit-induced jog anywhere; deviation over the tolerance gate measured against the TRUE source; a native bulge re-fitted; a rule that only works on one file.; a sub-tolerance smoothing pass keyed to feature size rather than to deviation; a smoothing allowance carried as a separate number from the measured end-to-end deviation; a corner rounded when the feature it sits on is NOT inside the operator's tolerance.; one tolerance applied to a whole file where the features have different functions; a default gate defended on a feature whose purpose does not need it.
Contract last changed 2026-08-06 — computed, not typed. Dated separately from the text above, so neither date can speak for the other.
⚠ Known defects
This item's subject has a known defect in the code. Recorded and deliberately NOT fixed — recording a defect is not a licence to fix it. Source: cadmaster/defects.json → cadmaster/KNOWN_DEFECTS.md, not this page — the text below is generated from the register so the two can never disagree.
- D11 — Borderline heal chains are counted, then smoothed with no flag reaching anyone
heal.classify_corners returns true corners AND borderline vertices -- the ones it could not confidently call a corner or an arc. heal() sums them into meta["borderline"] (9 on novi at tol 0.010) but records no locations: meta carries corner_pts and micro_pts and no borderline_pts. The count is printed only by heal.py's own __main__ block and reaches neither board.
Cost today: Nine unreviewed judgement calls per part, invisible.
Verified: 2026-08-03 at 36a55a3. Healed novi at tol 0.010: meta['borderline'] == 9; the only location keys in meta are corner_pts and micro_pts.
Customer ‘dirty’ files explode curves into hundreds of tiny straight LINE segments. Re-fit them into true arcs within tolerance.
- Tolerance: default gate 0.010" for these parts, but real work goes to 0.001" — build to that. Never call a result ‘identical’ unless it’s a true 100% match, measured honestly against the TRUE source (bulges expanded), sampled ~0.001".
- Spike vs sustained at each vertex — a real corner (spike) stays sharp and splits the chain; a coarse arc (sustained) is smoothed to tangent-continuous arcs. Robust test = neighbour consistency, not raw turn size. Flag genuinely borderline chains for a human.
- Jordan’s rule of thumb: mid-arc, favour smoothness over a sharp correction; a straight line turning 90° was meant to be a sharp corner — no correction there.
- A non-tangent jog/kink is a FAIL, even within tolerance. Cap arc acceptance at the arc’s actual max deviation from the source span, not just at vertices. Drop degenerate micro-segments.
- Preserve native DXF arcs (bulges) exactly — don’t re-fit them from points.
- The verifier checks BOTH: within tolerance AND zero fit-induced kinks.
- Solutions must generalise to all files, never be tuned to one part.
Sub-tolerance detail may be smoothed away — Jordan, 2026-08-06 (Q27)
“If we fall within the tolerance then smoothing is acceptable and you can be less verbose about it.” Jordan's reason: on a part this size, detail below the tolerance is invisible to the customer, so reproducing it is not worth the kinks it produces.
- The floor is the tolerance the operator set for the job — 10 thou on the Brazen plate. Not the kerf, not a fixed fraction of the gate. cadmaster proposed 20% of the gate; Jordan: “not that bad, but might be a bit tight.”
- Keyed to the deviation removing the feature causes, never to the feature's own size. Jordan: “Correct.”
- A true source corner may be rounded inside that budget — the one exception to only true source corners stay sharp. cadmaster proposed always keeping the corner; overruled.
- One budget, measured end-to-end. Smoothing and fitting spend the same allowance: what must stay inside the gate is the final best-fit deviation from the true source, which the board already reports. Design target for the smoothing share is half the gate; the measured total binds.
- Absolute at cut size — the same art cut larger keeps detail a small part loses; a rescaled job re-runs the pass.
- Reported briefly: a count and the worst deviation on the shop sheet, no exception list, nothing on the customer sheet.
Measured before asking, on the Brazen plate: all 261 remaining fit-induced kinks sit at a junction with a primitive under 0.005 in (184 under 0.001 in, median 0.0007), so at this floor the whole residue goes. Control: 45% of the 2372 clean junctions also carry a sub-5-thou primitive, so the pass touches about half the file's junctions, not only the 261 that are wrong — which is why the end-to-end measurement, not the count, is the check. Of 2633 healed primitives 1273 (48%) are shorter than the 0.007 kerf and carry 1.85 in of 62.46 in of path.
Not built yet. This records the ruling; the pass itself is the next piece of work.
Tolerance follows the feature's FUNCTION, not the file — Jordan, 2026-08-06
“Let's face it, it is supposed to be read, that's its function. So our eyes would never be able to detect the amount of detail you're trying to assign to it. This is what I'm trying to teach you. Business rule application logic.” Said of the Brazen plate: 5.5 in wide, brush-script type, seen from a foot away — at which nobody can tell 10 thou from 20.
- One file carries several tolerances, and applying one number to all of it is the defect. This plate has three classes on it: the lettering, the four mounting holes, and the outer profile. Only one of them is decorative.
- Derive the gate from what the feature is for — read at a distance, mates with hardware, butts against another part — and let the operator override. Never defend a default number on a feature whose function does not need it. Measuring to a thou is a capability, not an obligation.
- The eye catches discontinuity, not deviation. Nobody holds the original against the finished part, so a smooth error has no reference and vanishes; a kink or flat spot is self-referencing and shows at any tolerance. One arcminute at 12 in is 0.0035 in, and that is the limit for a detectable EDGE, not for an unreferenced smooth error, which is far coarser. This is why the no-kink rule survives the loosening — the two rules measure different things.
What it cost to learn: a full exchange defending 2.06 thou against 2.40 thou, and a 93 degree tangent error living on a 0.0009 in whisker, on decorative type. Both measurements were right and neither mattered.
What the code does today — record, 2026-08-06
heal.smooth_fit_kinks() implements the Q27 ruling. It runs after the fit (and after merge_collinear_lines), on a budget of SMOOTH_SHARE × the operator's gate — gate, never the fit target.
- It touches only junctions
find_jogs calls FIT-INDUCED, so a corner the source actually drew is left alone. Jordan's ruling also permits rounding one of those inside budget; the code deliberately stops short of that half for now. - Each kink is removed by spreading the turn, not by deleting the piece that carries it: the two prims are trimmed back and re-joined by a biarc (
_blend_junction), tangent-continuous at both ends by construction, with both far ends keeping their point AND their tangent so the blend is strictly local. The trim ladder is coarse-to-fine and the first fit that holds wins. - Every blend is accepted only on its measured symmetric deviation from the path it replaces (
_path_dev) being inside budget. Nothing consults the length of anything — that is the ruling. - Measured at gate 0.010, against the same four files: Brazen 261 fit-induced kinks → 8; ex2 2 → 0; ex3 0 → 0; ex4 0 → 0. Primitive count identical on all four (2633 / 1082 / 222 / 212). Worst single blend deviation 0.00051 in against a 0.005 in budget. End-to-end fidelity vs the true source on Brazen unchanged at 2.40 thou (reverse direction 1.69 → 1.61). The loosened budget bought kink removal at no fidelity cost, which is what Jordan's ruling predicted.
- Negative results, recorded so they are not retried. (1) Smoothing the boundary tangent is not the lever: sweeping its trigger at 2/5/10/20/45/90 degrees gave 337/316/287/271/261/261 kinks — every setting worse than doing nothing. (2) Deleting a sub-budget whisker and running its neighbour on cannot work, because turn is conserved: measured on Brazen it moved the break from a median 1.6 degrees to 1.5. It relocates a kink, it cannot remove one.
- 8 kinks remain on Brazen, the worst 17.5 degrees of excess — junctions where no blend fits inside the budget. They are a real remainder, not a rounding.