1 #ifndef MEAN_CURVATURE_3D_H_
2 #define MEAN_CURVATURE_3D_H_
4 #ifndef CGAL_EIGEN3_ENABLED
5 #define CGAL_EIGEN3_ENABLED
12 #include <unordered_map>
15 #include <CGAL/Simple_cartesian.h>
16 #include <CGAL/Surface_mesh.h>
17 #include <CGAL/Polyhedron_3.h>
18 #include <CGAL/Polyhedron_items_with_id_3.h>
19 #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
20 #include <CGAL/extract_mean_curvature_flow_skeleton.h>
21 #include <containers/sequential/graph/graph.h>
22 #include <containers/sequential/graph/algorithms/graph_algo_util.h>
23 #include <boost/functional/hash.hpp>
50 size_t m_iterations{1000};
53 bool useConvex{
false};
54 double scaleConvex{1.2};
65 typedef typename CGALKernel::Point_3
Point3;
67 typedef CGAL::Polyhedron_3<CGALKernel, CGAL::Polyhedron_items_with_id_3>
Polyhedron;
70 typedef MCSkeleton::vertex_descriptor
MCVD;
71 typedef MCSkeleton::edge_descriptor
MCED;
72 typedef Skeletonization::Meso_skeleton
MESO;
84 static void SetDefaultParameters(
XMLNode& _node);
93 template<
typename PolyhedronType>
106 void Write(
string _filename);
110 void Read(
string _filename);
117 template<
typename PolyhedronType>
118 void AddPolyhedron(PolyhedronType& _poly,
double _refine = 1.32);
121 void BuildSkeleton(
bool _curve =
true);
132 pair<WorkspaceSkeleton, AnnotationType> GetSkeleton();
136 pair<WorkspaceSkeleton, AnnotationType> GetMesoSkeleton();
153 void InitializeObstacleSpace(
const Environment* _env);
159 void GetWitnesses(MCVD& _v, vector<Point3d>& _witness);
165 void GetWitnesses(MESO::Vertex& _v, vector<Point3d>& _witness);
171 void GetWitnesses(Skeletonization::vertex_descriptor& _v, vector<Point3d>& _witness);
178 void Refine(SurfaceMesh& _m,
double _f=1.00);
182 void ToPolyLines(vector<vector<MCVD>>& _plines,
bool _isSimplify =
true);
185 Point3 Point(MCVD& _vd) {
return m_mcs[_vd].point; }
195 AnnotationType m_annotation;
203 template<
typename PolyhedronType>
210 Refine(m_input, _refine);
void Read(GenericStateGraph *_g, const std::string &_filename)
Definition: GenericStateGraph.h:1337
Definition: Environment.h:137
3D Mean Curvature Skeleton implementation from CGAL
Definition: MeanCurvatureSkeleton3D.h:42
CGAL::Simple_cartesian< double > CGALKernel
Definition: MeanCurvatureSkeleton3D.h:64
Skeletonization::Skeleton MCSkeleton
Definition: MeanCurvatureSkeleton3D.h:69
MCSkeleton::vertex_descriptor MCVD
Definition: MeanCurvatureSkeleton3D.h:70
void AddPolyhedron(PolyhedronType &_poly, double _refine=1.32)
Add an input polyhedron in the input mesh.
Definition: MeanCurvatureSkeleton3D.h:206
CGAL::Surface_mesh< Point3 > SurfaceMesh
Definition: MeanCurvatureSkeleton3D.h:66
void SetParameters(Parameters &_p)
Definition: MeanCurvatureSkeleton3D.h:140
vector< Point3d > WitnessType
Definition: MeanCurvatureSkeleton3D.h:73
MeanCurvatureSkeleton3D(PolyhedronType &_poly, bool _d=false)
Definition: MeanCurvatureSkeleton3D.h:94
MCSkeleton::edge_descriptor MCED
Definition: MeanCurvatureSkeleton3D.h:71
CGALKernel::Point_3 Point3
Definition: MeanCurvatureSkeleton3D.h:65
Skeletonization::Meso_skeleton MESO
Definition: MeanCurvatureSkeleton3D.h:72
CGAL::Mean_curvature_flow_skeletonization< SurfaceMesh > Skeletonization
Definition: MeanCurvatureSkeleton3D.h:68
static Parameters m_defaultParams
Parameters.
Definition: MeanCurvatureSkeleton3D.h:58
CGAL::Polyhedron_3< CGALKernel, CGAL::Polyhedron_items_with_id_3 > Polyhedron
Definition: MeanCurvatureSkeleton3D.h:67
PropertyMap< vector< WitnessType >, WitnessType > AnnotationType
Definition: MeanCurvatureSkeleton3D.h:74
Definition: PropertyMap.h:38
Definition: WorkspaceDecomposition.h:24
Geometric skeleton of the workspace.
Definition: WorkspaceSkeleton.h:22
Definition: MeanCurvatureSkeleton3D.h:46
std::string ioType
Definition: MeanCurvatureSkeleton3D.h:51
size_t space
Definition: MeanCurvatureSkeleton3D.h:55
std::string filebase
Definition: MeanCurvatureSkeleton3D.h:52