Example of Khalimsky Signed Cell export with Display3D.
#include <iostream>
#include "DGtal/io/boards/Board3D.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
using namespace Z3i;
{
K.init( plow, pup,
true );
board <<
SetMode3D( v.className(),
"Illustration" );
board << v << v2 << v3;
SCell sx =
K.sIncident( v, 0,
true );
SCell sy =
K.sIncident( v, 1,
true );
SCell sz =
K.sIncident( v, 2,
true );
SCell sxn =
K.sIncident( v, 0,
false );
SCell syn =
K.sIncident( v, 1,
false );
SCell szn =
K.sIncident( v, 2,
false );
board2 << tsx << tsy << tsz << tsxn << tsyn << tszn;
SCell sx2 =
K.sIncident( v2, 0,
true );
SCell sy2 =
K.sIncident( v2, 1,
true );
SCell sz2 =
K.sIncident( v2, 2,
true );
SCell sxn2 =
K.sIncident( v2, 0,
false );
SCell syn2 =
K.sIncident( v2, 1,
false );
SCell szn2 =
K.sIncident( v2, 2,
false );
board2 << tsx2 << tsy2 << tsz2 << tsxn2 << tsyn2 << tszn2;
SCell sx3 =
K.sIncident( v3, 0,
true );
SCell sy3 =
K.sIncident( v3, 1,
true );
SCell sz3 =
K.sIncident( v3, 2,
true );
SCell sxn3 =
K.sIncident( v3, 0,
false );
SCell syn3 =
K.sIncident( v3, 1,
false );
SCell szn3 =
K.sIncident( v3, 2,
false );
board2 << tsx3 << tsy3 << tsz3 << tsxn3 << tsyn3 << tszn3;
std::cout << "save obj" << std::endl;
board2.
saveOBJ(
"board3D-2bis-ks.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)
DGtal is the top-level namespace which contains all DGtal functions and types.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
HyperRectDomain< Space > Domain