two.js library has a function as follows;
makeArcSegment two.makeArcSegment(ox, oy, ir, or, sa, ea, res);
I calculate my parameters as follows;
var prevPt = points[i - 1];
var dxNext = nextPt.x - pt.x;
var dyNext = nextPt.y - pt.y;
var angleNext = Math.atan2(dyNext, dxNext);
var dxPrev = prevPt.x - pt.x;
var dyPrev = prevPt.y - pt.y;
var anglePrev = Math.atan2(dyPrev, dxPrev);
var innerRadius = 0;
var outerRadius = 20;
var arc = two.makeArcSegment(pt.x, pt.y, innerRadius, outerRadius, anglePrev, angleNext)
And my output is kind of unexpected.
At first node (after the line with the length of 225.46), sweep direction is counter clockwise. At second node (after 142.35), sweep direction is clockwise.How do I force it to be always counter clockwise?
Thanks.