[vtkusers] Speed up strategies for ray casting using vtkOBBTree?

David Doria daviddoria at gmail.com
Fri Nov 4 16:11:09 EDT 2016


On Fri, Nov 4, 2016 at 10:27 AM, BBerco <bebe0705 at colorado.edu> wrote:

> Dear all,
> I'm working on some ray casting applications with the help of vtkOBBTree.
> This class does a fine job as it is easy to use and does exactly what I
> want, but I was wondering if I could speed up the ray-casting process when
> large data sets are involved.
>
> I am dealing with ray-tracing from a LIDAR focal plane comprised of 128 x
> 128 elements to a target potentially comprised of hundreds of thousands of
> vertices (833538 in my example). Illuminating it with each of the 128 x 128
> = 16384 pixels in the focal plane takes more than 15 minutes (as my timer
> is
> still running!). Obviously this is a computationally intensive problem, but
> I was wondering if there were some alternative strategies that could speed
> up the process.
>
> Specifically, because I am casting each ray by going through the focal
> plane
> rows by rows, the facet hit by the ray corresponding to pixel [i,j] should
> be pretty close  to the facet hit by the ray coming from pixel[i,j+1] (if
> not the same). So here's my first question: is their a way to restrict the
> ray-facet intersect search to the neighbors of a given facet? This way,
> only
> the very first pixel of the focal plane would require a global search
> through the vtkOBBTree: the rest of the intersects could be searched inside
> the neighbors of the impacted cells (and not inside the complete shape).
>
> I guess I could somehow implement manually, but i'd rather not reinvent the
> wheel.
>
> Besides this idea, if there any ray casting strategy using built-in VTK
> features more adapted to large datasets such as those I am dealing with?
>
> Thanks!
>
> Ben
>

If you're intersecting rays with meshes, try vtkModifiedBSPTree - it is (or
at least used to be) much faster.

https://itk.org/Wiki/VTK/Examples/Cxx/DataStructures/ModifiedBSPTreeIntersectWithLine

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161104/c7f040c2/attachment.html>


More information about the vtkusers mailing list