Reputation: 584
I have used CatmullRomCurve3 to extrude over a curved line. Is it possible to extrude over a sharp line like below:
What I want to have is:
With possibly as few polygons as possible.
Upvotes: 1
Views: 4273
Reputation: 584
I ended up creating vertices, faces and calculating UVs myself. For anyone wanting to do something similar this helped me a lot. I still do not know if ExtrudeGeometry could have been used here.
Upvotes: 0
Reputation: 21
There are a number of ways you could create a geometry of steps, but to do so using ExtrudeGeometry, you could do something like:
var shape = new THREE.Shape();
shape.moveTo( 0, 0 );
var numSteps = 10, stepSize = 10;
for ( var i = 0; i < numSteps; i ++ ) {
shape.lineTo( i * stepSize, ( i + 1 ) * stepSize );
shape.lineTo( ( i + 1 ) * stepSize, ( i + 1 ) * stepSize );
}
var extrudeSettings = { amount: 100, bevelEnabled: false };
var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
var material = new THREE.MeshBasicMaterial( {color: 0xffffff } );
var steps = new THREE.Mesh( geometry, material );
For a full example based on webgl_geometry_extrude_shapes2, see below:
Upvotes: 2