|
@@ -29041,8 +29041,8 @@ THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) {
|
|
|
};
|
|
|
|
|
|
THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y,
|
|
|
- aCP2x, aCP2y,
|
|
|
- aX, aY ) {
|
|
|
+ aCP2x, aCP2y,
|
|
|
+ aX, aY ) {
|
|
|
|
|
|
var args = Array.prototype.slice.call( arguments );
|
|
|
|
|
@@ -29090,14 +29090,14 @@ THREE.Path.prototype.arc = function ( aX, aY, aRadius,
|
|
|
|
|
|
this.absarc(aX + x0, aY + y0, aRadius,
|
|
|
aStartAngle, aEndAngle, aClockwise );
|
|
|
-
|
|
|
+
|
|
|
};
|
|
|
|
|
|
THREE.Path.prototype.absarc = function ( aX, aY, aRadius,
|
|
|
aStartAngle, aEndAngle, aClockwise ) {
|
|
|
this.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius,
|
|
|
aStartAngle, aEndAngle, aClockwise ) {
|
|
|
|
|
@@ -29109,7 +29109,7 @@ THREE.Path.prototype.ellipse = function ( aX, aY, xRadius, yRadius,
|
|
|
aStartAngle, aEndAngle, aClockwise );
|
|
|
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
|
|
|
THREE.Path.prototype.absellipse = function ( aX, aY, xRadius, yRadius,
|
|
|
aStartAngle, aEndAngle, aClockwise ) {
|
|
@@ -29223,7 +29223,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
|
|
|
points.push( new THREE.Vector2( tx, ty ) );
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
|
|
|
@@ -29373,7 +29373,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
var lastPoint = points[ points.length - 1];
|
|
|
var EPSILON = 0.0000000001;
|
|
|
if ( Math.abs(lastPoint.x - points[ 0 ].x) < EPSILON &&
|
|
|
- Math.abs(lastPoint.y - points[ 0 ].y) < EPSILON)
|
|
|
+ Math.abs(lastPoint.y - points[ 0 ].y) < EPSILON)
|
|
|
points.splice( points.length - 1, 1);
|
|
|
if ( closedPath ) {
|
|
|
|
|
@@ -29387,7 +29387,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
|
|
|
// Breaks path into shapes
|
|
|
|
|
|
-THREE.Path.prototype.toShapes = function() {
|
|
|
+THREE.Path.prototype.toShapes = function( isCCW ) {
|
|
|
|
|
|
var i, il, item, action, args;
|
|
|
|
|
@@ -29425,19 +29425,23 @@ THREE.Path.prototype.toShapes = function() {
|
|
|
|
|
|
if ( subPaths.length == 0 ) return [];
|
|
|
|
|
|
- var tmpPath, tmpShape, shapes = [];
|
|
|
-
|
|
|
- var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() );
|
|
|
- // console.log("Holes first", holesFirst);
|
|
|
+ var solid, tmpPath, tmpShape, shapes = [];
|
|
|
|
|
|
if ( subPaths.length == 1) {
|
|
|
+
|
|
|
tmpPath = subPaths[0];
|
|
|
tmpShape = new THREE.Shape();
|
|
|
tmpShape.actions = tmpPath.actions;
|
|
|
tmpShape.curves = tmpPath.curves;
|
|
|
shapes.push( tmpShape );
|
|
|
return shapes;
|
|
|
- };
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() );
|
|
|
+ holesFirst = isCCW ? !holesFirst : holesFirst;
|
|
|
+
|
|
|
+ // console.log("Holes first", holesFirst);
|
|
|
|
|
|
if ( holesFirst ) {
|
|
|
|
|
@@ -29446,8 +29450,10 @@ THREE.Path.prototype.toShapes = function() {
|
|
|
for ( i = 0, il = subPaths.length; i < il; i ++ ) {
|
|
|
|
|
|
tmpPath = subPaths[ i ];
|
|
|
+ solid = THREE.Shape.Utils.isClockWise( tmpPath.getPoints() );
|
|
|
+ solid = isCCW ? !solid : solid;
|
|
|
|
|
|
- if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) {
|
|
|
+ if ( solid ) {
|
|
|
|
|
|
tmpShape.actions = tmpPath.actions;
|
|
|
tmpShape.curves = tmpPath.curves;
|
|
@@ -29470,13 +29476,15 @@ THREE.Path.prototype.toShapes = function() {
|
|
|
} else {
|
|
|
|
|
|
// Shapes first
|
|
|
+ tmpShape = undefined;
|
|
|
|
|
|
for ( i = 0, il = subPaths.length; i < il; i ++ ) {
|
|
|
|
|
|
tmpPath = subPaths[ i ];
|
|
|
+ solid = THREE.Shape.Utils.isClockWise( tmpPath.getPoints() );
|
|
|
+ solid = isCCW ? !solid : solid;
|
|
|
|
|
|
- if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) {
|
|
|
-
|
|
|
+ if ( solid ) {
|
|
|
|
|
|
if ( tmpShape ) shapes.push( tmpShape );
|
|
|
|