Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::copyleft::comiso Namespace Reference

Classes

class  FrameInterpolator
 
struct  MeshSystemInfo
 
class  MIQ_class
 
class  NRosyField
 
class  PoissonSolver
 
struct  SeamInfo
 
class  VertexIndexing
 

Functions

IGL_INLINE void frame_field (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::VectorXi &b, const Eigen::MatrixXd &bc1, const Eigen::MatrixXd &bc2, Eigen::MatrixXd &FF1, Eigen::MatrixXd &FF2)
 
template<typename DerivedV , typename DerivedF , typename DerivedU >
IGL_INLINE void miq (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1, const Eigen::PlainObjectBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedU > &UV, Eigen::PlainObjectBase< DerivedF > &FUV, double scale=30.0, double stiffness=5.0, bool direct_round=false, int iter=5, int local_iter=5, bool DoRound=true, bool SingularityRound=true, std::vector< int > round_vertices=std::vector< int >(), std::vector< std::vector< int > > hard_features=std::vector< std::vector< int > >())
 
template<typename DerivedV , typename DerivedF , typename DerivedU >
IGL_INLINE void miq (const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1_combed, const Eigen::PlainObjectBase< DerivedV > &PD2_combed, const Eigen::Matrix< int, Eigen::Dynamic, 3 > &MMatch, const Eigen::Matrix< int, Eigen::Dynamic, 1 > &Singular, const Eigen::Matrix< int, Eigen::Dynamic, 3 > &Seams, Eigen::PlainObjectBase< DerivedU > &UV, Eigen::PlainObjectBase< DerivedF > &FUV, double GradientSize=30.0, double Stiffness=5.0, bool DirectRound=false, int iter=5, int localIter=5, bool DoRound=true, bool SingularityRound=true, std::vector< int > roundVertices=std::vector< int >(), std::vector< std::vector< int > > hardFeatures=std::vector< std::vector< int > >())
 
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)
 
IGL_INLINE void nrosy (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::VectorXi &b, const Eigen::MatrixXd &bc, const int N, Eigen::MatrixXd &R, Eigen::VectorXd &S)
 

Class Documentation

◆ igl::copyleft::comiso::MeshSystemInfo

struct igl::copyleft::comiso::MeshSystemInfo
+ Collaboration diagram for igl::copyleft::comiso::MeshSystemInfo:
Class Members
vector< SeamInfo > EdgeSeamInfo this are used for drawing purposes
int num_integer_cuts num of integer for cuts
int num_vert_variables

Function Documentation

◆ frame_field()

IGL_INLINE void igl::copyleft::comiso::frame_field ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::VectorXi &  b,
const Eigen::MatrixXd &  bc1,
const Eigen::MatrixXd &  bc2,
Eigen::MatrixXd &  FF1,
Eigen::MatrixXd &  FF2 
)
666{
667 using namespace std;
668 using namespace Eigen;
669
670 assert(b.size() > 0);
671
672 // Init Solver
673 FrameInterpolator field(V,F);
674
675 for (unsigned i=0; i<b.size(); ++i)
676 {
677 VectorXd t(6); t << bc1.row(i).transpose(), bc2.row(i).transpose();
678 field.setConstraint(b(i), t);
679 }
680
681 // Solve
682 field.solve();
683
684 // Copy back
685 MatrixXd R = field.getFieldPerFace();
686 FF1 = R.block(0, 0, R.rows(), 3);
687 FF2 = R.block(0, 3, R.rows(), 3);
688}
Definition frame_field.cpp:24
Definition LDLT.h:16
STL namespace.

References igl::copyleft::comiso::FrameInterpolator::getFieldPerFace(), igl::copyleft::comiso::FrameInterpolator::setConstraint(), and igl::copyleft::comiso::FrameInterpolator::solve().

+ Here is the call graph for this function:

◆ miq() [1/2]

