pyboxbuilder.box.types.sliding.SlidingBox

class pyboxbuilder.box.types.sliding.SlidingBox[source]

Bases: BoxTypeBase

Sliding lid box type.

Produces a box body with dovetail grooves on two walls where the lid slides in, and a sliding lid that mates with those grooves.

build_body(spec: BoxSpec) → Bosl2Solid[source]

Build the complete box body with dovetail grooves.

build_lid(spec: BoxSpec, decoration: object = None) → Bosl2Solid[source]

Build the sliding lid — a dovetailed plate, chamfered at its leading end.

interior(spec: BoxSpec) → Interior[source]

Return the frame the box’s contents may occupy.

lid_rounded_edges(spec: BoxSpec) → list[Anchor][source]

Which of the lid’s edges may be rounded.

Only the end that ends up outside the box: its top edge and its two vertical corners. The other three sides of the plate live in the channel — two in the grooves, one against the stop — and rounding them would round away the very surfaces that support and locate the lid.

Parameters:
spec: BoxSpec

Needs width and length.

Returns:

A pybosl2 edges= selector for the exposed end.

open_end_side(spec: BoxSpec) → ScoopSide[source]

Return the wall the lid slides out through.

Parameters:
spec: BoxSpec

Needs width and length.

Returns:

BACK when the lid slides along the length, else RIGHT.

preferred_scoop_side(spec: BoxSpec) → ScoopSide[source]

Put a finger scoop in the wall the lid comes out of.

On a sliding box the cards leave the same way the lid does, so the cut belongs in that wall — and only that wall will do. The other three carry the lid: two hold the grooves it rides in, and cutting a scoop into a groove takes away the bearing that keeps the lid straight.

Parameters:
spec: BoxSpec

Needs width and length.

Returns:

The open end’s side.

slide_axis(spec: BoxSpec) → str[source]

Return the axis this lid slides along — the long one (FR-002b).

slides_along_length(spec: BoxSpec) → bool[source]

Whether the lid slides along Y rather than X.

wall_tops(spec: BoxSpec) → dict[ScoopSide, float][source]

Where each wall ends, which is not the same height all round.

The channel is cut out of the top band across the whole box and runs out through the exit wall, so the entry side wall stops a lid thickness below the box’s top (its material is gone). The other three sides go all the way to the top of the box itself.

Parameters:
spec: BoxSpec

Needs height; reads lid_thickness.

Returns:

{ScoopSide: z} for all four sides.