Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::copyleft::comiso::FrameInterpolator Class Reference
+ Collaboration diagram for igl::copyleft::comiso::FrameInterpolator:

Public Member Functions

IGL_INLINE FrameInterpolator (const Eigen::MatrixXd &_V, const Eigen::MatrixXi &_F)
 
IGL_INLINE ~FrameInterpolator ()
 
IGL_INLINE void resetConstraints ()
 
IGL_INLINE void setConstraint (const int fid, const Eigen::VectorXd &v)
 
IGL_INLINE void interpolateSymmetric ()
 
IGL_INLINE void solve ()
 
IGL_INLINE void frame2canonical (const Eigen::MatrixXd &TP, const Eigen::RowVectorXd &v, double &theta, Eigen::VectorXd &S)
 
IGL_INLINE void canonical2frame (const Eigen::MatrixXd &TP, const double theta, const Eigen::VectorXd &S, Eigen::RowVectorXd &v)
 
IGL_INLINE Eigen::MatrixXd getFieldPerFace ()
 
IGL_INLINE void PolarDecomposition (Eigen::MatrixXd V, Eigen::MatrixXd &U, Eigen::MatrixXd &P)
 

Public Attributes

Eigen::MatrixXd S
 
std::vector< bool > S_c
 
Eigen::MatrixXi TT
 
Eigen::MatrixXi TTi
 
std::vector< bool > edge_consistency
 
Eigen::MatrixXi edge_consistency_TT
 

Private Member Functions

IGL_INLINE double mod2pi (double d)
 
IGL_INLINE double modpi2 (double d)
 
IGL_INLINE double modpi (double d)
 
IGL_INLINE double vector2theta (const Eigen::MatrixXd &TP, const Eigen::RowVectorXd &v)
 
IGL_INLINE Eigen::RowVectorXd theta2vector (const Eigen::MatrixXd &TP, const double theta)
 
IGL_INLINE void interpolateCross ()
 
IGL_INLINE void computek ()
 
IGL_INLINE void compute_edge_consistency ()
 

Private Attributes

Eigen::VectorXd thetas
 
std::vector< bool > thetas_c
 
Eigen::MatrixXi EV
 
Eigen::MatrixXi FE
 
Eigen::MatrixXi EF
 
std::vector< bool > isBorderEdge
 
Eigen::VectorXd k
 
Eigen::MatrixXd V
 
Eigen::MatrixXi F
 
Eigen::MatrixXd N
 
std::vector< Eigen::MatrixXd > TPs
 

Detailed Description

Constructor & Destructor Documentation

◆ FrameInterpolator()

igl::copyleft::comiso::FrameInterpolator::FrameInterpolator ( const Eigen::MatrixXd &  _V,
const Eigen::MatrixXi &  _F 
)
108{
109 using namespace std;
110 using namespace Eigen;
111
112 V = _V;
113 F = _F;
114
115 assert(V.rows() > 0);
116 assert(F.rows() > 0);
117
118
119 // Generate topological relations
122
123 // Flag border edges
124 isBorderEdge.resize(EV.rows());
125 for(unsigned i=0; i<EV.rows(); ++i)
126 isBorderEdge[i] = (EF(i,0) == -1) || ((EF(i,1) == -1));
127
128 // Generate normals per face
130
131 // Generate reference frames
132 for(unsigned fid=0; fid<F.rows(); ++fid)
133 {
134 // First edge
135 Vector3d e1 = V.row(F(fid,1)) - V.row(F(fid,0));
136 e1.normalize();
137 Vector3d e2 = N.row(fid);
138 e2 = e2.cross(e1);
139 e2.normalize();
140
141 MatrixXd TP(2,3);
142 TP << e1.transpose(), e2.transpose();
143 TPs.push_back(TP);
144 }
145
146 // Reset the constraints
148
149 // Compute k, differences between reference frames
150 computek();
151
152 // Alloc internal variables
153 thetas = VectorXd::Zero(F.rows());
154 S = MatrixXd::Zero(F.rows(),3);
155
157}
IGL_INLINE void computek()
Definition frame_field.cpp:300
Eigen::MatrixXi TT
Definition frame_field.cpp:57
std::vector< Eigen::MatrixXd > TPs
Definition frame_field.cpp:103
IGL_INLINE void resetConstraints()
Definition frame_field.cpp:242
Eigen::MatrixXi EF
Definition frame_field.cpp:88
Eigen::MatrixXd N
Definition frame_field.cpp:100
Eigen::MatrixXi FE
Definition frame_field.cpp:88
Eigen::MatrixXi F
Definition frame_field.cpp:97
Eigen::MatrixXi EV
Definition frame_field.cpp:88
Eigen::VectorXd thetas
Definition frame_field.cpp:84
IGL_INLINE void compute_edge_consistency()
Definition frame_field.cpp:255
Eigen::MatrixXd S
Definition frame_field.cpp:51
std::vector< bool > isBorderEdge
Definition frame_field.cpp:89
Eigen::MatrixXi TTi
Definition frame_field.cpp:57
Eigen::MatrixXd V
Definition frame_field.cpp:96
Definition LDLT.h:16
IGL_INLINE void edge_topology(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::MatrixXi &EV, Eigen::MatrixXi &FE, Eigen::MatrixXi &EF)
Definition edge_topology.cpp:13
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
STL namespace.

References compute_edge_consistency(), computek(), igl::edge_topology(), EF, EV, F, FE, isBorderEdge, N, igl::per_face_normals(), resetConstraints(), S, thetas, TPs, igl::triangle_triangle_adjacency(), TT, TTi, and V.

+ Here is the call graph for this function:

◆ ~FrameInterpolator()

igl::copyleft::comiso::FrameInterpolator::~FrameInterpolator ( )
160{
161
162}

Member Function Documentation

◆ canonical2frame()

void igl::copyleft::comiso::FrameInterpolator::canonical2frame ( const Eigen::MatrixXd &  TP,
const double  theta,
const Eigen::VectorXd &  S,
Eigen::RowVectorXd &  v 
)
445{
446 using namespace std;
447 using namespace Eigen;
448
449 assert(S_v.size() == 3);
450
451 MatrixXd S_temp(2,2);
452 S_temp << S_v(0), S_v(1), S_v(1), S_v(2);
453
454 // Convert angle in vector in the tangent plane
455 // Vector2d vp(cos(theta),sin(theta));
456
457 // First reconstruct R
458 MatrixXd R(2,2);
459
460 R << cos(theta), -sin(theta), sin(theta), cos(theta);
461
462 // Rotation invariant reconstruction
463 MatrixXd M = S_temp * R;
464
465 Vector2d vp0(M(0,0),M(1,0));
466 Vector2d vp1(M(0,1),M(1,1));
467
468 // Unproject the vectors
469 RowVectorXd v0 = vp0.transpose() * TP;
470 RowVectorXd v1 = vp1.transpose() * TP;
471
472 v.resize(6);
473 v << v0, v1;
474}
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220

References cos(), and sin().

Referenced by getFieldPerFace(), and setConstraint().

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

◆ compute_edge_consistency()

void igl::copyleft::comiso::FrameInterpolator::compute_edge_consistency ( )
private
256{
257 using namespace std;
258 using namespace Eigen;
259
260 // Compute per-edge consistency
261 edge_consistency.resize(EF.rows());
262 edge_consistency_TT = MatrixXi::Constant(TT.rows(),3,-1);
263
264 // For every non-border edge
265 for (unsigned eid=0; eid<EF.rows(); ++eid)
266 {
267 if (!isBorderEdge[eid])
268 {
269 int fid0 = EF(eid,0);
270 int fid1 = EF(eid,1);
271
272 double theta0 = thetas(fid0);
273 double theta1 = thetas(fid1);
274
275 theta0 = theta0 + k(eid);
276
277 double r = modpi(theta0-theta1);
278
279 edge_consistency[eid] = r < igl::PI/4.0 || r > 3*(igl::PI/4.0);
280
281 // Copy it into edge_consistency_TT
282 int i1 = -1;
283 int i2 = -1;
284 for (unsigned i=0; i<3; ++i)
285 {
286 if (TT(fid0,i) == fid1)
287 i1 = i;
288 if (TT(fid1,i) == fid0)
289 i2 = i;
290 }
291 assert(i1 != -1);
292 assert(i2 != -1);
293
296 }
297 }
298}
Eigen::MatrixXi edge_consistency_TT
Definition frame_field.cpp:61
std::vector< bool > edge_consistency
Definition frame_field.cpp:60
IGL_INLINE double modpi(double d)
Definition frame_field.cpp:180
Eigen::VectorXd k
Definition frame_field.cpp:93
const double PI
Definition PI.h:16