template<typename DerivedV , typename DerivedF , typename DerivedU >
IGL_INLINE void igl::copyleft::comiso::miq ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::PlainObjectBase< DerivedV > &  PD1,
const Eigen::PlainObjectBase< DerivedV > &  PD2,
Eigen::PlainObjectBase< DerivedU > &  UV,
Eigen::PlainObjectBase< DerivedF > &  FUV,
double  scale = 30.0,
double  stiffness = 5.0,
bool  direct_round = false,
int  iter = 5,
int  local_iter = 5,
bool  DoRound = true,
bool  SingularityRound = true,
std::vector< int >  round_vertices = std::vector<int>(),
std::vector< std::vector< int > >  hard_features = std::vector<std::vector<int> >() 
)
1488{
1489
1490 DerivedV BIS1, BIS2;
1491 igl::compute_frame_field_bisectors(V, F, PD1, PD2, BIS1, BIS2);
1492
1493 DerivedV BIS1_combed, BIS2_combed;
1494 igl::comb_cross_field(V, F, BIS1, BIS2, BIS1_combed, BIS2_combed);
1495
1496 DerivedF Handle_MMatch;
1497 igl::cross_field_missmatch(V, F, BIS1_combed, BIS2_combed, true, Handle_MMatch);
1498
1499 Eigen::Matrix<int, Eigen::Dynamic, 1> isSingularity, singularityIndex;
1500 igl::find_cross_field_singularities(V, F, Handle_MMatch, isSingularity, singularityIndex);
1501
1503 igl::cut_mesh_from_singularities(V, F, Handle_MMatch, Handle_Seams);
1504
1505 DerivedV PD1_combed, PD2_combed;
1506 igl::comb_frame_field(V, F, PD1, PD2, BIS1_combed, BIS2_combed, PD1_combed, PD2_combed);
1507
1509 F,
1510 PD1_combed,
1511 PD2_combed,
1512 Handle_MMatch,
1513 isSingularity,
1514 Handle_Seams,
1515 UV,
1516 FUV,
1517 GradientSize,
1518 Stiffness,
1519 DirectRound,
1520 iter,
1521 localIter,
1522 DoRound,
1523 SingularityRound,
1524 roundVertices,
1525 hardFeatures);
1526
1527}
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
IGL_INLINE void miq(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1, const Eigen::PlainObjectBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedU > &UV, Eigen::PlainObjectBase< DerivedF > &FUV, double scale=30.0, double stiffness=5.0, bool direct_round=false, int iter=5, int local_iter=5, bool DoRound=true, bool SingularityRound=true, std::vector< int > round_vertices=std::vector< int >(), std::vector< std::vector< int > > hard_features=std::vector< std::vector< int > >())
Definition miq.cpp:1472
IGL_INLINE void find_cross_field_singularities(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedM > &Handle_MMatch, Eigen::PlainObjectBase< DerivedO > &isSingularity, Eigen::PlainObjectBase< DerivedO > &singularityIndex)
Definition find_cross_field_singularities.cpp:20
IGL_INLINE void cross_field_missmatch(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1, const Eigen::PlainObjectBase< DerivedV > &PD2, const bool isCombed, Eigen::PlainObjectBase< DerivedM > &missmatch)
Definition cross_field_missmatch.cpp:115
IGL_INLINE void compute_frame_field_bisectors(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &B1, const Eigen::PlainObjectBase< DerivedV > &B2, const Eigen::PlainObjectBase< DerivedV > &PD1, const Eigen::PlainObjectBase< DerivedV > &PD2, Eigen::PlainObjectBase< DerivedV > &BIS1, Eigen::PlainObjectBase< DerivedV > &BIS2)
Definition compute_frame_field_bisectors.cpp:19
IGL_INLINE void cut_mesh_from_singularities(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedM > &MMatch, Eigen::PlainObjectBase< DerivedO > &seams)
Definition cut_mesh_from_singularities.cpp:187
IGL_INLINE void comb_frame_field(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedP > &PD1, const Eigen::PlainObjectBase< DerivedP > &PD2, const Eigen::PlainObjectBase< DerivedP > &BIS1_combed, const Eigen::PlainObjectBase< DerivedP > &BIS2_combed, Eigen::PlainObjectBase< DerivedP > &PD1_combed, Eigen::PlainObjectBase< DerivedP > &PD2_combed)
Definition comb_frame_field.cpp:19
IGL_INLINE void comb_cross_field(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const Eigen::PlainObjectBase< DerivedV > &PD1in, const Eigen::PlainObjectBase< DerivedV > &PD2in, Eigen::PlainObjectBase< DerivedV > &PD1out, Eigen::PlainObjectBase< DerivedV > &PD2out)
Definition comb_cross_field.cpp:133

