pyboxbuilder.box.base.BoxTypeBase¶
- class pyboxbuilder.box.base.BoxTypeBase[source]¶
Bases:
objectBase for every box type implementation.
A subclass must provide
build_body(), andbuild_lid()unless it is a lidless type. Everything else has a default that suits a plain box with a lid sitting on top of it.- build_body(spec: ResolvedBoxSpec) Bosl2Solid[source]¶
Build the box body geometry.
- Parameters:¶
- spec: ResolvedBoxSpec¶
The box’s resolved description.
- Returns:¶
The body solid, in the box’s own frame with its minimum corner at the origin.
- Raises:¶
NotImplementedError – If the subclass does not provide one.
-
build_lid(spec: BoxSpec, decoration: object =
None) Bosl2Solid | None[source]¶ Build the lid geometry, in its seated position.
- cut_fingernail_catch(lid: Bosl2Solid, spec: BoxSpec) Bosl2Solid[source]¶
Sink the dish a nail starts a sliding lid with (FR-002e5).
A seated sliding lid is a plate flush with the box’s top: its only exposed surfaces are an end face one lid thickness tall and a smooth top, so there is nothing to grip. The dish is what gets it moving. A lid that lifts off has its own way open and takes no dish.
- exterior_protrusions(spec: BoxSpec | UnresolvedBoxSpec) tuple[float, float, float, float, float, float][source]¶
Return
(neg_x, pos_x, neg_y, pos_y, neg_z, pos_z)protruding beyond[0..W, 0..L, 0..H].Used by the container packer so features that intentionally stand proud of the nominal body — drawer handles, dispenser landing trays, or external stacking skirts — reserve clearance inside the game box.
- interior_mask(spec: BoxSpec) Bosl2Solid | None[source]¶
Return the volume inside the box that contents may actually occupy.
Usually the whole interior, and a type only says otherwise when something of its own stands in there. A hinge box is the case that needs it: keeping the hinge inside the box’s outline puts the barrel and its leaf webs in the back of the interior, exactly where a compartment would go (FR-002s).
- lid_keepouts(spec: BoxSpec) list[tuple[float, float, float]][source]¶
Return circles on the lid that decoration must leave solid.
A type declares these when its lid carries a feature of its own that a pattern would otherwise cut into — a sliding lid’s fingernail dish is the case (FR-002e5): it is a thinned spot that gets pulled on, so it needs whole material around it to pull against. Corner stacking pads are likewise kept solid so through-hole lid patterns do not undercut the 4 corner locator pyramids/indents.
- lid_rounded_edges(spec: BoxSpec) list[Anchor][source]¶
Which of this box type’s lid edges may be rounded.
- outer_size_for_interior(spec: BoxSpec | UnresolvedBoxSpec, inner_w: float, inner_l: float, inner_h: float) tuple[float, float, float][source]¶
Return the outer
(width, length, height)needed to enclose an interior.The inverse of
interior(), used when deriving a box’s minimum envelope from its compartments so types with sleeves, clamshell halves, or no lid are sized accurately rather than assuming2 * walland a standard lid plate.
- preferred_scoop_side(spec: BoxSpec) ScoopSide | None[source]¶
Which wall this box type wants a finger scoop in.
A hook rather than a rule, because only the type knows: on a sliding box the cut has to be in the wall the lid leaves by — the other three carry the lid, two of them holding the grooves it rides in (FR-069).