Skip to content

tesselations.scad

pinkfish edited this page Jun 17, 2026 · 11 revisions

LibFile: tesselations.scad

This file has all the modules needed to make a variety of tesselations.

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

include <boardgame_toolkit.scad>

File Contents

Function/Module: HexagonTesselationRepeatAtLocation()

Description:

Used to create a hexagonal tesselation at a specific spot in a grid given an x and a y location.

Arguments:

By Position What it does
x the x location to generate at
y the y location to generate at
size the size of the hex
pts the points (function only)

Example 1:

HexagonTesselationRepeatAtLocation() Example 1
include <boardgame_toolkit.scad>
HexagonTesselationRepeatAtLocation(x=0, y=0, size=20)
   LizardTriangle(size=20, thickness=1);



Example 2:

HexagonTesselationRepeatAtLocation() Example 2
include <boardgame_toolkit.scad>
region(HexagonTesselationRepeatAtLocation(x=0, y=0, size=20,
   pts=LizardTriangle(size=20, thickness=1)));




Module: HexagonTesselationRepeat()

Description:

Creates any hexagonal tesselation spaced correctly, using the triangle layout.

Arguments:

By Position What it does
rows number of rows to generate
cols number of columns to generate
size the size of the tesselation

Example 1:

HexagonTesselationRepeat() Example 1
include <boardgame_toolkit.scad>
HexagonTesselationRepeat(rows=4, cols=4, size=20)
    LizardTriangle(size=20, thickness=1);



Example 2:

HexagonTesselationRepeat() Example 2
include <boardgame_toolkit.scad>
HexagonTesselationRepeat(rows=4, cols=4, size=20)
    RhombiTriHexagonal(40); // need to double this since not using a triangle

Function/Module: TriangleTesselationRepeatAtLocation()

Description:

Creates any hexagonal tesselation spaced correctly, using the triangle layout. x = the x location to generate at y = the y location to generate at size = the size of the triangle

Example 1:

TriangleTesselationRepeatAtLocation() Example 1
include <boardgame_toolkit.scad>
TriangleTesselationRepeatAtLocation(x=0, y=0, size=20)
    LizardTriangle(size=20, thickness=1);



Example 2:

TriangleTesselationRepeatAtLocation() Example 2
include <boardgame_toolkit.scad>
region(TriangleTesselationRepeatAtLocation(x=0, y=0, size=20,
    pts=LizardTriangle(size=20, thickness=1)));




Module: TriangleTesselationRepeat()

Description:

Creates any triangle tesselation spaced correctly.

Arguments:

By Position What it does
rows number of rows to generate
cols number of columns to generate
size the size of the tesselation

Example 1:

TriangleTesselationRepeat() Example 1
include <boardgame_toolkit.scad>
TriangleTesselationRepeat(rows=4, cols=4, size=20)
    HalfRegularHexagon(20);




Function: HexagonalTesselationGenerateEdge()

Description:

Internal helper for the hexagonal tesselation generation to setup an edge.


Function/Module: HexagonalTesselation()

Description:

Make a tessealation around a hex. It will distort the sides using the input sets for each side. Each goes from -0.5 - 0.5 in the x direction using the set of points to create the line.

Arguments:

By Position What it does
points set of three lines to use as points on the hex.
radius the radius of the hex.

Example 1:

HexagonalTesselation() Example 1
include <boardgame_toolkit.scad>
HexagonalTesselation(
  points=[
    [[-0.5, 0], [0, 0.2], [0.5, 0]],
    [[-0.5, 0], [0, -0.2], [0.5, 0]],
    [[-0.5, 0], [0.3, 0.2], [0.5, 0]],
  ]
);



Example 2:

HexagonalTesselation() Example 2
include <boardgame_toolkit.scad>
region(HexagonalTesselation(
  points=[
    [[-0.5, 0], [0, 0.2], [0.5, 0]],
    [[-0.5, 0], [0, -0.2], [0.5, 0]],
    [[-0.5, 0], [0.3, 0.2], [0.5, 0]],
  ]
));




Function/Module: SquareTesselation()

Description:

Make a tessealation around a square. It will distort the sides using the input sets this only needs two sides. Each goes from -0.5 - 0.5 in the x direction using the set of points to create the line.

Arguments:

By Position What it does
points set of two lines to use as points on the square.
size the size of the square (width, length).
thickness the thickness of the outline, if non-0 adds an outline.
outer_offset how much to offset the edge by so it overlaps in a pattern, added to the outside.

Example 1:

SquareTesselation() Example 1
include <boardgame_toolkit.scad>
SquareTesselation(
  points=[
    [[-0.5, 0], [0, 0.2], [0.5, 0]],
    [[-0.5, 0], [0, -0.2], [0.5, 0]],
  ],
  size=[20,20]
);



Example 2:

SquareTesselation() Example 2
include <boardgame_toolkit.scad>
linear_extrude(height = 2)
RegularPolygonGrid(
  width=20, rows=5, cols=5, spacing=0,
  shape_edges=4, aspect_ratio=1.0,
  space_width=20, space_length=20
)
  SquareTesselation(
    points=[
      [[-0.5, 0], [0.2, 0.3], [0.5, 0]],
      [[-0.5, 0], [0.1, 0.2], [0.5, 0]],
    ],
    size=[20, 20], thickness=1, outer_offset=0.1
  );



Example 3:

