I am working with a fascinating system of tubes. These tubes are created using the following code:
tube_color - represents the color of the tube,
spline_points - a large collection of THREE.Vector3 objects,
segments, radiusSegments are just numerical values
var material = new THREE.MeshLambertMaterial( { color: tube_color, shading: THREE.SmoothShading } );
var spline = new THREE.SplineCurve3(spline_points);
var tube = new THREE.TubeGeometry(spline, segments, 10, radiusSegments, false, false);
var tubeMesh = new THREE.Mesh(tube, material);
scene.add(tubeMesh);
This piece of code generates a specific mesh object within the space. By utilizing myMesh.geometry.vertices, I can obtain an array of Vector3's for each mesh.
The main issue is: when I place a cube around a certain point in 3D space, it intersects with the tubes. An example of creating such a cube is demonstrated below:
var cube = new THREE.CubeGeometry(xSize,ySize,zSize, 5, 5, 5);
var material = new THREE.MeshBasicMaterial({
color: 0xff0000,
opacity: 1,
wireframe: true,
transparent: false
});
var selectionMesh = new THREE.Mesh(cube, material);
scene.add(selectionMesh);
Is there a way to identify meshes that intersect with this cubic area? While I could iterate through all meshes in the scene object and check if any of their points lie within the cubic area, I am hoping for a simpler method or algorithm to achieve this...