Is there a way to create a linear swept face with code?
I have written the following code:
// defining the profile
var points = [
new THREE.Vector2(0, 0),
new THREE.Vector2(10, 0),
new THREE.Vector2(10, 10),
new THREE.Vector2(20, 10),
new THREE.Vector2(20, 20),
];
var shape_profile = new THREE.Shape(points);
// creating the path
var sweep_path = new THREE.LineCurve3(new THREE.Vector3(0, 0, 0), new THREE.Vector3(30, 0, 30));
var extrusion_geometry = new THREE.ExtrudeGeometry(shape_profile , { steps: 1, bevelEnabled: false, extrudePath: sweep_path });
var quality_material = new THREE.MeshLambertMaterial({ color: 0xff8000, wireframe: false });
var result_mesh = new THREE.Mesh(extrusion_geometry, quality_material);
scene.add(result_mesh);
After running this code, I obtained the following result:
https://i.sstatic.net/s0lQy.jpg
However, the output does not match my desired outcome. My goal is to achieve something like this:
https://i.sstatic.net/tcDgw.jpg
What could be causing the discrepancy in results?