Skip to content

Instantly share code, notes, and snippets.

@baku89
Created March 26, 2024 10:19
Show Gist options
  • Save baku89/f74b034739a56980516bce86ff882800 to your computer and use it in GitHub Desktop.
Save baku89/f74b034739a56980516bce86ff882800 to your computer and use it in GitHub Desktop.
c = subdiv(circle([50, 50], 40), 10)
w = spawn(c, (s, i) => {
dir = i % 2 === 0 ? 0 : 1
t = sin((i / segmentCount(c) * 2 + time) * 360)
p0 = Segment.point(s, 0)
p1 = Segment.point(s, 1)
n0 = vec2.rotate(Segment.normal(s, 0), t * 73)
return i % 2 === 0 ? empty : arcByPointsTangent(p0, n0, p1)
})
stroke(w, '', 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment