pyboxbuilder.box.features.Closure

class pyboxbuilder.box.features.Closure(body: Bosl2Solid | None = None, lid: Bosl2Solid | None = None, body_cut: Bosl2Solid | None = None, lid_cut: Bosl2Solid | None = None, pin: Bosl2Solid | None = None)[source]

Bases: object

The two halves of a closure feature.

body is cut from or added to the box; lid likewise for the lid. Which of the two applies is the caller’s business — a rabbet subtracts its body half and adds its lid half, a knuckle adds both.

require_lid() → Bosl2Solid[source]

Return the lid half, for a closure that is required to have one.

Returns:

The lid solid.

Raises:

ValueError – If this closure produced no lid half. A caller unioning two lid halves has no sensible answer without both, and None | solid fails with a message about operand types rather than about the geometry.

body_cut : Bosl2Solid | None = None

Volume the body must give up for the lid’s half to move.

lid_cut : Bosl2Solid | None = None

Volume the lid must give up for the body’s half.

Both directions are needed once a hinge sits inside the box: each half’s knuckles then stand in space the other half would otherwise fill. Relieving only one side leaves the two fused just as surely as relieving neither.