[vtkusers] screen shot get clippet
Gilad Arnon
gilad.arnon at massivit.com
Tue Aug 4 09:06:23 EDT 2015
Thanks Biil,
It didn't help, but setting the range manually did.
*Gilad Arnon*
*SW team leader*
M: +972-54-5226846
T: +972-8-6519486
gilad.arnon at massivit.com
Massivit 3D Printing Technologies Ltd.
11 Pesakh Lev Lod 7129361, Israel
www.massivit.com
On Tue, Aug 4, 2015 at 3:13 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:
> Before
>
> renderWindow->Render();
>
> do
>
> renderer->ResetCameraClippingRange();
>
>
>
> On Tue, Aug 4, 2015 at 2:22 AM, Gilad Arnon <gilad.arnon at massivit.com>
> wrote:
>
>> Hi all,
>>
>> I'm trying to get a png file out of my polydata.
>> (I take several pictures from different angles.)
>> but sometimes the outcome is clipped.
>>
>> this is my code
>>
>> vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
>>
>> reader->SetFileName(name);
>>
>> reader->Update();
>>
>> inputPolyData = reader->GetOutput();
>>
>> vtkSmartPointer<vtkPolyDataMapper> inputPolyMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
>>
>> inputPolyMapper->SetInputData(inputPolyData);
>>
>> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
>>
>> actor->SetMapper(inputPolyMapper);
>>
>> vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
>>
>> vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
>>
>> vtkSmartPointer<vtkRenderWindowInteractor> interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
>>
>> interactor->SetRenderWindow(renderWindow);
>>
>> vtkSmartPointer<vtkAxesActor> axes =
>>
>> vtkSmartPointer<vtkAxesActor>::New();
>>
>> vtkSmartPointer<vtkOrientationMarkerWidget> axisWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
>>
>> axisWidget->SetOutlineColor(0.9300, 0.5700, 0.1300);
>>
>> axisWidget->SetOrientationMarker(axes);
>>
>> axisWidget->SetInteractor(interactor);
>>
>> renderWindow->AddRenderer(renderer);
>>
>> axisWidget->SetEnabled(1);
>>
>> axisWidget->InteractiveOff();
>>
>> renderWindow->SetOffScreenRendering(1);
>>
>> renderer->AddActor(actor);
>>
>> vtkSmartPointer<vtkLightKit> lightKit = vtkSmartPointer<vtkLightKit>::New();
>>
>> lightKit->AddLightsToRenderer(renderer);
>>
>> renderer->ResetCamera();
>>
>> renderWindow->Render();
>>
>> vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter =
>>
>> vtkSmartPointer<vtkWindowToImageFilter>::New();
>>
>> windowToImageFilter->SetInput(renderWindow);
>>
>> windowToImageFilter->SetMagnification(3);
>>
>> windowToImageFilter->SetInputBufferTypeToRGBA();
>>
>> windowToImageFilter->Update();
>>
>>
>> for example I receive this picture for a rectangle:
>>
>>
>> [image: Inline image 1]
>>
>>
>> Can someone assist?
>>
>>
>> Thanks,
>>
>> Gilad.
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150804/2e4fef59/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rect.png
Type: image/png
Size: 13713 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150804/2e4fef59/attachment.png>
More information about the vtkusers
mailing list