References edge_consistency, edge_consistency_TT, EF, isBorderEdge, k, modpi(), igl::PI, thetas, and TT.

Referenced by FrameInterpolator().

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

◆ computek()

void igl::copyleft::comiso::FrameInterpolator::computek ( )
private
301{
302 using namespace std;
303 using namespace Eigen;
304
305 k.resize(EF.rows());
306
307 // For every non-border edge
308 for (unsigned eid=0; eid<EF.rows(); ++eid)
309 {
310 if (!isBorderEdge[eid])
311 {
312 int fid0 = EF(eid,0);
313 int fid1 = EF(eid,1);
314
315 Vector3d N0 = N.row(fid0);
316 //Vector3d N1 = N.row(fid1);
317
318 // find common edge on triangle 0 and 1
319 int fid0_vc = -1;
320 int fid1_vc = -1;
321 for (unsigned i=0;i<3;++i)
322 {
323 if (EV(eid,0) == F(fid0,i))
324 fid0_vc = i;
325 if (EV(eid,1) == F(fid1,i))
326 fid1_vc = i;
327 }
328 assert(fid0_vc != -1);
329 assert(fid1_vc != -1);
330
331 Vector3d common_edge = V.row(F(fid0,(fid0_vc+1)%3)) - V.row(F(fid0,fid0_vc));
332 common_edge.normalize();
333
334 // Map the two triangles in a new space where the common edge is the x axis and the N0 the z axis
335 MatrixXd P(3,3);
336 VectorXd o = V.row(F(fid0,fid0_vc));
337 VectorXd tmp = -N0.cross(common_edge);
338 P << common_edge, tmp, N0;
339 P.transposeInPlace();
340
341
342 MatrixXd V0(3,3);
343 V0.row(0) = V.row(F(fid0,0)).transpose() -o;
344 V0.row(1) = V.row(F(fid0,1)).transpose() -o;
345 V0.row(2) = V.row(F(fid0,2)).transpose() -o;
346
347 V0 = (P*V0.transpose()).transpose();
348
349 assert(V0(0,2) < 10e-10);
350 assert(V0(1,2) < 10e-10);
351 assert(V0(2,2) < 10e-10);
352
353 MatrixXd V1(3,3);
354 V1.row(0) = V.row(F(fid1,0)).transpose() -o;
355 V1.row(1) = V.row(F(fid1,1)).transpose() -o;
356 V1.row(2) = V.row(F(fid1,2)).transpose() -o;
357 V1 = (P*V1.transpose()).transpose();
358
359 assert(V1(fid1_vc,2) < 10e-10);
360 assert(V1((fid1_vc+1)%3,2) < 10e-10);
361
362 // compute rotation R such that R * N1 = N0
363 // i.e. map both triangles to the same plane
364 double alpha = -atan2(V1((fid1_vc+2)%3,2),V1((fid1_vc+2)%3,1));
365
366 MatrixXd R(3,3);
367 R << 1, 0, 0,
368 0, cos(alpha), -sin(alpha) ,
369 0, sin(alpha), cos(alpha);
370 V1 = (R*V1.transpose()).transpose();
371
372 assert(V1(0,2) < 10e-10);
373 assert(V1(1,2) < 10e-10);
374 assert(V1(2,2) < 10e-10);
375
376 // measure the angle between the reference frames
377 // k_ij is the angle between the triangle on the left and the one on the right
378 VectorXd ref0 = V0.row(1) - V0.row(0);
379 VectorXd ref1 = V1.row(1) - V1.row(0);
380
381 ref0.normalize();
382 ref1.normalize();
383
384 double ktemp = atan2(ref1(1),ref1(0)) - atan2(ref0(1),ref0(0));
385
386 // just to be sure, rotate ref0 using angle ktemp...
387 MatrixXd R2(2,2);
388 R2 << cos(ktemp), -sin(ktemp), sin(ktemp), cos(ktemp);
389
390 tmp = R2*ref0.head<2>();
391
392 assert(tmp(0) - ref1(0) < (0.000001));
393 assert(tmp(1) - ref1(1) < (0.000001));
394
395 k[eid] = ktemp;
396 }
397 }
398
399}

