Hey there! I'm currently working on generating rays from vertex to vertex and checking if they intersect with a plane geometry. If the intersection occurs, I'm capturing the point of interception and adding it to an array of vertices. However, I suspect that I may not be using the raycaster correctly since the code snippet below is not producing the desired result. Any assistance or advice on this matter would be highly appreciated!
let vertexCount = geometry.vertices.length;
let vertexArray = geometry.vertices;
let planeY = plane.vertices[0].y;
let finalGeometry = new THREE.Geometry();
let intersects;
let intersectionPoint;
let raycaster = new THREE.Raycaster();
for (let i = 0; i < vertexCount; i++){
for (let k = 0; k < vertexCount; k++){
raycaster.set(vertexArray[i], vertexArray[k]);
intersects = raycaster.intersectObject(plane);
intersectionPoint = intersects.point;
finalGeometry.vertices.push(intersectionPoint);
}
}