Browse Source

Optimising THREE.ExtrudeGeometry::addShape

Nicholas Kinsey 14 years ago
parent
commit
285b51a1c1
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/extras/geometries/ExtrudeGeometry.js

+ 4 - 6
src/extras/geometries/ExtrudeGeometry.js

@@ -198,11 +198,9 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
 	var contour = vertices; // vertices has all points but contour has only points of circumference
 	var contour = vertices; // vertices has all points but contour has only points of circumference
 
 
 	for ( h = 0, hl = holes.length;  h < hl; h ++ ) {
 	for ( h = 0, hl = holes.length;  h < hl; h ++ ) {
-
-		ahole = holes[ h ];
-
-		vertices = vertices.concat( ahole );
-
+		
+		Array.prototype.push.apply( vertices, holes[ h ] );
+		
 	}
 	}
 
 
 
 
@@ -384,7 +382,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
 		}
 		}
 
 
 		holesMovements.push( oneHoleMovements );
 		holesMovements.push( oneHoleMovements );
-		verticesMovements = verticesMovements.concat( oneHoleMovements );
+		Array.prototype.push.apply( verticesMovements, oneHoleMovements );
 
 
 	}
 	}