Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Easiest way to extract an edge_to_face vector from a surface mesh
  • Date: Mon, 18 Sep 2017 08:11:07 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:R+v/4xPI+08r6iwM9W4l6mtUPXoX/o7sNwtQ0KIMzox0K/T/rarrMEGX3/hxlliBBdydsK0UzbeO+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6a8TWO6msZFRz7cAZ0Pe/oAZX6jsKt1un09YeATR9PgW/3Wr54JQ6qrAjX/u0Rm4plNu5x5RbOp3ZUYfV4zGh0IkiC3ly0sty0+4Ri9DgWvvYJ+MtJUKG8dKM9G+8LRA86Onw4sZW4/SLIShGCsyMR
  • Organization: GeometryFactory

On 09/15/2017 06:53 PM, Iasonm wrote:
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));

I don't understand why this compiles. You probably meant m_M.face( m_H.halfedge(ei)) and the same for the opposite halfedge (provided it is not a border halfedge).

Sebastien.

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