[vtkusers] Writing a sphere in a file

Panagiotis Foteinos panagiotis.foteinos at gmail.com
Mon Mar 27 08:37:11 EDT 2017


Hi all.

I am attempting to write a sphere in a vtk file. The following snippet:

*************************************************
vtkSmartPointer<vtkSphereSource>  sphereSource =
vtkSmartPointer<vtkSphereSource>::New();

sphereSource->SetCenter(0.0, 0.0, 0.0);
sphereSource->SetRadius(1.0);

vtkSmartPointer<vtkPolyDataWriter> writer =
vtkSmartPointer<vtkPolyDataWriter>::New();
writer->SetInputData(sphereSource->GetOutput());
writer->SetFileName(filename.c_str());
writer->Update();
*************************************************

creates an empty file.

Any suggestions?

Warm Regards,
Panos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170327/ef152072/attachment.html>


More information about the vtkusers mailing list