Skip to content

shapes.scad

pinkfish edited this page Jun 26, 2026 · 31 revisions

LibFile: shapes.scad

This file has all the modules needed to make various shapes.

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

include <boardgame_toolkit.scad>

File Contents

  1. Section: Shapes

Section: Shapes

Shapes to use in boxes and stuff.

Function: MakeShapeObject()

Arguments:

By Position What it does
shape_type The type of shape to use (default default_lid_shape_width)
shape_thickness thickness of the shape (default default_lid_shape_thickness)
shape_width width of the shape (default default_lid_shape_width)
shape_thickness thickness of the shape (default default_lid_shape_thickness)
shape_aspect_ratio aspect ratio of the shape (default default_lid_aspect_ratio)
rounding rounding of the shape (default default_lid_shape_rounding)
supershape_m1 m1 of the supershape (default default_lid_supershape_m1)
supershape_m2 m2 of the supershape (default default_lid_supershape_m2)
supershape_n1 n1 of the supershape (default default_lid_supershape_n1)
supershape_n2 n2 of the supershape (default default_lid_supershape_n2)
supershape_n3 n3 of the supershape (default default_lid_supershape_n3)
supershape_a a of the supershape (default default_lid_supershape_a)
supershape_b b of the supershape (default default_lid_supershape_b)

Module: Sword2d()

Description:

2d shape of a sword.

Arguments:

By Position What it does
length length of the sword
width width of the sword
blade_width width of the blade (default width / 3)
hilt_length length of the hilt (default length / 15)
hilt_pos position on the blade where the hilt starts (default length / 7)
blade_rounding how much rounding on the end of the blade (default 1)
hilt_rounding how much rounding on the hilt (default 1)

Example 1:

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




Module: Sword2dOutline()

Description:

2d outline of a sword.

Arguments:

By Position What it does
length length of the sword
width width of the sword
blade_width width of the blade (default width / 3)
hilt_length length of the hilt (default length / 15)
hilt_pos position on the blade where the hilt starts (default length / 7)
blade_rounding how much rounding on the end of the blade (default 1)
hilt_rounding how much rounding on the hilt (default 1)
line_width how wide the line is (default 1)

Example 1:

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




Module: Crossbow2d()

Description:

A 2d crossbow shape.

Arguments:

By Position What it does
length length of the cross bpw.
width width of the cross bow
handle_width width of the handle bit (default width/8)
bow_width width of the bow section of the bow (default width/4)
outer_circle how big of a circle with the crossbow to draw (default width*2)

Example 1:

Crossbow2d() Example 1
include <boardgame_toolkit.scad>
Crossbow2d(70, 50);




Module: Crossbow2dOutline()

Description:

An outline of a 2d crossbow shape.

Arguments:

By Position What it does
length length of the cross bpw.
width width of the cross bow
handle_width width of the handle bit (default width/8)
bow_width width of the bow section of the bow (default width/4)
outer_circle how big of a circle with the crossbow to draw (default width*2)
line_width width of the line to display (default 1)

Example 1:

Crossbow2dOutline() Example 1
include <boardgame_toolkit.scad>
Crossbow2dOutline(70, 50);




Module: Sledgehammer2d()

Description:

A 2d sledgehammer shape.

Arguments:

By Position What it does
length length of the cross bpw.
width width of the cross bow
handle_width width of the handle bit (default width/4)
rounding_head rounding amoubnt on the head (default width/5)
rounding_handle rounding amount on the handle (default width/10)
head_length length of the head

Example 1:

Sledgehammer2d() Example 1
include <boardgame_toolkit.scad>
Sledgehammer2d(70, 50);




Module: Sledgehammer2dOutline()

Description:

An outline of a 2d sledgehammer shape.

Arguments:

By Position What it does
length length of the cross bpw.
width width of the cross bow
handle_width width of the handle bit (default width/4)
head_length length of the head (default length/3.5)
rounding_head rounding amoubnt on the head (default 2)
rounding_handle rounding amount on the handle (default 1)
line_width width of the lione (default 1)
strap_width width of the strap outline(default line_width*4)

Example 1:

Sledgehammer2dOutline() Example 1
include <boardgame_toolkit.scad>
Sledgehammer2dOutline(70, 50);




Module: Shoe2d()

Description:

An nice 2d shoe shape.

Arguments:

By Position What it does
size size of the shoe
leg_length length of the leg bit of the shoe (default size/3)
sole_height height of the sole base of the shoe (default size/20)
base_width height of the base part of the shoe (default size/3)

Example 1:

Shoe2d() Example 1
include <boardgame_toolkit.scad>
Shoe2d(50);




Module: Shoe2dOutline()

Description:

An nice 2d shoe outline shape.

Arguments:

By Position What it does
size size of the shoe
leg_length length of the leg bit of the shoe (default size/3)
sole_height height of the sole base of the shoe (default size/20)
base_width height of the base part of the shoe (default size/3)
line_width width of the outline line (default 1)

Example 1:

Shoe2dOutline() Example 1
include <boardgame_toolkit.scad>
Shoe2dOutline(50);




Module: Bag2d()

Description:

An nice 2d bag shape.

Arguments:

By Position What it does
size size of the bag
base_round_diameter round diameter of the base circles (default size/4)
main_round_diameter round diameter of the middle bulge bit (default size/2)
neck_width width of the neck of the bag (default size/6)
rope_length length of the rope (default size/4)

Example 1:

Bag2d() Example 1
include <boardgame_toolkit.scad>
Bag2d(50);




Module: Bag2dOutline()

Description:

An nice 2d bag outline shape.

Arguments:

By Position What it does
size size of the bag
base_round_diameter round diameter of the base circles (default size/4)
main_round_diameter round diameter of the middle bulge bit (default size/2)
neck_width width of the neck of the bag (default size/6)
line_width width of the line to use for the outline
rope_length length of the rope

Example 1:

Bag2dOutline() Example 1
include <boardgame_toolkit.scad>
Bag2d(50);




Module: Torch2d()

Description:

An nice 2d torch shape.

Arguments:

By Position What it does
length length of the torch
width width of the torch
handle_width the width of the handle (default width/2)
head_length length of the head (default length/7)

Example 1:

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




Module: Torch2dOutline()

Description:

An nice 2d torch outline shape.

Arguments:

By Position What it does
length length of the torch
width width of the torch
handle_width the width of the handle (default width/2)
head_length length of the head (default length/7)
line_width width of the line (default 1)

Example 1:

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




Module: Teapot2d()

Description:

An nice 2d teapor shape.

Arguments:

By Position What it does
length length of the teapot
width width of the teapot
top_width top width of the teapot (default width*6/10)
top_length length to the top part of the teapot.
top_circle_diameter circle of the top part of the teapot
handle_rounding rounding amount to use int he top handle
handle_width width of the top handle
spout_length length of the spout
side_handle_length length of the side handle
side_handle_rounding rounding of the bottom part of the handle

Example 1:

Teapot2d() Example 1
include <boardgame_toolkit.scad>
Teapot2d(100, 70);




Module: Coin2d()

Description:

A simple coin icon to use in things.

Arguments:

By Position What it does
size the size of the coin
text text to put in the coin (default 1)
text_size size of the text to use (dewfault size/2)

Example 1:

Coin2d() Example 1
include <boardgame_toolkit.scad>
Coin2d(50);



Example 2:

Coin2d() Example 2
include <boardgame_toolkit.scad>
Coin2d(50, text = "5");




Module: CoinPile2d()

Description:

Makes a coin pile to use in other places.

Arguments:

By Position What it does
size size of the pile
coin_num number of coins in the pile (default 5)
rounding how much to round the coins (default (size * 3 / 4) / (calc_coin_num * 2))

