mrdoob/three.js — Issue #1012: ExtrudeGeometry: getBoundingBox undefined
Author: eskimomatt
Created: 2012-01-03 14:07:28+00:00
State: open

After going through various examples of extrudegeometry and fiddling with http://jsbin.com/obajov/ example, i decided to try and extrude some more complex shapes using the same method. I created an svg, and the converted the points to line functions, no matter what i do to the numbers below, i always get 'Cannot call method 'getBoundingBox' of undefined' in the console - i've tried rounding these figures, even cutting the amount to a simpler state - in some cases i get 'triangulation failed' instead - any suggestions would be greatly appreciated

var path = new THREE.Path();

path.moveTo(-90.978,180.481);
path.lineTo(-144.503,182.492);
path.lineTo(-146.244,177.762);
path.lineTo(-155.334,173.521);
path.lineTo(-79.687,128.726);
path.lineTo(-57.016,133.761);
path.lineTo(-54.166,125.207);
path.lineTo(-31.759,109.318);
path.lineTo(-73.317,120.723);
path.lineTo(-124.647,92.623);
path.lineTo(-125.466,84.068);
path.lineTo(-74.547,57.585);
path.lineTo(-77.804,37.62);
path.lineTo(-90.51,37.031);
path.lineTo(-63.141,19.695);
path.lineTo(-45.217,20.103);
path.lineTo(-38.38,30.009);
path.lineTo(-41.145,17.66);
path.lineTo(-28.107,23.36);
path.lineTo(-36.475,12.735);
path.lineTo(-18.822,-25.731);
path.lineTo(-29.661,-19.175);
path.lineTo(-43.987,-44.266);
path.lineTo(-15.202,-66.991);
path.lineTo(-54.976,-60.158);
path.lineTo(-64.427,-74.23);
path.lineTo(-64.427,-57.582);
path.lineTo(-82.349,-69.553);
path.lineTo(-68.015,-98.459);
path.lineTo(-59.36,-98.459);
path.lineTo(-69.643,-114.347);
path.lineTo(-65.983,-126.563);
path.lineTo(-57.428,-124.527);
path.lineTo(-55.017,-126.563);
path.lineTo(-64.354,-129.006);
path.lineTo(-63.531,-144.076);
path.lineTo(-81.465,-134.299);
path.lineTo(-92.458,-103.743);
path.lineTo(-98.702,-102.635);
path.lineTo(-81.465,-151.817);
path.lineTo(-58.635,-167.61);
path.lineTo(-62.721,-174.224);
path.lineTo(-95.631,-156.646);
path.lineTo(-99.497,-159.101);
path.lineTo(-81.876,-176.68);
path.lineTo(-80.654,-188.492);
path.lineTo(-74.542,-196.233);
path.lineTo(-65.177,-197.862);
path.lineTo(-65.177,-227.196);
path.lineTo(-37.866,-268.733);
path.lineTo(13.235,-253.834);
path.lineTo(-30.13,-213.322);
path.lineTo(-23.611,-205.992);
path.lineTo(-6.548,-209.721);
path.lineTo(39.536,-197.031);
path.lineTo(39.944,-189.701);
path.lineTo(1.473,-134.291);
path.lineTo(-23.607,-123.7);
path.lineTo(-23.607,-119.217);
path.lineTo(-7.315,-116.37);
path.lineTo(-3.651,-121.257);
path.lineTo(21.716,-107.57);
path.lineTo(26.782,-33.043);
path.lineTo(31.388,-35.303);
path.lineTo(50.534,-23.894);
path.lineTo(66.825,52.291);
path.lineTo(54.606,61.661);
path.lineTo(58.275,62.068);
path.lineTo(66.825,72.719);
path.lineTo(76.602,60.032);
path.lineTo(108.79,90.176);
path.lineTo(83.525,125.622);
path.lineTo(69.672,125.622);
path.lineTo(76.931,130.907);
path.lineTo(52.842,139.313);
path.lineTo(73.743,148.021);
path.lineTo(88.245,147.037);
path.lineTo(88.003,159.838);
path.lineTo(46.449,176.948);
path.lineTo(34.506,170.272);
path.lineTo(2.856,167.583);
path.lineTo(-8.957,158.621);
path.lineTo(-6.102,165.95);
path.lineTo(-30.138,165.95);
path.lineTo(-31.364,172.877);
path.lineTo(-77.804,159.838);
path.lineTo(-90.978,180.481);

var shapes = path.toShapes();
var solid = new THREE.ExtrudeGeometry(shapes, { amount: 100, bevelEnabled: false });