Skip to main content

shell

Function shell 

Source
pub fn shell(
    tx: &mut Transaction<'_>,
    options: &ShellOptions,
) -> Result<ShellReport>
Expand description

Solidifies the mesh into a printable shell of wall thickness.

  • The input surface stays. Every live vertex gains a copy moved by thickness against its smooth normal; every proper triangle gains a reversed copy over the copied vertices, so the copy faces outward from the wall interior.
  • Every boundary edge (an edge of exactly one proper triangle) gains a flat wall quad over its copy: for the edge the outer triangle uses as x -> y, the quad is (y, x, x') and (y, x', y'), which agrees with both sheets along their shared edges. Rims through non-manifold vertices or orientation seams are stitched edge by edge on a best-effort basis and may stay open.
  • Writes happen in order: copy vertices, then copy and wall triangles. Then remove_degenerate with the default options drops collapsed triangles (a wall thinner than the local curvature pinches its copy to nothing) and unused vertices, reported as degenerate_removed and vertices_removed. History is untouched.

ยงErrors

  • OpsError::InvalidInput when the thickness is not positive and finite, when a vertex position or a copy position is not finite, or when the mesh buffers are not a valid mesh.
  • OpsError::Store when memory runs out.

Nothing is written in any of these cases.