vedo icon indicating copy to clipboard operation
vedo copied to clipboard

vedo marching cubes algorithm

Open cakeinspace opened this issue 4 years ago • 3 comments
trafficstars

Hey thanks for the wonderful library. I am also looking into vtk but the documentation and the examples seem really opaque.

I was wondering if the marching cubes algorithm in vedo is the same as the marching cubes in vtk. Is it the discreteMarchingCubes algorithm. or does the volume.isosurface follow some other algorithm.

Also in terms of functionality can I do almost everything in vtk in vedo as well or does vtk have better implementations, I ask this because the documentation says vedo is based entirely on vtk and numpy.

cakeinspace avatar Sep 03 '21 13:09 cakeinspace

Thanks,

  1. Yes, vedo is a wrapper around vtk so it mostly runs the same algorithms. In the case of isosurfacing it is by vtkContourFilter.
  2. I would say that if you cannot do something in vedo you can still access any native vtk objects you need.

marcomusy avatar Sep 03 '21 13:09 marcomusy

ah thanks a lot is there a way to use vtk.discreteMarchingCubes. Also on a related note. When I load a 3d numpy array as a volume object and then extract the mesh from it. I notice that there is some kind of coordinate transformation. For example the point in the numpy array at x, y, z is no longer at that point in the mesh. Is there a way to get this coordinate transformation so that I can transform the mesh points back to the numpy array coordinates

cakeinspace avatar Sep 03 '21 15:09 cakeinspace

ah thanks a lot is there a way to use vtk.discreteMarchingCubes.

It's not implemented. But you can still mix vtk and vedo easily and seamlessly, see examples: examples/volumetric/streamlines2.py examples/volumetric/tensors.py examples/volumetric/tensor_grid.py

Also on a related note. When I load a 3d numpy array as a volume object and then extract the mesh from it. I notice that there is some kind of coordinate transformation. For example the point in the numpy array at x, y, z is no longer at that point in the mesh. Is there a way to get this coordinate transformation so that I can transform the mesh points back to the numpy array coordinates

Uhm, can you make an example? It might be a different convention or half bin shift..

marcomusy avatar Sep 03 '21 15:09 marcomusy