[vtkusers] Writing a sphere in a file

Mathieu Westphal mathieu.westphal at kitware.com
Mon Mar 27 08:39:18 EDT 2017


Hi

- writer->SetInputData(sphereSource->GetOutput());
+ writer->SetInputConnection(sphereSource->GetOutputPort(0));

Regards,

Mathieu Westphal

On Mon, Mar 27, 2017 at 2:37 PM, Panagiotis Foteinos <
panagiotis.foteinos at gmail.com> wrote:

> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170327/90d39c14/attachment.html>


More information about the vtkusers mailing list