mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.68k stars 35.37k forks source link

THREE.EllipseCurve is calculating start/end angles incorrectly #9282

Open killroy42 opened 8 years ago

killroy42 commented 8 years ago
Description of the problem

With the latest update to THREE.EllipseCurve on the dev branch, the angle calculations are incorrect. You can no longer create a clockwise, full circle, as using 0/2Pi as the angles inverts/reverse the curve.

The problematic changes are in THREE.EllipseCurve.prototype.getPoint

Example:

// v-- full, counter-clockwise circle with origin on right
shape.absellipse(0, 0, 10, 10, 0, 2 * Math.PI, true);
 // v-- full, clockwise circle with origin on right
shape.absellipse(0, 0, 10, 10, 0, 2 * Math.PI + Number.EPSILON*2.1, true);

Expected behaviour is to get a clockwise circle when using 0/2Pi as start/end angles and true for the clockwise flag.

Three.js version
zz85 commented 8 years ago

Relates to #8952 #9079