Hello, everyone!
I’m using Extrude Buffer Geometry to stretch along a specified path. I want to stretch using my defined path point, not a fixed step. However, Figure 2 is my expected effect. What should I do? Please help me. Thank you very much.
This is my code:
var radius = 0.12;
var pathPoints = [
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(0, 1.196, 0),
new THREE.Vector3(0, 1.196, 1),
new THREE.Vector3(0, 0, 1)
];
var points = roundedCornerLine(pathPoints, radius, 12);
var arcShape = new THREE.Shape();
arcShape.moveTo(0, 0);
arcShape.absarc(0, 0, radius, 0, Math.PI * 2, false);
var path= new THREE.CatmullRomCurve3(points);
var step = path.points.length;
var geo = new THREE.ExtrudeBufferGeometry(arcShape, {
extrudePath: path,
curveSegments: 12,
steps: step,
bevelEnabled: false
});
var mesh = new THREE.Mesh(geo, new THREE.MeshPhongMaterial());
mesh.material.wireframe = true;
scene.add(mesh);
This is the result:
Figure 2 is what I expected: