Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I create mesh from a 3D binary mask? #854

Open
zhang-qiang-github opened this issue Apr 13, 2022 · 1 comment
Open

How can I create mesh from a 3D binary mask? #854

zhang-qiang-github opened this issue Apr 13, 2022 · 1 comment

Comments

@zhang-qiang-github
Copy link

The mask means the pixel inside of object is 1, and the pixel outside of object is 0.

If I have a 3D binary mask, how can I create the mesh?

@wd15
Copy link
Contributor

wd15 commented Apr 14, 2022

I'm not sure exactly what you're asking for here. Some clarification might help.

My guess is that you could either base the material properties on the mask and use a grid mesh, which often works well (e.g. have a null region without diffusion) or somehow use the mask to generate a mesh using Gmsh. I'm not sure about the latter. Gmsh does have a Python API (maybe it's just a Python tool that interfaces with the CLI), which might make programming it easier. I can imagine generating a geometry for Gmsh based on the masked array using Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants