[vtkusers] STL file surface coordinate

tony hakki tony2007vtk at yahoo.com
Sat Dec 30 09:59:03 EST 2006


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061230/00954991/attachment.htm>


More information about the vtkusers mailing list