Skip to content

boardgame_toolkit.scad

pinkfish edited this page Oct 2, 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: BuildingBlocks

Section: BuildingBlocks

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: RoundedBoxOnLengeth()

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:

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




Module: RoundedBoxAllSides()

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()

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()

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()

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

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()

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
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

Example 1:

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

Module: LidMeshHex()

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 = 70, length = 50, lid_height = 3, boundary = 10, radius = 5, shape_thickness = 2);

Module: LidMeshRepeating()

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.

Example 1:

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

Clone this wiki locally