[vtkusers] MarchingCubes on polydata with vtkjs

marf marvin.huber at basf.com
Wed Jul 25 08:34:44 EDT 2018


Hello guys, I have some polydata and want to extract its surface. I stumble
upon vtkImageMarchingCubes, which seemed to be exactly what I need. Only it
is not able to handle polydata. I tried using it like this:

*const cubes = vtk.Filters.General.vtkImageMarchingCubes.newInstance();
cubes.setContourValue(0.5);
cubes.setInputConnection(this.reader.getOutputPort());
cubes.update();
this.mapper.setInputConnection(cubes.getOutputPort());*

But using it like this throws an error

*ERROR TypeError: o.getOrigin is not a function*

Where, as I figured out, o is my polydata, which indeed does not have a
getOrigin method. From looking at ImageMarchingCube's code, I also figured
out it would then need a getSpacing() and getDimensions() method.
So my question is, what kind of data do I feed to ImageMarchingCubes or is
there any way to get it to work with polydata?
Greetings, Marvin



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list