Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM > Class Template Reference
+ Collaboration diagram for igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >:

Public Member Functions

 MissMatchCalculator (const Eigen::PlainObjectBase< DerivedV > &_V, const Eigen::PlainObjectBase< DerivedF > &_F, const Eigen::PlainObjectBase< DerivedV > &_PD1, const Eigen::PlainObjectBase< DerivedV > &_PD2)
 
void calculateMissmatch (Eigen::PlainObjectBase< DerivedM > &Handle_MMatch)
 

Public Attributes

const Eigen::PlainObjectBase< DerivedV > & V
 
const Eigen::PlainObjectBase< DerivedF > & F
 
const Eigen::PlainObjectBase< DerivedV > & PD1
 
const Eigen::PlainObjectBase< DerivedV > & PD2
 
DerivedV N
 

Private Member Functions

int MissMatchByCross (const int f0, const int f1)
 compute the mismatch between 2 faces
 

Private Attributes

std::vector< bool > V_border
 
std::vector< std::vector< int > > VF
 
std::vector< std::vector< int > > VFi
 
DerivedF TT
 
DerivedF TTi
 

Detailed Description

template<typename DerivedV, typename DerivedF, typename DerivedM>
class igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >

Constructor & Destructor Documentation

◆ MissMatchCalculator()

template<typename DerivedV , typename DerivedF , typename DerivedM >
igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::MissMatchCalculator ( const Eigen::PlainObjectBase< DerivedV > &  _V,
const Eigen::PlainObjectBase< DerivedF > &  _F,
const Eigen::PlainObjectBase< DerivedV > &  _PD1,
const Eigen::PlainObjectBase< DerivedV > &  _PD2 
)
inline
85 :
86 V(_V),
87 F(_F),
88 PD1(_PD1),
89 PD2(_PD2)
90 {
95 }
const Eigen::PlainObjectBase< DerivedV > & V
Definition cross_field_missmatch.cpp:28
std::vector< std::vector< int > > VFi
Definition cross_field_missmatch.cpp:39
const Eigen::PlainObjectBase< DerivedV > & PD2
Definition cross_field_missmatch.cpp:31
std::vector< bool > V_border
Definition cross_field_missmatch.cpp:37
DerivedV N
Definition cross_field_missmatch.cpp:33
DerivedF TTi
Definition cross_field_missmatch.cpp:42
DerivedF TT
Definition cross_field_missmatch.cpp:41
const Eigen::PlainObjectBase< DerivedF > & F
Definition cross_field_missmatch.cpp:29
const Eigen::PlainObjectBase< DerivedV > & PD1
Definition cross_field_missmatch.cpp:30
std::vector< std::vector< int > > VF
Definition cross_field_missmatch.cpp:38
IGL_INLINE void vertex_triangle_adjacency(const typename DerivedF::Scalar n, const Eigen::MatrixBase< DerivedF > &F, std::vector< std::vector< VFType > > &VF, std::vector< std::vector< VFiType > > &VFi)
Definition vertex_triangle_adjacency.cpp:12
IGL_INLINE void per_face_normals(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedZ > &Z, Eigen::PlainObjectBase< DerivedN > &N)
Definition per_face_normals.cpp:13
IGL_INLINE std::vector< bool > is_border_vertex(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F)
Definition is_border_vertex.cpp:14
IGL_INLINE void triangle_triangle_adjacency(const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTTi > &TTi)
Definition triangle_triangle_adjacency.cpp:116

References igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::F, igl::is_border_vertex(), igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::N, igl::per_face_normals(), igl::triangle_triangle_adjacency(), igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::TT, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::TTi, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::V, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::V_border, igl::vertex_triangle_adjacency(), igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::VF, and igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::VFi.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculateMissmatch()

template<typename DerivedV , typename DerivedF , typename DerivedM >
void igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::calculateMissmatch ( Eigen::PlainObjectBase< DerivedM > &  Handle_MMatch)
inline
98 {
99 Handle_MMatch.setConstant(F.rows(),3,-1);
100 for (size_t i=0;i<F.rows();i++)
101 {
102 for (int j=0;j<3;j++)
103 {
104 if (((int)i)==TT(i,j) || TT(i,j) == -1)
105 Handle_MMatch(i,j)=0;
106 else
107 Handle_MMatch(i,j) = MissMatchByCross(i,TT(i,j));
108 }
109 }
110 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Definition CwiseNullaryOp.h:341
int MissMatchByCross(const int f0, const int f1)
compute the mismatch between 2 faces
Definition cross_field_missmatch.cpp:47

References igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::F, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::MissMatchByCross(), Eigen::PlainObjectBase< Derived >::rows(), Eigen::PlainObjectBase< Derived >::setConstant(), and igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::TT.

Referenced by igl::cross_field_missmatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MissMatchByCross()

template<typename DerivedV , typename DerivedF , typename DerivedM >
int igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::MissMatchByCross ( const int  f0,
const int  f1 
)
inlineprivate

compute the mismatch between 2 faces

49 {
54
56 dir1Rot.normalize();
57
58 // TODO: this should be equivalent to the other code below, to check!
59 // Compute the angle between the two vectors
60 // double a0 = atan2(dir0.dot(B2.row(f0)),dir0.dot(B1.row(f0)));
61 // double a1 = atan2(dir1Rot.dot(B2.row(f0)),dir1Rot.dot(B1.row(f0)));
62 //
63 // double angle_diff = a1-a0; //VectToAngle(f0,dir1Rot);
64
65 double angle_diff = atan2(dir1Rot.dot(PD2.row(f0)),dir1Rot.dot(PD1.row(f0)));
66
67 // std::cerr << "Dani: " << dir0(0) << " " << dir0(1) << " " << dir0(2) << " " << dir1Rot(0) << " " << dir1Rot(1) << " " << dir1Rot(2) << " " << angle_diff << std::endl;
68
69 double step=igl::PI/2.0;
70 int i=(int)std::floor((angle_diff/step)+0.5);
71 int k=0;
72 if (i>=0)
73 k=i%4;
74 else
75 k=(-(3*i))%4;
76 return k;
77 }
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
const double PI
Definition PI.h:16
IGL_INLINE Eigen::Matrix< Scalar, 3, 3 > rotation_matrix_from_directions(const Eigen::Matrix< Scalar, 3, 1 > v0, const Eigen::Matrix< Scalar, 3, 1 > v1)
Definition rotation_matrix_from_directions.cpp:14
Coord step(const Coord &crd, Dir d)
Definition MarchingSquares.hpp:137

References igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::N, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::PD1, igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::PD2, igl::PI, and igl::rotation_matrix_from_directions().

Referenced by igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::calculateMissmatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ F

template<typename DerivedV , typename DerivedF , typename DerivedM >
const Eigen::PlainObjectBase<DerivedF>& igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::F

◆ N

template<typename DerivedV , typename DerivedF , typename DerivedM >
DerivedV igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::N

◆ PD1

template<typename DerivedV , typename DerivedF , typename DerivedM >
const Eigen::PlainObjectBase<DerivedV>& igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::PD1

◆ PD2

template<typename DerivedV , typename DerivedF , typename DerivedM >
const Eigen::PlainObjectBase<DerivedV>& igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::PD2

◆ TT

template<typename DerivedV , typename DerivedF , typename DerivedM >
DerivedF igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::TT
private

◆ TTi

template<typename DerivedV , typename DerivedF , typename DerivedM >
DerivedF igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::TTi
private

◆ V

template<typename DerivedV , typename DerivedF , typename DerivedM >
const Eigen::PlainObjectBase<DerivedV>& igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::V

◆ V_border

template<typename DerivedV , typename DerivedF , typename DerivedM >
std::vector<bool> igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::V_border
private

◆ VF

template<typename DerivedV , typename DerivedF , typename DerivedM >
std::vector<std::vector<int> > igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::VF
private

◆ VFi

template<typename DerivedV , typename DerivedF , typename DerivedM >
std::vector<std::vector<int> > igl::MissMatchCalculator< DerivedV, DerivedF, DerivedM >::VFi
private

The documentation for this class was generated from the following file: