[vtkusers] points inside closed mesh

Bryn Lloyd blloyd at vision.ee.ethz.ch
Sat Aug 23 12:35:09 EDT 2008


Hi,

try this:


   vtkOBBTree *obb = vtkOBBTree::New();
   obb->SetDataSet( pdmesh );
   obb->CacheCellBoundsOn();
   obb->SetTolerance(0.0);
   obb->BuildLocator();

   double p0[3] = {x, y, z}; // point used in query
   double p1[3] = {1e20,0.0,0.0};
   int code = obb->IntersectWithLine(p0,p1,0,0);
   // or : bool isInside = obb->InsideOrOutside(p0)<0;
   bool isInside = (code==-1);


Good luck,

Bryn





On Aug 23, 2008, at 12:24 PM, lucas Grijander wrote:

> Hi all,
>
> I have a closed 3D mesh and a cloud of 3D points. For my application  
> I have to find which points are inside the closed mesh and which are  
> outside. The shape of the mesh is random, we cannot apply convex  
> methods, etc... I would like to know if there is any method  
> implemented in vtk to solve this problem?
>
> best regards
>
> Lucas.
>
> Invite your mail contacts to join your friends list with Windows  
> Live Spaces. It's easy! Try it!  
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080823/6fef4865/attachment.htm>


More information about the vtkusers mailing list