[vtkusers] Line polygon intersection

David Doria daviddoria at gmail.com
Mon Feb 13 09:10:44 EST 2012


On Mon, Feb 13, 2012 at 9:07 AM, Jothybasu Selvaraj <jothybasu at gmail.com> wrote:
> Hi all,
>
> I want to find whether a ray passes through a 2D polygon or not. The 2D
> polygon will be at any depth and orientation (rotate aboth x,y,&z axes).
>
> Can the vtkOBBTree or vtkModifiedBSPTree do this?
>
> Thanks
>
> --
> Jothy

Yes, and the vtkModifiedBSPTree is much much faster:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/ModifiedBSPTree_IntersectWithLine

If you just need to intersect one polygon (not a whole tree of a
mesh), you can use
http://www.vtk.org/doc/nightly/html/classvtkPolygon.html#aaa65561067bdaaca9f965fffcc7e7e8b
directly.

David



More information about the vtkusers mailing list