haesleinhuepf / napari-process-points-and-surfaces

Process and analyze surfaces using vedo in napari.
BSD 3-Clause "New" or "Revised" License
21 stars 4 forks source link

Some implementations of nppas.subdivide_* produce empty meshes when processing gastruloid #57

Open haesleinhuepf opened 1 year ago

haesleinhuepf commented 1 year ago

... not sure why.

To reproduce:

import napari_process_points_and_surfaces as nppas
gastruloid = nppas.gastruloid()

subdivided_gastruloid = nppas.subdivide_loop_vedo(gastruloid, number_of_iterations=1)
subdivided_gastruloid 

image

Workaround 1: Use nppas.subdivide_adaptive()

Workarounnd 2: install open3d and use this:

import napari_process_points_and_surfaces as nppas
gastruloid = nppas.gastruloid()

subdivided_gastruloid = nppas.subdivide_loop(gastruloid, number_of_iterations=1)
nppas.SurfaceTuple(subdivided_gastruloid)

image

haesleinhuepf commented 1 year ago

nppas.subdivide_linear and subdivide_butterfly appear to have the same issue.

nppas.subdivide_adaptive appears to work though.

haesleinhuepf commented 1 year ago

Hey Johannes @jo-mueller ,

would you mind taking care of this issue? Also see the related PR-draft. Feel free to use its branch to test things.

Thanks!

jo-mueller commented 1 year ago

Hi @haesleinhuepf ,

I can have a look. Judging from what @marcomusy suggested here, would it be an option to implement the vedo isosurface method in nppas as an option to marching cubes (as opposed to augmenting marching cubes with multiple failsafes)?

Nonetheless, these failsafes should ultimately be available, too.

haesleinhuepf commented 1 year ago

implement the vedo isosurface method in nppas as an option to marching cubes

Yes, let's do this step by step. If nppas has a isosurface function, we can play with it. If I understand it right, it is an alternative to marching cubes, no? If it does its job well, we could use it, recommend it in the documentation and then deprecate the partially broken marching cubes.