Check visualization for Periodic Delaunay Triangulation as well. Change example to a delaunay triangulation.

Add is_triangulation_in_1_sheet() check and then convert to 9-sheet if the triangulation isn't so already.
This commit is contained in:
Jasmeet Singh 2019-06-22 18:49:49 -07:00
parent a9eae8a297
commit f8bc47dbf6
3 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,20 @@
0.6 0.2
0.4 0.4
0.2 0.8
0.192592592592593 0.037037037037037
0.17037037037037 0.177777777777778
0.451851851851852 0.111111111111111
0.274074074074074 0.37037037037037
0.133333333333333 0.592592592592593
0.037037037037037 0.688888888888889
0.177777777777778 0.844444444444444
0.288888888888889 0.674074074074074
0.318518518518519 0.925925925925926
0.540740740740741 0.844444444444444
0.637037037037037 0.703703703703704
0.511111111111111 0.496296296296296
0.725925925925926 0.237037037037037
0.933333333333333 0.22962962962963
0.733333333333333 0.511111111111111
0.925925925925926 0.459259259259259
0.866666666666667 0.777777777777778
0.77037037037037 0.925925925925926
0.881481481481482 0.977777777777778
0.990000000000000 0.911111111111111

View File

@ -1,12 +1,12 @@
#include <CGAL/Periodic_2_triangulation_2.h>
#include <CGAL/Periodic_2_triangulation_traits_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <CGAL/draw_periodic_2_triangulation_2.h>
#include<fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Periodic_2_triangulation_traits_2<K> GT;
typedef CGAL::Periodic_2_triangulation_2<GT> PDT;
typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2<K> GT;
typedef CGAL::Periodic_2_Delaunay_triangulation_2<GT> PDT;
typedef PDT::Point Point;
@ -24,6 +24,11 @@ int main(int argc, char* argv[])
}
assert(T.is_valid());
if( T.is_triangulation_in_1_sheet())
T.convert_to_9_sheeted_covering();
// Draw the periodic triangulation
CGAL::draw(T);
return EXIT_SUCCESS;
}

View File

@ -120,6 +120,8 @@ protected:
add_point_in_face(t[2]);
face_end();
// Display the edges of the faces as segments with a
// light gray color for better visualization
add_segment(t[0], t[1], CGAL::Color(207, 213, 211));
add_segment(t[1], t[2], CGAL::Color(207, 213, 211));
add_segment(t[2], t[0], CGAL::Color(207, 213, 211));