[vtkusers] Writing a sphere in a file

Panagiotis Foteinos panagiotis.foteinos at gmail.com
Mon Mar 27 09:08:22 EDT 2017


Thank you Mathieu.

It works like a charm.

Best,
Panos

On Mon, Mar 27, 2017 at 2:39 PM, Mathieu Westphal <
mathieu.westphal at kitware.com> wrote:

> 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/25630d9b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circumSphere.PNG
Type: image/png
Size: 144842 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170327/25630d9b/attachment-0001.png>


More information about the vtkusers mailing list