Question

I have a 3d mesh (a set of triangles) that defines a closed watertight surface. I want to rasterize this mesh, that is divide the space occupied by the mesh to even, little cubes (the 3d equivalent of 2d pixels), and paint the cubes that a triangle passes through as black and the rest as white. Similar to how one would rasterize a 2d vector-graphic image into a rasterized bmp, for instance. In other words, I want to output a 3d array, A that is M x M x M, such that A(i,j,k) is 1 if there is some triangle which passes through the space occupied by the cube at the location i,j,k. Hope that was clear, if not - tell me and I'll clarify.

Any algorithm, library, matlab routine will do.

Was it helpful?

Solution 2

I've found this voxelizer quite fitting for my needs. It works quite fast, and also has a matlab script for reading the resulting voxel file into matlab.

OTHER TIPS

I cannot present you some algorithm or library, but a small hint. The term you are looking for is Voxelization. Try google and it may present you some ressources on this, along with this small but also quite old introduction to the topic which might be a foundation for further research.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top