vtk and triangulation

Jerry Patterson jpatterson at agleader.com
Mon Jun 21 17:11:41 EDT 1999


Hi,

  I'm new to vtk and I would like to triangulate my data then use that
triangulation to make a nice structured grid of my data.  I have two
questions.

  First, I've been trying to use vtkDelaunay2D to do the triangulation,
so far to no avail.  I have a series of xy points that I put into
vtkPoints object as follows:

vtkPoints vpts;
vpts.SetNumberOfPoints(numsamples);
for (long smpli = 0; smpli < numsamples; ++smpli) {
  float inp[3];
  //set values
  vpts.SetPoint(smpli,inp);
}


Then I put the points into some sort of point set like a
vtkUnstructuredGrid or a vtkPolyData and set that as the input to the
vtkDelaunay2D object.  Here's a snippet of that code:

vtkPolyData pset;
pset.SetPoints(&vpts);
pset.BuildCells();  //I tried this to see if it would help :(
pset.Update();      //I tried this too

vtkDelaunay2D tri;
tri.SetInput(&pset);
tri.Update();

vtkPolyData* tridset = tri.GetOutput();

int csize=0;
cellt = tridset->GetCellType(csize);

vtkCellArray* cells = tridset->GetPolys();
int* cell;
cells->GetCell(0,csize,cell);

for csize here I get some obnouxiously huge number (1515870810) which
isn't exactly a triangle :(.
So the first question is how do I get this to work???

My second question is, once I get this triangulated dataset, is there
any way for me to get some sort of structured grid output I can get that
follows the triangulation I give it?  I.e., is there someway I can
derive a grid from a triangulation?

Thanks for your help!
Jerry

---
Jerry Patterson
Software Engineer
Ag Leader Technology
jpatterson at agleader.com
jerpat at iastate.edu




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list