Weird arc full circle (bug?)


I try to export a processing sketch in js but I’ve a strange behaviour. There are stranges randoms (and always in the begining of the sketch) full circles only in the js
You can see in this page:

Do you have an idea ?

1 Like

Nice sketch! Looks like arc(x, y, w, h, pi, pi) produces a circle. You can see this if you comment out the arcEnd = map(...) and add arcEnd = pi. I guess the assumption is that when arc is called with the same start and stop you want a circle in p5.js. It probably makes sense sometimes but clearly it’s not what you’re looking for.

You could either change the to look something like arcEnd = map(sin(offset + theta), -1, 1, pi + 0.01, pi*2) or add an if statement so the arc is only drawn when (arcEnd !== pi). Hope that helps.