<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>I actually had the same impression myself, but noticed that the normals are also ok. What changed things *dramatically* were the options on the smoother, notably these 3:</div><div><br></div><div><pre class="de1" style="font-family: monospace, monospace; padding: 0px; border: 0px none white; line-height: 1.2em; font-size: 1em; margin-top: 0px; margin-bottom: 0px; background-image: none; vertical-align: top;"> smoothFilter<span class="sy2" style="color: rgb(0, 0, 64);">-</span><span class="sy1" style="color: rgb(0, 0, 128);">></span>SetRelaxationFactor<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="nu16" style="color: rgb(128, 0, 128);">0.1</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span>
smoothFilter<span class="sy2" style="color: rgb(0, 0, 64);">-</span><span class="sy1" style="color: rgb(0, 0, 128);">></span>FeatureEdgeSmoothingOff<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span>
smoothFilter<span class="sy2" style="color: rgb(0, 0, 64);">-</span><span class="sy1" style="color: rgb(0, 0, 128);">></span>BoundarySmoothingOn<span class="br0" style="color: rgb(0, 128, 0);">(</span><span class="br0" style="color: rgb(0, 128, 0);">)</span><span class="sy4" style="color: rgb(0, 128, 128);">;</span>
</pre></div><div><span class="sy4" style="color: rgb(0, 128, 128);"><br></span></div><div>Now, only a dozen iterations are enough where I needed a few hundreds!</div><div>This could be something to check…</div><div><br></div><div>Alexandre </div><div><br></div><div><br><div><div>On 27 Nov 2015, at 15:54, Fernando Pérez-García <<a href="mailto:fepegar@gmail.com">fepegar@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi David,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks for your response. I just tried that and I got the same result. Any other ideas?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Fernando</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-27 15:09 GMT+01:00 David Cole <span dir="ltr"><<a href="mailto:DLRdave@aol.com" target="_blank">DLRdave@aol.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try applying a vtkPolyDataNormals filter after smoothing, as demonstrated in this example:<div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SmoothPolyDataFilter" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SmoothPolyDataFilter</a></div><div><br></div><div>This was a months-long frustration for my team, before we finally realized it simply needed recomputed normals to render properly.</div><div><br></div><div><br></div><div>Hope this helps,</div><div>David C.</div><div class="HOEnZb"><div class="h5"><div><br><br>On Friday, November 27, 2015, Fernando Pérez-García <<a href="mailto:fepegar@gmail.com" target="_blank">fepegar@gmail.com</a>> 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-family:tahoma,sans-serif">Dear VTK experts,<br></div><div class="gmail_quote"><div dir="ltr"><div style="font-family:tahoma,sans-serif">
<br>This is my first post here. I'm trying to smooth a mesh created from a mask. I've tried different parameters but I don't get the result I want, some vertices don't move at all!</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">I attach <div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">snaps from the</div> original<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline"> mesh</div>, the poor result I get from VTK and the one that's looks good, which I got using the Laplacian filter in MeshLab. <br>
<br>
<br>
This is my code:<br>
<br><div style="margin: 0px;">reader = vtk.vtkPolyDataReader()</div><div style="margin: 0px;">reader.SetFileName(meshInputPath)</div><div style="margin: 0px;">reader.Update()</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">mesh = reader.GetOutput()</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">smoothFilter = vtk.vtkSmoothPolyDataFilter()</div><div style="margin: 0px;">smoothFilter.SetNumberOfIterations(500)</div><div style="margin: 0px;">smoothFilter.SetInput(mesh)</div><div style="margin: 0px;">smoothFilter.Update()</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">writer = vtk.vtkPolyDataWriter()</div><div style="margin: 0px;">writer.SetInput(smoothFilter.GetOutput())</div><div style="margin: 0px;">writer.SetFileName(meshOutputPath)</div><div style="margin: 0px;">writer.Write()</div><br><br>Do you know what I'm doing wrong?</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">Thank you,</div><div style="font-family:tahoma,sans-serif"><br>Fernando<br><br></div></div>
</div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">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">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers">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">http://public.kitware.com/mailman/listinfo/vtkusers</a><br></blockquote></div><br></div></body></html>