|
@@ -199,6 +199,9 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
|
|
|
divisions = divisions || 12;
|
|
divisions = divisions || 12;
|
|
|
|
|
|
|
|
+ var b2 = THREE.ShapeUtils.b2;
|
|
|
|
+ var b3 = THREE.ShapeUtils.b3;
|
|
|
|
+
|
|
var points = [];
|
|
var points = [];
|
|
|
|
|
|
var cpx, cpy, cpx2, cpy2, cpx1, cpy1, cpx0, cpy0,
|
|
var cpx, cpy, cpx2, cpy2, cpx1, cpy1, cpx0, cpy0,
|
|
@@ -253,8 +256,8 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
|
|
|
var t = j / divisions;
|
|
var t = j / divisions;
|
|
|
|
|
|
- tx = THREE.ShapeUtils.b2( t, cpx0, cpx1, cpx );
|
|
|
|
- ty = THREE.ShapeUtils.b2( t, cpy0, cpy1, cpy );
|
|
|
|
|
|
+ tx = b2( t, cpx0, cpx1, cpx );
|
|
|
|
+ ty = b2( t, cpy0, cpy1, cpy );
|
|
|
|
|
|
points.push( new THREE.Vector2( tx, ty ) );
|
|
points.push( new THREE.Vector2( tx, ty ) );
|
|
|
|
|
|
@@ -294,8 +297,8 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
|
|
|
|
|
|
var t = j / divisions;
|
|
var t = j / divisions;
|
|
|
|
|
|
- tx = THREE.ShapeUtils.b3( t, cpx0, cpx1, cpx2, cpx );
|
|
|
|
- ty = THREE.ShapeUtils.b3( t, cpy0, cpy1, cpy2, cpy );
|
|
|
|
|
|
+ tx = b3( t, cpx0, cpx1, cpx2, cpx );
|
|
|
|
+ ty = b3( t, cpy0, cpy1, cpy2, cpy );
|
|
|
|
|
|
points.push( new THREE.Vector2( tx, ty ) );
|
|
points.push( new THREE.Vector2( tx, ty ) );
|
|
|
|
|
|
@@ -571,6 +574,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var isClockWise = THREE.ShapeUtils.isClockWise;
|
|
|
|
|
|
var subPaths = extractSubpaths( this.actions );
|
|
var subPaths = extractSubpaths( this.actions );
|
|
if ( subPaths.length === 0 ) return [];
|
|
if ( subPaths.length === 0 ) return [];
|
|
@@ -591,7 +595,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- var holesFirst = ! THREE.ShapeUtils.isClockWise( subPaths[ 0 ].getPoints() );
|
|
|
|
|
|
+ var holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );
|
|
holesFirst = isCCW ? ! holesFirst : holesFirst;
|
|
holesFirst = isCCW ? ! holesFirst : holesFirst;
|
|
|
|
|
|
// console.log("Holes first", holesFirst);
|
|
// console.log("Holes first", holesFirst);
|
|
@@ -609,7 +613,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
|
|
|
|
|
|
tmpPath = subPaths[ i ];
|
|
tmpPath = subPaths[ i ];
|
|
tmpPoints = tmpPath.getPoints();
|
|
tmpPoints = tmpPath.getPoints();
|
|
- solid = THREE.ShapeUtils.isClockWise( tmpPoints );
|
|
|
|
|
|
+ solid = isClockWise( tmpPoints );
|
|
solid = isCCW ? ! solid : solid;
|
|
solid = isCCW ? ! solid : solid;
|
|
|
|
|
|
if ( solid ) {
|
|
if ( solid ) {
|