Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Platonic Solids

FSL can construct Platonic solids using standard tier commands with calculated angles and symmetry. We use the Math object for calculations to keep the code robust and readable.

Dodecahedron Generator

A Dodecahedron has 12 regular pentagonal faces. Oriented with a face on top, we have 4 tiers:

  • = Horizontal (Top/Bottom)
  • 90° = Vertical (Girdle)

The ring faces are inclined at atan(2) ≈ 63.435° from the pole. The two rings form an antiprism relationship, offset by 36° from each other.

// Dodecahedron Construction
// 0° = Horizontal (Top), 90° = Vertical (Girdle)

gear = 80

// Distance from center to face
w = 1.0

// Face inclination angle: atan(2) ≈ 63.435°
ring_angle = Math.toDegrees(Math.atan(2))

// Top Face (Horizontal)
Top up 0 @ 0.0 : w

// Upper Ring (5 faces, aligned with top)
Ring1 up 0 @ ring_angle : w x5

// Lower Ring (5 faces, offset by 36° = gear/10 = 8 indices)
offset = gear / 10
Ring2 down offset @ ring_angle : w x5

// Bottom Face (Horizontal)
Bot down 0 0.0 : w x1

Notes

  • Math Object: We use Math.toDegrees(Math.atan(2)) for precision.
  • Symmetry: x5 requires a gear divisible by 5 (e.g., 80).
  • Antiprism: The lower ring is offset by 36° (index 8 on gear 80) relative to the upper ring.