Skip to content

shapes.scad

pinkfish edited this page Nov 14, 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: 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.

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 2)
rounding_handle rounding amount on the handle (default 1)

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




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




Clone this wiki locally