References cos(), EF, EV, F, isBorderEdge, k, N, sin(), and V.

Referenced by FrameInterpolator().

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

◆ frame2canonical()

void igl::copyleft::comiso::FrameInterpolator::frame2canonical ( const Eigen::MatrixXd &  TP,
const Eigen::RowVectorXd &  v,
double &  theta,
Eigen::VectorXd &  S 
)
403{
404 using namespace std;
405 using namespace Eigen;
406
407 RowVectorXd v0 = v.segment<3>(0);
408 RowVectorXd v1 = v.segment<3>(3);
409
410 // Project onto the tangent plane
411 Vector2d vp0 = TP * v0.transpose();
412 Vector2d vp1 = TP * v1.transpose();
413
414 // Assemble matrix
415 MatrixXd M(2,2);
416 M << vp0, vp1;
417
418 if (M.determinant() < 0)
419 M.col(1) = -M.col(1);
420
421 assert(M.determinant() > 0);
422
423 // cerr << "M: " << M << endl;
424
425 MatrixXd R,S;
427
428 // Finally, express the cross field as an angle
429 theta = atan2(R(1,0),R(0,0));
430
431 MatrixXd R2(2,2);
432 R2 << cos(theta), -sin(theta), sin(theta), cos(theta);
433
434 assert((R2-R).norm() < 10e-8);
435
436 // Convert into rotation invariant form
437 S = R * S * R.inverse();
438
439 // Copy in vector form
440 S_v = VectorXd(3);
441 S_v << S(0,0), S(0,1), S(1,1);
442}
IGL_INLINE void PolarDecomposition(Eigen::MatrixXd V, Eigen::MatrixXd &U, Eigen::MatrixXd &P)
Definition frame_field.cpp:640

References cos(), PolarDecomposition(), S, and sin().

Referenced by setConstraint().

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

◆ getFieldPerFace()

Eigen::MatrixXd igl::copyleft::comiso::FrameInterpolator::getFieldPerFace ( )
626{
627 using namespace std;
628 using namespace Eigen;
629
630 MatrixXd R(F.rows(),6);
631 for (unsigned i=0; i<F.rows(); ++i)
632 {
633 RowVectorXd v;
634 canonical2frame(TPs[i],thetas(i),S.row(i),v);
635 R.row(i) = v;
636 }
637 return R;
638}
IGL_INLINE void canonical2frame(const Eigen::MatrixXd &TP, const double theta, const Eigen::VectorXd &S, Eigen::RowVectorXd &v)
Definition frame_field.cpp:444

References canonical2frame(), F, S, thetas, and TPs.

Referenced by igl::copyleft::comiso::frame_field().

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

◆ interpolateCross()

void igl::copyleft::comiso::FrameInterpolator::interpolateCross ( )
private
206{
207 using namespace std;
208 using namespace Eigen;
209
210 //olga: was
211 // NRosyField nrosy(V,F);
212 // for (unsigned i=0; i<F.rows(); ++i)
213 // if(thetas_c[i])
214 // nrosy.setConstraintHard(i,theta2vector(TPs[i],thetas(i)));
215 // nrosy.solve(4);
216 // MatrixXd R = nrosy.getFieldPerFace();
217
218 //olga: is
219 Eigen::MatrixXd R;
220 Eigen::VectorXd S;
221 Eigen::VectorXi b; b.resize(F.rows(),1);
222 Eigen::MatrixXd bc; bc.resize(F.rows(),3);
223 int num = 0;
224 for (unsigned i=0; i<F.rows(); ++i)
225 if(thetas_c[i])
226 {
227 b[num] = i;
228 bc.row(num) = theta2vector(TPs[i],thetas(i));
229 num++;
230 }
231 b.conservativeResize(num,Eigen::NoChange);
232 bc.conservativeResize(num,Eigen::NoChange);
233
234 igl::copyleft::comiso::nrosy(V, F, b, bc, 4, R, S);
235 //olga:end
236 assert(R.rows() == F.rows());
237
238 for (unsigned i=0; i<F.rows(); ++i)
239 thetas(i) = vector2theta(TPs[i],R.row(i));
240}
IGL_INLINE Eigen::RowVectorXd theta2vector(const Eigen::MatrixXd &TP, const double theta)
Definition frame_field.cpp:199
std::vector< bool > thetas_c
Definition frame_field.cpp:85
IGL_INLINE double vector2theta(const Eigen::MatrixXd &TP, const Eigen::RowVectorXd &v)
Definition frame_field.cpp:189
@ NoChange
Definition Constants.h:350
IGL_INLINE void nrosy(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::VectorXi &b, const Eigen::MatrixXd &bc, const Eigen::VectorXi &b_soft, const Eigen::VectorXd &w_soft, const Eigen::MatrixXd &bc_soft, const int N, const double soft, Eigen::MatrixXd &R, Eigen::VectorXd &S)
Definition nrosy.cpp:877

