<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;" class="">Hi everyone,<div class=""><br class=""></div><div class="">I’m new with vtk and I’m trying to remesh a vtkPolyData with the vtkMarchingCubes-Algorithm.</div><div class=""><br class=""></div><div class="">To do this I’m using the code described here: <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Modelling/MarchingCubes" class="">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Modelling/MarchingCubes</a></div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div><div class="">def marchingCubes(size):</div><div class=""><br class=""></div><div class=""> volume = vtk.vtkImageData()</div><div class=""><br class=""></div><div class=""> bounds = [0.0, 0.0, 0.0 , 0.0, 0.0, 0.0]</div><div class=""><br class=""></div><div class=""> data.GetBounds(bounds)</div><div class=""><br class=""></div><div class=""> iBounds = 0</div><div class=""> while iBounds < 6:</div><div class=""> range = bounds[iBounds+1] - bounds[iBounds]</div><div class=""> bounds[iBounds] = bounds[iBounds] - .0001 * range</div><div class=""> bounds[iBounds+1] = bounds[iBounds+1] + .0001 * range</div><div class=""> iBounds = iBounds + 2</div><div class=""><br class=""></div><div class=""> voxelModeller = vtk.vtkVoxelModeller()</div><div class=""> voxelModeller.SetSampleDimensions(size,size,size) #Set cube size</div><div class=""> voxelModeller.SetModelBounds(bounds)</div><div class=""> voxelModeller.SetScalarTypeToFloat()</div><div class=""> voxelModeller.SetMaximumDistance(.1)</div><div class=""><br class=""></div><div class=""> voxelModeller.SetInputData(data)</div><div class=""> voxelModeller.Update()</div><div class=""><br class=""></div><div class=""> isoValue = 0.01 #0.001</div><div class=""> volume.DeepCopy(voxelModeller.GetOutput())</div><div class=""><br class=""></div><div class=""> surface = vtk.vtkMarchingCubes()</div><div class=""> if vtk.VTK_MAJOR_VERSION <= 5:</div><div class=""> surface.SetInput(volume)</div><div class=""> else:</div><div class=""> surface.SetInputData(volume)</div><div class=""><br class=""></div><div class=""> surface.ComputeScalarsOff()</div><div class=""> surface.SetValue(0, isoValue)</div><div class=""><br class=""></div><div class=""> surface.Update()</div><div class=""><br class=""></div><div class=""> data = surface.GetOutput()</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Here my problem:</div><div class="">My input has just one Surface/Layer, the output has two layers as you see at the screenshot attached.</div><div class="">Is it possible to create an output with a remeshed polydata with just one layer?</div><div class=""><br class=""></div><div class="">Thanks in advance,</div><div class="">Sebastian</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="FEF5C5C9-4CDA-401E-84B5-269781AF28ED" class="" src="cid:DCF2C3DA-2C62-4322-85A3-D93A5F1747A1@fritz.box"><img apple-inline="yes" id="233C356D-93F0-4719-A2C2-07910541E7C3" class="" src="cid:A38ADC09-A487-46EE-BC38-A210E43B4635@fritz.box"></div></body></html>