Spirograph

Draws a hypotrochoid: the geometric curve you get from rolling one circle inside another with a pen offset from the center. The N/D ratio between the outer and inner radii sets how the loops nest. Think of it as the digital version of the toy.

Inputs

PortTypeDefaultRangeDescription
SizeScalar1.00–1Overall scale
NScalar52–12Outer radius. Controls the bounding shape
DScalar11–8Inner radius. Controls how tightly the curve loops

Outputs

PortTypeDescription
FrameFrameClosed spirograph curve

Ideas

  • Set N=5, D=3 for a classic five-loop star. N=7, D=4 produces a tighter weave with more crossings.
  • Animate D with a slow Phasor so the curve continually morphs between forms.
  • Feed into Colorize with Hue driven by Phasor for a constantly shifting hypnotic pattern.

Tips

  • The curve closes after loops = D / gcd(N, D) revolutions. Coprime N and D give the longest, most intricate curves.
  • N=D is invalid (the inner circle equals the outer). The node clamps D to stay below N.
  • Rosette: petal-and-weave variation
  • Rose: simpler rhodonea curve
  • Spiral: open inward-to-outward path