Parasol Planning Library (PPL)
Macros | Typedefs | Functions
TetGenDecomposition.cpp File Reference
#include "TetGenDecomposition.h"
#include "Geometry/Bodies/Body.h"
#include "Geometry/Bodies/MultiBody.h"
#include "MPLibrary/ValidityCheckers/CollisionDetection/CDInfo.h"
#include "MPLibrary/ValidityCheckers/CollisionDetection/PQPCollisionDetection.h"
#include "MPProblem/Environment/Environment.h"
#include "MPProblem/MPProblem.h"
#include "Workspace/WorkspaceDecomposition.h"
#include "Utilities/PMPLExceptions.h"
#include "Utilities/XMLNode.h"
#include "tetgen.h"
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/IO/io.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/IO/print_OFF.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Nef_3/SNC_indexed_items.h>
Include dependency graph for TetGenDecomposition.cpp:

Macros

#define TETLIBRARY
 

Typedefs

using CGALKernel = CGAL::Exact_predicates_exact_constructions_kernel
 
using NefPolyhedron = CGAL::Nef_polyhedron_3< CGALKernel >
 
using Polyhedron = CGAL::Polyhedron_3< CGALKernel >
 

Functions

size_t PointIndex (const NefPolyhedron &_polyhedron, const NefPolyhedron::Point_3 &_p)
 
void AddVertices (tetgenio *const _freeModel, const NefPolyhedron &_freespace, const bool _debug)
 
vector< vector< vector< size_t > > > ExtractFacets (const NefPolyhedron &_freespace)
 
void AddFacets (tetgenio *const _freeModel, const NefPolyhedron &_freespace, const bool _debug)
 
void AddHoles (tetgenio *const _freeModel, const NefPolyhedron &_freespace, const Environment *const _env, const bool _debug)
 
void OutputNefPolyhedron (const NefPolyhedron &_p, const string _filename)
 

Macro Definition Documentation

◆ TETLIBRARY

#define TETLIBRARY

Typedef Documentation

◆ CGALKernel

using CGALKernel = CGAL::Exact_predicates_exact_constructions_kernel

◆ NefPolyhedron

using NefPolyhedron = CGAL::Nef_polyhedron_3<CGALKernel>

◆ Polyhedron

using Polyhedron = CGAL::Polyhedron_3<CGALKernel>

Function Documentation

◆ AddFacets()

void AddFacets ( tetgenio *const  _freeModel,
const NefPolyhedron _freespace,
const bool  _debug 
)

Add the facets to the free model.

Parameters
_freeModelThe tetgen model under construction.
_freespaceThe free space polyhedra.
_debugShow debug messages?

◆ AddHoles()

void AddHoles ( tetgenio *const  _freeModel,
const NefPolyhedron _freespace,
const Environment *const  _env,
const bool  _debug 
)

Add holes to the free model for each obstacle.

Parameters
_freeModelThe tetgen model under construction.
_freespaceThe free space polyhedra.
_envThe environment object.
_debugShow debug messages?
Todo:
There seems to be an intermittent problem with adding holes for obstacles that touch the environment boundary. Sometimes it causes bad decompositions where the free space gets eaten away, and sometimes not. Not adding the hole sometimes causes tetgen to not remove the tetras within the obstacle. We need to characterize the cases where it fails and where it works.

◆ AddVertices()

void AddVertices ( tetgenio *const  _freeModel,
const NefPolyhedron _freespace,
const bool  _debug 
)

Add the vertices to the free model.

Parameters
_freeModelThe tetgen model under construction.
_freespaceThe free space polyhedra.
_debugShow debug messages?

◆ ExtractFacets()

vector<vector<vector<size_t> > > ExtractFacets ( const NefPolyhedron _freespace)

Extract facet info from the freespace nef poly.

Parameters
_freespaceThe freespace nef poly.
Returns
A set of facet descriptors.

◆ OutputNefPolyhedron()

void OutputNefPolyhedron ( const NefPolyhedron _p,
const string  _filename 
)

◆ PointIndex()

size_t PointIndex ( const NefPolyhedron _polyhedron,
const NefPolyhedron::Point_3 &  _p 
)

Get the index of a point in the freespace nef poly.

Parameters
_polyhedronThe nef polyhedron of interest.
_pThe point to locate.
Returns
The index of _p in _polyhedron's vertex list. If it is not found, an exception will be thrown.