Example 1:

CoinPile2d() Example 1
include <boardgame_toolkit.scad>
CoinPile2d(50);



Example 2:

CoinPile2d() Example 2
include <boardgame_toolkit.scad>
CoinPile2d(50, coin_num=3);



Example 3:

CoinPile2d() Example 3
include <boardgame_toolkit.scad>
CoinPile2d(50, coin_num=10);




Constant: australia_map_length

Description:

The length of the australian svg map


Constant: australia_map_width

Description:

The width of the australian svg map


Function: AustraliaMapWidth()

Description:

Works out the width of the map from the length.


Module: AustraliaMap2d()

Description:

a map of australia

Arguments:

By Position What it does
length length of the map

Example 1:

AustraliaMap2d() Example 1
include <boardgame_toolkit.scad>
AustraliaMap2d(100);




Module: Rock2d()

Description:

Makes a rock shape to use in walls and things.

Arguments:

By Position What it does
length length of the rock
width width of the rock
rounding rounding on the edge of the rock (default min(width,lenght)/5)

Constant: ruins_2d_length

Description:

The length of the ruins svg


Constant: ruins_2d_width

Description:

The length of the ruins svg


Function: Ruins2dWidth()

Description:

Works out the width of the map from the length.


Module: Ruins2d()

Description:

Makes a small ruins image to use in stuff.

Example 1:

Ruins2d() Example 1
include <boardgame_toolkit.scad>
Ruins2d(50);




Module: RockWall2d()

Description:

Makes a nice rock wall

Arguments:

By Position What it does
size size of the rock wall
num_rows number of rows (default 10)
num_cols numer of cols (default 40)
spacing spacing between rocks (default size/200)

Example 1:

RockWall2d() Example 1
include <boardgame_toolkit.scad>
RockWall2d(50);




Module: D20Outline2d()

Description:

Makes a nice d20 outline for some dice.

Arguments:

By Position What it does
size size of the die image
offset the size of the walls

Example 1:

D20Outline2d() Example 1
include <boardgame_toolkit.scad>
D20Outline2d(10, 0.5);




Module: SawBlade2d()

Description:

Makes a nice 2d saw blade.

Arguments:

By Position What it does
size size of the saw blade
inner_spindle_size size of the inside spindle (default size/10)

Module: SawBlade2dOutline()

Description:

Makes a nice 2d saw blade.

Arguments:

By Position What it does
size size of the saw blade
inner_spindle_size size of the inside spindle (default size/10)
outer_width outer width of the shape

Example 1:

SawBlade2dOutline() Example 1
include <boardgame_toolkit.scad>
SawBlade2d(50);




Module: Handshake2d()

Description:

Creates two hands shaking hands.

Arguments:

By Position What it does
size size of the hands.

Example 1:

Handshake2d() Example 1
include <boardgame_toolkit.scad>
Handshake2d(30);




Module: Fist2d()

Description:

A nice fist for use in stuff. Fist is from fist printables by Vendicar Design

Arguments:

By Position What it does
size size of the fist

Example 1:

Fist2d() Example 1
include <boardgame_toolkit.scad>
Fist2d(20);




Module: Fist2dOutline()

Description:

Outline of a fst

Arguments:

By Position What it does
size size of the fist
line_width width of the line (default 1)

Module: Leaf2d()

Description:

Makes a nice leaf.

Arguments:

By Position What it does
size size of the leaf

Module: LaurelWreath2d()

Description:

Makes a laurel wreathe for use all over the place

Arguments:

By Position What it does
size size of the laurel

Module: Anvil2d()

Description:

Makes a nice 2d anvil.

Arguments:

By Position What it does
size size of the anvil
with_hammer show a hammer on the anvil and spark too

Example 1:

Anvil2d() Example 1
include <boardgame_toolkit.scad>
Anvil2d(30);



Example 2:

Anvil2d() Example 2
include <boardgame_toolkit.scad>
Anvil2d(30, with_hammer = true);




Module: HalfEye2d()

Description:

Makes a single eye for use in various things where eyes are needed. This is a half eye on an angle.

Arguments:

By Position What it does
angle angle the eye is on
outer_size size of the outside circle.
inner_size size of the inside circle
pupil_size size of the pupil

Example 1:

HalfEye2d() Example 1
include <boardgame_toolkit.scad>
HalfEye2d(30);



Example 2:

HalfEye2d() Example 2
include <boardgame_toolkit.scad>
HalfEye2d(60);



Example 3:

HalfEye2d() Example 3
include <boardgame_toolkit.scad>
translate([-6, 0, 0]) HalfEye2d(60);
translate([6, 0, 0]) mirror([1, 0]) HalfEye2d(60);
// Nose.
translate([0, -4, 0]) {
  circle(d=3);
  translate([0, -2]) {
    rect([1, 3]);
    translate([-3, -1.5]) ring(r1=2.5, r2=3, angle=[360, 180], n=32);
    translate([3, -1.5]) mirror([1, 0]) ring(r1=2.5, r2=3, angle=[360, 180], n=32);
  }
}

Module: SideEye2d()

Description:

Makes a single eye for use in various things where eyes are needed. This is a half eye on an angle.

Arguments:

By Position What it does
angle angle the pupil is at
outer_size size of the outside circle.
inner_size size of the inside circle
pupil_size size of the pupil

Example 1:

SideEye2d() Example 1
include <boardgame_toolkit.scad>
SideEye2d(30);



Example 2:

SideEye2d() Example 2
include <boardgame_toolkit.scad>
SideEye2d(90);



Example 3:

SideEye2d() Example 3
include <boardgame_toolkit.scad>
translate([6, 0, 0]) SideEye2d(90);
translate([-6, 0, 0]) SideEye2d(90);
translate([0, -4, 0]) {
  translate([1, 0.6]) rotate(30) rect([4, 1]);
  translate([-1, 0.6]) rotate(150) rect([4, 1]);
  circle(d=3);
}




Module: CloudShape2d()

Description:

Makes a cloud object. This object was made by Twanne on thingiverse: https://www.thingiverse.com/thing:641665/files

Arguments:

By Position What it does
width The width of the cloud. This also determine the height, because the height is half the width.

Example 1:

CloudShape2d() Example 1
include <boardgame_toolkit.scad>
CloudShape2d(100);




Module: SingleLog2d()

Description:

A single log image.

Arguments:

By Position What it does
size size of the log
line_width width of the line

Example 1:

SingleLog2d() Example 1
include <boardgame_toolkit.scad>
SingleLog2d(15);




Module: Tower2d()

Description:

Make a single keep tower for use in gams and stuff.

Arguments:

By Position What it does
size size of the tower

Example 1:

Tower2d() Example 1
include <boardgame_toolkit.scad>
Tower2d(20);




Module: Sign2d()

Description:

Makes a sign shape to use for stuff.

Arguments:

By Position What it does
size size of the sign

Module: PortugalCastle()

Description:

The castle used on the flag of portugal

Arguments:

By Position What it does
stroke_width width of the stroke to use for the castle outline
width the final width of the castle.

Example 1:

PortugalCastle() Example 1
include <boardgame_toolkit.scad>
PortugalCastle(0.2, 50);




Module: TrainOutline()

Description:

Creates a nice train outline to use for stuff.

Arguments:

By Position What it does
length length of the train

Example 1:

TrainOutline() Example 1
include <boardgame_toolkit.scad>
TrainOutline(100);




Module: WagonOutline()

Description:

Create a wagon outline from the exciting svg.

Arguments:

By Position What it does
length the length of the wagon

Example 1:

WagonOutline() Example 1
include <boardgame_toolkit.scad>
WagonOutline(50);




Clone this wiki locally