Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Easiest way to extract an edge_to_face vector from a surface mesh

Subject: CGAL users discussion list

List archive

[cgal-discuss] Easiest way to extract an edge_to_face vector from a surface mesh


Chronological Thread 
  • From: Iasonm <>
  • To:
  • Subject: [cgal-discuss] Easiest way to extract an edge_to_face vector from a surface mesh
  • Date: Fri, 15 Sep 2017 09:53:24 -0700 (MST)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:zmIC3RKzkARPVjqjR9mcpTZWNBhigK39O0sv0rFitYgXLPTxwZ3uMQTl6Ol3ixeRBMOAtKIC1rKempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXkiybsvHtLQl2/blItZ7e9JomHhMu+06W++obYfh5TrDu7e7J7ahus/ivLscxDoIJ5LaA0gk/Qu2dPf+lQyEtnIFuSm1D34cLmr80ryDhZp/90rp0Iaq79ZaltFuQAAQ==

Hello,
given a CGAL::Surface_Mesh<SomeKernel> what is the easiest way to extract
mesh "connectivity" vectors like for example an edge_to_face vector of which
the ith position holds another vector which holds the indices of all the
faces that are adjacent to the ith edge?

I tried:
for (CGALSurfaceMesh::edge_index ei : m_M.edges()) {
CGALSurfaceMesh::face_index f0(m_M.halfedge(ei, 0));
CGALSurfaceMesh::face_index f1(m_M.halfedge(ei, 1));
std::vector<size_t> facesOfEdge{size_t(f0), size_t(f1)};
edge_to_face[size_t(ei)] = facesOfEdge;
}
the above gives face indices that are as big as twice the number of faces in
the mesh. For example when the mesh has 90 faces I would get using the above
indices up to 179. Why does the above not work and could you suggest me
another way to get the needed connectivity vector?



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page