Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] question on splitting edges

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] question on splitting edges


Chronological Thread 
  • From: "Bill Conan" <>
  • To:
  • Subject: Re: [cgal-discuss] question on splitting edges
  • Date: Tue, 17 Jun 2008 07:04:02 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ZrYb+94KjaCd5Ljy5oyz99LRPtX8xguvQlzkpIin7w6jLwTG2J+MNPcjHm1bh+/7i3 yx0nxGt0le5/zr6WND7dJX9RTj5XBgdlbxiNy0qypqVQEzr/OfFHWUfkRLRSy7h4PkKs lgG5jKYB5rXRFtDtJCsjwRZSfHilvzqO8Acqw=

thanks Bart,

i did an experiment, the truth is that if i split an edge e, the newly
generated sub edges will be at the old position of e.

suppose the original edge list is e1->e2->e3->e4

now if i want to split the e2 to eA and eB, then the list will be like
this e1->eA->eB->e3->e4

therefore, if i write the code as this:

Edge_iterator iter=p.edges_begin();
Edge_iterator iterE=p.edges_end();

for(iter;iter!=iterE;++iter)
{
p.split_edge(iter);
}

it will loop forever,

the correct code should be like this:

Edge_iterator iter=p.edges_begin();
Edge_iterator iterE=p.edges_end();

for(iter;iter!=iterE;++iter)
{
p.split_edge(iter);
++iter;
}

cheers,

On Tue, Jun 17, 2008 at 3:46 AM, Bart Janssens
<>
wrote:
> On 6/16/08, Bill Conan
> <>
> wrote:
>> I'm wondering how people do this kind of operation normally?
>> for example, when applying a subdivision on a geometry object,
>
> Hi Bill,
>
> K-3D meshes used to have a structure similar to the CGAL Halfedge
> structure. To split edges, we traveled along the edges using the
> next() method, making sure to store a handle to the old "next" edge
> before moving on. Pseudo code would be like this:
>
> For each facet
> Get first edge first_edge
> while edge != first_edge
> old_clockwise = edge->next()
> split edge
> edge = old_clockwise
>
> Dunno if this is OK in CGAL, though. Also, you might need to make sure
> the opposite edges remain in sync.
>
> Cheers,
>
> --
> Bart
> --
> 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