Is there a way to create a uniform mesh in 2D and 3D image masks? I have a very complex geometry I'd like to mesh, consisting of many internal sources and holes in the mesh. The easiest way to do it, it seems, would be to turn each pixel in the binary mask into two triangular elements. I need to do this for 2D and 3D cases.
Does anyone know of a tutorial which might help, or some simple mesh generation functions which might work? I was thinking about creating a uniform mesh the size of the image and deleting the cells which are not contained in the mask, but I'm unsure how to reference the cells given a position x,y in the image.
Thanks!
Ryan