Examples

The repository has seven examples under examples/, one for each tiling and layout. Open a file in OpenSCAD and preview it with F5.

Every example follows the same outline:

  1. Generate the centres and echo() them.
  2. Remove some with filter_center_points().
  3. Compute the vertices and draw them with generic_poly(), extruded and coloured.
  4. Label the centres with print_points().

On the documentation site each example below is an embedded model. Click the picture to load a 3D view you can rotate, and Customize (live) to change the example’s parameters in the browser. On GitHub the embeds show as include lines.

Hexagons

Radial

examples/hexagons/hexagons_radial_tess_example.scad

Five levels of hexagons of radius 10, drawn at radius 9 to leave a gap. Eleven centres are filtered out to cut a wedge from the middle to the top edge. It shows:

  • copying coordinates from the echo() output into a filter list
  • color_scheme = "scheme1" with alpha = 0.5
  • print_points() raised to the top of the extrusion with translate()

Rectangular

examples/hexagons/hexagons_rect_tess_example.scad

Five rows of six hexagons, with tiles removed from the left and right edges to change the outline.

Squares

Radial

examples/squares/squares_radial_tess_example.scad

Five levels of squares of side 10 with no gap. The rows are staggered; see Layouts.

Rectangular

examples/squares/squares_rect_tess_example.scad

A 9 × 6 grid with every other column removed above the bottom row, leaving a comb.

Triangles

Both triangle examples generate enough tiles that the point labels are switched off. Set print_pts = true to see them.

Radial

examples/triangles/triangles_radial_tess_example.scad

Sixteen levels, 361 triangles, with the four at the centre removed. It passes angular_offset = 30, rect = false to triangle_vertices(), which radial centres need.

Rectangular

examples/triangles/triangles_rect_tess_example.scad

Fifteen rows of nine triangles with a zigzag band removed from the left edge to the middle.

4.8.8

examples/tess_4_8_8/tess_4_8_8_tess_example.scad

A 7 × 7 grid of octagons and the 6 × 6 squares between them. It shows:

  • two lists of centres, filtered separately: the four corner octagons and the central one, and the four squares around the centre
  • the squares drawn with angular_offset = 0
  • a different colour scheme and opacity for each kind of tile

Images in the other pages

The pictures in Layouts and the Reference look straight down on these same examples. They were produced with:

openscad examples/hexagons/hexagons_radial_tess_example.scad \
  -o hexagons_radial.png --imgsize=800,600 \
  --camera=0,0,0,0,0,0,0 --projection=o --viewall --autocenter

Known issues

  • In the two hexagon examples, setting filter = false does not show the unfiltered pattern. The line centers = filter ? filtered_centers : centers; refers to itself, so centers is undefined and OpenSCAD warns Ignoring unknown variable "centers". The other examples use unfiltered_centers there and work either way.

This site uses Just the Docs, a documentation theme for Jekyll.