提交 1177ba52 编写于 作者: M Mr.doob

Merge pull request #7662 from WestLangley/dev-path

Path: Make use of autoClose property
......@@ -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 );
};
......
......@@ -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 ] );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册