<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div><div>Dear Cory,</div><div><br></div><div>It is still Null. Can we recalculate normals on the output of boolean operation?</div><div><br></div><div>Thanks,<br></div><div><br></div><div><br></div><div>Majid Mohammad Sadeghi<br>PhD Candidate<br>Mechatronics Engineering Department<br>Istanbul Technical University</div><div><br></div></div><div><br></div><div><br></div><div id="yahoo_quoted_0603099233" class="yahoo_quoted"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><div>On Tuesday, July 18, 2017, 5:26:05 PM GMT+3, Cory Quammen <cory.quammen@kitware.com> wrote:</div><div><br></div><div><br></div><div><div id="yiv2265602017"><html><div><div dir="ltr">Okay, let's try one more thing. Does<div><br clear="none"></div><div><span style="font-size:12.8px;">vtkDataArray* normals = output->GetPointData()->GetArray("Normals");</span><br clear="none"></div><div><span style="font-size:12.8px;"><br clear="none"></span></div><div><span style="font-size:12.8px;">return NULL? Perhaps the normals array is being copied but not being set as the active normals.</span></div><div><span style="font-size:12.8px;"><br clear="none"></span></div><div><span style="font-size:12.8px;">Thanks,</span></div><div><span style="font-size:12.8px;">Cory</span></div></div><div class="yiv2265602017gmail_extra"><br clear="none"><div class="yiv2265602017yqt6546603337" id="yiv2265602017yqt32882"><div class="yiv2265602017gmail_quote">On Tue, Jul 18, 2017 at 9:03 AM, Majid Mohammad sadeghi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:majid.msadeghi@yahoo.com" target="_blank" href="mailto:majid.msadeghi@yahoo.com">majid.msadeghi@yahoo.com</a>></span> wrote:<br clear="none"><blockquote class="yiv2265602017gmail_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 clear="none"></div><div>!normals returns true, so as you said there is no normal array. Is there a way to copy that before the operation and apply it afterwards? But I think that wont work because part of the data is changed in the boolean operation. So how can we keep the normals?<br clear="none"></div><div><br clear="none"></div><div>Thanks,<br clear="none"></div></div><div><div class="yiv2265602017h5"><div><br clear="none"></div><div><br clear="none"></div><div class="yiv2265602017m_5588922741043973659yahoo_quoted" id="yiv2265602017m_5588922741043973659yahoo_quoted_0872482599"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><div>On Tuesday, July 18, 2017, 4:21:45 PM GMT+3, Cory Quammen <<a rel="nofollow" shape="rect" ymailto="mailto:cory.quammen@kitware.com" target="_blank" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> wrote:</div><div><br clear="none"></div><div><br clear="none"></div><div><div id="yiv2265602017m_5588922741043973659yiv4388726475"><div><div dir="ltr">Hmm, now I wonder if the boolean operations filter is simply removing the normals filter. The code has changed from the original, which did preserve normals. It looks like the current code should preserve normals as well, but I'm not 100% sure if that is the case.<div><br clear="none"></div><div>In the output of the boolean operation filter, could you check that there is a normals array in the pointdata?</div><div><br clear="none"></div><div>vtkDataArray* normals = output->GetPointData()-> GetNormals();</div><div><br clear="none"></div><div>If "normals" is NULL, then the normals are not being copied to the output.</div><div><br clear="none"></div><div>Thanks,</div><div>Cory</div><div><br clear="none"></div><div><br clear="none"></div></div><div class="yiv2265602017m_5588922741043973659yiv4388726475gmail_extra"><br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475yqt2838649759" id="yiv2265602017m_5588922741043973659yiv4388726475yqt34369"><div class="yiv2265602017m_5588922741043973659yiv4388726475gmail_quote">On Mon, Jul 17, 2017 at 11:47 AM, Majid Mohammad sadeghi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:majid.msadeghi@yahoo.com" target="_blank" href="mailto:majid.msadeghi@yahoo.com">majid.msadeghi@yahoo.com</a>></span> wrote:<br clear="none"><blockquote class="yiv2265602017m_5588922741043973659yiv4388726475gmail_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 style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div><div>Dear Cory,</div><div><br clear="none"></div><div>All you said was exactly what I have done. I tested your method to check the data and I could see only one of the objects. So If I understand right, during the boolean operation the vtkPolyDataNormals are recalculated and that is the reason the polydata is shown smoothed. Is there a way not to let boolean recalculate it? Or more generally is there a way to keep the bumps. That kind of is the norm in the medical field and some doctors might not feel very good about the smooth data. </div><div><br clear="none"></div><div>Thanks.<br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div></div><div><br clear="none"></div><div><br clear="none"></div></div><div><div class="yiv2265602017m_5588922741043973659yiv4388726475h5"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yahoo_quoted" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yahoo_quoted_0353535763"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><div>On Monday, July 17, 2017, 7:33:19 PM GMT+3, Cory Quammen <<a rel="nofollow" shape="rect" ymailto="mailto:cory.quammen@kitware.com" target="_blank" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> wrote:</div><div><br clear="none"></div><div><br clear="none"></div><div><div id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"><div><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 clear="none"></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 clear="none"></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 clear="none"></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 clear="none"></div><div>HTH,</div><div>Cory</div></div><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437gmail_extra"><br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437yqt1313009924" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437yqt42239"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437gmail_quote">On Mon, Jul 17, 2017 at 11:22 AM, Majid Mohammad sadeghi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:majid.msadeghi@yahoo.com" target="_blank" href="mailto:majid.msadeghi@yahoo.com">majid.msadeghi@yahoo.com</a>></span> wrote:<br clear="none"><blockquote class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437gmail_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 clear="none"></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 clear="none"></div><div>Thanks,<br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div></div><div><br clear="none"></div><div><br clear="none"></div><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yahoo_quoted" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yahoo_quoted_1044874322"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"></span><div>On Monday, July 17, 2017, 6:48:58 PM GMT+3, Cory Quammen <<a rel="nofollow" shape="rect" ymailto="mailto:cory.quammen@kitware.com" target="_blank" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> wrote:</div><div><br clear="none"></div><div><br clear="none"></div><div><div id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283"><div><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"></span><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><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283gmail_extra"><br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283yqt2635617791" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283yqt86732"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283gmail_quote"><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437">On Mon, Jul 17, 2017 at 10:21 AM, Majid Mohammad sadeghi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:majid.msadeghi@yahoo.com" target="_blank" href="mailto:majid.msadeghi@yahoo.com">majid.msadeghi@yahoo.com</a>></span> wrote:<br clear="none"></span><blockquote class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_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="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"></span><div><div>Dear Cory,</div><div><br clear="none"></div><div>Thanks for the reply, I set the actors property to SetInterpolationToFlat<span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43br0">(</span><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43br0">)</span><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_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="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43sy4"><br clear="none"></span></div><div><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445ydp77e60f43sy4"><img class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445ydpd8a9132ainline-image" alt="Inline image" title="Inline image" style="max-width:800px;width:100%;" src="cid:x8e5OcJj0LsmY3VvAEqp"><br clear="none"></span></div><div><br clear="none"></div><div><br clear="none"></div></div><div><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283h5"><div><br clear="none"></div><div><br clear="none"></div><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yahoo_quoted" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yahoo_quoted_0661689143"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"></span><div>On Monday, July 17, 2017, 6:00:50 PM GMT+3, Cory Quammen <<a rel="nofollow" shape="rect" ymailto="mailto:cory.quammen@kitware.com" target="_blank" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> wrote:</div><div><br clear="none"></div><div><br clear="none"></div><div><div dir="ltr"><div><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437">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" target="_blank" href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/FlatShading">http://www.vtk.org/Wiki/VTK/ Examples/Cxx/Visualization/ FlatShading</a><br clear="none"></span><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yqt4422395062" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yqtfd55966"><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"><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" ymailto="mailto:vtkusers@vtk.org" target="_blank" href="mailto:vtkusers@vtk.org">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="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"><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" target="_blank" href="http://www.kitware.com">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" target="_blank" href="http://www.kitware.com/opensource/opensource.html">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" target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_ FAQ</a><br clear="none">><br clear="none">> Search the list archives at: <a rel="nofollow" shape="rect" target="_blank" href="http://markmail.org/search/?q=vtkusers">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" target="_blank" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/ mailman/listinfo/vtkusers</a></span></div><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"><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.</span><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yqt4422395062" id="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283m_-1901337663695966445yqtfd44047"><br clear="none"></div></div></div></div></div></div></div></div></div></div></blockquote></div></div><span class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437"><br clear="none"><br clear="all"></span><div><br clear="none"></div>-- <br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437m_3535866334131255207yiv6912911283gmail_signature">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.</div>
</div></div></div></div></div></div></div></div></blockquote></div></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475m_8064730952683201153yiv4044883437gmail_signature">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.</div>
</div></div></div></div></div></div></div></div></div></div></blockquote></div></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="yiv2265602017m_5588922741043973659yiv4388726475gmail_signature">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.</div>
</div></div></div></div></div></div></div></div></div></div></blockquote></div></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="yiv2265602017gmail_signature">Cory Quammen<br clear="none">Staff R&D Engineer<br clear="none">Kitware, Inc.</div>
</div></div></html></div></div></div></div></div></body></html>