added function to retrieve the parametrization in matrix form

This commit is contained in:
Luigi Malomo 2017-03-07 14:34:36 +01:00
parent 155806f53e
commit a75dbdc05d
1 changed files with 16 additions and 0 deletions

View File

@ -202,6 +202,22 @@ public:
}
}
static void GetUVData(const MeshType &mesh,
MatrixXm & uv)
{
tri::RequireVertexCompactness(mesh);
tri::RequirePerVertexTexCoord(mesh);
uv = MatrixXm(mesh.VN(), 2);
// per vertices uv
for (int i = 0; i < mesh.VN(); i++)
{
uv(i,0) = mesh.vert[i].cT().U();
uv(i,1) = mesh.vert[i].cT().V();
}
}
// get edge to face and edge to vertex adjacency
static void GetTriEdgeAdjacency(const MeshType &mesh,
Eigen::MatrixXi& EV,