Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 6, 2021
1 parent 69dc7a7 commit 81487f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/extras/curves/CatmullRomCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,9 @@ class CatmullRomCurve3 extends Curve {
let dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );

// safety check for repeated points
if ( dt1 < 1e-4 )
dt1 = 1.0;
if ( dt0 < 1e-4 )
dt0 = dt1;
if ( dt2 < 1e-4 )
dt2 = dt1;
if ( dt1 < 1e-4 ) dt1 = 1.0;
if ( dt0 < 1e-4 ) dt0 = dt1;
if ( dt2 < 1e-4 ) dt2 = dt1;

px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );
py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );
Expand Down
6 changes: 2 additions & 4 deletions src/extras/curves/EllipseCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ class EllipseCurve extends Curve {
const samePoints = Math.abs( deltaAngle ) < Number.EPSILON;

// ensures that deltaAngle is 0 .. 2 PI
while ( deltaAngle < 0 )
deltaAngle += twoPi;
while ( deltaAngle > twoPi )
deltaAngle -= twoPi;
while ( deltaAngle < 0 ) deltaAngle += twoPi;
while ( deltaAngle > twoPi ) deltaAngle -= twoPi;

if ( deltaAngle < Number.EPSILON ) {

Expand Down

0 comments on commit 81487f2

Please sign in to comment.