Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Vertex and faces N-ring computation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Vertex and faces N-ring computation


Chronological Thread 
  • From: Nguyen Tan Khoa <>
  • To:
  • Subject: Re: [cgal-discuss] Vertex and faces N-ring computation
  • Date: Wed, 18 Apr 2007 03:12:03 +0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer; b=CAOOzgrvx+R5n+MTG8KkPf4+fv/vfsfjL1sF8T/bPvSMudRVHX4ZJLfx6WM0vAxg8VRcXLsmz5kCX0CPJxbGJPSA5pdplAK4o7jkmKF/KeQuT4mOnZpZMDjgvpoQazFkcuGzyIclMuIrgc4CxAlmkb/gjU+U5rvdGHxkLJkAcU8=

Dear Koutsokeras Miltiadis,

You can apply a bread-first search algorithm to find the N-rings. You can take a look at this snippet of code:

HV_circulator circulator;
QList<VERTEXHANDLEWITHLEVEL> toGrow;
QList<int> exploredVertices, exploredVertices1;
VERTEXHANDLEWITHLEVEL currentVH;
std::vector<Point> result;
// initialization
exploredVertices.clear();
exploredVertices1.clear();
result.clear();
currentVH.vh = v;
currentVH.level = 1;
toGrow.push_back( currentVH );
//std::cout << "Incident vertices of " << v->index << " are: ";
while ( !toGrow.isEmpty() ) {
currentVH = toGrow.takeFirst();
circulator = currentVH.vh->vertex_begin();
exploredVertices.push_front( currentVH.vh->index );
if ( currentVH.level > linkSize ) {
break;
} else {
do {
if ( exploredVertices.indexOf( circulator->next()->vertex()->index ) == -1 ) {
toGrow.push_back( VERTEXHANDLEWITHLEVEL(circulator->next()->vertex(), currentVH.level+1) );
if ( currentVH.level + 1 > linkSize ) {
result.push_back( circulator->next()->vertex()->point() );
//std::cout << circulator->next()->vertex()->index << "\t";
// std::cout << result[result.size()-1] << std::endl;
}
exploredVertices.push_back( circulator->next()->vertex()->index );
}
} while (++circulator != currentVH.vh->vertex_begin());
//std::cout << std::endl;
}
}
return result;


On Apr 3, 2007, at 11:07 PM, Koutsokeras Miltiadis wrote:

Can someone point out how to robustly compute N-ring neighbors of vertices and faces of Polyhedral surfaces? Circulators provide the 1-ring neighbors but I haven't found any examples about N-rings. Thank you in advance for every reply.

-- 
Koutsokeras Miltiadis

Computational Intelligence Laboratory (http://www.iit.demokritos.gr/cil/)
Institute of Informatics and Telecommunications
National Center for Scientific Research "Demokritos"
P.O. BOX   60228
GR-153 10 Agia Paraskevi, Athens, Greece.

-- 
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to




Archive powered by MHonArc 2.6.16.

Top of Page