pyboxbuilder.box.features

Reusable closure features shared by the box types (T162).

A lid only works if the body has the matching half of the same feature — a rabbet needs a ledge cut for it, a sliding lid needs grooves the right depth, a filament hinge needs knuckles that interleave and share a pin axis. Keeping both halves of each feature in one function is what stops them drifting apart.

Everything is built in the box’s own frame: (0, 0, 0) is its lower-left corner at the bed. pybosl2 primitives are centre-anchored, so placement goes through shell.block / shell.corner.

Classes

CapFingerMetrics

The numbers a cap box's four corner cutouts are cut from.

CapMetrics

The numbers a cap box's body and lid must agree on.

Closure

The two halves of a closure feature.

FingernailCatch

A sliding lid's fingernail dish: where it is, and how big.

Functions

apply_horizontal_interlock

Apply horizontal side interlocking features according to spec.interlock_type (FR-089, FR-102).

apply_stackable_body

Apply stacking features to a box body according to spec.stackable (FR-101).

apply_stackable_lid

Apply matching stacking features to a box lid according to spec.stackable (FR-101).

build_bump_detent

Return positive bump and negative dimple (FR-099).

build_horizontal_dovetail

Build a true flared trapezoidal vertical dovetail joint key or socket (FR-102).

build_interlock_clip

Build a double-dovetail butterfly connector clip that locks adjacent boxes (FR-102).

build_leaf_spring_detent

Return positive detent bead, lid relief slot, and body dimple (FR-099).

build_loop_detent

Return positive loop tab and negative body pocket cutter with hook (FR-099).

build_magnet_detent

Return negative cylindrical magnet cavities for lid and body (FR-099).

build_pattern_stacking_groove

Build the female pattern-matched stacking groove cutter for a box floor or lid.

build_pattern_stacking_ridge

Build the male pattern-matched stacking lattice ridge for a lid or tray top.

build_perimeter_stacking_foot

Return an inset perimeter foot/V-ridge rim (FR-101).

build_perimeter_stacking_indent

Return a perimeter channel/V-groove cutter to be subtracted from floor or lid top (FR-101).

build_pinch_slide_hinge_catch

Return dual opposing captive dovetail sliders that pinch toward the center to release.

build_push_button_hinge_catch

Return a compliant thumb-press push-button release catch on the front wall.

build_rotary_bolt_hinge_catch

Return a flush print-in-place quarter-turn rotary cam disk inside the lid.

build_slide_across_hinge_catch

Return a captive print-in-place horizontal dovetail sliding bolt catch (card_library style).

build_slide_up_hinge_catch

Return a captive print-in-place vertical dovetail slider catch on the front wall.

build_spin_hinge_catch

Return a print-in-place rotary spin catch (turn-button cam latch) on the front wall.

build_stacking_feet

Return 4 corner locator feet (FR-101).

build_stacking_indents

Return 4 corner indent cutter solids to be subtracted from floor or lid/rim (FR-101).

build_stacking_pyramid_indents

Return 4 corner 45-degree pyramid (or multi-pyramid grid / cone) female indent cutters.

build_stacking_pyramids

Return 4 corner 45-degree pyramid (or multi-pyramid grid / cone) male bosses.

build_stacking_slide_latch

Return the combined housing and captive vertical dovetail slider assembly for spec.

build_stacking_slide_latch_parts

Return (housings, sliders) for the side-wall print-in-place push-up stacking latches.

build_toggle_latch_hinge_catch

Return a print-in-place articulated draw-latch bail on the front wall.

build_vertical_pinch_slide_hinge_catch

Return dual opposing captive horizontal dovetail sliders in the vertical body wall.

build_vertical_rotary_bolt_hinge_catch

Return a flush quarter-turn rotary cam disk mounted in the vertical body front wall.

build_vertical_slide_across_hinge_catch

Return a vertical-wall print-in-place horizontal dovetail sliding bolt catch.

build_wedge_detent

Return positive wedge barb and negative pocket groove (FR-099).

cap_body

Return a cap box's body: full footprint below, stepped in for the skirt above.

cap_finger_cutouts

Return the four corner cutouts that let a cap lid be pushed off (FR-002i).

cap_finger_metrics

Size a cap box's corner finger cutouts, or explain why it cannot have any.

cap_lid

Return a cap box's lid: a plate whose skirt grips the body's stepped-in band.

cap_metrics

Work out a cap box's shared geometry from its declared size.

cap_slipover_catch

Return a retention catch for cap boxes or slipover boxes (FR-002q2, FR-002q3, FR-099).

corner_catch

Return a finger notch wrapping a corner, as the original's CornerCatch.

dovetail_track

Return the dovetailed channel a lid slides in, and the lid that fills it.

extrude_footprint

Extrude a footprint outline upward from base_z.

extrude_rounded_footprint

Extrude a polygon footprint with rounded vertical corners and optional top/bottom roundovers.

filament_hinge

Interleaved knuckles along the back edge, bored for a filament pin.

fingernail_catch

Size and place the dish that starts a sliding lid moving (FR-002e5).

fingernail_dish

Return the solid to subtract from a lid to leave the dish.

hinge_catch

Return the front snap-fit or print-in-place catch for a hinged box (FR-002v, FR-099).

hinge_intrusion

Return the volume a hinge occupies inside the box, as a solid to subtract.

lead_chamfer_size

Return the slight chamfer that lets a lid start into its grooves (FR-002d).

lid_corner_rounding

Return the radius on the sliding lid's leading corners (FR-002e4).

magnetic_hinge_catch

Return the front magnet boss and matching body/lid magnet sockets for a hinged box.

magnetic_hinge_catch_metrics

Return (x_center, y_center, r_boss) for a hinged box's front magnet catch.

offset_footprint

Grow or shrink a footprint outline by distance (positive shrinks).

path_body_metrics

(inset per side, body height) for a polygon-footprint body.

path_cap

Return a cap whose skirt follows a polygon footprint instead of a rectangle.

path_sleeve

Return a sleeve that slips over a polygon-footprint body, stopping at the foot.

polygon_grid_position

Calculate the (x, y) world position for regular polygon cells in a tessellated grid (FR-102).

rabbet

Return a ledge cut into the top rim, and the plate that drops into it.

regular_polygon_path

Generate closed 2D polygon vertices for a regular N-sided polygon (FR-102).

sliding_catch

Return a retention catch that clicks the sliding lid shut (FR-002e1, FR-099).

sliding_dovetail

Return the dovetail depths that hold a sliding lid in its grooves.

sliding_track

Return the sliding channel and lid, in the slide-along-X frame.

slipover_gap

How much body a sleeve leaves exposed above the foot (FR-002p).

slipover_metrics

(inset per side, body height) for a slipover box.

stacking_order_pyramid_config

Return the keyed pyramid configuration for the given 0-based vertical stacking interface.