SurfaceExtractor
The SurfaceExtractor does exactly the opposite of the
Voxelizer; it reads a matrix containing a 3D
structure in voxel
-representation, and constructs a Geometry, a
Facet-based representation.
SurfaceExtractor can be used with either
Matrix, boost's
multi_array,
or with Blitz++'s
Array through BlitzArray.
The SurfaceExtractor operates by the principle of an
iso-surface, using the
Marching Cubes
algorithm. More information about the procedure, including the basis of this
code, can be found
here.
Note: The generation of normals for the facets is probably wrong.
Interface
void extractSurface(const Matrix_t &matrix,
Geometry_t &geometry,
const double isolevel = 0.5)
|
Convert voxel-data in "matrix" into facet-data in "geometry".
The parameter "isolevel" determines the border between what is
considered "inside" voxels and "outside" voxels. |
|