Skip to content

Instantly share code, notes, and snippets.

@toomasv
Created June 4, 2019 19:15
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/c5bcf9ff6d67d9b6b11ba3b734ae30a8 to your computer and use it in GitHub Desktop.
Save toomasv/c5bcf9ff6d67d9b6b11ba3b734ae30a8 to your computer and use it in GitHub Desktop.
Yin yang flowing
Red []
spiral: function [
start step /out /sweep /stop val
][
shape: copy []
stop: any [val 0]
i: 1
until [
repend shape [
quote 'arc
as-pair start 0
hlf: (absolute start) / 2
hlf 0
]
if sweep [append shape 'sweep]
start: (i: 0 - i) * ((absolute start) - step)
stop >= absolute start
]
shape
]
sp: spiral 18 3
view compose/deep [
box 150x150 draw [
translate 75x75
r: rotate 0 0x0 [
circle 0x0 50
pen off
shape [
fill-pen black
move 0x0
arc 0x-50 25 25 0
arc 0x50 50 50 0
arc 0x0 25 25 0 sweep
] clip [
move -8x25
'arc 16x0 8 8 0
'arc -16x0 8 8 0
][
r2: rotate 0 0x25 [
fill-pen black
pen off
circle 0x25 8
shape [
line-width 1
pen white
fill-pen off
move -9x25
(sp)
move -9x25
]
]
] clip [
move -8x-25
'arc 16x0 8 8 0
'arc -16x0 8 8 0
][
r3: rotate 0 0x-25 [
fill-pen white
pen off
circle 0x-25 8
shape [
line-width 1
pen black
fill-pen off
move -9x-25
(sp)
move -9x-25
]
]
]
]
]
rate 32
on-time [
r/2: r/2 + 1
r2/2: r2/2 - 5
r3/2: r3/2 - 5
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment