DGtal 1.4.0
|
This documentation describes a voxelization approach of a triangulated structure. The proposed approach follows the method described by Laine [79].
The approach is rather simple: Given a triangulated mesh, the MeshVoxlizer processes each triangle independently. If the triangle intersects a given template centered at a given grid point, then the grid point belongs to the digitization of the triangle.
The geometry of the template is used to control the topology of the resulting digital set. We provide two templates to obtain 6- and 26-separable digital sets (see Limitations for discussion).
Given a Mesh aMesh, the MeshVoxelizer class is templated by a type of digital set (model of concepts::CDigitalSet) to store the voxels, and an integer specifying the expected separability of the surface (either 6 or 26).
Let us first create a simple unit cube (see exampleMeshVoxelizer)
We first include the class:
We then create a voxelization of a scaled version of the cube onto a \( 128^3\) domain:
Once exported
we obtain the following voxel set:
Here you have another example with a more complex mesh (using DGtaltools tools for visualization):
At this point intersection tests are performed using arithmetics on double as an approximation of \( \mathbb{R}^3\). The digitization may not be exact when the mesh are integer or rational vertices for instance.