[vtkusers] VTKPolyData Inside Points

David Doria daviddoria at gmail.com
Sun Feb 27 20:51:29 EST 2011


On Sun, Feb 27, 2011 at 7:06 PM, Sam <sistephan at gmail.com> wrote:

> Hello,
>
> Given a point in VTK Space, I want to know whether this point is inside or
> outside a VTKPolyData model.  I have tried using vtkSelectEnclosedPoints
> but
> it is slow and does now seem to function properly.
>
> Instead, I would like to do this following:
>
> I want to cast a ray from the give point and count how many times I cross
> the VTKPolyData model's surface.  How do I do this?
>
> Is this how you tried to use vtkSelectEnclosedPoints?

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject

If you can show us that your mesh is valid and it is giving incorrect
results I'm sure someone will look into that bug.

I usually use the Modified BSP tree to do ray-mesh intersections:

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

I've never tried to get more than one intersection out though.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110227/a63d89f6/attachment.htm>


More information about the vtkusers mailing list