mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 04:56:01 +10:00
Fixed SplineCurve array bug
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user