References F, Eigen::NoChange, igl::copyleft::comiso::nrosy(), S, theta2vector(), thetas, thetas_c, TPs, V, and vector2theta().

Referenced by solve().

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

◆ interpolateSymmetric()

void igl::copyleft::comiso::FrameInterpolator::interpolateSymmetric ( )
483{
484 using namespace std;
485 using namespace Eigen;
486
487 // Generate uniform Laplacian matrix
488 typedef Eigen::Triplet<double> triplet;
489 std::vector<triplet> triplets;
490
491 // Variables are stacked as x1,y1,z1,x2,y2,z2
492 triplets.reserve(3*4*F.rows());
493
494 MatrixXd b = MatrixXd::Zero(3*F.rows(),1);
495
496 // Build L and b
497 for (unsigned eid=0; eid<EF.rows(); ++eid)
498 {
499 if (!isBorderEdge[eid])
500 {
501 for (int z=0;z<2;++z)
502 {
503 // W = [w_a, w_b
504 // w_b, w_c]
505 //
506
507 // It is not symmetric
508 int i = EF(eid,z==0?0:1);
509 int j = EF(eid,z==0?1:0);
510
511 int w_a_0 = (i*3)+0;
512 int w_b_0 = (i*3)+1;
513 int w_c_0 = (i*3)+2;
514
515 int w_a_1 = (j*3)+0;
516 int w_b_1 = (j*3)+1;
517 int w_c_1 = (j*3)+2;
518
519 // Rotation to change frame
520 double r_a = cos(z==1?k(eid):-k(eid));
521 double r_b = -sin(z==1?k(eid):-k(eid));
522 double r_c = sin(z==1?k(eid):-k(eid));
523 double r_d = cos(z==1?k(eid):-k(eid));
524
525 // First term
526 // w_a_0 = r_a^2 w_a_1 + 2 r_a r_b w_b_1 + r_b^2 w_c_1 = 0
527 triplets.push_back(triplet(w_a_0,w_a_0, -1 ));
528 triplets.push_back(triplet(w_a_0,w_a_1, r_a*r_a ));
529 triplets.push_back(triplet(w_a_0,w_b_1, 2 * r_a*r_b ));
530 triplets.push_back(triplet(w_a_0,w_c_1, r_b*r_b ));
531
532 // Second term
533 // w_b_0 = r_a r_c w_a + (r_b r_c + r_a r_d) w_b + r_b r_d w_c
534 triplets.push_back(triplet(w_b_0,w_b_0, -1 ));
535 triplets.push_back(triplet(w_b_0,w_a_1, r_a*r_c ));
536 triplets.push_back(triplet(w_b_0,w_b_1, r_b*r_c + r_a*r_d ));
537 triplets.push_back(triplet(w_b_0,w_c_1, r_b*r_d ));
538
539 // Third term
540 // w_c_0 = r_c^2 w_a + 2 r_c r_d w_b + r_d^2 w_c
541 triplets.push_back(triplet(w_c_0,w_c_0, -1 ));
542 triplets.push_back(triplet(w_c_0,w_a_1, r_c*r_c ));
543 triplets.push_back(triplet(w_c_0,w_b_1, 2 * r_c*r_d ));
544 triplets.push_back(triplet(w_c_0,w_c_1, r_d*r_d ));
545 }
546 }
547 }
548
549 SparseMatrix<double> L(3*F.rows(),3*F.rows());
550 L.setFromTriplets(triplets.begin(), triplets.end());
551
552 triplets.clear();
553
554 // Add soft constraints
555 double w = 100000;
556 for (unsigned fid=0; fid < F.rows(); ++fid)
557 {
558 if (S_c[fid])
559 {
560 for (unsigned i=0;i<3;++i)
561 {
562 triplets.push_back(triplet(3*fid + i,3*fid + i,w));
563 b(3*fid + i) += w*S(fid,i);
564 }
565 }
566 }
567
568 SparseMatrix<double> soft(3*F.rows(),3*F.rows());
569 soft.setFromTriplets(triplets.begin(), triplets.end());
570
572
573 M = L + soft;
574
575 // Solve Lx = b;
576
578
579 solver.compute(M);
580
581 if(solver.info()!=Success)
582 {
583 std::cerr << "LU failed - frame_interpolator.cpp" << std::endl;
584 assert(0);
585 }
586
587 MatrixXd x;
588 x = solver.solve(b);
589
590 if(solver.info()!=Success)
591 {
592 std::cerr << "Linear solve failed - frame_interpolator.cpp" << std::endl;
593 assert(0);
594 }
595
596 S = MatrixXd::Zero(F.rows(),3);
597
598 // Copy back the result
599 for (unsigned i=0;i<F.rows();++i)
600 S.row(i) << x(i*3+0), x(i*3+1), x(i*3+2);
601
602}
Sparse supernodal LU factorization for general matrices.
Definition SparseLU.h:75
void compute(const MatrixType &matrix)
Definition SparseLU.h:124
ComputationInfo info() const
Reports whether previous computation was successful.
Definition SparseLU.h:202
A versatible sparse matrix representation.
Definition SparseMatrix.h:98
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition SparseSolverBase.h:88
A small structure to hold a non zero as a triplet (i,j,value).
Definition SparseUtil.h:155
std::vector< bool > S_c
Definition frame_field.cpp:52
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297
#define L(s)
Definition I18N.hpp:18

