[vtkusers] points from polydata
Sebastien MARAUX
maraux at ondim.fr
Mon Mar 17 09:44:33 EST 2003
Hello,
reader[i]->GetOutput()->GetPoint(0) /*for first & */
reader[i]->GetOutput()->Getpoint(reader[i]->GetOutput()->GetNumberOfPoints()
-1);
/*for last should do it if you only got a polyline in your polydata
if you have several cells, you can use traversal methods on cell arrays,
with getPolys, getStrips, getLines and getVertices methods
and use ptsIds[0] & ptsIds[numPts] from returned info
to get your points instead of 0 and output->GNOP()-1 */
Sebastien MARAUX
----- Original Message -----
From: "Bruno Travençolo" <bant at grad.icmc.usp.br>
To: <vtkusers at public.kitware.com>
Sent: Monday, March 17, 2003 3:25 PM
Subject: [vtkusers] points from polydata
> Hello All,
>
> I read a polydata from this file, that represents one line in the space:
> --------------------------------------------------------------------------
--
> # vtk DataFile Version 3.0
> A simple line formed by 1000 points
> ASCII
> DATASET POLYDATA
> POINTS 1000 float
> 247.0 218.0 145.0
> 246.9 218.4 145.2
> ..........
>
> LINES 1 1001
> 1000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14..............
> --------------------------------------------------------------------------
--
>
> and the commands that I used to read it was:
>
> reader[i] = vtkPolyDataReader::New();
> reader[i]->SetFileName(filename);
> reader[i]->Update();
>
>
> Now I want to get the first point and the last point from the point
> list. Something like that:
>
> float first[3],last[3]
> first = reader[i]->GetOutput()???????????
> last = reader[i]->GetOutput()???????????
>
>
> But I didn't find the proper command for that. How can I do this??
>
> thanks,
>
> Bruno.
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list