feat(kernel): exact chamfer history after pocket, step, slot and bite cuts
Chamfer is one of the most common features and is usually applied right after a cut. A chamfer cuts with a prism cutter, and its history came out None after four of the six common box cuts. Without exact history, any reference to a chamfer face (or a face it trimmed) falls back to geometric guessing in naming, which can silently re-attach to the wrong face. Two gaps in the stepped-prism section tags caused it, both now closed by bookkeeping at construction, never by sampling or geometric tie-breaks: - Cap edge at the far end of a slab. A slab's section is read off the cap where it starts and carried up to the cap where it ends; that cap's outline can run along one wall in several collinear edges, so which one a result edge lies on was unknown. When the stack is read, each slab segment that runs end to end along one segment of an ending cap's outline (beside the same wall) records that cap edge as `far`; the lineage takes it when it bounds the wall and the result cap. - Walls an earlier cut left in coplanar pieces. A segment carried through a level kept the wall it was read beside, even where that wall gives way to another piece at the level (or within the slab), so the tag named the wrong face. `Stations` records the operand's edges across walls; at each level a carried segment keeps its wall when nothing crosses it there, moves to the one wall across it when it ends there, and is otherwise unknown (no history). A wall crossed inside a slab is unknown too, for simple and stepped prisms alike. chamfer_after_box_cuts now covers all six cuts (notch, pocket, step, slot, hole, bite), each verified against geometry and composed through the cut over [block, tool]. The layered partial-depth cut test now verifies its second cut, whose history was None before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J53sR6gEaVt56soFDpTck8
This commit is contained in:
1 parent
43ddde4a5d
commit
688f806682
3 files changed
+226
-47
No files matched your search
@@ -422,14 +422,22 @@ fn fillet_after_box_cuts() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A chamfer right after a box cut whose cutter's cut goes the prism way: the cutter's walls meet
|
||||
/// the cut body's walls where a segment was split off.
|
||||
/// A chamfer right after a box cut, its cutter's cut going the prism way along the edge: the
|
||||
/// cutter's walls meet the cut body's walls where a segment was split off. The cut body's ends
|
||||
/// have their outlines in collinear edges (pocket, step, bite), each matched by the segment
|
||||
/// running along it; walls the cut left in pieces across the slabs (step, slot, bite) are
|
||||
/// followed through the levels where one piece gives way to the next. Composed with the cut,
|
||||
/// over the block and the tool.
|
||||
#[test]
|
||||
fn chamfer_after_box_cuts() {
|
||||
let b = cube();
|
||||
let at = Vec3::new(5.0, 0.0, 20.0);
|
||||
for (name, cut, _) in box_cuts().into_iter().filter(|(name, ..)| matches!(*name, "notch" | "hole")) {
|
||||
for (name, cut, tool) in box_cuts() {
|
||||
let r = crate::chamfer(&cut, &[at], 2.0).unwrap();
|
||||
let h = verified(&r, &cut, reach(2.0 * 1.5));
|
||||
assert_eq!(with(h, &[edge(edge_at(&cut, at))]).len(), 1, "{name}: {h:?}");
|
||||
let mut through = h.clone();
|
||||
through.substitute(0, cut.history().unwrap()).unwrap();
|
||||
through.check(&r, &[&b, &tool]).unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user