References Eigen::SparseLU< _MatrixType, _OrderingType >::compute(), cos(), EF, F, Eigen::SparseLU< _MatrixType, _OrderingType >::info(), isBorderEdge, k, L, S, S_c, Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::setFromTriplets(), sin(), and Eigen::SparseSolverBase< Derived >::solve().

Referenced by solve().

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

◆ mod2pi()

double igl::copyleft::comiso::FrameInterpolator::mod2pi ( double  d)
private
165{
166 while(d<0)
167 d = d + (2.0*igl::PI);
168
169 return fmod(d, (2.0*igl::PI));
170}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)
Definition MathFunctions.h:1242

References igl::PI.

◆ modpi()

double igl::copyleft::comiso::FrameInterpolator::modpi ( double  d)
private
181{
182 while(d<0)
183 d = d + (igl::PI);
184
185 return fmod(d, (igl::PI));
186}

References igl::PI.

Referenced by compute_edge_consistency().

+ Here is the caller graph for this function:

◆ modpi2()

double igl::copyleft::comiso::FrameInterpolator::modpi2 ( double  d)
private
173{
174 while(d<0)
175 d = d + (igl::PI/2.0);
176
177 return fmod(d, (igl::PI/2.0));
178}

References igl::PI.

◆ PolarDecomposition()

void igl::copyleft::comiso::FrameInterpolator::PolarDecomposition ( Eigen::MatrixXd  V,
Eigen::MatrixXd &  U,
Eigen::MatrixXd &  P 
)
641{
642 using namespace std;
643 using namespace Eigen;
644
645 // Polar Decomposition
647
648 U = svd.matrixU() * svd.matrixV().transpose();
649 P = svd.matrixV() * svd.singularValues().asDiagonal() * svd.matrixV().transpose();
650}
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition JacobiSVD.h:489
@ ComputeFullV
Definition Constants.h:387
@ ComputeFullU
Definition Constants.h:383

References Eigen::ComputeFullU, Eigen::ComputeFullV, Eigen::SVDBase< Derived >::matrixU(), Eigen::SVDBase< Derived >::matrixV(), Eigen::SVDBase< Derived >::singularValues(), and V.

Referenced by frame2canonical().

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

◆ resetConstraints()

