[vtkusers] STL file surface coordinate
Bill Lorensen
wlorens1 at nycap.rr.com
Sat Dec 30 14:06:08 EST 2006
Tony,
Yes, if you first do a:
read>Update();
Bill
At 09:59 AM 12/30/2006, tony hakki wrote:
>hello;
>Can I use the following code for obtain STL file's all (x,y,z) surface
>coordinates?Thanks in advance
>tony
>
>
>double X[3], Y[3], Z[3];
>
>vtkSTLReader *read = vtkSTLReader::New();
>
>
>
>..................
>
>
>
>tkPolyData *Source=read->GetOutput();
>
>// Put source points in SourcePoints
>
>SourcePoints = Source->GetPoints();
>
>// For each cell i do:
>
>for (i = 0; i < ncells; i++)
>
>// Get the points belonging to this cell.
>
>Source->GetCellPoints(i,cells);
>
>
>
>pId = cells->GetId(0);
>
>SourcePoints->GetPoint(pId,X);
>
>pId = cells->GetId(1);
>
>SourcePoints->GetPoint(pId,Y);
>
>pId = cells->GetId(2);
>
>SourcePoints->GetPoint(pId,Z);
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061230/fd2b2d2c/attachment.htm>
More information about the vtkusers
mailing list