|
@@ -366,12 +366,16 @@ THREE.Shape.Utils = {
|
|
}
|
|
}
|
|
|
|
|
|
var holeIndex, shapeIndex,
|
|
var holeIndex, shapeIndex,
|
|
- shapePt, h, h2, holePt,
|
|
|
|
|
|
+ shapePt, holePt,
|
|
holeIdx, cutKey, failedCuts = [],
|
|
holeIdx, cutKey, failedCuts = [],
|
|
tmpShape1, tmpShape2,
|
|
tmpShape1, tmpShape2,
|
|
tmpHole1, tmpHole2;
|
|
tmpHole1, tmpHole2;
|
|
|
|
|
|
- for (h = 0, hl = holes.length; h < hl; h++) { indepHoles.push( h ); }
|
|
|
|
|
|
+ for ( var h = 0, hl = holes.length; h < hl; h ++ ) {
|
|
|
|
+
|
|
|
|
+ indepHoles.push( h );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
var counter = indepHoles.length * 2;
|
|
var counter = indepHoles.length * 2;
|
|
while ( indepHoles.length > 0 ) {
|
|
while ( indepHoles.length > 0 ) {
|
|
@@ -389,7 +393,7 @@ THREE.Shape.Utils = {
|
|
holeIndex = -1;
|
|
holeIndex = -1;
|
|
|
|
|
|
// search for hole which can be reached without intersections
|
|
// search for hole which can be reached without intersections
|
|
- for ( h = 0; h < indepHoles.length; h++ ) {
|
|
|
|
|
|
+ for ( var h = 0; h < indepHoles.length; h ++ ) {
|
|
holeIdx = indepHoles[h];
|
|
holeIdx = indepHoles[h];
|
|
|
|
|
|
// prevent multiple checks
|
|
// prevent multiple checks
|
|
@@ -397,7 +401,7 @@ THREE.Shape.Utils = {
|
|
if ( failedCuts[cutKey] !== undefined ) continue;
|
|
if ( failedCuts[cutKey] !== undefined ) continue;
|
|
|
|
|
|
hole = holes[holeIdx];
|
|
hole = holes[holeIdx];
|
|
- for ( h2 = 0; h2 < hole.length; h2 ++ ) {
|
|
|
|
|
|
+ for ( var h2 = 0; h2 < hole.length; h2 ++ ) {
|
|
holePt = hole[ h2 ];
|
|
holePt = hole[ h2 ];
|
|
if (! isCutLineInsideAngles( shapeIndex, h2 ) ) continue;
|
|
if (! isCutLineInsideAngles( shapeIndex, h2 ) ) continue;
|
|
if ( intersectsShapeEdge( shapePt, holePt ) ) continue;
|
|
if ( intersectsShapeEdge( shapePt, holePt ) ) continue;
|
|
@@ -437,7 +441,13 @@ THREE.Shape.Utils = {
|
|
// To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first.
|
|
// To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first.
|
|
|
|
|
|
var allpoints = contour.concat();
|
|
var allpoints = contour.concat();
|
|
- for (var h = 0, hl = holes.length; h < hl; h++) { Array.prototype.push.apply( allpoints, holes[h] ); }
|
|
|
|
|
|
+
|
|
|
|
+ for ( var h = 0, hl = holes.length; h < hl; h ++ ) {
|
|
|
|
+
|
|
|
|
+ Array.prototype.push.apply( allpoints, holes[h] );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
//console.log( "allpoints",allpoints, allpoints.length );
|
|
//console.log( "allpoints",allpoints, allpoints.length );
|
|
|
|
|
|
// prepare all points map
|
|
// prepare all points map
|