Skip to content

boardgame_toolkit.scad

pinkfish edited this page Oct 8, 2024 · 35 revisions

LibFile: boardgame_toolkit.scad

This file has all the modules needed to generate varioius inserts for board games. It makes the generation of the inserts simpler by creating a number of useful base modules for making boxes and lids of various types specific to board game inserts. Specifically it makes tabbed lids and sliding lids easily.

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

include <boardgame_toolkit.scad>

File Contents

  1. Section: Components

  2. Section: Labels

  3. Section: Lid

  4. Section: SlidingBox

  5. Section: TabbedBox

  6. Section: SlipBox

  7. Section: CapLid

  8. Section: Dividers

  9. Section: Curves

Constant: m_piece_wiggle_room

Description:

How many mm to use as gaps for when things join.


Constant: SHAPE_TYPE_DENSE_HEX

Description:

Creates a shape with a dense hexes, so they overlap.


Constant: SHAPE_TYPE_DENSE_TRIANGLE

Description:

Creates a shape with a dense triangles, so they overlap.


Constant: SHAPE_TYPE_CIRCLE

Description:

Creates a shape with a circles.


Constant: SHAPE_TYPE_HEX

Description:

Creates a shape with a hexes.


Constant: SHAPE_TYPE_OCTOGON

Description:

Creates a shape with a octogons.


Constant: SHAPE_TYPE_TRIANGLE

Description:

Creates a shape with a triangle.


Constant: SHAPE_TYPE_NONE

Description:

Empty shape, no space filling.


Constant: SHAPE_TYPE_SQUARE

Description:

Layout a nice set of squares.


Constant: SHAPE_TYPE_ROUNDED_SQUARE

Description:

Layout a nice set of rounded squares.


Constant: SHAPE_TYPE_HILBERT

Description:

Layout a nice hilbert curve.


Section: Components

Building blocks to make all the rest of the items from. This has all the basic parts of the board game toolkit for making polygons and laying them out.

Module: RoundedBoxOnLength()

Topics: Recess

Usage:

  • RoundedBoxOnLength(100, 50, 10, 5);

Description:

Creates a rounded box for use in the board game insert with a nice radius on two sides (length side).

Arguments:

By Position What it does
width width of the cube
length of the cube
height of the cube
radius radius of the curve on the edges

Example 1:

RoundedBoxOnLength() Example 1
include <boardgame_toolkit.scad>
RoundedBoxOnLength(30, 20, 10, 7);




Module: RoundedBoxAllSides()

Topics: Recess

Usage:

  • RoundedBoxAllSides(30,20,10,5);

Description:

Creates a rounded box with all the sides rounded.

Arguments:

By Position What it does
width width of the cube
length of the cube
height of the cube
radius radius of the curve on the edges

Example 1:

RoundedBoxAllSides() Example 1
include <boardgame_toolkit.scad>
RoundedBoxAllSides(30, 20, 10, 7);




Module: RoundedBoxGrid()

Topics: Recess, Grid

Usage:

  • RoundedBoxGrid(20,20,10,5, rows=2, cols=1);

Description:

Create a grid of rounded boxes, this is useful for inserting a number of containers inside a insert box.

Arguments:

By Position What it does
width width of the space (total, inside will be divided by this)
length of the space (total, inside will be divided by this)
height of the space
radius radius of the curve on the edges
rows number of rows to generate
cols number of cols to generate
spacing number of mm between the spaces (default 2)
all_sides round all the sides (default false)

Example 1:

RoundedBoxGrid() Example 1
include <boardgame_toolkit.scad>
RoundedBoxGrid(30, 20, 10, 7, rows=2, cols=1);




Module: RegularPolygon()

Topics: Recess

Usage:

  • RegularPolygon(10, 5, 6);

Description:

Creates a regular polygon with specific height/width and number of edges.

Arguments:

By Position What it does
width total width of the piece, this is equivilant to the apothem of a polygon * 2
height how high to create the item
shape_edges number of edges for the polygon

Example 1:

RegularPolygon() Example 1
include <boardgame_toolkit.scad>
RegularPolygon(10, 5, shape_edges = 6);




Module: RegularPolygonGrid()

Topics: Grid

Usage:

  • RegularPolygonGrid(10, 2, 1, 2)

Description:

