From b540faaf5c93472b992984aaddabd82f2ce03509 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:14:43 -0400 Subject: [PATCH] Thicken: a surface turned to its back grows the other way again Going into SMLib a sheet's shell holds both sides of each face, so the side the record keeps as the sheet's front is lost, and SMLib thickens along the surfaces' natural normals: Reverse Normal did not change which way a thicken grew. A sheet used against its natural normals everywhere is thickened by the negated thickness. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/surfaces.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/kernel/src/surfaces.rs b/crates/kernel/src/surfaces.rs index 89569711a..b8411cbc1 100644 --- a/crates/kernel/src/surfaces.rs +++ b/crates/kernel/src/surfaces.rs @@ -765,7 +765,12 @@ pub(crate) fn stitch_no_worse(bodies: &[&Body], tol: f64, exempt: &[u32]) -> Res /// ([`crate::offset_backend::thicken`]). pub fn thicken(body: &Body, thickness: f64, symmetric: bool) -> Result { body.require_brep("thicken")?; - imp::thicken(body, thickness, symmetric) + // SMLib holds a sheet's faces with both sides and thickens along their surfaces' natural + // normals; a sheet turned to its back (every face used against its natural normal) grows the + // other way. + let sides = face_sides(body.record()); + let turned = !sides.is_empty() && sides.iter().all(|forward| !forward); + imp::thicken(body, if turned { -thickness } else { thickness }, symmetric) } /// The faces `picked` of `body` (indices in its face order) offset one by one by SMLib, each onto