pyboxbuilder.box.spec.BoxSpec¶
- class pyboxbuilder.box.spec.BoxSpec(width: float, length: float, height: float, label: str = 'box', wall_thickness: float = 2.0, floor_thickness: float = 1.6, lid_thickness: float = 2.0, hollow: bool = True, path: tuple[tuple[float, float], ...] = (), interior_top: float | None = None, wall_tops: dict[~pyboxbuilder.enums.ScoopSide, float] = <factory>, open_sides: tuple[~pyboxbuilder.enums.ScoopSide, ...] = (), mid_wall_height_ratio: float | None = None, end_wall_length: float = 30.0, rounding: float | None = None, base_rounding: float | None = None, base_chamfer: float | bool | None = None, inner_rounding: float | None = None, rim_free: bool = False, rim_rounding: float | None = None, lid_corner_rounding: float | None = None, finger_holes: tuple[~typing.Any, ...] = (), auto_finger_holes: bool = True, size_spacing: float = 0.2, sliding_slack: float = 0.1, cap_slack: float = 0.2, slip_slack: float = 0.2, lid_slide_axis: str | None = None, dovetail: bool = True, lead_chamfer: float | None = None, catch_type: ~pyboxbuilder.enums.CatchType | str | None = None, catch_size: float | None = None, catch_radius: float | None = None, latch_radius: float = 1.2, fingernail_catch: bool = True, fingernail_radius: float | None = None, fingernail_depth: float | None = None, lid_border_margin_mm: float | None = None, cap_height: float | None = None, cap_finger_cutouts: bool = True, cap_finger_radius: float | None = None, cap_finger_length: float | None = None, cap_finger_height: float | None = None, foot: float = 2.0, slip: float = 1.6, slipover_gap: float | None = None, slipover_finger_height: float | None = None, inset: float = 1.0, hinge_count: int = 5, hinge_pin_diameter: float = 3.0, filament_diameter: float = 1.75, hinge_catch_type: ~pyboxbuilder.enums.HingeCatchType | None = None, magnet_type: ~pyboxbuilder.enums.MagnetType | None = None, magnet_size: tuple[float, float, float] | None = None, magnet_diameter: float = 6.0, magnet_height: float = 3.0, magnet_count_width: int = 2, magnet_count_length: int = 2, stackable: ~pyboxbuilder.enums.StackableMode | None = None, stackable_shape: ~pyboxbuilder.enums.StackableShape | None = None, stackable_pyramid_count: int | tuple[int, ...] | None = None, stackable_top_pyramid_count: int | tuple[int, ...] | None = None, stackable_bottom_pyramid_count: int | tuple[int, ...] | None = None, stackable_top: bool = True, stackable_bottom: bool = True, stackable_printer_safe: bool = True, stackable_pattern: ~pyboxbuilder.enums.PatternType | None = None, stackable_pattern_spacing: float | None = None, stackable_pattern_web: float | None = None, stackable_pattern_border: float | None = None, stackable_thickness: float | None = None, stackable_fit_offset: float = 0.15, stackable_foot_size: float | None = None, stackable_foot_height: float = 1.6, stackable_foot_inset: float | None = None, tilt_to_lift: bool = True, keystone: bool = False, ribbon_channel: bool = False, cantilever_thickness: float = 2.0, cantilever_width: float = 14.0, deflection_clearance: float = 0.25, detent_height: float = 0.8, latch_axis: ~pyboxbuilder.enums.LatchAxis = LatchAxis.X, lug_count: int = 4, turn_angle: float = 90.0, lug_height: float = 2.5, lug_depth: float = 1.2, bayonet_slack: float = 0.3, round_footprint: bool = False, thread_pitch: float = 3.0, thread_turns: float = 2.0, thread_clearance: float = 0.25, thread_depth: float = 1.0, chute_angle: float = 0.0, tile_angle: float | None = None, token_thickness: float = 3.0, dispense_slot_clearance: float = 0.8, sight_slot_width: float = 8.0, sight_slot_start: float | None = None, dispenser_mode: ~pyboxbuilder.enums.DispenserExtractionMode = DispenserExtractionMode.SCOOP, scoop_radius: float = 14.0, floor_scoop_depth: float = 12.0, floor_scoop_width: float = 24.0, tray_depth: float = 20.0, rear_push_width: float = 22.0, arch_height: float | None = None, draw_angle: float = 20.0, retaining_lip_height: float = 10.0, discard_well: bool = True, arena_wall_height: float = 28.0, felt_pocket_depth: float = 1.2, corner_deflectors: bool = True, push_hole_radius: float = 0.0, drawer_handle_style: ~pyboxbuilder.enums.DrawerHandleStyle = DrawerHandleStyle.HANDLE, drawer_handle_length: float = 4.0, drawer_pull_lip: float = 4.0, sleeve_slack: float = 0.25, sleeve_wall_thickness: float | None = None, spine_gap: float = 1.0, clamshell_hinge_radius: float = 2.5, closure_latch: bool = True, interlock_type: ~pyboxbuilder.enums.InterlockType | None = None, interlock_clearance: float = 0.15, interlock_size: float | tuple[float, ...] | None = None, interlock_sides: tuple[int | str, ...] | None = None, dovetail_clearance: float = 0.15, gridfinity_pitch: float = 42.0, polygon_sides: int | None = None, polygon_apothem: float | None = None, pip_radial_clearance: float = 0.35, pip_axial_clearance: float = 0.4, pip_cone_angle: float = 45.0, pip_hinge_radius: float = 3.0, pip_bridge_width: float = 0.4, pip_bridge_thickness: float = 0.4, pip_snap_catch: bool = True, pip_snap_width: float = 12.0, pip_snap_diameter: float = 3.0, pip_gap_mm: float = 1.0, inset_hinge_side_gap: float = 3.0, inset_hinge_tab_height: float = 6.0, slide_catch_style: str = 'front')[source]¶
Bases:
objectEverything a box type needs to build its body and lid.
Frozen, so a type cannot reach back and change the description it was handed. Derive a variant with
dataclasses.replace():body_spec = replace(spec, height=spec.height - spec.lid_thickness)- default_wall_top() float[source]¶
How high a wall stands when the box type says nothing about it.
The box’s own top face, less any band a lid occupies — so a cut merges into the surface a hand actually touches rather than into a plane buried under the lid.
- Returns:¶
The z of the wall’s top.
-
resolved_catch_size(default: float | None =
None) float[source]¶ Return the primary dimension for the catch (FR-099).
-
resolved_catch_type(default: CatchType =
CatchType.NONE) CatchType[source]¶ Return the resolved CatchType enum for this box (FR-099).
- to_unresolved() UnresolvedBoxSpec[source]¶
Convert this resolved spec into a mutable declaration spec (FR-091).
- wall_top(side: ScoopSide) float[source]¶
One wall’s top z (FR-070).
- Parameters:¶
- Returns:¶
That wall’s top, or
default_wall_top()if this spec carries no per-side map yet.
- with_wall_tops(box: object) BoxSpec[source]¶
Return this spec with each wall’s top resolved for a box type.
The four walls of a box do not have to end at the same height, and assuming they do is how a scoop ends up hanging in space: a sliding box’s exit wall stops a lid thickness below the others, because that is where its channel runs out through it.
-
auto_finger_holes : bool =
True¶ Let a lidless box cut its own default pair of grips (FR-047/FR-047b).
-
base_chamfer : float | bool | None =
None¶ Bottom chamfer in mm, or True for 3.0mm;
Nonedefaults to a rounded base.
-
base_rounding : float | None =
None¶ Radius for this body’s base/bottom edges;
Nonederives it from wall_thickness.
-
cap_finger_length : float | None =
None¶ How far a corner cutout runs along each side;
Nonederives it between 10mm and a sixth of the side (FR-002m).
-
cap_finger_radius : float | None =
None¶ Corner cutout radius;
Nonederives it from the height available.
-
catch_radius : float | None =
None¶ Bump-catch radius;
Noneis no catch, which is a plain sliding box’s default (FR-002e3).
-
catch_size : float | None =
None¶ Primary dimension for the catch (bump radius, wedge depth, or loop size); None derives from wall thickness.
-
catch_type : CatchType | str | None =
None¶ Lid retention mechanism — NONE, BUMP, LOOP, WEDGE, or None for type default (FR-099).
-
end_wall_length : float =
30.0¶ Length in mm of the full-height wall sections at each end when stepped.
-
fingernail_catch : bool =
True¶ Cut the dish a nail starts a sliding lid with (FR-002e5).
On by default: a seated sliding lid is a flush plate with nothing to grip, so the dish is part of the type rather than an option. Only the sliding family reads this.
-
fingernail_depth : float | None =
None¶ How deep it sinks;
Noneuses half the lid’s thickness, which is also the cap — the dish must never pierce the plate.
-
fingernail_radius : float | None =
None¶ Opening radius of that dish;
Nonederives it from the lid’s narrow dimension.
-
hinge_catch_type : HingeCatchType | None =
None¶ Catch type for hinged boxes (FR-106); HingeCatchType.RIDGE, HingeCatchType.BUMP, or HingeCatchType.NONE.
-
hollow : bool =
True¶ Hollow the whole interior.
Falsewhere compartments define the cavities instead, or for a solid block.
-
inner_rounding : float | None =
None¶ Radius where a partial lid grips the body;
Noneuses half the outer radius (FR-044b).
-
interior_top : float | None =
None¶ Explicit z of the interior’s ceiling;
Nonederives it as the box top less any band the lid occupies (FR-064).
-
lead_chamfer : float | None =
None¶ Chamfer on the lid’s leading end;
Noneuses a quarter of the lid thickness (FR-002d).
-
lid_border_margin_mm : float | None =
None¶ Margin the label keeps clear of the lid edge; propagated from the lid builder.
-
lid_corner_rounding : float | None =
None¶ Radius of a sliding lid’s vertical corners;
Nonederives it from the wall, capped at the dovetail depth (FR-002e4).
-
lid_slide_axis : str | None =
None¶ Sliding axis (‘x’ along width, ‘y’ along length, or None for default).
-
magnet_size : tuple[float, float, float] | None =
None¶ Slot dimensions
(diameter_or_width, length, depth).
-
magnet_type : MagnetType | None =
None¶ Magnet slot shape;
Nonemeans no magnets.
-
mid_wall_height_ratio : float | None =
None¶ Optional fractional height (0 < r < 1) for the lowered middle span of side walls.
-
open_sides : tuple[ScoopSide, ...] =
()¶ Exterior walls omitted down to the floor on a no-lid tray/cradle.
-
path : tuple[tuple[float, float], ...] =
()¶ Closed polygon footprint for a path box; empty means the rectangle implied by
widthandlength(FR-018).
-
rim_rounding : float | None =
None¶ Radius for a top edge that stays exposed with the lid on — a sliding box’s rails (FR-043f1).
Nonemeans none.
-
slide_catch_style : str =
'front'¶ Placement style for sliding hinge catch (‘front’ or ‘card_library’).
-
slipover_finger_height : float | None =
None¶ Height of the sleeve’s corner notches;
Noneuses half the skirt, capped at 20mm (FR-002h).
-
slipover_gap : float | None =
None¶ Band of body left showing below the sleeve;
Nonederives it as a quarter of the covered height, held between 3mm and 6mm (FR-002p).
-
stackable : StackableMode | None =
None¶ Interlocking rim mode;
Nonemeans not stackable.
-
stackable_bottom_pyramid_count : int | tuple[int, ...] | None =
None¶ Pyramid grid configuration for the bottom floor sockets;
Nonefalls back tostackable_pyramid_count.
-
stackable_fit_offset : float =
0.15¶ Clearance between a stacked box’s foot/rim and the one below it.
-
stackable_foot_height : float =
1.6¶ Height of protruding locator feet / depth of matching indents in mm.
-
stackable_foot_inset : float | None =
None¶ Inset distance from perimeter in mm;
Nonederives it from wall_thickness / 2.
-
stackable_foot_size : float | None =
None¶ Width/diameter of locator feet in mm;
Nonederives it from wall_thickness.
-
stackable_pattern : PatternType | None =
None¶ Pattern type used for pattern-matched stacking;
Nonederives from lid pattern or defaults to HEX.
-
stackable_pattern_border : float | None =
None¶ Border margin in mm for pattern-matched stacking;
Nonederives from lid pattern or LID_BORDER_MM.
-
stackable_pattern_spacing : float | None =
None¶ Cell spacing in mm for pattern-matched stacking;
Nonederives from lid pattern or footprint.
-
stackable_pattern_web : float | None =
None¶ Rib web width in mm for pattern-matched stacking;
Nonederives from lid pattern or DEFAULT_WEB_MM.
-
stackable_printer_safe : bool =
True¶ Keep the box bottom flat on the print bed (z = 0) with recessed 45-degree sockets and top bosses.
-
stackable_pyramid_count : int | tuple[int, ...] | None =
None¶ Pyramid grid config per corner pad (int N, 2-tuple (nx, ny), or 4-tuple (c_fl, c_fr, c_bl, c_br)).
-
stackable_shape : StackableShape | None =
None¶ 3D-printable geometry profile for feet/indents (PYRAMIDS, PYRAMID, CONE, PATTERN, FLAT).
-
stackable_thickness : float | None =
None¶ Interlocking rim thickness;
Nonederives it from the wall.
-
stackable_top_pyramid_count : int | tuple[int, ...] | None =
None¶ Pyramid grid configuration for the top lid/rim;
Nonefalls back tostackable_pyramid_count.
-
tilt_to_lift : bool =
True¶ Subtle bottom rounding (wall_thickness) to rock box up for easy extraction.
- wall_tops : dict[ScoopSide, float]¶
The z of each wall’s top, per side (FR-070). Filled in by
with_wall_tops(); empty until then.