0

I have an input as set of voxels with their centre's (x,y,z) given. I have a set of lines. I want to find if a line is intersected by any voxel in the given voxel set. (Yes/No Question). The current algorithm I am using is to traverse through the complete voxel set until I found intersection with any voxel. This takes much time. Is it any way to do it faster?

I am finding intersection of a voxel with the line by calculating the distance of the centre of the voxel from the line and checking whether it is less than some small quantity.

Rahul Sonanis
  • 55
  • 2
  • 7

1 Answers1

1

If voxel is axis-aligned box, then you can use any line-clipping algorithm to check for intersection.

I'd recommend Liang-Barsky one (checks for intersection with 6 planes)

MBo
  • 77,366
  • 5
  • 53
  • 86