[vtkusers] Check if point is inside convex hull

Bryn Lloyd blloyd at vision.ee.ethz.ch
Wed Nov 4 07:23:58 EST 2009


Your mesh is a vtkUnstructuredGrid, i.e. it is a vtkDataSet.


call the function:

vtkDataSet::FindCell(double x[3], vtkCell *cell, vtkIdType cellId, 
double tol2, int &subId, double pcoords[3], double *weights)

or any other variant of this function.


It returns the cell Id or -1 if no cell was found to contain the point.





Dirk wrote:
> Dear list,
> 
> Lets say I created a convex hull H of a point cloud with vtkDelaunay3D.
> I have a point A.
> What's the best way to find out whether A is inside H, 
> on H or outside of H?
> How do I get the id of the tetraheder in which A lies?
> 
> Thank you,
> Dirk
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 


-- 
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7, ETF C110
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------



More information about the vtkusers mailing list