Skip to content

lids_base.scad

pinkfish edited this page Mar 20, 2026 · 21 revisions

LibFile: lids_base.scad

This file has all the shared lid pieces for making lids.

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

include <boardgame_toolkit.scad>

File Contents

  1. Section: Lid

Section: Lid

Building blocks for making various kinds of lids and labels.

Constant: default_lid_shape_width

Description:

Set this at the top of the file to change the default shape width of the box lid.


Constant: default_lid_layout_width

Description:

Set this at the top of the file to change the default layout width of the box lid.


Constant: default_lid_aspect_ratio

Description:

Set this at the top of the file to change the default aspect ratio of the box lid.


Constant: default_lid_shape_thickness

Description:

Set this at the top of the file to change the default shape_thickness of the box lid.


Constant: default_lid_shape_rounding

Description:

Set this at the top of the file to change the default rounding of the box lid.


Constant: default_lid_shape_type

Description:

Set this at the top of the file to change the default shape type of the box lid.


Constant: default_lid_supershape_m1

Description:

Set this at the top of the file to change the default supershape m1 element


Constant: default_lid_supershape_m2

Description:

Set this at the top of the file to change the default supershape m]2 element


Constant: default_lid_supershape_n1

Description:

Set this at the top of the file to change the default supershape n1 element


Constant: default_lid_supershape_n2

Description:

Set this at the top of the file to change the default supershape n2 element


Constant: default_lid_supershape_n3

Description:

Set this at the top of the file to change the default supershape n3 element


Constant: default_lid_supershape_a

Description:

Set this at the top of the file to change the default supershape a element


Constant: default_lid_supershape_b

Description:

Set this at the top of the file to change the default supershape b element


Constant: default_lid_catch_type

Description:

The default type of catch to use on boxes that support catches.


Function: IsDenseShapeType()

Description:

If the shape type is dense or not.

Arguments:

By Position What it does
shape_type the shape_type to check

Function: DenseShapeEdges()

Description:

The number of edges on the dense shape.

Arguments:

By Position What it does
shape_type the shape_type to check

Module: LidMeshDense()

Topics: PatternFill

Usage:

  • LidMeshDense(path=square([100,50]), lid_thickness = 3, boundary = 10, radius = 5, 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
path the path for the mesh section
lid_thickness 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_edges the number of edges on the dense shape (default 6)
material_colour the colour of the material in the box (default default_material_colour)
inner_control if the polygon lays itself out by using $polygonX and $polygonY (default false)

Example 1:

LidMeshDense() Example 1
include <boardgame_toolkit.scad>
LidMeshDense(path=square([100,50]), lid_thickness = 3, boundary = 10, radius = 10, shape_edges = 6) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_HEX,  shape_width = $layout_width));
}

Example 2:

LidMeshDense() Example 2
include <boardgame_toolkit.scad>
LidMeshDense(path=square([100,50]), lid_thickness = 3, boundary = 10, radius = 10, shape_edges = 3) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_TRIANGLE,  shape_width = $layout_width));
}

Module: LidMeshHex()

Topics: PatternFill

Usage:

  • LidMeshHex(size = [70, 50], lid_thickness = 3, boundary = 10, radius = 5);

Description:

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

Arguments:

By Position What it does
size [x,y] size of the mesh section
lid_thickness 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
inner_control if the polygon lays itself out by using $polygonX and $polygonY (default false)

Example 1:

LidMeshHex() Example 1
include <boardgame_toolkit.scad>
LidMeshHex(size = [100, 50], lid_thickness = 3, boundary = 10, radius = 10);

Module: LidMeshRepeating()

Topics: PatternFill

Usage:

  • LidMeshRepeating(square([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. Sets $layout_width as the layout width

Arguments:

By Position What it does
path the size of the layout grid [x,y]
lid_thickness how high the lid is
boundary how wide of a boundary edge to put on the side of the lid
layout_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)
material_colour the colour of the material in the box (default default_material_colour)
inner_control if the polygon lays itself out by using $polygonX and $polygonY (default false)

Example 1:

LidMeshRepeating() Example 1
include <boardgame_toolkit.scad>
LidMeshRepeating(path=square([50,50]), lid_thickness = 3, boundary = 5, layout_width = 10)
   difference() {
     circle(r = 7);
     circle(r = 6);
   }

Example 2:

LidMeshRepeating() Example 2
include <boardgame_toolkit.scad>
LidMeshRepeating(path=square([50,50]), lid_thickness = 3, boundary = 5, layout_width = 10, inner_control = 2)
   Voronoi(width = 50, length = 50, thickness = 2, cellsize = 10);

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.

Arguments:

By Position What it does
size [x,y] width of the mesh section
lid_thickness how high the lid is
boundary how wide of a boundary edge to put on the side of the lid
layout_width the width to use between each shape.
path the path for the mesh section
aspect_ratio the aspect ratio (multiple by dy) (default 1.0)
dense if the layout is dense (default false)
dense_shape_edges number of edges on the dense shape
material_colour the colour of the material in the box (default default_material_colour)
inner_control if the polygon lays itself out by using $polygonX and $polygonY (default false)

Example 1:

LidMeshBasic() Example 1
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10, dense = true) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_HEX, shape_thickness = 2, shape_width = $layout_width));
}

Example 2:

LidMeshBasic() Example 2
include <boardgame_toolkit.scad>
LidMeshBasic(size = [70, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_HEX, shape_thickness = 1, shape_width = 14));
}

Example 3:

LidMeshBasic() Example 3
include <boardgame_toolkit.scad>
LidMeshBasic(size = [70, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_HEX, shape_thickness = 1, shape_width = 11));
}

Example 4:

LidMeshBasic() Example 4
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_DENSE_TRIANGLE, shape_thickness = 2, shape_width = $layout_width));
}

Example 5:

LidMeshBasic() Example 5
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_CIRCLE, shape_thickness = 2, shape_width = 14));
}

Example 6:

LidMeshBasic() Example 6
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_TRIANGLE, shape_thickness = 2, shape_width = $layout_width));
}

Example 7:

LidMeshBasic() Example 7
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_HEX, shape_thickness = 1, shape_width = 14));
}

Example 8:

LidMeshBasic() Example 8
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 16));
}

Example 9:

LidMeshBasic() Example 9
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 13, shape_aspect_ratio=1.25));
}

Example 10:

LidMeshBasic() Example 10
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_OCTOGON, shape_thickness = 1, shape_width = 10.5, shape_aspect_ratio=1));
}

Example 11:

LidMeshBasic() Example 11
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_SQUARE, shape_thickness = 2, shape_width = 11));
}

Example 12:

LidMeshBasic() Example 12
include <boardgame_toolkit.scad>
default_lid_shape_rounding = 3;
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_SQUARE, shape_thickness = 2, shape_width = 11));
}

Example 13:

LidMeshBasic() Example 13
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_CLOUD, shape_thickness = 2, shape_width = $layout_width+1));
}

Example 14:

LidMeshBasic() Example 14
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   ShapeByType(MakeShapeObject(shape_type = SHAPE_TYPE_SUPERSHAPE, shape_thickness = 2));
}

Example 15:

LidMeshBasic() Example 15
include <boardgame_toolkit.scad>
LidMeshBasic(size = [100, 50], lid_thickness = 2, boundary = 10, layout_width = 10) {
   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: SlidingLidFingernail()

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingLidFingernail(radius = 10, lid_thickness = 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_thickness 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)
material_colour the colour of the material in the box (default default_material_colour)

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_thickness the height of the lid (defaults to default_lid_thickness)
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_thickness = 2, prism_width = 0.75, wall_thickness = 2);

Module: MakeTabs()

Topics: TabbedBox, TabbedLid

Usage:

  • MakeTabs(50, 100, wall_thickness = 2, lid_thickness = 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
size [width, length] of the box
lid_thickness the height of the lid (default = default_lid_thickness)
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)

Example 1:

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




Module: MakeLidLabel()

Topics: Label

Description:

Makes a label to put into the lid in the right place with the right rotation.

Arguments:

By Position What it does
size [x,y] inside width of the lid
options the options for the label
lid_thickness thickness of the lid

Example 1:

MakeLidLabel() Example 1
include <boardgame_toolkit.scad>
MakeLidLabel([100, 20], lid_thickness = 2, text_str = "frog",
  options=MakeLabelOptions(text_length = 50, text_scale = 1.0, border = 2,
    offset = 4, font = default_label_font, radius = 2,
    label_type = LABEL_TYPE_FRAMED, full_height = true));

Example 2:

MakeLidLabel() Example 2
include <boardgame_toolkit.scad>
MakeLidLabel([100, 20], text_str = "frog",  lid_thickness = 2,
   options=MakeLabelOptions(text_length = 50,
   label_type = LABEL_TYPE_FRAMED_SHORT,text_scale = 0.7,
   border = 2,
   offset = 4, font = default_label_font, radius = 2, full_height = false));

Example 3:

MakeLidLabel() Example 3
include <boardgame_toolkit.scad>
MakeLidLabel([100, 20], text_str = "frog", lid_thickness = 2,
   options=MakeLabelOptions(text_length = 50, text_scale = 0.5, border = 2,
   offset = 4, font = default_label_font, label_type = LABEL_TYPE_FRAMED,
   radius = 2, full_height = false));

Example 4:

MakeLidLabel() Example 4
include <boardgame_toolkit.scad>
MakeLidLabel([100, 30],  text_str = "frog", lid_thickness = 2,
   options=MakeLabelOptions(text_length = 50, text_scale = 0.3, border = 1,
   offset = 4, font = default_label_font, radius = 2, full_height = true,
   label_type = LABEL_TYPE_FRAMED));

Clone this wiki locally