Lays out the grid with all the polygons as children. The layout handles any shape as children. This uses the exact width of the polygon to layout the underlying grid. This just does all the spacing, the actual generation is done using the children to this module. This is usually used in conjuction with RegularPolygon()

Arguments:

By Position What it does
width total width of the piece, this is equivilant to the apothem of a polygon * 2
rows number of rows to generate
cols number of cols to generate
spacing spacing between shapres
aspect_ratio ratio between shape and width, the dy is * this (default 1.0)

Example 1:

RegularPolygonGrid() Example 1
include <boardgame_toolkit.scad>
RegularPolygonGrid(width = 10, rows = 2, cols = 1, spacing = 2)
   RegularPolygon(width = 10, height = 5, shape_edges = 6);

Module: RegularPolygonGridDense()

Topics: Grid

Usage:

  • RegularPolygonGridDense(10, 2, 1)

Description:

Lays out the grid with all the polygons as children in a dense layout, this only works for triangles and hexes. It will do a dense space filling using the spacing as the distance between the polygons. This uses the exact width of the polygon to layout the underlying grid. This just does all the spacing, the actual generation is done using the children to this module. This is usually used in conjuction with RegularPolygon()

Arguments:

By Position What it does
radius this is the radius of the polygon, distance from center to edges
rows number of rows to generate
cols number of cols to generate
spacing spacing between shapres

Example 1:

RegularPolygonGridDense() Example 1
include <boardgame_toolkit.scad>
RegularPolygonGridDense(radius = 10, rows = 3, cols = 2)
   RegularPolygon(width = 10, height = 5, shape_edges = 6);




Module: HexGridWithCutouts()

Topics: Recess Grid

Usage:

  • HexGridWithCutouts(rows = 4, cols = 3, height = 10, spacing = 0, push_block_height = 1, tile_width = 29);

Description:

This creates a hex grid with cutouts that can be used to cut out piece of a box to make a nice hex spacing inside the box.

Arguments:

By Position What it does
rows rows of the grid
cols colrs of the grid
height height of the grid
spacing space between the tiles
tile_width width of the tiles
push_block_height height of the pushblock to use (default 0)

Example 1:

HexGridWithCutouts() Example 1
include <boardgame_toolkit.scad>
HexGridWithCutouts(rows = 4, cols = 3, height = 10, spacing = 0, push_block_height = 1, tile_width = 29);

Section: Labels

Building blocks for making labels.

Module: MakeStripedGrid()

Topics: Label

Usage:

  • MakeStripedGrid(20,50);

Description:

Creates a background striped grid, this is used in the label space generation.

Arguments:

By Position What it does
width width of the grid space
length length of the grid space
bar_width width of the bars (default 1)

Example 1:

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




Module: Make3dStripedGrid()

Topics: Label

Usage:

  • Make3dStripedGrid(20,50);

Description:

Creates a background striped grid, this is used in the label space generation.

Arguments:

By Position What it does
width width of the grid space
length length of the grid space
bar_width_top width of the bars (default 1)
bar_width_bottom height of the bar (default bar_width_top)

Example 1:

Make3dStripedGrid() Example 1
include <boardgame_toolkit.scad>
Make3dStripedGrid(width = 20, length = 50, height = 1);



Example 2:

Make3dStripedGrid() Example 2
include <boardgame_toolkit.scad>
Make3dStripedGrid(width = 20, length = 50, height = 0.2, bar_width_bottom = 1);

Module: MakeStripedLidLabel()

Topics: Label

Usage:

  • MakeStripedLidLabel(20, 80, 2, label="Australia", border = 2, offset = 4);

Description:

Makes a label inside a striped grid to use in the lid. It makes a label with a border and a striped grid in the background to keep the label in plave.

Arguments:

By Position What it does
width width of the label section
length length of the label section
lid_height height of the lid/label
label the text of the label
border how wide the border is around the label (default 2)
offset how far in from the sides the text should be (default 4)
font the font to use for the text (default "Stencil Std:style=Bold")
radius the radius of the corners on the label section (default 5)
full_height full height of the lid (default false)

Example 1:

MakeStripedLidLabel() Example 1
include <boardgame_toolkit.scad>
MakeStripedLidLabel(width = 20, length = 80, lid_height = 2, label = "Australia");

Example 2:

MakeStripedLidLabel() Example 2
include <boardgame_toolkit.scad>
MakeStripedLidLabel(width = 20, length = 80, lid_height = 2, label = "Australia", full_height = true);

