In my latest project, I managed to create a stunning 3D line graph using THREE.js and the CatmullRomCurve3 class for smooth curves. Everything was going smoothly until I attempted to turn that curve into a mesh and possibly extrude it.
My initial approach resulted in errors because it seems that a curve is not compatible with the geometry constructor:
var geometry = new THREE.ShapeGeometry( curve );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var mesh = new THREE.Mesh( geometry, material ) ;
The error messages led me to explore using the curve as an extrudePath parameter in examples like this:
var extrudeSettings = {
steps : 100,
bevelEnabled : false,
extrudePath : curve
};
However, this method still requires a shape to be passed to ExtrudeGeometry, which feels redundant since the curve already defines the desired shape. Is there a more straightforward way to achieve this without creating a separate shape?
If anyone has any insights or solutions to this challenge, I would greatly appreciate your help!