[vtkusers] construct a vtkPolyLine/PolyGon from a set of vtkLines

nsarrasin nsarrasin at phenix-systems.com
Mon Jan 3 08:47:44 EST 2011


First of all, Happy New Year to everyone !

Now that's done, I describe my problem.

Is there a way to construct a vtkPolyLine from a set of vtkLines ?

>From vtkConnectivityFilter->SetExtractionModeToSpecifiedRegions, I get a
continuous set of lines as a polydata (see
http://img135.imageshack.us/img135/2812/beforew.png). 
Then I have to convert this polyline to my own format. The probleme is that
I can't get the points in the right order. I've basically done this :

double coords[3];
std::vector<double*> vect;
for(int i=0; i<polydata->GetNumberOfPoints(); i++)
{
  polydata->GetPoints()->GetPoint(i, coords);
  vect.push_bak(coords);
}

Which gives me a wrong result (see
http://img593.imageshack.us/img593/5090/aftero.png).

Does VTK provides a way to find the right order of the points ?

Thanks by advance.
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/construct-a-vtkPolyLine-PolyGon-from-a-set-of-vtkLines-tp3325716p3325716.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list