[vtkusers] How to get the facet normals from stl file

Samu gaoxuanhui at foxmail.com
Fri Jun 17 09:29:39 EDT 2011


I use the vtkSTLReader to read the stl file. Here is my code:
vtkSTLReader *vascularSTL = vtkSTLReader::New();
vascularSTL->SetFileName("E:\\courses\\fileinfo\\menjingmai.stl");
vascularSTL->Update();
cout<<"vascularSTL updates complete!"<&lt;endl;

vtkPolyData *vascularData = vascularSTL-&gt;GetOutput();
vascularData->BuildCells();
vascularData->BuildLinks();

but I get the NULL pointers with the codes belowd:
vascularData->GetPointData()->GetNormals()
vascularData->GetPointData()->GetScalars()
vascularData->GetCellData()->GetScalars()
...
Does it mean that the vtkSTLReader is incomplete?? Does VTK have another stl
reader ? Could you give some suggestions?

--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-the-facet-normals-from-stl-file-tp4498677p4498742.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list