Open liyihongcug opened 8 years ago
Error is Uncaught TypeError: Cannot read property 'amount' of undefined !! I update chapter-06\05-extrude-svg.html. you can see below `
`
But It can't run. I am boring so that I can't make progress in this week. I hope you can help me.
All code are below: ` var shapearr=[]; var shape, svgString; var paths=document.querySelectorAll("svg > path[id]") for(var i = 0; i < paths.length; i++) { var path = paths[i]; svgString=path.getAttribute('d'); console.log(svgString); //shape = transformSVGPathExposed(svgString); shape=createMesh(new THREE.ShapeGeometry(drawShape2(svgString))); scene.add(shape); shapearr.push(shape); } ..... var controls = new function () { this.amount =6; //2; this.bevelThickness = 2; this.bevelSize = 0.5; this.bevelEnabled = true; this.bevelSegments = 3; this.bevelEnabled = true; this.curveSegments = 12; this.steps = 1; this.asGeom = function () { scene.remove(shape); var options = { amount: controls.amount, bevelThickness: controls.bevelThickness, bevelSize: controls.bevelSize, bevelSegments: controls.bevelSegments, bevelEnabled: controls.bevelEnabled, curveSegments: controls.curveSegments, steps: controls.steps };
var paths=document.querySelectorAll("svg > path[id]") console.log(shapearr); for(var i = 0; i < paths.length; i++) { var path = paths[i]; svgString=path.getAttribute('d'); console.log(svgString); // shape = transformSVGPathExposed(svgString); shape=createMesh(new THREE.ExtrudeGeometry(drawShape2(svgString)),options); scene.add(shape); } }; }; ``
I sovled the poblem .The answer is upper
@liyihongcug could you show this result?
codes are above . YOu can find it.
Error is Uncaught TypeError: Cannot read property 'amount' of undefined !! I update chapter-06\05-extrude-svg.html. you can see below `
`
But It can't run. I am boring so that I can't make progress in this week. I hope you can help me.
All code are below: ` var shapearr=[]; var shape, svgString; var paths=document.querySelectorAll("svg > path[id]") for(var i = 0; i < paths.length; i++) { var path = paths[i]; svgString=path.getAttribute('d'); console.log(svgString); //shape = transformSVGPathExposed(svgString); shape=createMesh(new THREE.ShapeGeometry(drawShape2(svgString))); scene.add(shape); shapearr.push(shape); } ..... var controls = new function () { this.amount =6; //2; this.bevelThickness = 2; this.bevelSize = 0.5; this.bevelEnabled = true; this.bevelSegments = 3; this.bevelEnabled = true; this.curveSegments = 12; this.steps = 1; this.asGeom = function () { scene.remove(shape); var options = { amount: controls.amount, bevelThickness: controls.bevelThickness, bevelSize: controls.bevelSize, bevelSegments: controls.bevelSegments, bevelEnabled: controls.bevelEnabled, curveSegments: controls.curveSegments, steps: controls.steps };