Skip to content

Instantly share code, notes, and snippets.

@baku89
Created March 28, 2024 03:50
Show Gist options
  • Save baku89/c4dfe82d6a76e5e0a2f6b6bc02ec0695 to your computer and use it in GitHub Desktop.
Save baku89/c4dfe82d6a76e5e0a2f6b6bc02ec0695 to your computer and use it in GitHub Desktop.
240328.pave.js
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