Subject: CGAL users discussion list
List archive
- From: "Wesley Smith" <>
- To:
- Subject: Re: Voronoi_diagram_3 design question
- Date: Wed, 19 Sep 2007 13:01:30 -0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G5S0Jgr+rKg/VjHOcpEVHbChd/K0r5xfUig9F4Jkl+gjnNqhAxKmQ3frEB1Zroq9TGhGyHtZxCDV/zxusF8y9Jp+WGzec7xv2q7NR+9mxJHB+jfgbb+pSjBLqY5HHaQvf5hhqCYdWJKoeXj7RIzVNyqVGwzzzOrOrhCzIxT18QM=
What a difference a day makes. I managed to make this design alot
simpler. Here's an implementation that iterates in a CCW fashion
around a vertex in a 3D Delaunay diagram using the next_around_edge
util function:
This is from the Halfedge class of Voronoi_diagram_3
Halfedge_handle next(Delaunay_vertex_handle v) const {
int index;
CGAL_precondition( c_->has_vertex(v, index) );
return next( index );
}
Halfedge_handle next(int vi) const {
CGAL_precondition(i_ != vi);
Delaunay_facet f(c_, DG::next_around_edge(i_, vi));
if(! vda_->dual().is_infinite( c_->neighbor(f.second) ) ) {
//SEGMENT (transform into new cell)
Cell_handle c = c_->neighbor(f.second);
return Halfedge_handle( Halfedge_3(vda_, c,
c->index(f.first)) );
}
else {
//RAY (stays in cell)
return Halfedge_handle( Halfedge_3(vda_, f) );
}
}
wes
- Voronoi_diagram_3 design question, Wesley Smith, 09/18/2007
- Re: Voronoi_diagram_3 design question, Wesley Smith, 09/19/2007
Archive powered by MHonArc 2.6.16.