I'm struggling with headaches while attempting to extrude a spline to the scene's origin. Here is my current approach:
First, I create a spline using the following code snippet:
let centerX = 0
let centerY = 0
let radius = 200
let coils = 50
let rotation = 2 * Math.PI
let thetaMax = coils * Math.PI
let awayStep = radius / thetaMax
let chord = 5
let vertices = []
for (let theta = chord / awayStep; theta <= thetaMax;) {
let away = awayStep * theta
let around = theta + rotation
let x = centerX + Math.cos(around) * away
let y = centerY + Math.sin(around) * away
theta += chord / away
let vec3 = new THREE.Vector3(x, y, 0)
vertices.push(vec3)
}
let axisPoints = []
data.forEach((d, i) => {
axisPoints.push(new THREE.Vector3(vertices[i].z, vertices[i].y / 2, vertices[i].x / 2))
})
let axis = new THREE.CatmullRomCurve3(axisPoints)
let geometry = new THREE.BufferGeometry().setFromPoints(axis.getPoints(axisPoints.length))
let material = new THREE.LineBasicMaterial({
color: 0x481e34,
transparent: true,
opacity: 0.2
})
let splineObject = new THREE.Line(geometry, material)
scene.add(splineObject)
Now, I am trying to extrude a "mesh" or "face" along this spline, leading directly to the scene's origin at 0, similar to the image shown https://i.sstatic.net/YyNjy.png.
Despite numerous attempts, I have not been able to achieve this desired outcome. Any assistance would be greatly appreciated!
Thank you in advance!