Resulting digitization of a cube
#include <iostream>
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/base/Common.h"
#include "DGtal/shapes/Mesh.h"
#include "DGtal/shapes/MeshVoxelizer.h"
#include "DGtal/io/writers/MeshWriter.h"
{
trace.beginBlock (
"Example MeshVoxelizer" );
trace.info()<<
"Creating a cube"<<std::endl;
trace.info()<<
"Digitization..."<<std::endl;
voxelizer.
voxelize(outputSet, aMesh, 15.0);
trace.info()<<
"Got "<< outputSet.size() <<
" voxels."<<std::endl;
return 0;
}
Aim: A class for computing the digitization of a triangle or a Mesh.
void voxelize(DigitalSet &outputSet, const Mesh< MeshPoint > &aMesh, const double scaleFactor=1.0)
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
void addQuadFace(Index indexVertex1, Index indexVertex2, Index indexVertex3, Index indexVertex4, const DGtal::Color &aColor=DGtal::Color::White)
void addVertex(const TPoint &vertex)
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
HyperRectDomain< Space > Domain
Z2i::DigitalSet DigitalSet