Browse Source

Fixed SplineCurve array bug

zz85 14 years ago
parent
commit
ae71419f1f

+ 1 - 1
src/extras/geometries/ExtrudeGeometry.js

@@ -30,7 +30,7 @@ THREE.ExtrudeGeometry = function( shape, options ) {
 
 	THREE.Geometry.call( this );
 
-    var vertices = shape.getPoints();
+    var vertices = shape.getSpacedPoints();
 	var reverse = THREE.FontUtils.Triangulate.area( vertices ) > 0 ;
 	if (reverse) {
 		//faces = THREE.FontUtils.Triangulate( vertices.reverse(), true );

+ 1 - 1
src/extras/geometries/Path.js

@@ -111,7 +111,7 @@ THREE.Path.prototype.splineThru = function( pts /*Array of Vector*/ ) {
 	var y0 = lastargs[ lastargs.length - 1 ];
 	
 	var npts = [new THREE.Vector2(x0, y0)];
-	npts=  npts.concat(pts.unshift);
+	npts=  npts.concat(pts);
 	var curve = new THREE.SplineCurve( npts );
 	this.curves.push( curve );
 	

+ 1 - 0
src/extras/geometries/Shape.js

@@ -43,6 +43,7 @@ THREE.Shape.prototype.getSpacedPoints = function(divisions) {
 	var pts = [];
 	for (var i=0; i< divisions;i++) {
 		pts.push(this.getPoint(i/divisions));
+		if(!this.getPoint(i/divisions)) throw "DIE";
 	}
 	//console.log(pts);
 	return pts;