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 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-28 22:14:43 -04:00
committed by Irakli Kourtis
parent b68f71a2de
commit b540faaf5c
+6 -1
View File
@@ -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> {
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