Reset platonic code.
[voro++.git] / branches / 2d_boundary / examples / simple_nonconvex.cc
blob90fe85c1c632b8338c62e44e2d75c1632a2715a4
1 #include "voro++_2d.hh"
2 #include <iostream>
3 int main() {
4 double up[14];
5 int noofbnds=7;
6 voronoicell_2d up1;
7 voronoicell_2d up2;
8 up[0]=0; up[1]=0; up[2]=-2; up[3]=5; up[4]=-5; up[5]=5;
9 up[6]=-5; up[7]=-5; up[8]=5; up[9]=-5; up[10]=5; up[11]=5;
10 up[12]=2; up[13]=5;
11 up1.init_nonconvex(up,noofbnds);
12 up1.draw_gnuplot(0,0,"up.gnu");
13 up1.nonconvexity=true;
14 up1.plane_nonconvex(0,-3,9);
15 up1.draw_gnuplot(0,0,"up_cut1.gnu");
16 up1.plane_nonconvex(-2,5,29);
17 up1.draw_gnuplot(0,0,"up_cut2.gnu");
18 up2.init_nonconvex(up, noofbnds);
19 up2.plane_nonconvex(2,5,29);
20 up2.draw_gnuplot(0,0,"up_cut3.gnu");
22 double right[14];
23 voronoicell_2d right1;
24 voronoicell_2d right2;
25 right[0]=0; right[1]=0; right[2]=5; right[3]=2; right[4]=5; right[5]=5;
26 right[6]=-5; right[7]=5; right[8]=-5; right[9]=-5; right[10]=5; right[11]=-5;
27 right[12]=5; right[13]=-2;
28 right1.init_nonconvex(right, noofbnds);
29 right2.init_nonconvex(right, noofbnds);
30 right1.draw_gnuplot(0,0,"right.gnu");
31 right1.plane_nonconvex(-3,0,9);
32 right1.draw_gnuplot(0,0,"right_cut1.gnu");
33 right1.plane_nonconvex(2,2,4);
34 right1.draw_gnuplot(0,0,"right_cut2.gnu");
35 right2.plane_nonconvex(2,-2,4);
36 right2.draw_gnuplot(0,0,"right_cut3.gnu");
38 double down[14];
39 voronoicell_2d down1;
40 voronoicell_2d down2;
41 down[0]=0; down[1]=0; down[2]=2; down[3]=-5; down[4]=5; down[5]=-5;
42 down[6]=5; down[7]=5; down[8]=-5; down[9]=5; down[10]=-5; down[11]=-5;
43 down[12]=-2; down[13]=-5;
44 down1.init_nonconvex(down, noofbnds);
45 down2.init_nonconvex(down, noofbnds);
47 down1.draw_gnuplot(0,0,"down.gnu");
48 down1.plane_nonconvex(0,3,9);
49 down1.draw_gnuplot(0,0,"down_cut1.gnu");
50 down1.plane_nonconvex(2,-2,4);
51 down1.draw_gnuplot(0,0,"down_cut2.gnu");
52 down2.plane_nonconvex(-2,-2,4);
53 down2.draw_gnuplot(0,0,"down_cut3.gnu");
55 double left[14];
56 voronoicell_2d left1;
57 voronoicell_2d left2;
58 left[0]=0; left[1]=0; left[2]=-5; left[3]=-2; left[4]=-5; left[5]=-5;
59 left[6]=5; left[7]=-5; left[8]=5; left[9]=5; left[10]=-5; left[11]=5;
60 left[12]=-5; left[13]=2;
61 left1.init_nonconvex(left, noofbnds);
62 left2.init_nonconvex(left, noofbnds);
63 left1.draw_gnuplot(0,0,"left.gnu");
64 left1.init_nonconvex(left, noofbnds);
65 left1.plane_nonconvex(3,0,9);
66 left1.draw_gnuplot(0,0,"left_cut1.gnu");
67 left1.plane_nonconvex(-2,2,4);
68 left1.draw_gnuplot(0,0,"left_cut2.gnu");
69 left2.plane_nonconvex(-2,-2,4);
70 left2.draw_gnuplot(0,0,"left_cut3.gnu");
72 cout << up1.reg1[0] << " " << up1.reg1[1] << " " << up1.reg1[2] << " " <<
73 up1.reg1[3]<< " ";
74 cout << up1.reg2[0] << " " << up1.reg2[1] << " " << up1.reg2[2] << " " <<
75 up1.reg2[3]<< " ";
77 cout << right1.reg1[0] << " " << right1.reg1[1] << " " << right1.reg1[2] << " " <<
78 right1.reg1[3]<< " ";
79 cout << right1.reg2[0] << " " << right1.reg2[1] << " " << right1.reg2[2] << " " <<
80 right1.reg2[3]<< " ";
82 cout << down1.reg1[0] << " " << down1.reg1[1] << " " << down1.reg1[2] << " " <<
83 down1.reg1[3]<< " ";
84 cout << down1.reg2[0] << " " << down1.reg2[1] << " " << down1.reg2[2] << " " <<
85 down1.reg2[3]<< " ";
87 cout << left1.reg1[0] << " " << left1.reg1[1] << " " << left1.reg1[2] << " " <<
88 left1.reg1[3]<< " ";
89 cout << left1.reg2[0] << " " << left1.reg2[1] << " " << left1.reg2[2] << " " <<
90 left1.reg2[3]<< " ";
96 return 0;