ray = (position=startpoint, velocity= endpoint - startpoint)
endtime = 1
for hit in eachtraversal(ray, edges)
if hit.exit_time > endtime
# endpoint might be in the middle of a voxel, handle this edge case
break
else
# handle ordinary hit
end
end
For your second question intersection length can be computed as follows:
Thanks a lot for your amazing reply. It is very helpful for me.
I think there is a small typo error in the answer to my second question, the intersection length may be: norm(ray.velocity) *(hit.exit_time - hit.entry_time)