<div dir="ltr">Before<div><pre style="white-space:pre-wrap;color:rgb(0,0,0);margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderWindow</span><span style="font-family:arial,sans-serif">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(250,130,30)">Render</span><span style="font-family:arial,sans-serif">();</span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">do</span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);margin-top:0px;margin-bottom:0px">renderer->ResetCameraClippingRange();<span style="font-family:arial,sans-serif"><br></span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);margin-top:0px;margin-bottom:0px"><br></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 2:22 AM, Gilad Arnon <span dir="ltr"><<a href="mailto:gilad.arnon@massivit.com" target="_blank">gilad.arnon@massivit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi all,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm trying to get a png file out of my polydata.</div><div class="gmail_default" style="font-size:small">(I take several pictures from different angles.)</div><div class="gmail_default" style="font-size:small">but sometimes the outcome is clipped.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">this is my code</div><div class="gmail_default"><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkSTLReader</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">reader</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkSTLReader</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">reader</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetFileName</span><span style="color:#000000">(</span><span style="color:#189494">name</span><span style="color:#000000">);</span></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">reader</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">Update</span><span style="color:#000000">();</span></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">inputPolyData</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">reader</span><span style="color:#000000">-></span><span style="color:#ff8200">GetOutput</span><span style="color:#000000">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkPolyDataMapper</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">inputPolyMapper</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkPolyDataMapper</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">inputPolyMapper</span><span style="color:#000000">-></span><span style="color:#ff8200">SetInputData</span><span style="color:#000000">(</span><span style="color:#5582ff">inputPolyData</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkActor</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">actor</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0"> </span><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkActor</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">actor</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetMapper</span><span style="color:#000000">(</span><span style="color:#5582ff">inputPolyMapper</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkRenderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">></span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderer</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkRenderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">>::</span><span style="font-family:arial,sans-serif;color:rgb(255,130,0)">New</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkRenderWindow</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">renderWindow</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0">  </span><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkRenderWindow</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkRenderWindowInteractor</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">interactor</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span><span style="color:#c0c0c0">  </span><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkRenderWindowInteractor</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">interactor</span><span style="color:#000000">-></span><span style="color:#ff8200">SetRenderWindow</span><span style="color:#000000">(</span><span style="color:#5582ff">renderWindow</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkAxesActor</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">axes</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkAxesActor</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkOrientationMarkerWidget</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">></span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">axisWidget</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkOrientationMarkerWidget</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">>::</span><span style="font-family:arial,sans-serif;color:rgb(255,130,0)">New</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">axisWidget</span><span style="color:#000000">-></span><span style="color:#ff8200">SetOutlineColor</span><span style="color:#000000">(</span><span style="color:#000080">0.9300</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000080">0.5700</span><span style="color:#000000">,</span><span style="color:#c0c0c0"> </span><span style="color:#000080">0.1300</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">axisWidget</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetOrientationMarker</span><span style="color:#000000">(</span><span style="color:#5582ff">axes</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">axisWidget</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(250,130,30)">SetInteractor</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">interactor</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(250,130,30)">AddRenderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">axisWidget</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetEnabled</span><span style="color:#000000">(</span><span style="color:#000080">1</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">axisWidget</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">InteractiveOff</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">renderWindow</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetOffScreenRendering</span><span style="color:#000000">(</span><span style="color:#000080">1</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">renderer</span><span style="color:#000000">-></span><span style="color:#ff8200">AddActor</span><span style="color:#000000">(</span><span style="color:#5582ff">actor</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkLightKit</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">></span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">lightKit</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(223,65,223)">vtkLightKit</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">>::</span><span style="font-family:arial,sans-serif;color:rgb(255,130,0)">New</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">lightKit</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;color:rgb(255,130,0)">AddLightsToRenderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">renderer</span><span style="color:#000000">-></span><span style="color:#ff8200">ResetCamera</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">renderWindow</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(250,130,30)">Render</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkWindowToImageFilter</span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#5582ff">windowToImageFilter</span><span style="color:#c0c0c0"> </span><span style="color:#000000">=</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#df41df">vtkSmartPointer</span><span style="color:#000000"><</span><span style="color:#df41df">vtkWindowToImageFilter</span><span style="color:#000000">>::</span><span style="color:#ff8200">New</span><span style="color:#000000">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">windowToImageFilter</span><span style="color:#000000">-></span><span style="color:#ff8200">SetInput</span><span style="color:#000000">(</span><span style="color:#5582ff">renderWindow</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">windowToImageFilter</span><span style="color:#000000">-></span><span style="font-style:italic;color:#fa821e">SetMagnification</span><span style="color:#000000">(</span><span style="color:#000080">3</span><span style="color:#000000">);</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="color:#5582ff">windowToImageFilter</span><span style="color:#000000">-></span><span style="color:#ff8200">SetInputBufferTypeToRGBA</span><span style="color:#000000">();</span><span style="color:#c0c0c0"> </span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(85,130,255)">windowToImageFilter</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;font-style:italic;color:rgb(250,130,30)">Update</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">();</span></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000" face="arial, sans-serif">for example I receive this picture for a rectangle:</font></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font color="#000000" face="arial, sans-serif"><br></font></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><img src="cid:ii_14ef75d2b91cb355" alt="Inline image 1" width="544" height="544"><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px">Can someone assist?</pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><br></pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px">Thanks,</pre><pre style="font-size:small;margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif">Gilad.</span><b style="font-family:arial,sans-serif"> </b></pre></pre></div>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Unpaid intern in BillsBasement at noware dot com<br></div>
</div>