diff --git a/src/extras/core/CurvePath.js b/src/extras/core/CurvePath.js index 888019ec8512da6f5e304184478a750887dddaf3..380f83dc241c245e5d724b5d4aab7c8146211dbd 100644 --- a/src/extras/core/CurvePath.js +++ b/src/extras/core/CurvePath.js @@ -146,7 +146,7 @@ THREE.CurvePath.prototype.getCurveLengths = function() { THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) { - var pts = this.getPoints( divisions, true ); + var pts = this.getPoints( divisions ); return this.createGeometry( pts ); }; @@ -155,7 +155,7 @@ THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) { THREE.CurvePath.prototype.createSpacedPointsGeometry = function( divisions ) { - var pts = this.getSpacedPoints( divisions, true ); + var pts = this.getSpacedPoints( divisions ); return this.createGeometry( pts ); }; diff --git a/src/extras/core/Path.js b/src/extras/core/Path.js index 694802b7d682fbf1c621d95b8250530fbae38353..d1550f697614f87db965a6192c9f0e83da0a6166 100644 --- a/src/extras/core/Path.js +++ b/src/extras/core/Path.js @@ -169,7 +169,7 @@ THREE.Path.prototype.absellipse = function ( aX, aY, xRadius, yRadius, aStartAng }; -THREE.Path.prototype.getSpacedPoints = function ( divisions, closedPath ) { +THREE.Path.prototype.getSpacedPoints = function ( divisions ) { if ( ! divisions ) divisions = 40; @@ -183,11 +183,11 @@ THREE.Path.prototype.getSpacedPoints = function ( divisions, closedPath ) { } - // if ( closedPath ) { - // - // points.push( points[ 0 ] ); - // - // } + if ( this.autoClose ) { + + points.push( points[ 0 ] ); + + } return points; @@ -195,7 +195,7 @@ THREE.Path.prototype.getSpacedPoints = function ( divisions, closedPath ) { /* Return an array of vectors based on contour of the path */ -THREE.Path.prototype.getPoints = function( divisions, closedPath ) { +THREE.Path.prototype.getPoints = function( divisions ) { divisions = divisions || 12; @@ -431,7 +431,8 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) { if ( Math.abs( lastPoint.x - points[ 0 ].x ) < Number.EPSILON && Math.abs( lastPoint.y - points[ 0 ].y ) < Number.EPSILON ) points.splice( points.length - 1, 1 ); - if ( closedPath ) { + + if ( this.autoClose ) { points.push( points[ 0 ] );