I want to extrude a shape
along an extrudePath
using THREE.ExtrudeBufferGeometry()
.
Basically this works fine, but the initial shape orientation is arbitrary, due to FrenetFrames as answered in this question.
The extrudePath is lying on one plane, so there will never be a problem regarding closing the Extrusion due to "wrong" orientation.
var myExtrudePath = new THREE.CatmullRomCurve3( <some THREE.Vector3() vectors> );
var shape = new THREE.Shape();
shape.lineTo( ... );
...
var extrudeSettings = { extrudePath: myExtrudePath };
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
Is there a way to set the initial shape orientation manually?
EDIT 1
I would like to avoid editing the three.js-File. I found something here. Is it (still) possible to give normal-vectors or frames as options to the ExtrudeBufferGeometry() ?
I imagine something like:
var phi = Math.PI / 2;
var normal = new THREE.Vector3( Math.sin(phi), Math.cos(phi), 0);
var binormal = new THREE.Vector3( Math.cos(phi), Math.sin(phi), 0);
var frames = { normals: [normal, normal], binormals: [binormal, binormal] };
var extrudeSettings = {
steps: 100,
extrudePath: path,
frames: frames
}
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
This does not work so far. I get an Error in three.js:2582:4 :
TypeError: v is undefined
copy
ExtrudeBufferGeometry.prototype.addShape
ExtrudeBufferGeometry.prototype.addShapeList
ExtrudeBufferGeometry