Section: Lid

Building blocks for making various kinds of lids and labels.

Module: LidMeshDense()

Topics: PatternFill

Usage:

  • LidMeshDense(width = 70, length = 50, lid_height = 3, boundary = 10, radius = 5, shape_thickness = 2, shape_edges =
  • 6);

Description:

Make a hex mesh for the lid. This makes a nice pattern for use on the lids.

Arguments:

By Position What it does
width width of the mesh section
length the length of the mesh section
lid_height how high the lid is
boundary how wide of a boundary edge to put on the side of the lid
radius the radius of the polygon to create
shape_thickness how thick to generate the gaps between the hexes (default 2)
shape_edges number of edges for the shape (default 6)
offset how much to offset the shape, so you can do overlapping shapes (default 0)

Example 1:

LidMeshDense() Example 1
include <boardgame_toolkit.scad>
LidMeshDense(width = 100, length = 50, lid_height = 3, boundary = 10, radius = 10, shape_thickness = 2, shape_edges
= 6);

Example 2:

LidMeshDense() Example 2
include <boardgame_toolkit.scad>
LidMeshDense(width = 100, length = 50, lid_height = 3, boundary = 10, radius = 10, shape_thickness = 2, shape_edges
= 3);

Module: LidMeshHex()

Topics: PatternFill

Usage:

  • LidMeshHex(width = 70, length = 50, lid_height = 3, boundary = 10, radius = 5, shape_thickness = 2);

Description:

Make a hex mesh for the lid. This makes a nice pattern for use on the lids.

Arguments:

By Position What it does
width width of the mesh section
length the length of the mesh section
lid_height how high the lid is
boundary how wide of a boundary edge to put on the side of the lid
radius the radius of the polygon to create
shape_thickness how thick to generate the gaps between the hexes

Example 1:

LidMeshHex() Example 1
include <boardgame_toolkit.scad>
LidMeshHex(width = 100, length = 50, lid_height = 3, boundary = 10, radius = 10, shape_thickness = 2);

Module: LidMeshRepeating()

Topics: PatternFill

Usage:

  • LidMeshRepeating(50, 20, 3, 5, 10);

Description:

Make a mesh for the lid with a repeating shape. It uses the children of this to repeat the shape.

Arguments:

By Position What it does
width width of the mesh section
length the length of the mesh section
lid_height how high the lid is
boundary how wide of a boundary edge to put on the side of the lid
shape_width the width to use between each shape.
aspect_ratio the aspect ratio (multiple by dy) (default 1.0)
shape_edges the number of edges on the shape (default 4)

Example 1:

LidMeshRepeating() Example 1
include <boardgame_toolkit.scad>
LidMeshRepeating(width = 50, length = 50, lid_height = 3, boundary = 5, shape_width = 10)
   difference() {
     circle(r = 7);
     circle(r = 6);
   }

Module: LidMeshBasic()

Description:

Creates a lid mesh with a set of known shapes. The width is the width of the shape for layout purposes and the shape_width is the width for generation purposes. The layout width and shape width default to being the same for dense layouts, and overlapping for non-dense layouts.

Example 1:

LidMeshBasic() Example 1
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_DENSE_HEX, shape_thickness = 2, shape_width = 10);

Example 2:

LidMeshBasic() Example 2
include <boardgame_toolkit.scad>
LidMeshBasic(width = 70, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_DENSE_HEX, shape_thickness = 1, shape_width = 14);

Example 3:

LidMeshBasic() Example 3
include <boardgame_toolkit.scad>
LidMeshBasic(width = 70, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_DENSE_HEX, shape_thickness = 1, shape_width = 11);

Example 4:

LidMeshBasic() Example 4
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_DENSE_TRIANGLE, shape_thickness = 2, shape_width = 10);

Example 5:

LidMeshBasic() Example 5
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_CIRCLE, shape_thickness = 2, shape_width = 14);

Example 6:

LidMeshBasic() Example 6
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10, shape_type =
    SHAPE_TYPE_TRIANGLE, shape_thickness = 2, shape_width = 10);

Example 7:

LidMeshBasic() Example 7
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_HEX, shape_thickness = 1, shape_width = 14);

Example 8:

LidMeshBasic() Example 8
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 16);

Example 9:

LidMeshBasic() Example 9
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 13, aspect_ratio=1.25);

