Skip to content

base_bgtk.scad

pinkfish edited this page Nov 26, 2025 · 19 revisions

LibFile: base_bgtk.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

Constant: m_piece_wiggle_room

Description:

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


Constant: default_lid_thickness

Description:

The default lid thickness for all boxes.


Constant: default_wall_thickness

Description:

The default wall thickness for all boxes.


Constant: default_floor_thickness

Description:

The default lid thickness for all boxes.


Constant: default_slicing_layer_height


Constant: default_voronoi_seed


Constant: default_material_colour

Description:

The default colour to use for material when making boxes.


Constant: default_label_colour

Description:

The default colour to use for the label when making boxes.


Constant: default_label_background_colour

Description:

The default colour to use for the label background when making boxes.


Constant: default_positive_colour

Description:

The default colour to use for postivie pieces.


Function: DefaultValue()

Description:

Figures out the value, uses the input if it is not undefined, default if it is undefined.

Arguments:

By Position What it does
input input value to check, only used if not undefined
default default value to use, only used if the input is undefined.

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_SUPERSHAPE

Description:

Makes a nice Superformula shape.


Constant: SHAPE_TYPE_HILBERT

Description:

Layout a nice hilbert curve.


Constant: SHAPE_TYPE_CLOUD

Description:

Makes a nice cloud shape.


Constant: SHAPE_TYPE_PENTAGON_R1

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R2

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R3

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R4

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R5

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R6

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R7

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R8

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R9

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R10

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R11

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R12

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R13

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R14

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_PENTAGON_R15

Description:

Makes a nice repeating pentagon shape.


Constant: SHAPE_TYPE_ESCHER_LIZARD

Description:

Makes a nice repeating escher lizard shape.


Constant: SHAPE_TYPE_VORONOI

Description:

Make a lid with a voronoi layout.


Constant: SHAPE_TYPE_LEAF

Description:

Make a lid with a voronoi layout.


Constant: SHAPE_TYPE_LEAF_VEINS

Description:

Make a shape with leaf veins, use a wider shape for this it will take forever to render.


Constant: SHAPE_TYPE_DROP

Description:

Make a shape that looks a bit like a drop and rendered as a tesselation.


Constant: SHAPE_TYPE_DELTOID_TRIHEXAGONAL

Description:

Make a shape that is a deltoid trihexagon.


Constant: SHAPE_TYPE_DELTOID_TRIHEXAGONAL_KITE

Description:

Make a shape that is a deltoid trihexagon with kiting.


Constant: SHAPE_TYPE_DELTOID_TRIHEXAGONAL_KITE

Description:

Make a shape that is a half regular hexagon.


Constant: SHAPE_TYPE_RHOMBI_TRI_HEXAGONAL

Description:

Make a shape that is a rhombitrihexagon.


Constant: SHAPE_TYPE_PENROSE_TILING_5

Description:

Make a shape that is a penrose tiling.


Constant: SHAPE_TYPE_PENROSE_TILING_7

Description:

Make a shape that is a penrose tiling.


Constant: CATCH_NONE

Description:

No catch associated with the lid.


Constant: CATCH_SHORT

Description:

Catch on the shortest side, wedge style


Constant: CATCH_LONG

Description:

Catch on the longest side, wedge style.


Constant: CATCH_ALL

Description:

Catch on the all sides, wedge style.


Constant: CATCH_BUMPS_SHORT

Description:

Small bumbs on the side of the box to hold the lid in place, not a wedge.


Constant: CATCH_BUMPS_LONG

Description:

Small bumbs on the side of the box to hold the lid in place, not a wedge.


Constant: LABEL_TYPE_FRAMED

Description:

The label framed inside a box, with a striped background.


Constant: LABEL_TYPE_FRAMED_SOLID

Description:

The label framed inside a box, with a solid background.


Constant: LABEL_TYPE_FRAMED_SHORT

Description:

The label framed inside a box, with a stripedbackground on the short length.


Constant: LABEL_TYPE_FRAMED_SHORT_SOLID

Description:

The label framed inside a box, with a solid background on the short length.


Constant: LABEL_TYPE_FRAMELESS_ANGLE

Description:

The label on an angle across the lid.


Constant: LABEL_TYPE_FRAMELESS

Description:

The label across the lid on the long lenfth.


Constant: LABEL_TYPE_FRAMELESS

Description:

The label across the lid on the short length.


Constant: default_label_font

Description:

The default font to use for labels


Constant: default_label_solid_background

Description:

The default to use if the label should have a solid background or not.


Constant: default_label_type

Description:

The detault type of label to use for all the lids.


Module: DifferenceWithOffset()

Description:

Helper function that does an offset with the size inside the difference of the object makes it easier for constructing outlines.

Arguments:

By Position What it does
offset how much of an offset, -ve is inside the shape, +ve is outside the shape.

Clone this wiki locally