31 #if !defined WindingNumbersShape_h
33 #define WindingNumbersShape_h
36 #error You need to have activated LIBIGL (WITH_LIBIGL flag) to include this file.
41 #include <DGtal/base/Common.h>
42 #include <DGtal/base/CountedConstPtrOrConstPtr.h>
43 #include <DGtal/base/ConstAlias.h>
45 #include <DGtal/shapes/CEuclideanOrientedShape.h>
46 #include <igl/fast_winding_number.h>
47 #include <igl/octree.h>
49 #include <igl/copyleft/cgal/point_areas.h>
65 template<
typename TSpace>
88 bool skipPointAreas =
false)
96 trace.
warning()<<
"[WindingNumberShape] Skipping the CGAL point area estimation. By default, point areas are set to 1.0"<<std::endl;
98 if (points->rows()> 20)
108 trace.
warning()<<
"[WindingNumberShape] Too few points to use CGAL point_areas. Using the constant area setting."<<std::endl;
120 const Eigen::VectorXd &areas)
145 const double threshold = 0.3)
const
147 Eigen::MatrixXd queries(1,3);
150 return singlePoint[0];
160 const double threshold = 0.3)
const
163 std::vector<Orientation> results( queries.rows(),
DGtal::OUTSIDE );
164 Eigen::MatrixXd O_CM;
166 Eigen::MatrixXd O_EC;
170 igl::fast_winding_number(*
myPoints,*
myNormals,
myPointAreas,
myO_PI,
myO_CH,O_CM,O_R,O_EC,queries,2,W);
173 for(
auto i=0u; i < queries.rows(); ++i)
175 if (std::abs(W(i)) < threshold )
178 if (std::abs(W(i)) > threshold)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Space::RealVector RealVector
DGtal is the top-level namespace which contains all DGtal functions and types.
PointVector< 3, double > RealPoint