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

David Gobbi david.gobbi at gmail.com
Mon Jan 3 09:18:26 EST 2011


On Mon, Jan 3, 2011 at 1:47 PM, nsarrasin <nsarrasin at phenix-systems.com> wrote:
>
> 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 ?

Yes, the vtkStripper filter will do exactly that.

But there is something else that you need to fix.  The Points in a
vtkPolyData are not ordered according to connectivity.  What you have
to do is get the cells from the data, since the PointIds in the cells
_are_ ordered by connectivity:

vtkCellArray *lines = data->GetLines();
vtkPoints *points = data->GetPoints();

Go through all the polylines in the cell array and use the point Ids
to get the points.

  David



More information about the vtkusers mailing list