pyboxbuilder.compartments.carve

Turn a laid-out set of compartments into the solid that gets cut from a body.

layout_compartments decides where things go; this module builds what is removed. It handles three kinds of compartment:

  • a plain rectangular well (optionally with rounded corners and a finger scoop),

  • a silhouette well driven by shape_file,

  • an element pack — many individual silhouettes at their own offsets, rotations and depths inside one bounding box (FR-004b).

Everything is returned in the box’s own coordinate frame, so a caller only has to subtract it from the body.

Functions

build_compartment_scoop

Build a compartment's finger scoop — the part that pierces a wall.

build_compartment_well

Build a compartment's well — the part that stays inside the walls.

build_contents

Union the cutouts for every placed compartment.

build_inserts

Build every coloured positive insert across the placed compartments.

compartment_floor_z

Z of a compartment's floor.

default_scoop_side

Which wall a scoop goes in when the compartment does not say.

interior_column

Return a tall prism over the interior footprint, used to clip compartments.

interior_mouth

Return the open volume above the interior ceiling — the box's mouth.

tray_rounding

Return the radius for a tray well's vertical corners and its floor.