Given a 3d solid box with points in it. Given a box meshed with tetraheda. The dimensions of both boxes are the same.
I need to find an algorithm, that maps points of the solid to respective tetrahedra in the mesh.
I used the next algorithm:
- Refine solid with an octree
- Iterate over tetrahedra in the mesh and check if it intersects with a branch or a leave of the octree. (Ratschek & Rockne's algorithm)
- If it intersects, map the points from the octree to the tetrahedron.
But the algorithm is very slow, moreover I have huge problems checking the intersection between a box and a tetrahedron.
I could still stick with an octree, but I definitely need something reasonable to check the intersections. Any comment will be highly appreciated.
UPDATE: I have 2 million solid points and 200k tetrahedra
UPDATE 2: I am trying to implement Walking in a triangulation