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 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-27 21:41:24 -04:00
committed by Irakli Kourtis
parent ab3ba1af44
commit ccff7224c3
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -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> {
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<Self> {
+4 -2
View File
@@ -185,10 +185,12 @@ fn polyhedron_record(hs: &[HalfSpace], verts: &[Vec3], faces: &[(usize, Vec<usiz
}
/// Hollow a body: walls of `thickness` inside, open at the faces under `open` (SMLib's shell).
/// The result's history is over `[b]`: the inner walls are offsets of the faces they line.
/// The result's history is over `[b]`: the inner walls are offsets of the faces they line. Each
/// kept planar wall and its inner lining carry the outer and inner shell roles of the face they
/// came from (face certificates: sketches and press-pulls attach to them).
pub fn shell(b: &Body, open: &[Vec3], thickness: f64) -> Result<Body> {
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