Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] offset

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] offset


Chronological Thread 
  • From: Issha Kayo <>
  • To:
  • Subject: Re: [cgal-discuss] offset
  • Date: Mon, 12 Oct 2009 21:23:50 +0900
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=u3nrUIlQ9ctTwJifA79RyK7xeTNe4duRHUPnX1yTkX2t/8oBGpvdlsI2MV96SFDW9A 6AKzduoFWjZ9nQBI2FjQUjhv0Ssi/rF4+vu1hFlTXe9sDOYa1CzuCzeHg3mbvme2nWbd nqyZnyFGuCGzP5A7u+95oBL5n8FI+3l0YT0AI=

Hi Manuel and everyone,

> See also the reference documentation:
> http://www.cgal.org/Manual/last/doc_html/cgal_manual/Periodic_3_triangulation_3_ref/Class_Periodic_3_triangulation_3.html

Oh, yes! Your advise is exactly what I wanted and it works!
Thank you for the information. It has solved most of my simple problem,
but I still have a silly question.

Assume a point at (0.01 0.5 0.5) might be in a cell, one of whose
vertices is out of the original cube. In this case I expect
point(Periodic_point) to return the position of the vertex, say, (-0.05,
0.5, 0.5). The actual return, however, seems to be (0.95, 0.5, 0.5).

As an example, please see the following code. I can easily imagine I'm
doing something very silly ....

Thank you,
Issha

-------------
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_3_triangulation_traits_3.h>
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>

#include <iostream>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Periodic_3_triangulation_traits_3<K> GT;
typedef CGAL::Periodic_3_Delaunay_triangulation_3<GT> PDT;
typedef PDT::Point Point;

int main()
{
PDT T;

// Input point grid (27 points)
for (double x=0.1 ; x < .9 ; x += 0.33) {
for (double y=0.1 ; y < .9 ; y += 0.33) {
for (double z=0.1 ; z < .9 ; z += 0.33) {
T.insert(Point(x,y,z));
} } }

Point p(0.05, 0.5, 0.5);
PDT::Cell_handle c;
c=T.locate(p);

T.convert_to_1_sheeted_covering();

std::cout << T.point(T.periodic_point(c,0)) << std::endl;
std::cout << T.point(T.periodic_point(c,1)) << std::endl;
std::cout << T.point(T.periodic_point(c,2)) << std::endl;
std::cout << T.point(T.periodic_point(c,3)) << std::endl;

return 0;
}
-----------------------------

The resulting output is

1.1 0.43 0.43 <--- If 0.1 0.43 0.43, I'm happy.
1.1 0.76 0.43 <--- If 0.1 0.76 0.43, I'm happ..
0.76 0.76 0.76 <--- If -0.24 0.76 0.76, I'm hap...
1.1 0.43 0.76 <--- If 0.1 0.43 0.76, ..





Archive powered by MHonArc 2.6.16.

Top of Page