39 #include "ConfigExamples.h"
40 #include "DGtal/helpers/StdDefs.h"
41 #include "DGtal/base/Common.h"
42 #include "DGtal/shapes/Mesh.h"
44 #include "DGtal/shapes/MeshVoxelizer.h"
46 #include "DGtal/io/boards/Board3D.h"
47 #include "DGtal/io/writers/MeshWriter.h"
51 using namespace DGtal;
64 trace.
info()<<
"Creating a cube"<<std::endl;
90 trace.
info()<<
"Digitization..."<<std::endl;
91 voxelizer.
voxelize(outputSet, aMesh, 15.0);
93 trace.
info()<<
"Got "<< outputSet.
size() <<
" voxels."<<std::endl;
98 for(
auto voxel : outputSet)
100 board.
saveOBJ(
"voxelizedCube.obj");
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
void saveOBJ(const std::string &filename, const bool isNormalized=false)
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
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)
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.