References igl::comb_cross_field(), igl::comb_frame_field(), igl::compute_frame_field_bisectors(), igl::cross_field_missmatch(), igl::cut_mesh_from_singularities(), igl::find_cross_field_singularities(), and miq().

Referenced by miq(), and miq().

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

◆ miq() [2/2]

template<typename DerivedV , typename DerivedF , typename DerivedU >
IGL_INLINE void igl::copyleft::comiso::miq ( const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F,
const Eigen::PlainObjectBase< DerivedV > &  PD1_combed,
const Eigen::PlainObjectBase< DerivedV > &  PD2_combed,
const Eigen::Matrix< int, Eigen::Dynamic, 3 > &  MMatch,
const Eigen::Matrix< int, Eigen::Dynamic, 1 > &  Singular,
const Eigen::Matrix< int, Eigen::Dynamic, 3 > &  Seams,
Eigen::PlainObjectBase< DerivedU > &  UV,
Eigen::PlainObjectBase< DerivedF > &  FUV,
double  GradientSize = 30.0,
double  Stiffness = 5.0,
bool  DirectRound = false,
int  iter = 5,
int  localIter = 5,
bool  DoRound = true,
bool  SingularityRound = true,
std::vector< int >  roundVertices = std::vector<int>(),
std::vector< std::vector< int > >  hardFeatures = std::vector<std::vector<int> >() 
)
1446{
1447 GradientSize = GradientSize/(V.colwise().maxCoeff()-V.colwise().minCoeff()).norm();
1448
1450 F,
1451 PD1_combed,
1452 PD2_combed,
1453 Handle_MMatch,
1454 Handle_Singular,
1455 Handle_Seams,
1456 UV,
1457 FUV,
1458 GradientSize,
1459 Stiffness,
1460 DirectRound,
1461 iter,
1462 localIter,
1463 DoRound,
1464 SingularityRound,
1465 roundVertices,
1466 hardFeatures);
1467
1468 miq.extractUV(UV,FUV);
1469}
Definition miq.cpp:297

References miq().

+ Here is the call graph for this function:

◆ nrosy() [1/2]

IGL_INLINE void igl::copyleft::comiso::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 
)
890{
891 // Init solver
893
894 // Add hard constraints
895 for (unsigned i=0; i<b.size();++i)
896 solver.setConstraintHard(b(i),bc.row(i));
897
898 // Add soft constraints
899 for (unsigned i=0; i<b_soft.size();++i)
900 solver.setConstraintSoft(b_soft(i),w_soft(i),bc_soft.row(i));
901
902 // Set the soft constraints global weight
903 solver.setSoftAlpha(soft);
904
905 // Interpolate
906 solver.solve(N);
907
908 // Copy the result back
909 R = solver.getFieldPerFace();
910
911 // Extract singularity indices
912 S = solver.getSingularityIndexPerVertex();
913}
Definition nrosy.cpp:36

References igl::copyleft::comiso::NRosyField::getFieldPerFace(), igl::copyleft::comiso::NRosyField::getSingularityIndexPerVertex(), igl::copyleft::comiso::NRosyField::setConstraintHard(), igl::copyleft::comiso::NRosyField::setConstraintSoft(), igl::copyleft::comiso::NRosyField::setSoftAlpha(), and igl::copyleft::comiso::NRosyField::solve().

Referenced by igl::copyleft::comiso::FrameInterpolator::interpolateCross().

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

◆ nrosy() [2/2]

IGL_INLINE void igl::copyleft::comiso::nrosy ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
const Eigen::VectorXi &  b,
const Eigen::MatrixXd &  bc,
const int  N,
Eigen::MatrixXd &  R,
Eigen::VectorXd &  S 
)
925{
926 // Init solver
928
929 // Add hard constraints
930 for (unsigned i=0; i<b.size();++i)
931 solver.setConstraintHard(b(i),bc.row(i));
932
933 // Interpolate
934 solver.solve(N);
935
936 // Copy the result back
937 R = solver.getFieldPerFace();
938
939 // Extract singularity indices
940 S = solver.getSingularityIndexPerVertex();
941}

References igl::copyleft::comiso::NRosyField::getFieldPerFace(), igl::copyleft::comiso::NRosyField::getSingularityIndexPerVertex(), igl::copyleft::comiso::NRosyField::setConstraintHard(), and igl::copyleft::comiso::NRosyField::solve().

+ Here is the call graph for this function: