Skip to content

sliding_box.scad

pinkfish edited this page Jun 6, 2026 · 20 revisions

LibFile: sliding_box.scad

This file has all the modules needed to generate a sliding box.

To use, add the following lines to the beginning of your file:

include <boardgame_toolkit.scad>

File Contents

  1. Section: SlidingBox

Section: SlidingBox

All the pieces for making sliding lids and different types of sliding lids/boxes.

Module: SlidingLid()

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingLid(size=[10, 30], lid_thickness=3, wall_thickness = 2, size_spacing = 0.2);

Description:

Creates a sliding lid for a sliding lid box, the children to this module are inserted into the lid. This does all the right things on the edges, uses some wiggle room to add in a buffer and also does a small amount of angling on the ends to make them easier to insert.

Arguments:

By Position What it does
size [width, length] the size of the box itself
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
size_spacing how much of an offset to use in generate the slides spacing (default m_piece_wiggle_room)
lid_rounding how much rounding on the edge of the lid (default wall_thickness/2)
material_colour the colour of the material in the box (default default_material_colour)
lid_chamfer how much to chamfer the lid

Example 1:

SlidingLid() Example 1
include <boardgame_toolkit.scad>
SlidingLid(size = [100, 100], lid_thickness=3, wall_thickness = 2)
  translate([ 10, 10, 0 ])
    LidMeshHex(size = [100, 100], lid_thickness = 3, boundary = 10, radius = 12);

Example 2:

SlidingLid() Example 2
include <boardgame_toolkit.scad>
SlidingLid(size=[100, 100], lid_thickness=3, wall_thickness = 2)
  translate([ 10, 10, 0 ])
    LidMeshHex(size = [100, 100], lid_thickness = 3, boundary = 10, radius = 12);

Module: SlidingBoxLidWithCustomShape()

Topics: SlidingBox, SlidingLid

Description:

Lid for a sliding lid box. This uses the first child as the shape for repeating on the lid and the rest as children for the lid.

Arguments:

By Position What it does
size [width, length] outside size of the lid
lid_boundary boundary around the outside for the lid (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
layout_width the width of the layout pieces (default default_lid_layout_width)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
size_spacing extra spacing to apply between pieces (default m_piece_wiggle_room)
lid_rounding how much rounding on the edge of the lid (default wall_thickness/2)
wall_thickness thickness of the walls (default default_wall_thickness)
lid_pattern_dense if the layout is dense (default false)
lid_dense_shape_edges the number of edges on the dense layout (default 6)
material_colour the colour of the material in the box (default default_material_colour)
lid_chamfer how much to chamfer the lid
pattern_inner_control if the shape needs inner control (default false)

Example 1:

SlidingBoxLidWithCustomShape() Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithCustomShape([100, 50]) {
  ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_SUPERSHAPE, shape_thickness = 2, supershape_m1 = 12, supershape_m2 = 12,
     supershape_n1 = 1, supershape_b = 1.5, shape_width = 15));
}

Module: SlidingBoxLidWithLabelAndCustomShape()

Topics: SlidingBox, SlidingLid

Usage: SlidingBoxLidWithLabelAndCustomShape(size=[100, 50], text\_str = "Frog");

Description:

Lid for a sliding lid box. This uses the first child as the shape for repeating on the lid.

Arguments:

By Position What it does
size [width, length] outside size of the lid
text_str the string to use for the label
lid_boundary boundary around the outside for the lid (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
layout_width the width of the layout pieces (default default_lid_layout_width)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
size_spacing extra spacing to apply between pieces (default m_piece_wiggle_room)
wall_thickness the width of the wall (default default_wall_thickness)
lid_rounding how much rounding on the edge of the lid (default wall_thickness/2)
lid_pattern_dense if the layout is dense (default false)
lid_dense_shape_edges the number of edges on the dense layout (default 6)
material_colour the colour of the material in the box (default default_material_colour)
label_options options for the label (default undef)
lid_chamfer how much to chamfer the lid
pattern_inner_control if the shape needs inner control (default false)

Example 1:

SlidingBoxLidWithLabelAndCustomShape() Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabelAndCustomShape(size=[100, 50], text_str = "Frog") {
  ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_SUPERSHAPE, shape_thickness = 2, supershape_m1 = 12, supershape_m2 = 12,
     supershape_n1 = 1, supershape_b = 1.5, shape_width = 15));
}

Module: SlidingBoxLidWithLabel

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingBoxLidWithLabel(size = [100, 100], lid_thickness = 3, text_str
  • = "Trains");

Description:

This is a composite method that joins together the other pieces to make a simple lid with a label and a hex grid. The children to this as also pulled out of the lid so can be used to build more complicated lids.

Arguments:

By Position What it does
size [width, length] outside size of the lid
text_str The string to write
lid_thickness thickness of the lid (default default_lid_thickness)
lid_boundary how much boundary should be around the pattern (default 10)
layout_width the width of the layout pieces (default default_lid_layout_width)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
wall_thickness thickness of the walls (default default_wall_thickness)
size_spacing how much of an offset to use in generate the slides spacing (default m_piece_wiggle_room)
lid_rounding how much rounding on the edge of the lid (default wall_thickness/2)
material_colour the colour of the material in the box (default default_material_colour)
label_options options for the label (default undef)
shape_options options for the shape (default undef)
lid_chamfer how much to chamfer the lid

Example 1:

SlidingBoxLidWithLabel Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabel(
    size = [100, 100], lid_thickness = 3, text_str = "Trains");

Module: SlidingBoxLidWithShape

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingBoxLidWithShape(size = [100, 100], lid_thickness = 3);

Description:

This is a composite method that joins together the other pieces to make a simple lid with a label and a hex grid. The children to this as also pulled out of the lid so can be used to build more complicated lids.

Arguments:

By Position What it does
size [width, length] outside size of the lid
lid_thickness thickness of the lid (default default_lid_thickness)
lid_boundary how much boundary should be around the pattern (default 10)
layout_width the width of the layout pieces (default default_lid_layout_width)
wall_thickness thickness of the walls (default default_wall_thickness)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
size_spacing how much of an offset to use in generate the slides spacing (default m_piece_wiggle_room)
lid_rounding how much rounding on the edge of the lid (default wall_thickness/2)
material_colour the colour of the material in the box (default default_material_colour)
shape_options options for the shape (default undef)
lid_chamfer how much to chamfer the lid

Example 1:

SlidingBoxLidWithShape Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithShape(
    size = [100, 100], lid_thickness = 3);




Module: MakeBoxWithSlidingLid()

Topics: SlidingBox

Usage:

  • MakeBoxWithSlidingLid([50, 100, 20]);

Description:

Makes a box with a sliding lid, this just creates the box itself with the cutouts for the sliding lid pieces. The children to this will be removed from inside the box and how to add in the cutouts.

The children all start from the edge inside the wall width and up from the floor in the box.

Inside the children of the box you can use the $inner_height , $inner_width, $inner_length = length variables to deal with the box sizes.

Arguments:

By Position What it does
size [width, length, height] outside size of the box
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
floor_thickness thickness of the floor (default default_floor_thickness)
material_colour the colour of the material in the box (default default_material_colour)
positive_only_children the list of children to be positive only
positive_negative_children the list of children to be positive and negative
positive_colour colour of the postive pieces default_positive_colour
size_spacing amount of wiggle room between pieces (default m_piece_wiggle_room)
spin the spin to spin the box by (default 0)
anchor the anchor to use (default BOTTOM + FRONT + LEFT)
orient the orientation to use (default UP)

Example 1:

MakeBoxWithSlidingLid() Example 1
include <boardgame_toolkit.scad>
MakeBoxWithSlidingLid([50, 100, 20]);




Clone this wiki locally