From ccff7224c31be86bc7d01cdb4baa45e4559f7ace Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Tue, 27 Oct 2026 21:41:24 -0400 Subject: [PATCH] Shell: its planar walls carry their shell roles again The SMLib port of shell dropped with_shell_planar_sources (then deleted it as dead code), so a shelled body's kept walls and their inner linings had no ShellPlanar certificate: a sketch or press-pull on a shell's floor lost its attachment (the Pi case's Sketch2 and everything after it, press_pull_on_the_pi_case_floor) and the shell certificate tests found no inner/outer face. The roles come from the input's exact planar supports, so they apply to SMLib's result unchanged. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/planar_sources.rs | 6 ++++++ crates/kernel/src/polyhedron.rs | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/kernel/src/planar_sources.rs b/crates/kernel/src/planar_sources.rs index af081a1f58..ad0ee3249c 100644 --- a/crates/kernel/src/planar_sources.rs +++ b/crates/kernel/src/planar_sources.rs @@ -141,6 +141,12 @@ impl Body { self.map_planar_sources(&[input], None, None, &[], false) } + /// Generate distinct outer/inner roles from the exact original supports of + /// an inside shell. Generated rims and curved walls are intentionally absent. + pub(crate) fn with_shell_planar_sources(self, input: &Body, thickness: f64, open: &[Vec3]) -> Result { + self.map_planar_sources(&[input], Some(thickness), None, open, false) + } + /// Retain exact shell roles, and construction roles for Cut, only on unchanged /// supports without a competing coplanar tool. No imported or fitted role is inferred. pub(crate) fn with_preserved_boolean_planar_sources(self, input: &Body, tool: &Body, constructed: bool) -> Result { diff --git a/crates/kernel/src/polyhedron.rs b/crates/kernel/src/polyhedron.rs index 5b966f9cd4..4b895bce97 100644 --- a/crates/kernel/src/polyhedron.rs +++ b/crates/kernel/src/polyhedron.rs @@ -185,10 +185,12 @@ fn polyhedron_record(hs: &[HalfSpace], verts: &[Vec3], faces: &[(usize, Vec Result { let _span = solidcraft_profile::span("kernel", "shell"); - crate::offset_backend::shell(b, open, thickness) + crate::offset_backend::shell(b, open, thickness)?.with_shell_planar_sources(b, thickness, open) } /// Tilt the faces near `faces` by `angle` about their line on the neutral plane, so that they