mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 00:07:24 +00:00
add export eigen edge matrix from CMesh
This commit is contained in:
parent
fb7e1ec7e2
commit
77097029db
@ -555,6 +555,32 @@ Eigen::MatrixX3i meshlab::faceMatrix(const CMeshO& mesh)
|
||||
return faces;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a #E*2 Eigen matrix of integers containing the vertex indices of
|
||||
* the edges of a CMeshO.
|
||||
* The edges in the mesh must be compact (no deleted edges).
|
||||
* If the mesh is not compact, a vcg::MissingCompactnessException will be thrown.
|
||||
*
|
||||
* @param mesh: input mesh
|
||||
* @return #E*2 matrix of integers (vertex indices composing the edges)
|
||||
*/
|
||||
Eigen::MatrixX2i meshlab::edgeMatrix(const CMeshO& mesh)
|
||||
{
|
||||
vcg::tri::RequireEdgeCompactness(mesh);
|
||||
|
||||
// create eigen matrix of edges
|
||||
Eigen::MatrixXi edges(mesh.EN(), 2);
|
||||
|
||||
// copy faces
|
||||
for (int i = 0; i < mesh.EN(); i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
edges(i, j) = (int) vcg::tri::Index(mesh, mesh.edge[i].V(j));
|
||||
}
|
||||
}
|
||||
|
||||
return edges;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a #F list of Eigen vectors of integers containing the vertex indices of
|
||||
* the polygonal mesh contained in the CMeshO mesh.
|
||||
|
||||
@ -82,6 +82,7 @@ void addFaceVectorAttribute(
|
||||
// From CMeshO to Eigen
|
||||
EigenMatrixX3m vertexMatrix(const CMeshO& mesh);
|
||||
Eigen::MatrixX3i faceMatrix(const CMeshO& mesh);
|
||||
Eigen::MatrixX2i edgeMatrix(const CMeshO& mesh);
|
||||
std::list<EigenVectorXui> polygonalFaceList(const CMeshO& mesh);
|
||||
EigenMatrixX3m vertexNormalMatrix(const CMeshO& mesh);
|
||||
EigenMatrixX3m faceNormalMatrix(const CMeshO& mesh);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user