<meta http-equiv="content-type" content="text/html; charset=utf-8"><div class="gmail_quote">On Sun, Feb 27, 2011 at 7:06 PM, Sam <span dir="ltr"><<a href="mailto:sistephan@gmail.com">sistephan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
Given a point in VTK Space, I want to know whether this point is inside or<br>
outside a VTKPolyData model. I have tried using vtkSelectEnclosedPoints but<br>
it is slow and does now seem to function properly.<br>
<br>
Instead, I would like to do this following:<br>
<br>
I want to cast a ray from the give point and count how many times I cross<br>
the VTKPolyData model's surface. How do I do this?<br><br></blockquote><div>Is this how you tried to use vtkSelectEnclosedPoints?</div><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject</a><br clear="all">
<br></div><div class="gmail_quote">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.</div><div class="gmail_quote"><br></div><div class="gmail_quote">
I usually use the Modified BSP tree to do ray-mesh intersections:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/ModifiedBSPTree_IntersectWithLine">http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/ModifiedBSPTree_IntersectWithLine</a></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">I've never tried to get more than one intersection out though.</div><div class="gmail_quote"><br><div>David</div></div>