[vtkusers] FindAndGetCell ?!

Terence Lim tlim at mda.ca
Tue Nov 6 17:06:51 EST 2001


Hi vtkusers,

I am looking for a way to get the cellid of a cell (triangle type) that
contains an inputted point.  This point is not a vertex of any of the
triangles, it is a point which may be contained by the boundaries of the
vertices.  I have tried the FindAndGetCell method but i must be doing
something wrong because the returned cellid is always 0 regardless of what
the input point is. i am absolutely sure that the coordinates of this input
point is actually contained within a cell in my mesh. What am I doing wrong?

float tester[3], pcoords[3], *weights;
float tol2 = 0;
tester[0] = 100;		//x coordinate of the point
tester[1] = 10;		//y coordinate of the point
tester[2] = 5;		//z coordinate of the point
int cellid= 0;
int subId= 0;
vtkTriangle *tri = vtkTriangle::New();
vtkCell *testcell =
Delaunay->GetOutput()->FindAndGetCell(tester,tri,cellid,tol2,subId,pcoords,w
eights);
cout<<"The cellid of the cell that contains this point is: "<<cellid<<endl;
//this always returns 0


Any suggestions would be greatly appreciated.

Thanks,

Terence Lim




More information about the vtkusers mailing list