<div dir="ltr">What I think you are seeing with the rough surface is surface normals generated from an image volume. I am assuming a lot here, so please correct me if I am wrong. It looks like you have a geometry of a bone extracted from a CT scan. The extraction algorithm was probably a variant of marching cubes or a similar algorithm. The surface normals estimated from the surface extraction algorithm were probably computed from the intensity gradient of the CT scan. This is a reasonable approach, but noise in the CT scan will affect the gradient calculation and may perturb the surface normals in the geometry a little. When this happens, you can get a rough appearing surface from the surface lighting calculation. Google "bump mapping" for how this can be used for a nice graphics effect - I think roughly the same thing is happening with your original data.<div><br></div><div>When you use vtkPolyDataNormals, the normals are computed from the surface data, which was smooth to begin with. Hence, the normals are not perturbed, so you don't get a bumpy appearance.</div><div><br></div><div>In any case, the measurements you want to take are not dependent on the surface normals. As long as the points on the surface are not smooth, which they should not be, your measurement procedure should be fine.</div><div><br></div><div>To convince yourself the geometry is the same, you can display both the original "bumpy" surface and the smoothed surface at the same time with different colors. You should see just one surface or the other, probably the one you added to the vtkRenderer last. If the geometry is different, you will see some of one surface color and some of the other depending on which geometry is closer to the camera. I suspect you will see just one surface.</div><div><br></div><div>HTH,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 17, 2017 at 11:22 AM, Majid Mohammad sadeghi <span dir="ltr"><<a href="mailto:majid.msadeghi@yahoo.com" target="_blank">majid.msadeghi@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:medium"><div><div>Dear Cory,</div><div><br></div><div>As I applied vtkPolyDataNormals to the polydata before the boolean operation I got the smoothed object, so you were right. But I dont understand exactly what is happening here? Since the geometry dimentions are very important for my application, Can I have the noisy version? Is there any way I do not get it smoothed?</div><div><br></div><div>Thanks,<br></div><div><br></div><div><br></div></div><div><br></div><div><br></div><div id="m_3535866334131255207yahoo_quoted_1044874322" class="m_3535866334131255207yahoo_quoted"><div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><span class=""><div>On Monday, July 17, 2017, 6:48:58 PM GMT+3, Cory Quammen <<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>> wrote:</div><div><br></div><div><br></div></span><div><div id="m_3535866334131255207yiv6912911283"><div><span class=""><div dir="ltr">There shouldn't be any geometry smoothing going on in this filter. Can you verify that the geometry has changed in the smoothed version?<div><br clear="none"></div><div>This is speculation, but one possibility is that the surface normals in your original surface come from a gradient computation in the volume from which the surface was extracted and noise in the volume result in the bumpy appearance. You can check this by applying the vtkPolyDataNormals filter to your original surface and looking at the result.</div><div><br clear="none"></div><div>HTH,</div><div>Cory</div></div></span><div class="m_3535866334131255207yiv6912911283gmail_extra"><br clear="none"><div class="m_3535866334131255207yiv6912911283yqt2635617791" id="m_3535866334131255207yiv6912911283yqt86732"><div class="m_3535866334131255207yiv6912911283gmail_quote"><span class="">On Mon, Jul 17, 2017 at 10:21 AM, Majid Mohammad sadeghi <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:majid.msadeghi@yahoo.com" target="_blank">majid.msadeghi@yahoo.com</a>></span> wrote:<br clear="none"></span><blockquote class="m_3535866334131255207yiv6912911283gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:medium"><span class=""><div><div>Dear Cory,</div><div><br clear="none"></div><div>Thanks for the reply, I set the actors property to  SetInterpolationToFlat<span class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43br0">(</span><span class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43br0">)</span><span class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43sy4">; as you said, but the result is the same I put a picture before and after boolean operation here. Any suggestion? Are you familier with any other library? Current boolean operation takes about 150 seconds on my system, do you think this is normal?<br clear="none"></span></div><div><span class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43sy4"><br clear="none"></span></div><div><span class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43sy4"><img class="m_3535866334131255207yiv6912911283m_-1901337663695966445ydpd8a9132ainline-image" alt="Inline image" title="Inline image" style="max-width:800px;width:100%" src="cid:mTu6vmTmMcFhMZX72h11"><br clear="none"></span></div><div><br clear="none"></div><div><br clear="none"></div></div></span><div><div class="m_3535866334131255207yiv6912911283h5"><div><br clear="none"></div><div><br clear="none"></div><div class="m_3535866334131255207yiv6912911283m_-1901337663695966445yahoo_quoted" id="m_3535866334131255207yiv6912911283m_-1901337663695966445yahoo_quoted_0661689143"><div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><span class=""><div>On Monday, July 17, 2017, 6:00:50 PM GMT+3, Cory Quammen <<a rel="nofollow" shape="rect" href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>> wrote:</div><div><br clear="none"></div><div><br clear="none"></div></span><div><div dir="ltr"><div><span class="">What do you mean by smooth? The lighting is smooth? I think the filter<br clear="none">may be adding surface normals, in which case any actor for the data<br clear="none">will turn on Gouraud shading (or maybe Phong) by default, which will<br clear="none">make your surface look smooth. You can turn off smooth lighting as<br clear="none">shown in this example:<br clear="none"><br clear="none"><a rel="nofollow" shape="rect" href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/FlatShading" target="_blank">http://www.vtk.org/Wiki/VTK/ Examples/Cxx/Visualization/ FlatShading</a><br clear="none"></span><div class="m_3535866334131255207yiv6912911283m_-1901337663695966445yqt4422395062" id="m_3535866334131255207yiv6912911283m_-1901337663695966445yqtfd55966"><span class=""><br clear="none">On Mon, Jul 17, 2017 at 9:49 AM, Majid Mohammad sadeghi via vtkusers<br clear="none"><<a rel="nofollow" shape="rect" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>> wrote:<br clear="none">> Hi everyone,<br clear="none">><br clear="none"></span>> I am using vtkBooleanOperationPolyDataFil ter, and it works fine except after<span class=""><br clear="none">> the operation it smoothes the polydata, which I dont want. Is there a way to<br clear="none">> stop that? Or is there another library for boolean operations on polydata?<br clear="none">><br clear="none">> Thanks.<br clear="none">><br clear="none">><br clear="none">> ______________________________ _________________<br clear="none">> Powered by <a rel="nofollow" shape="rect" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br clear="none">><br clear="none">> Visit other Kitware open-source projects at<br clear="none">> <a rel="nofollow" shape="rect" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/ opensource/opensource.html</a><br clear="none">><br clear="none">> Please keep messages on-topic and check the VTK FAQ at:<br clear="none">> <a rel="nofollow" shape="rect" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_ FAQ</a><br clear="none">><br clear="none">> Search the list archives at: <a rel="nofollow" shape="rect" href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q= vtkusers</a><br clear="none">><br clear="none">> Follow this link to subscribe/unsubscribe:<br clear="none">> <a rel="nofollow" shape="rect" href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/ mailman/listinfo/vtkusers</a></span></div><span class=""><br clear="none">><br clear="none"><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.<div class="m_3535866334131255207yiv6912911283m_-1901337663695966445yqt4422395062" id="m_3535866334131255207yiv6912911283m_-1901337663695966445yqtfd44047"><br clear="none"></div></span></div></div></div></div></div></div></div></div></div></blockquote></div></div><span class=""><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="m_3535866334131255207yiv6912911283gmail_signature">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.</div>
</span></div></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br>Staff R&D Engineer<br>Kitware, Inc.</div>
</div>