Skip to content
Permalink
Browse files

remove empty shapes

  • Loading branch information...
lautr3k committed Mar 26, 2016
1 parent 6ad86f2 commit 61b7cb6d1d008b37f8a175cb94b2317b51a7503e
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/slacer/slicer.js
@@ -364,22 +364,28 @@ var SLAcer = SLAcer || {};
var color = this.settings.color;
//var color = ((1<<24)*Math.random()|0);
var geo = new THREE.ShapeGeometry(shapes[key]);

if (!geo.faces.length || !geo.vertices.length) {
delete shapes[key];
continue;
}

meshes.push(new THREE.Mesh(
geo,
new THREE.MeshBasicMaterial({
color: color, side: THREE.DoubleSide
})
));
} catch(e) {
}
catch(e) {
console.error(e);
console.log(shapes[key]);
}
}

// remove empty shapes...
shapes = shapes.filter(function(n){ return n != undefined });

return {
time : Date.now() - time,
geometry: geometry,

0 comments on commit 61b7cb6

Please sign in to comment.
You can’t perform that action at this time.