From ae5dc2416c0b93a24665bfb25500ab2e42f5f030 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:11:05 -0400 Subject: [PATCH] Split Body: a face tool runs over its own surface's parameters face_patch put the tool face's surface (a cylinder) over the domain of its NURBS form, which SMLib parameterises otherwise (0..1, not the angle and height), so the patch handed to SMLib was a sliver of the cylinder or empty and SMLib refused it as an invalid argument (split_body_by_a_face). The domain is the analytic surface's: a whole turn, unbounded along the axis, closed past the body as before. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/splitface.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/kernel/src/splitface.rs b/crates/kernel/src/splitface.rs index f6d809828..f39dc005f 100644 --- a/crates/kernel/src/splitface.rs +++ b/crates/kernel/src/splitface.rs @@ -154,8 +154,9 @@ fn face_patch(body: &Body, face: usize) -> Result { let record = body.record(); let f = record.faces.get(face).ok_or_else(|| invalid(format!("the tool body has no face {face}")))?; let forward = body.face_forward(face); - // The surface's own parameter box, unbounded where it is. - let dom = SurfaceEval::new(f.parameters()).map_err(|e| invalid(format!("the split tool's surface: {e}")))?.domain(); + // The surface's own parameter box, unbounded where it is: of `surface` itself, not of its + // NURBS form (SMLib's cylinder is held on one, parameterised otherwise). + let dom = SurfaceEval::new(&f.surface).map_err(|e| invalid(format!("the split tool's surface: {e}")))?.domain(); let range = |k: usize| dom.range[k].map_or(ALL, |(a, b)| [a, b]); Ok(Patch { surface: f.surface.clone(), domain: [range(0), range(1)], flip: !forward }) }