mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 02:25:55 +00:00
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:
@@ -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> {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user