pmneila/PyMCubes

Multimaterial Capability?

jonathanhestroffer opened this issue · 5 comments

Hi,

I have volume data consisting of different materials with different Feature Ids.

Will PyMCubes work for this type of multimaterial data? For example I would like the isosurface for each Feature Id.

Many thanks,
Jonathan

Hi @jonathanhestroffer

Not sure if I understand what you need. How is exactly your volume data? You have an array indicating different regions of your the volume and need to assign indices to the vertices? You need to extract multiple isosurfaces, one per feature id? What are these feature ids?

Do you have a minimal piece of code that exemplifies your problem?

Hi,

I cannot see the image. Do you have a link?

In any case, if I understood correctly, cannot you just run marching cubes once per isosurface? Something like this:

meshes = [mcubes.marching_cubes(volume, fid) for fid in feature_ids]

Would that solve your problem?

image

Here is the image.

I forgot to mention that I haven't yet tried your code :)

I will try this. Thank you!

I see. After seeing your image I realize that my first impression was not correct. What you want is to extract the mesh surrounding each feature id? In that case, the code you want might be like this:

meshes = [mcubes.marching_cubes(volume == fid, 0.5) for fid in feature_ids]

Let me know if that works.