void igl::copyleft::comiso::FrameInterpolator::resetConstraints ( )
243{
244 thetas_c.resize(F.rows());
245 S_c.resize(F.rows());
246
247 for(unsigned i=0; i<F.rows(); ++i)
248 {
249 thetas_c[i] = false;
250 S_c[i] = false;
251 }
252
253}

References F, S_c, and thetas_c.

Referenced by FrameInterpolator().

+ Here is the caller graph for this function:

◆ setConstraint()

void igl::copyleft::comiso::FrameInterpolator::setConstraint ( const int  fid,
const Eigen::VectorXd &  v 
)
605{
606 using namespace std;
607 using namespace Eigen;
608
609 double t_;
610 VectorXd S_;
611
612 frame2canonical(TPs[fid],v,t_,S_);
613
614 Eigen::RowVectorXd v2;
615 canonical2frame(TPs[fid], t_, S_, v2);
616
617 thetas(fid) = t_;
618 thetas_c[fid] = true;
619
620 S.row(fid) = S_;
621 S_c[fid] = true;
622
623}
IGL_INLINE void frame2canonical(const Eigen::MatrixXd &TP, const Eigen::RowVectorXd &v, double &theta, Eigen::VectorXd &S)
Definition frame_field.cpp:402

References canonical2frame(), frame2canonical(), S, S_c, thetas, thetas_c, and TPs.

Referenced by igl::copyleft::comiso::frame_field().

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

◆ solve()

void igl::copyleft::comiso::FrameInterpolator::solve ( )
477{
480}
IGL_INLINE void interpolateCross()
Definition frame_field.cpp:205
IGL_INLINE void interpolateSymmetric()
Definition frame_field.cpp:482

References interpolateCross(), and interpolateSymmetric().

Referenced by igl::copyleft::comiso::frame_field().

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

◆ theta2vector()

Eigen::RowVectorXd igl::copyleft::comiso::FrameInterpolator::theta2vector ( const Eigen::MatrixXd &  TP,
const double  theta 
)
private
200{
201 Eigen::Vector2d vp(cos(theta),sin(theta));
202 return vp.transpose() * TP;
203}

References cos(), and sin().

Referenced by interpolateCross().

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

◆ vector2theta()

double igl::copyleft::comiso::FrameInterpolator::vector2theta ( const Eigen::MatrixXd &  TP,
const Eigen::RowVectorXd &  v 
)
private
190{
191 // Project onto the tangent plane
192 Eigen::Vector2d vp = TP * v.transpose();
193
194 // Convert to angle
195 double theta = atan2(vp(1),vp(0));
196 return theta;
197}

Referenced by interpolateCross().

+ Here is the caller graph for this function:

Member Data Documentation

◆ edge_consistency

std::vector<bool> igl::copyleft::comiso::FrameInterpolator::edge_consistency

◆ edge_consistency_TT

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::edge_consistency_TT

◆ EF

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::EF
private

◆ EV

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::EV
private

Referenced by FrameInterpolator(), and computek().

◆ F

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::F
private

◆ FE

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::FE
private

Referenced by FrameInterpolator().

◆ isBorderEdge

std::vector<bool> igl::copyleft::comiso::FrameInterpolator::isBorderEdge
private

◆ k

Eigen::VectorXd igl::copyleft::comiso::FrameInterpolator::k
private

◆ N

Eigen::MatrixXd igl::copyleft::comiso::FrameInterpolator::N
private

Referenced by FrameInterpolator(), and computek().

◆ S

Eigen::MatrixXd igl::copyleft::comiso::FrameInterpolator::S

◆ S_c

std::vector<bool> igl::copyleft::comiso::FrameInterpolator::S_c

◆ thetas

Eigen::VectorXd igl::copyleft::comiso::FrameInterpolator::thetas
private

◆ thetas_c

std::vector<bool> igl::copyleft::comiso::FrameInterpolator::thetas_c
private

◆ TPs

std::vector<Eigen::MatrixXd> igl::copyleft::comiso::FrameInterpolator::TPs
private

◆ TT

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::TT

◆ TTi

Eigen::MatrixXi igl::copyleft::comiso::FrameInterpolator::TTi

Referenced by FrameInterpolator().

◆ V

Eigen::MatrixXd igl::copyleft::comiso::FrameInterpolator::V
private

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