SquareTesselation() Example 3
include <boardgame_toolkit.scad>
region(SquareTesselation(
  points=[
    [[-0.5, 0], [0, 0.2], [0.5, 0]],
    [[-0.5, 0], [0, -0.2], [0.5, 0]],
  ],
  size=[20,20]
));




Function: TesselationSideLine()

Description:

Do the tesselation from a side line.

Arguments:

By Position What it does
path the path to point the side on
side the pattern to do with the side

Function/Module: TesselationDrop()

Description:

Creates a drop tesselation.

Arguments:

By Position What it does
size the size of the drop ([x,y])
arc_offset how wide the arc should be.
thickness the thickness of the wall (if non 0)
outer_offset the amount to add to the outside of the shape for layout
arc_points how many points on the arc

Example 1:

TesselationDrop() Example 1
include <boardgame_toolkit.scad>
TesselationDrop(size = [20,20]);




Module: TesselationLeaf()

Description:

A solid leaf for use with tesselations.

Arguments:

By Position What it does
size size of the leaf

Example 1:

TesselationLeaf() Example 1
include <boardgame_toolkit.scad>
TesselationLeaf(40);




Function/Module: TesselationLeafOutline()

Description:

A leaf outline for use with tesselations.

Arguments:

By Position What it does
size size of the leaf
thickness thickness of the sides
with_veins show veins in the leaf
vein_thickness how thick to make the veins in the leaf

Example 1:

TesselationLeafOutline() Example 1
include <boardgame_toolkit.scad>
TesselationLeafOutline(40);



Example 2:

TesselationLeafOutline() Example 2
include <boardgame_toolkit.scad>
TesselationLeafOutline(40, with_veins=true);




Function: TesselationLeafOutlineMakePolygon()

Description:

The internal piece to make a boundary for the leaf.

Arguments:

By Position What it does
section_height height of the section
section the section

Function: TesselationLeafOutlineMakeVeins()

Description:

Make the veins for the leaf.

Arguments:

By Position What it does
calc_thickness the thickness of the leaf
section_height height of the section
section the section
calc_vein_thickness how thick to make the veins in the leaf

Function/Module: TesselationLeafOutlineThree()

Description:

A leaf outline for use with tesselations, this groups into three to make layout a lot easier.

Arguments:

By Position What it does
size size of the leaf
thickness thickness of the sides
with_veins show veins in the leaf
vein_thickness how thick the veins in the lid are

Example 1:

TesselationLeafOutlineThree() Example 1
include <boardgame_toolkit.scad>
TesselationLeafOutlineThree(40);



Example 2:

TesselationLeafOutlineThree() Example 2
include <boardgame_toolkit.scad>
TesselationLeafOutlineThree(40, with_veins=true);



Example 3:

TesselationLeafOutlineThree() Example 3
include <boardgame_toolkit.scad>
TesselationLeafOutlineThree(40, thickness=2, with_veins=true);




Function/Module: DeltoidTrihexagonalTiling()

Description:

A tesselation to use with the layout to make nice triangle layout hex pattern.

Arguments:

By Position What it does
size size of the hex
thickness thickness of the sides
outer_offset how much to offset the outside edge
kite do a kite tiling

Example 1:

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



Example 2:

DeltoidTrihexagonalTiling() Example 2
include <boardgame_toolkit.scad>
DeltoidTrihexagonalTiling(20, kite=true);



Example 3:

DeltoidTrihexagonalTiling() Example 3
include <boardgame_toolkit.scad>
region(DeltoidTrihexagonalTiling(20));




Function: DeltoidTrihexagonalTilingGetPoints()

Description:

A interl part of the deltoid tesslation.

Arguments:

By Position What it does
pts the points to mess with
thickness thickness of the sides
kite do a kite tiling

Function: DeltoidTrihexagonalTilingInnerParts()

Description:

A interl part of the deltoid tesslation.

Arguments:

By Position What it does
pts the points to mess with
thickness thickness of the sides
kite do a kite tiling

Function/Module: HalfRegularHexagon()

Description:

A half regular hexagon to use with the layout to make nice layout. This is actually based on a triangle tesselation with rotations

Arguments:

By Position What it does
size size of the hex
thickness thickness of the sides
outer_offset how much to offset the outside edge

Example 1:

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



Example 2:

HalfRegularHexagon() Example 2
include <boardgame_toolkit.scad>
region(HalfRegularHexagon(20));




Function/Module: RhombiTriHexagonal()

Description:

A rhombitrihexagon layout, which makes a nifty tesselation. This is actually based on a triangle tesselation with rotations

Arguments:

By Position What it does
size size of the hex
thickness thickness of the sides
outer_offset how much to offset the outside edge

Example 1:

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



Example 2:

RhombiTriHexagonal() Example 2
include <boardgame_toolkit.scad>
region(RhombiTriHexagonal(20));




Module: TesselationPegasus()

Description:

Pegasus tesselation to use on the lids.

Arguments:

By Position What it does
size size of the hex
thickness thickness of the sides
outer_offset how much to offset the outside edge

Example 1:

TesselationPegasus() Example 1
include <boardgame_toolkit.scad>
TesselationPegasus(size=[20, 20]);



Example 2:

TesselationPegasus() Example 2
include <boardgame_toolkit.scad>
TesselationPegasus(size=[30, 20], thickness=0.5);




Clone this wiki locally