DGtal  1.3.beta
io/boards/dgtalBoard3D-1-points.cpp

Example of digital point export with Display3D.

See also
Export objects with Board3D
Illustration of the resulting exported file (OBJ format visualized with blender).
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board3D.h"
#include "DGtal/helpers/StdDefs.h"
using namespace std;
using namespace DGtal;
using namespace DGtal::Z3i;
int main()
{
trace.beginBlock ( "Example dgtalBoard3D-1-points" );
Point p1( -3, -2, 0 );
Point p2( 7, 3 , 6);
Point p3( -1, -1, -1);
Point p4(-1, -1, 0 );
Point p5( 5, 2 , 4);
Point p6(-3, -6, 0 );
Point p7( 5, 2 , 3);
Domain domain(p4, p5);
DigitalSet shape_set( domain );
shape_set.insertNew(p6);
shape_set.insertNew(p7);
Board3D<> board;
board << SetMode3D(domain.className(), "Paving");
board << p1 << p2 << p3;
board << shape_set;
board.saveOBJ("dgtalBoard3D-1-points.obj");
trace.info()<<" Second"<<std::endl;
Board3D<> board2;
board2 << SetMode3D(domain.className(), "Paving");
board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
board2 << p1 ;
board2 << CustomColors3D(Color(0, 255,0),Color(0, 0,255));
board2 << p2 << p3;
board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
board2 << p6;
board2.saveOBJ("dgtalBoard3D-1bis-points.obj");
return 0;
}
// //
DGtal::HyperRectDomain< Space >
DGtal::Trace::endBlock
double endBlock()
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
DGtal::trace
Trace trace
Definition: Common.h:154
DGtal::HyperRectDomain::className
std::string className() const
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Board3D
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
Definition: Board3D.h:81
DGtal::DigitalSetByAssociativeContainer::insertNew
void insertNew(const Point &p)
DGtal::Trace::info
std::ostream & info()
DGtal::Board3D::saveOBJ
void saveOBJ(const std::string &filename, const bool isNormalized=false)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::CustomColors3D
Definition: DrawWithDisplay3DModifier.h:129
DGtal::SetMode3D
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Definition: DrawWithDisplay3DModifier.h:73
main
int main(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
domain
Domain domain
Definition: testProjection.cpp:88
DGtal::PointVector< dim, Integer >
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition: DigitalSetByAssociativeContainer.h:89