|
@@ -6,19 +6,32 @@
|
|
|
|
|
|
namespace igl
|
|
|
{
|
|
|
- // Creates a quad mesh from a triangular mesh and a set of two directions
|
|
|
- // per face, using the algorithm described in the paper
|
|
|
+ // Global seamless parametrization aligned with a given per-face jacobian (PD1,PD2).
|
|
|
+ // The algorithm is based on
|
|
|
// "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
|
|
|
// ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383)
|
|
|
|
|
|
// Inputs:
|
|
|
- // Vin #V by 3 eigen Matrix of mesh vertex 3D positions
|
|
|
- // F #F by 4 eigen Matrix of face (quad) indices
|
|
|
- // maxIter maximum numbers of iterations
|
|
|
- // threshold minimum allowed threshold for non-planarity
|
|
|
+ // V #V by 3 list of mesh vertex 3D positions
|
|
|
+ // F #F by 3 list of faces indices in V
|
|
|
+ // PD1 #V by 3 first line of the Jacobian per triangle
|
|
|
+ // PD2 #V by 3 second line of the Jacobian per triangle
|
|
|
+ // (optional, if empty it will be a vector in the tangent plane orthogonal to PD1)
|
|
|
+ // scale global scaling for the gradient (controls the quads resolution)
|
|
|
+ // stiffness weight for the stiffness iterations
|
|
|
+ // direct_round greedily round all integer variables at once (greatly improves optimization speed but lowers quality)
|
|
|
+ // iter stiffness iterations (0 = no stiffness)
|
|
|
+ // local_iter number of local iterations for the integer rounding
|
|
|
+ // do_round enables the integer rounding (disabling it could be useful for debugging)
|
|
|
+ // round_vertices id of additional vertices that should be snapped to integer coordinates
|
|
|
+ // hard_features #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates
|
|
|
+ //
|
|
|
// Output:
|
|
|
- // Vout #V by 3 eigen Matrix of planar mesh vertex 3D positions
|
|
|
+ // UV #UV by 2 list of vertices in 2D
|
|
|
+ // FUV #FUV by 3 list of face indices in UV
|
|
|
//
|
|
|
+ // TODO: rename the parameters name in the cpp consistenly
|
|
|
+ // improve the handling of hard_features, right now it might fail in difficult cases
|
|
|
|
|
|
template <typename DerivedV, typename DerivedF, typename DerivedU>
|
|
|
IGL_INLINE void miq(const Eigen::PlainObjectBase<DerivedV> &V,
|
|
@@ -27,13 +40,23 @@ namespace igl
|
|
|
const Eigen::PlainObjectBase<DerivedV> &PD2,
|
|
|
Eigen::PlainObjectBase<DerivedU> &UV,
|
|
|
Eigen::PlainObjectBase<DerivedF> &FUV,
|
|
|
- double GradientSize = 30.0,
|
|
|
- double Stiffness = 5.0,
|
|
|
- bool DirectRound = false,
|
|
|
+ double scale = 30.0,
|
|
|
+ double stiffness = 5.0,
|
|
|
+ bool direct_round = false,
|
|
|
int iter = 5,
|
|
|
- int localIter = 5, bool DoRound = true,
|
|
|
- std::vector<int> roundVertices = std::vector<int>(),
|
|
|
- std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
|
|
|
+ int local_iter = 5,
|
|
|
+ bool DoRound = true,
|
|
|
+ std::vector<int> round_vertices = std::vector<int>(),
|
|
|
+ std::vector<std::vector<int> > hard_features = std::vector<std::vector<int> >());
|
|
|
+
|
|
|
+ // Helper function that allows to directly provided pre-combed bisectors for an already cut mesh
|
|
|
+ // Additional input:
|
|
|
+ // PD1_combed, PD2_combed : #F by 3 combed jacobian
|
|
|
+ // BIS1_combed, BIS2_combed: #F by 3 pre combed bi-sectors
|
|
|
+ // MMatch: #F by 3 list of per-corner integer PI/2 rotations
|
|
|
+ // Singular: #V list of flag that denotes if a vertex is singular or not
|
|
|
+ // SingularDegree: #V list of flag that denotes the degree of the singularity
|
|
|
+ // Seams: #F by 3 list of per-corner flag that denotes seams
|
|
|
|
|
|
template <typename DerivedV, typename DerivedF, typename DerivedU>
|
|
|
IGL_INLINE void miq(const Eigen::PlainObjectBase<DerivedV> &V,
|
|
@@ -42,10 +65,10 @@ namespace igl
|
|
|
const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
|
|
|
const Eigen::PlainObjectBase<DerivedV> &BIS1_combed,
|
|
|
const Eigen::PlainObjectBase<DerivedV> &BIS2_combed,
|
|
|
- const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_MMatch,
|
|
|
- const Eigen::Matrix<int, Eigen::Dynamic, 1> &Handle_Singular,
|
|
|
- const Eigen::Matrix<int, Eigen::Dynamic, 1> &Handle_SingularDegree,
|
|
|
- const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
|
|
|
+ const Eigen::Matrix<int, Eigen::Dynamic, 3> &MMatch,
|
|
|
+ const Eigen::Matrix<int, Eigen::Dynamic, 1> &Singular,
|
|
|
+ const Eigen::Matrix<int, Eigen::Dynamic, 1> &SingularDegree,
|
|
|
+ const Eigen::Matrix<int, Eigen::Dynamic, 3> &Seams,
|
|
|
Eigen::PlainObjectBase<DerivedU> &UV,
|
|
|
Eigen::PlainObjectBase<DerivedF> &FUV,
|
|
|
double GradientSize = 30.0,
|