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

Public Member Functions

 Comb (const Eigen::PlainObjectBase< DerivedV > &_V, const Eigen::PlainObjectBase< DerivedF > &_F, const Eigen::PlainObjectBase< DerivedV > &_PD1, const Eigen::PlainObjectBase< DerivedV > &_PD2)
 
void comb (Eigen::PlainObjectBase< DerivedV > &PD1out, Eigen::PlainObjectBase< DerivedV > &PD2out)
 

Public Attributes

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

Static Private Member Functions

static double Sign (double a)
 
static Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > K_PI_new (const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &a, const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &b, const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &n)
 a and b should be in the same plane orthogonal to N
 

Private Attributes

DerivedF TT
 
DerivedF TTi
 

Detailed Description

template<typename DerivedV, typename DerivedF>
class igl::Comb< DerivedV, DerivedF >

Constructor & Destructor Documentation

◆ Comb()

template<typename DerivedV , typename DerivedF >
igl::Comb< DerivedV, DerivedF >::Comb ( const Eigen::PlainObjectBase< DerivedV > &  _V,
const Eigen::PlainObjectBase< DerivedF > &  _F,
const Eigen::PlainObjectBase< DerivedV > &  _PD1,
const Eigen::PlainObjectBase< DerivedV > &  _PD2 
)
inline
68 :
69 V(_V),
70 F(_F),
71 PD1(_PD1),
72 PD2(_PD2)
73 {
76 }
DerivedV N
Definition comb_cross_field.cpp:30
const Eigen::PlainObjectBase< DerivedV > & PD1
Definition comb_cross_field.cpp:28
const Eigen::PlainObjectBase< DerivedV > & V
Definition comb_cross_field.cpp:26
const Eigen::PlainObjectBase< DerivedV > & PD2
Definition comb_cross_field.cpp:29
DerivedF TTi
Definition comb_cross_field.cpp:35
DerivedF TT
Definition comb_cross_field.cpp:34
const Eigen::PlainObjectBase< DerivedF > & F
Definition comb_cross_field.cpp:27
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 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::Comb< DerivedV, DerivedF >::F, igl::Comb< DerivedV, DerivedF >::N, igl::per_face_normals(), igl::triangle_triangle_adjacency(), igl::Comb< DerivedV, DerivedF >::TT, igl::Comb< DerivedV, DerivedF >::TTi, and igl::Comb< DerivedV, DerivedF >::V.

+ Here is the call graph for this function:

Member Function Documentation

◆ comb()

template<typename DerivedV , typename DerivedF >
void igl::Comb< DerivedV, DerivedF >::comb ( Eigen::PlainObjectBase< DerivedV > &  PD1out,
Eigen::PlainObjectBase< DerivedV > &  PD2out 
)
inline
79 {
80// PD1out = PD1;
81// PD2out = PD2;
82 PD1out.setZero(F.rows(),3);PD1out<<PD1;
83 PD2out.setZero(F.rows(),3);PD2out<<PD2;
84
85 Eigen::VectorXi mark = Eigen::VectorXi::Constant(F.rows(),false);
86
87 std::deque<int> d;
88
89 d.push_back(0);
90 mark(0) = true;
91
92 while (!d.empty())
93 {
94 int f0 = d.at(0);
95 d.pop_front();
96 for (int k=0; k<3; k++)
97 {
98 int f1 = TT(f0,k);
99 if (f1==-1) continue;
100 if (mark(f1)) continue;
101
106
107
109 dir0Rot.normalize();
111
112 PD1out.row(f1) = targD;
113 PD2out.row(f1) = n1.cross(targD).normalized();
114
115 mark(f1) = true;
116 d.push_back(f1);
117
118 }
119 }
120
121 // everything should be marked
122 for (int i=0; i<F.rows(); i++)
123 {
124 assert(mark(i));
125 }
126 }
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition CwiseNullaryOp.h:515
static Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > K_PI_new(const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &a, const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &b, const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &n)
a and b should be in the same plane orthogonal to N
Definition comb_cross_field.cpp:48
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

References igl::Comb< DerivedV, DerivedF >::F, igl::Comb< DerivedV, DerivedF >::K_PI_new(), igl::Comb< DerivedV, DerivedF >::N, igl::Comb< DerivedV, DerivedF >::PD1, igl::Comb< DerivedV, DerivedF >::PD2, igl::rotation_matrix_from_directions(), Eigen::PlainObjectBase< Derived >::rows(), Eigen::PlainObjectBase< Derived >::setZero(), and igl::Comb< DerivedV, DerivedF >::TT.

Referenced by igl::comb_cross_field().

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

◆ K_PI_new()

template<typename DerivedV , typename DerivedF >
static Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > igl::Comb< DerivedV, DerivedF >::K_PI_new ( const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &  a,
const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &  b,
const Eigen::Matrix< typename DerivedV::Scalar, 3, 1 > &  n 
)
inlinestaticprivate

a and b should be in the same plane orthogonal to N

51 {
52 Eigen::Matrix<typename DerivedV::Scalar, 3, 1> c = (a.cross(n)).normalized();
53 typename DerivedV::Scalar scorea = a.dot(b);
54 typename DerivedV::Scalar scorec = c.dot(b);
55 if (fabs(scorea)>=fabs(scorec))
56 return a*Sign(scorea);
57 else
58 return c*Sign(scorec);
59 }
static double Sign(double a)
Definition comb_cross_field.cpp:41

References igl::Comb< DerivedV, DerivedF >::Sign().

Referenced by igl::Comb< DerivedV, DerivedF >::comb().

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

◆ Sign()

template<typename DerivedV , typename DerivedF >
static double igl::Comb< DerivedV, DerivedF >::Sign ( double  a)
inlinestaticprivate
41{return (double)((a>0)?+1:-1);}

Referenced by igl::Comb< DerivedV, DerivedF >::K_PI_new().

+ Here is the caller graph for this function:

Member Data Documentation

◆ F

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

◆ N

template<typename DerivedV , typename DerivedF >
DerivedV igl::Comb< DerivedV, DerivedF >::N

◆ PD1

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

◆ PD2

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

◆ TT

template<typename DerivedV , typename DerivedF >
DerivedF igl::Comb< DerivedV, DerivedF >::TT
private

◆ TTi

template<typename DerivedV , typename DerivedF >
DerivedF igl::Comb< DerivedV, DerivedF >::TTi
private

◆ V

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

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