Skip to content

sliding_box.scad

pinkfish edited this page Nov 12, 2024 · 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(width=10, length=30, lid_thickness=3, wall_thickness = 2, lid_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
width the width of the box itself
length the length of the box itself
lid_thickness the height of the lid (defaults to 3)
wall_thickness how wide the side walls are (defaults to 2)
lid_size_spacing how much of an offset to use in generate the slides spacing on all four sides defaults to
[m_piece_wiggle_room](base_bgtk.scad#constant-m_piece_wiggle_room)

Example 1:

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

Module: SlidingBoxLidWithLabel

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingBoxLidWithLabel(width = 100, length = 100, lid_thickness = 3, text_width = 60, text_height = 30, text_str
  • = "Trains", label_rotated = false);

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
width width of the box (outside dimension)
length length of the box (outside dimension)
text_width width of the text section
text_height length of the text section
text_str The string to write
lid_thickness height of the lid (default 3)
wall_thickness thickness of the walls (default 2)
lid_boundary how much boundary should be around the pattern (default 10)
label_radius radius of the rounded corner for the label section (default 12)
border how wide the border strip on the label should be (default 2)
offset how far inside the border the label should be (default 4)
label_rotated if the label should be rotated (default false)
layout_width the width of the layout pieces (default default_lid_layout_width)
shape_width width of the shape (default default_lid_shape_width)
shape_thickness how wide the pieces are (default default_lid_shape_thickness)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
lid_size_spacing how much of an offset to use in generate the slides spacing on all four sides defaults to
[m_piece_wiggle_room](base_bgtk.scad#constant-m_piece_wiggle_room)

Example 1:

SlidingBoxLidWithLabel Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabel(
    width = 100, length = 100, lid_thickness = 3, text_width = 60,
    text_height = 30, text_str = "Trains", label_rotated = false);

Module: MakeHexBoxWithSlidingLid()

Topics: SlidingBox, SlidingLid, Hex

Usage:

  • MakeHexBoxWithSlidingLid(5, 7, 19, 1, 29);

Description:

Creates a box with a specific number of hex spaces given the rows/cols and width of the pieces. Useful for making 18xx style boxes quickly. Children to this are the same as children to the MakeBoxWithSlidingLid().

This will make sure the cutouts are only inside the box and in the floor, if you want to cut out the sides of the box do this with a difference after making this object.

Arguments:

By Position What it does
rows number of rows to generate
cols number of cols to generate
height height of the box itsdle (outside height)
push_block_height height of the raised bit in the middle to make removing easier
lid_thickness height of the lid (defaults to 3)
wall_thickness thickness of the walls (defaults to 2)
spacing spacing between the hexes

Example 1:

MakeHexBoxWithSlidingLid() Example 1
include <boardgame_toolkit.scad>
MakeHexBoxWithSlidingLid(rows = 5, cols = 2, height = 10, push_block_height = 0.75, tile_width = 29);

Module: SlidingLidForHexBox()

Topics: SlidingBox, SlidingLid, Hex

Usage:

  • SlidingLidForHexBox(5, 7, 29);

Description:

Creates a sliding lid for use with a hex box, sets up the sizes correctly to match the the hex row/col set.

Arguments:

By Position What it does
rows number of rows to generate
cols number of cols to generate
tile_width width of the tiles
lid_thickness height of the lid (defaults to 3)
wall_thickness thickness of the walls (defaults to 2)
spacing spacing between the hexes

Example 1:

SlidingLidForHexBox() Example 1
include <boardgame_toolkit.scad>
SlidingLidForHexBox(rows = 5, cols = 2, tile_width = 29);




Module: SlidingLidWithLabelForHexBox()

Topics: SlidingBox, SlidingLid, Hex

Usage:

  • SlidingLidWithLabelForHexBox(rows = 3, cols = 4, tile_width = 29, lid_thickness = 3, text_width = 60, text_height
  • = 30, text_str = "Trains", label_rotated = false);

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
rows number of rows to generate
cols number of cols to generate
tile_width width of the tiles
lid_thickness height of the lid (defaults to 3)
wall_thickness thickness of the walls (defaults to 2)
spacing spacing between the hexes
text_width width of the text section
text_height length of the text section
text_str The string to write
lid_thickness height of the lid (default 3)
lid_boundary how much boundary should be around the pattern (default 10)
label_radius radius of the rounded corner for the label section (default 12)
border how wide the border strip on the label should be (default 2)
offset how far inside the border the label should be (degault 4)
label_rotated if the label should be rotated (default false)
wall_thickness how wide the walls are (default 2)
layout_width the width of the layout pieces (default default_lid_layout_width)
shape_width width of the shape (default default_lid_shape_width)
shape_thickness how wide the pieces are (default default_lid_shape_thickness)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)

Example 1:

SlidingLidWithLabelForHexBox() Example 1
include <boardgame_toolkit.scad>
SlidingLidWithLabelForHexBox(
    cols = 3, rows = 4, tile_width = 29, lid_thickness = 3, text_width = 60,
    text_height = 30, text_str = "Trains", label_rotated = false);

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.

Arguments:

By Position What it does
width width of the box (outside width)
length length of the box (outside length)
height height of the box (outside height)
wall_thickness thickness of the walls (default 2)
lid_thickness height of the lid (default 3)
floor_thickness thickness of the floor (default 2)

Example 1:

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




Clone this wiki locally