pyboxbuilder.box.spec

BoxSpec — the one description a box type is built from.

Every geometric default in the library is declared once, here, as a field default. Nothing downstream restates one: a function that needs the wall thickness reads spec.wall_thickness and gets the default from this file, rather than carrying a fallback of its own — so there is no second copy to fall out of step with the first.

This replaces a plain dict that was assembled in two places with two different exclusion lists, and whose defaults were restated at 170 call sites — wall_thickness alone at 36 of them. That is how a hinge came to be built with five knuckles by the geometry and three by the builder that configured it.

Classes

BoxSpec

Everything a box type needs to build its body and lid.

ResolvedBoxSpec

Frozen, fully-resolved geometric contract for CSG solid generation (FR-091).

UnresolvedBoxSpec

Declaration-phase box specification where dimensions may be deferred (FR-091).

Functions

build_spec

Assemble the one description this box is built from (FR-091).

describe

Return a JSON-serialisable description of everything that shapes a box.