Subject: CGAL users discussion list
List archive
- From: Daniel Duque <>
- To:
- Subject: [cgal-discuss] Geometry in a 2D periodic triangulation
- Date: Wed, 13 Nov 2013 14:15:51 +0100
Hello,
I have finally been able to have a look at this exciting new feature of CGAL. I would love to say that I understand everything on the manual, but sadly this is not the case. At any rate, after building the periodic triangulation I get a list of vertices whose Cartesian coordinates are all within the original domain. Usually, there is only one covering, so there are just as many vertices as the points I used as input.for( Finite_edges_iterator ed=T.finite_edges_begin();
ed!=T.finite_edges_end();
ed++) {
FT l2=per_dist2(v0->point(), v1->point());
// ... print out, collect stats, whatever
}
FT per_dist(const FT& x1, const FT& x2) {
FT dx=x1-x2;
if(fabs(dx)>LL/2.0)
if(dx>0)
dx -= LL;
else
dx += LL;
return dx;
}
FT per_dist2(const Point& P1, const Point& P2) {
FT dx=per_dist(P1.x(),P2.x());
FT dy=per_dist(P1.y(),P2.y());
return dx*dx+dy*dy;
}
I would like to get some reassurance that what I am doing is correct. Not very elegant, perhaps, and even redundant (there may be some CGAL function that does just this), but in the end correct (all edges are taken into account just once, for example).
Thanks very much,
Thanks very much,
Daniel
- [cgal-discuss] Geometry in a 2D periodic triangulation, Daniel Duque, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Monique Teillaud, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Daniel Duque, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Monique Teillaud, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Daniel Duque, 11/14/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Monique Teillaud, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Daniel Duque, 11/13/2013
- Re: [cgal-discuss] Geometry in a 2D periodic triangulation, Monique Teillaud, 11/13/2013
Archive powered by MHonArc 2.6.18.