Voxelizes a triangulated mesh into an ndarray