Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss]To understand half edge data structure (VERY IMPORTANT)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss]To understand half edge data structure (VERY IMPORTANT)


Chronological Thread 
  • From: "Mathieu Brédif" <>
  • To:
  • Subject: Re: [cgal-discuss]To understand half edge data structure (VERY IMPORTANT)
  • Date: Wed, 7 May 2008 14:34:10 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Kqsz5iqWSKdKwvOGuFfJ51jnkhk9jKODiXWi0zqYnPngDbdsKEA2PUJ3Y/KZlGgjPphWHXyFeDaPAatPuf1q6bZPnW0/PMuyzwVCHtgriotpHrze/ggAcYP+6N4Ucbq4j78aeKcpWsRaWkvYT/6uojGsN3Nklv3Tk5onbNwWpmo=

Hi,
the facet_begin() halfedge is arbitrary, your mistake is to assume
that facet2->facet_begin() is a particular halfedge handle.
My advice is to stay with halfedges without using the intermediate face
handles:

A C = AB->prev()->opposite()
A'C = AC->next_on_vertex() // or more verbosely AB->next()->opposite()

Mathieu

On Wed, May 7, 2008 at 1:58 PM, samuel kim
<>
wrote:
> Hi all,
>
> I am struggling in an implementation with the half edge data structure.
> What I want to do is to travel the triangles from triangle# 1 to triangle#
> 3 as shown at attached picture. For this, I read CGAL document and
> implemented based on what I understood. But result is not going to
> triangle# 3 but going back to triangle# 1 from triangle#2. The below is the
> source code I tried.
>
> Facet_handle hf_new;
> Facet_iterator pFacet = facets_begin();
> Halfedge_around_facet_circulator pHalfedge = pFacet->facet_begin(); //
> expecting to get the handle of half_edge1 on triangle#1
>
> hf_new = pHalfedge->prev()->opposite()->facet(); // expecting to get the
> handle of facet of triangle#2
> pHalfedge = hf_new->facet_begin(); // expecting to get the handle of
> half_edge2 in the triangle#2
>
> hf_new = pHalfedge->next()->opposite()->facet(); // expecting to get the
> handle of facet of triangle#3
> pHalfedge = hf_new->facet_begin(); // expecting to get the handle of
> half_edge2 on the triangle#3
>
>
> If I did as the above, the handle of facet was that of triangle#1. So I
> want to ask you a question, when I do this,
> hf_new = pHalfedge->prev()->opposite()->facet(); // expecting to
> get the handle of facet of triangle#2
> pHalfedge = hf_new->facet_begin(); // expecting to get the handle
> of half_edge2 in the triangle#2
> Which edge handle should be returned in triangle#2?
> And what is the base rule to get to know the exact pointer of the handle
> of half_edge data structure whenever travel triangles? Because I have tried
> many times, and found that the pointer of handle of half_edge data
> structure was varying at each triangle which was not expectable.
>
> Thank you for your help.
>
> Samuel
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>



Archive powered by MHonArc 2.6.16.

Top of Page