Example 10:

LidMeshBasic() Example 10
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 10.5, aspect_ratio=1);

Example 11:

LidMeshBasic() Example 11
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_SQUARE, shape_thickness = 2, shape_width = 11);

Example 12:

LidMeshBasic() Example 12
include <boardgame_toolkit.scad>
LidMeshBasic(width = 100, length = 50, lid_height = 2, boundary = 10, layout_width = 10,
    SHAPE_TYPE_ROUNDED_SQUARE, shape_thickness = 2, shape_width = 11);

Module: SlidingLidFingernail()

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingLidFingernail(radius = 10, lid_height = 3);

Description:

Creates a fingernail section for moving a sliding lid.

Arguments:

By Position What it does
radius radius of the circle the gap is in
lid_height height of the lid
finger_gap the space to make for a finger gap (default = 1.5)
sphere the size of the sphere for the inset (default 12)
finger_length the length of the finger section (default = 15)

Example 1:

SlidingLidFingernail() Example 1
include <boardgame_toolkit.scad>
SlidingLidFingernail(3);




Module: MakeLidTab()

Topics: TabbedBox, TabbedLid

Usage:

  • MakeLidTab(5, 10, 2);

Description:

Makes a lid tab, a single lid lab, to use for boxes.

Arguments:

By Position What it does
length the length of the tab
height the height of the tab
lid_height the height of the lid (defaults to 2)
prism_width the width of the prism (defaults to 0.75)
wall_thickness the thickness of the walls (default 2)

Example 1:

MakeLidTab() Example 1
include <boardgame_toolkit.scad>
MakeLidTab(length = 5, height = 10, lid_height = 2, prism_width = 0.75, wall_thickness = 2);

Module: MakeTabs()

Topics: TabbedBox, TabbedLid

Usage:

  • MakeTabs(50, 100, wall_thickness = 2, lid_height = 2);

Description:

Create the tabs for the box, this can be used on the lids and the box to create cutouts, this just does the layout. Use the MakeLidTab() to make the tabs, it will place the children at each of the specified offsets to make the tabs.

Arguments:

By Position What it does
box_width width of the box (outside size)
box_length length of the box (outside size)
wall_thickness thickness of the walls to use (default = 2)
lid_height the height of the lid (default = 2)
tab_length how long the tab is (default = 10)
make_tab_width make tabs on the width side (default false)
make_tab_length make tabs on the length side (default true)
prism_width width of the prism to take from the side of the box (default 0.75)

Example 1:

MakeTabs() Example 1
include <boardgame_toolkit.scad>
MakeTabs(50, 100)
  MakeLidTab(length = 10, height = 6);




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_height=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_height 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](#constant-m_piece_wiggle_room)

Example 1:

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

Module: SlidingBoxLidWithLabel

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingBoxLidWithLabel(width = 100, length = 100, lid_height = 3, text_width = 60, text_length = 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_length length of the text section
text_str The string to write
lid_height 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 (default 4)
label_rotated if the label should be rotated (default false)
layout_width space in the grid for the layout (default 12)
shape_width with of the shape in the grid (default 12)
shape_type type of the shape to generate on the lid (default SHAPE_TYPE_DENSE_HEX)
shape_thickness thickness of the shape in the mesh (default 2)

Example 1:

SlidingBoxLidWithLabel Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabel(
    width = 100, length = 100, lid_height = 3, text_width = 60,
    text_length = 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_height 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_height 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_height = 3, text_width = 60, text_length
  • = 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_height 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_length length of the text section
text_str The string to write
lid_height 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 space in the grid for the layout (default 12)
shape_width with of the shape in the grid (default 12)
shape_type type of the shape to generate on the lid (default SHAPE_TYPE_DENSE_HEX)
shape_thickness thickness of the shape in the mesh (default 2)

Example 1:

SlidingLidWithLabelForHexBox() Example 1
include <boardgame_toolkit.scad>
SlidingLidWithLabelForHexBox(
    cols = 3, rows = 4, tile_width = 29, lid_height = 3, text_width = 60,
    text_length = 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.

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
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_height height of the lid (default 3)

Example 1:

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




Section: TabbedBox

Module: InsetLid()

Topics: TabbedBox

Usage:

  • InsetLid(50, 100);

Description:

Make a lid inset into the box with tabs on the side to close the box. This just does the insets around the top.

Arguments:

By Position What it does
width the width of the box (outside width)
length the length of the box (outside length)
lid_height height of the lid (default 2)
wall_thickness thickness of the walls (default 2)
inset how far the side is inset from the edge of the box (default 1)
lid_size_spacing how much wiggle room to give in the model (default m_piece_wiggle_room)

Example 1:

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




Module: InsetLidTabbed()

Topics: TabbedBox, TabbedLid

Usage:

  • InsetLidTabbed(30, 100);

Description:

Makes an inset lid with the tabes on the side.

Arguments:

By Position What it does
width width of the box (outside width)
length length of the box (outside length)
lid_height height of the lid (default 2)
wall_thickness thickness of the walls (default 2)
inset how far to inset the lid (default 1)
lid_size_spacing the wiggle room in the lid generation (default m_piece_wiggle_room)
make_tab_width makes tabes on thr width (default false)
make_tab_length makes tabs on the length (default true)
prism_width width of the prism in the tab. (default 0.75)
tab_length length of the tab (default 10)
tab_height height of the tab (default 6)

Example 1:

InsetLidTabbed() Example 1
include <boardgame_toolkit.scad>
InsetLidTabbed(30, 100);




Module: InsetLidTabbedWithLabel()

Topics: TabbedBox, TabbedLid

Usage:

  • InsetLidTabbedWithLabel(width = 100, length = 100, lid_height = 3, text_width = 60, text_length = 30, text_str
  • = "Trains", label_rotated = false);

Description:

This is a composite method that joins together the other pieces to make a simple inset tabbed 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_length length of the text section
text_str The string to write
lid_height 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 to false
tab_height height of the tabs (default 6)
tab_length length of the tabs (default 10)
inset inset of the edge (default 1)
make_tab_width makes tabes on thr width (default false)
make_tab_length makes tabs on the length (default true)
prism_width width of the prism in the tab. (default 0.75)
layout_width space in the grid for the layout (default 12)
shape_width with of the shape in the grid (default 12)
shape_type type of the shape to generate on the lid (default SHAPE_TYPE_DENSE_HEX)
shape_thickness thickness of the shape in the mesh (default 2)

Example 1:

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

Module: InsetLidTabbedForHexBox()

Topics: TabbedBox, TabbedLid, Hex

Usage:

  • InsetLidTabbedForHexBox(5, 7, 29);

Description:

Creates a inset tabbed 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_height height of the lid (defaults to 3)
wall_thickness thickness of the walls (defaults to 2)
spacing spacing between the hexes
tab_height height of the tabs (default 6)
tab_length length of the tabs (default 10)
inset inset of the edge (default 1)
make_tab_width makes tabes on thr width (default false)
make_tab_length makes tabs on the length (default true)
prism_width width of the prism in the tab. (default 0.75)

Example 1:

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




Module: InsetLidTabbedWithLabelForHexBox()

Topics: TabbedBox, TabbedLid, Hex

Usage:

  • InsetLidTabbedWithLabelForHexBox(rows = 3, cols = 4, tile_width = 29, lid_height = 3, text_width = 60,
  • text_length = 30, text_str = "Trains", label_rotated = false);

Description:

This is a composite method that joins together the other pieces to make a simple inset tabbed 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_height 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_length length of the text section
text_str The string to write
lid_height 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 space in the grid for the layout (default 12)
shape_width with of the shape in the grid (default 12)
shape_type type of the shape to generate on the lid (default SHAPE_TYPE_DENSE_HEX)
shape_thickness thickness of the shape in the mesh (default 2)

Example 1:

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

Module: MakeBoxWithTabsInsetLid()

Topics: TabbedBox, TabbedLid

Usage:

  • MakeBoxWithTabsInsetLid(width = 30, length = 100, height = 20);

Description:

Makes a box with an inset lid. Handles all the various pieces for making this with tabs. 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. The children and moves so 0,0,0 is the bottom inside of the box to make for easier arithmatic.

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 how thick the walls are (default 2)
lid_height how hight the lid is (default 2)
tab_height how heigh to make the tabs (default 6)
inset how far to inset the lid (default 1)
make_tab_width make the tabs on the width (default false)
make_tab_length make the tabs on the length (default true)
prism_width width of the prism to generate (default 0.75)
tab_length how long the tab is (default 10)
stackable should we pull a piece out the bottom of the box to let this stack (default false)
lid_size_spacing wiggle room to use when generatiung box (default m_piece_wiggle_room)

Example 1:

MakeBoxWithTabsInsetLid() Example 1
include <boardgame_toolkit.scad>
MakeBoxWithTabsInsetLid(width = 30, length = 100, height = 20);

Module: MakeHexBoxWithInsetTabbedLid()

Topics: TabbedBox, TabbedLid, Hex

Usage:

  • MakeHexBoxWithInsetTabbedBox, TabbedLid(rows = 4, cols = 3, height = 15, push_block_height = 1, tile_width =
  • 29);

Description:

Makes a hex box with an inset lid, this is a useful combination box for 18xx style games.

Arguments:

By Position What it does
rows number of rows in the box
cols number of cols in the box
height height of the box (outside height)
push_block_height height of the push blocks
tile_width the width of the files
lid_height height of the lid (default 2)

Example 1:

MakeHexBoxWithInsetTabbedLid() Example 1
include <boardgame_toolkit.scad>
MakeHexBoxWithInsetTabbedLid(rows = 4, cols = 3, height = 15, push_block_height = 1, tile_width = 29);

Section: SlipBox

Module: MakeBoxWithSlipoverLid()

Topics: SlipoverBox

Usage: MakeBoxWithSlipoverLid(100, 50, 10);

Description:

Makes the inside of the slip box, this will take a second lid that slides over the outside of the box.

Arguments:

By Position What it does
width outside width of the box
height outside height of the box
wall_thickness thickness of the walls (default 2)
foot how big the foot should be around the bottom of the box (default 0)
size_spacing amount of wiggle room to put into the model when making it (default m_piece_wiggle_room)
wall_height height of the wall if not set (default height - wall_thickness2 - size_spacing2)

Example 1:

MakeBoxWithSlipoverLid() Example 1
include <boardgame_toolkit.scad>
MakeBoxWithSlipoverLid(100, 50, 10);




Module: SlipoverBoxLid()

Topics: SlipoverBox

Usage: SlipBoxLid(100, 50, 10);

Description:

Make a box with a slip lid, a lid that slips over the outside of a box.

Arguments:

By Position What it does
width width of the lid (outside width)
length of the lid (outside length)
height height of the lid (outside height)
wall_thickness how thick the walls are (default 2)
size_spacing how much to offset the pieces by to give some wiggle room (default m_piece_wiggle_room)
foot size of the foot on the box.

Example 1:

SlipoverBoxLid() Example 1
include <boardgame_toolkit.scad>
SlipoverBoxLid(100, 50, 10);




Module: SlipoverLidWithLabel()

Topics: SlipoverBox

Usage: SlipoverLidWithLabel(20, 100, 10, text\_width = 50, text\_length = 20, text\_str = "Marmoset", shape\_type =

Example 1:

SlipoverLidWithLabel() Example 1
include <boardgame_toolkit.scad>
SlipoverLidWithLabel(20, 100, 10, text_width = 50, text_length = 20, text_str = "Marmoset",
   shape_type = SHAPE_TYPE_CIRCLE, layout_width = 10, shape_width = 14);

Section: CapLid

Module: MakeCapLidBox()

Topics: CapLid

Usage: MakeBoxWithCapLid(100, 50, 20);

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
cap_height height of the cap on the box (default 10)
lid_height thickness of the lid (default 1)
wall_thickness thickness of the walls (default 2)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
lid_finger_hold_len length of the finger hold sections to cut out (default min(width,lenght)/5)
finger_hold_height how heigh the finger hold bit it is (default 5)

Example 1:

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




Module: CapBoxLid()

Topics: CapBox

Usage: CapBoxLid(100, 50, 20);

Description:

Lid for a cap box, small cap to go on the box with finger cutouts.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
cap_height height of the cap on the box (default 10)
lid_height thickness of the lid (default 1)
wall_thickness thickness of the walls (default 2)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
lid_finger_hold_len length of the finger hold sections to cut out (default min(width,lenght)/5)
finger_hold_height how heigh the finger hold bit it is (default 5)

Example 1:

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




Module: CapBoxLidWithLabel()

Topics: CapBox

Usage: CapBoxLidWithLabel(100, 50, text\_width = 70, text\_length = 20, text\_str = "Frog");

Description:

Lid for a cap box, small cap to go on the box with finger cutouts.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
lid_boundary boundary around the outside for the lid (default 10)
cap_height height of the cap on the box (default 10)
lid_height thickness of the lid (default 1)
wall_thickness thickness of the walls (default 2)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
lid_finger_hold_len length of the finger hold sections to cut out (default min(width,lenght)/5)
finger_hold_height how heigh the finger hold bit it is (default 5)
label_radius radius of the label corners (default 12)
border border of the item (default 2)
offset offset in from the edge for the label (default 4)
label_rotated if the label is rotated (default false)
layout_width the width of the layout pieces (default 12)
shape_width width of the shape (default layout_width)
shape_thickness how wide the pieces are (default 2)
size_spacing extra spacing to apply between pieces (default m_piece_wiggle_room)

Example 1:

CapBoxLidWithLabel() Example 1
include <boardgame_toolkit.scad>
CapBoxLidWithLabel(100, 50, text_width = 70, text_length = 20, text_str = "Frog");

Section: Dividers

Module: MakeDividerTab()

Topics: Dividers

Usage: MakeDividerTab(10, 20, 1);

Description:

Makes a divider tab tab section with nice curves in and out of the tab. Any children to this are diffed out of the tab.

Arguments:

By Position What it does
tab_height height of the tab

Example 1:

MakeDividerTab() Example 1
include <boardgame_toolkit.scad>
MakeDividerTab(10, 20, 1);



Example 2:

MakeDividerTab() Example 2
include <boardgame_toolkit.scad>
// Divider tab with a svg image in it.
MakeDividerTab(10, 20, 1)  translate([ 6, 5, -2 ]) mirror([ 0, 1, 0 ])
    linear_extrude(height = 4) offset(delta = 0.001) scale(0.04) import("svg/australia.svg");

Module: MakeDivider()

Topics: Dividers

Usage: MakeDivider(10, 20, 1, 5, 3, 0);

Description:

Makes a divider with a tab section up the top. First child is a diff to the tab, the rest is a diff to the main body of the tab.

Arguments:

By Position What it does
tab_height height of the tab

Example 1:

MakeDivider() Example 1
include <boardgame_toolkit.scad>
MakeDivider(width = 40, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 0, tab_radius
= 2);

Example 2:

MakeDivider() Example 2
include <boardgame_toolkit.scad>
MakeDivider(width = 40, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 1, tab_radius
= 2);

Example 3:

MakeDivider() Example 3
include <boardgame_toolkit.scad>
MakeDivider(width = 80, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 1, tab_radius
= 2);

Example 4:

MakeDivider() Example 4
include <boardgame_toolkit.scad>
// Divider with a svg image in it.
MakeDivider(70, 50, 1, tab_height = 5, tab_position = 0, num_tabs = 3)  translate([ 6, 5, -2 ]) mirror([ 0, 1,
0 ])
    linear_extrude(height = 4) offset(delta = 0.001) scale(0.04) import("svg/australia.svg");

Module: MakeDividerWithText()

Topics: Dividers

Usage: MakeDividerWithText(10, 20, 1, 5, 3, 0);

Description:

Makes a divider with a tab section up the top. First child is a diff to the tab, the rest is a diff to the main body of the tab.

Arguments:

By Position What it does
tab_height height of the tab

Example 1:

MakeDividerWithText() Example 1
include <boardgame_toolkit.scad>
MakeDividerWithText(width = 40, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 0,
text_str = "Frog");

Example 2:

MakeDividerWithText() Example 2
include <boardgame_toolkit.scad>
MakeDividerWithText(width = 40, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 1,
text_str = "Bing");

Example 3:

MakeDividerWithText() Example 3
include <boardgame_toolkit.scad>
MakeDividerWithText(width = 40, length = 70, thickness = 1, tab_height = 10, num_tabs = 3, tab_position = 2,
text_str = "Croak", text_depth=0.5);

Section: Curves

Module: HilbertCurve()

Usage: HilbertCurve(3, 100);

Description:

Generates a hilbert curve for uses in board games.

Arguments:

By Position What it does
order depth of recursion to use 3 is a reasonable number
size size to generate the curve, this is a square size
line_thickness how thick to generate the lines in the curve (default = 20)
smoothness how smooth to make all the curves (default 32)

Example 1:

HilbertCurve() Example 1
include <boardgame_toolkit.scad>
HilbertCurve(3, 100);




Clone this wiki locally