Skip to content

shapes.scad

pinkfish edited this page Nov 15, 2024 · 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.

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:

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/4)
head_lenght length of the head (default length/3.5)
rounding_head rounding amoubnt on the head (default width/5)
rounding_handle rounding amount on the handle (default width/10)

Example 1:

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




Module: Sledgehammer2dOutline()

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/4)
head_lenght 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

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
size size 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
size size 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
width width of the rock
length length 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)

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




Clone this wiki locally