Skip to content

Instantly share code, notes, and snippets.

@toomasv
Created March 27, 2018 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toomasv/b8883f41543c4b54142b4a62a5386797 to your computer and use it in GitHub Desktop.
Save toomasv/b8883f41543c4b54142b4a62a5386797 to your computer and use it in GitHub Desktop.
Red [
Author: "Toomas Vooglaid"
Date: 2018-03-26
Purpose: "Study of spirograph"
]
tick: 0
view [
panel [
origin 0x0 space 0x0
img: image 300x300
at 0x0 box 300x300 rate 30 draw [
translate 150x150
circle 0x0 100
pen blue line 0x-100 0x100 circle 0x-100 2 circle 0x100 2
pen green line -100x0 100x0 circle -100x0 2 circle 100x0 2
circ: rotate 0 0x0
rot: rotate 0 75x0
pen black circle 75x0 25
line-cap round
pen gray line-width 8 line 50x0 100x0
pen blue line-width 1 circle 50x0 1
pen green circle 100x0 1
pen red circle 90x0 1
]
on-time [
tick: tick + 1
circ/2: tick
rot/2: 2 * negate tick * 1.25
img/image: draw img/image compose/deep [
translate 150x150
pen red
rotate (tick) 0x0
rotate (2 * negate tick * 1.25) 75x0
circle 90x0 .5
]
]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment