Welcome! 馃憢 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
When drawing the arc (I removed the parseFloat() as they are not necessary):
arc(0, 0, sz, sz, pi, arcEnd);
if pi and arcEnd is at the same place, it will draw a circle (pi and 2*pi is at the same place so using those two angles will draw a full circle). In your code, the value of arcEnd doesn't end up as pi (or the limited floating point representation of it since there isn't an infinite number of digits) but it gets really close to it.
There is a check in the code base if the two angles are really close together and if they are treat them as the same point and as such draw a full circle. The difference betweent the two angles needs to be greater than 0.00001 (as defined here) for them to be considered seperate points.
We can reduce the value of epsilon (the name of the difference between the angles) but that makes it hard to draw a full circle by gradually increasing the value of endArc (ie. the opposite case of the sketch) which is why this was implemented like this in the first place.
@b0nb0n For your case, I would do something like this:
arcEnd = map(sin(offSet+theta), -1, 1, pi+0.0001, 2*pi);
That way the value of arcEnd will not reach a point where the two angles are too close together while not having any change in how it looks.
thanks @limzykenneth. I think we can close this one since it is expected behavior.
Most helpful comment
When drawing the arc (I removed the
parseFloat()as they are not necessary):if
piandarcEndis at the same place, it will draw a circle (piand2*piis at the same place so using those two angles will draw a full circle). In your code, the value ofarcEnddoesn't end up aspi(or the limited floating point representation of it since there isn't an infinite number of digits) but it gets really close to it.There is a check in the code base if the two angles are really close together and if they are treat them as the same point and as such draw a full circle. The difference betweent the two angles needs to be greater than 0.00001 (as defined here) for them to be considered seperate points.
We can reduce the value of
epsilon(the name of the difference between the angles) but that makes it hard to draw a full circle by gradually increasing the value ofendArc(ie. the opposite case of the sketch) which is why this was implemented like this in the first place.@b0nb0n For your case, I would do something like this:
That way the value of
arcEndwill not reach a point where the two angles are too close together while not having any change in how it looks.