From 98ecd1968f0d49cbc5b760307d3f440e6df1290c Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 11:13:37 -0400 Subject: [PATCH 01/11] test --- src/csg/cgal_helper_polygon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 2b95b9d..ec595b1 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -1,7 +1,7 @@ #include "csg_cgal_helper.hpp" #include -#include +//#include namespace { typedef CGAL::Polygon_2 Polygon; @@ -32,8 +32,9 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - return CGAL::bounded_side_2(polygon.begin(), polygon.end(), Point(xx, yy), - IK()) == CGAL::ON_BOUNDED_SIDE; + return false; + //return CGAL::bounded_side_2(polygon.begin(), polygon.end(), Point(xx, yy), + //IK()) == CGAL::ON_BOUNDED_SIDE; } } // namespace cgal_helper -- GitLab From b67ca3c56cbeff82e1a5424471bab1e0fda9169f Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 11:26:50 -0400 Subject: [PATCH 02/11] test2 --- src/csg/cgal_helper_polygon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index ec595b1..c275516 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -1,7 +1,7 @@ #include "csg_cgal_helper.hpp" #include -//#include +#include namespace { typedef CGAL::Polygon_2 Polygon; -- GitLab From 4ebc187c9978da551fede4068f8536e292ea690b Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 11:47:20 -0400 Subject: [PATCH 03/11] test3 --- src/csg/cgal_helper_polygon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index c275516..6c36df9 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -1,7 +1,7 @@ #include "csg_cgal_helper.hpp" #include -#include +//#include namespace { typedef CGAL::Polygon_2 Polygon; @@ -32,9 +32,9 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - return false; - //return CGAL::bounded_side_2(polygon.begin(), polygon.end(), Point(xx, yy), - //IK()) == CGAL::ON_BOUNDED_SIDE; + //return false; + return CGAL::bounded_side_2(polygon.vertices_begin(), polygon.vertices_end(), Point(xx, yy), + IK()) == CGAL::ON_BOUNDED_SIDE; } } // namespace cgal_helper -- GitLab From c06cc4f42f0b97e01930c072cb15be7236ce7400 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 11:49:24 -0400 Subject: [PATCH 04/11] test4 --- src/csg/cgal_helper_polygon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 6c36df9..72f164b 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -33,8 +33,9 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { //return false; + IK traits = IK(); return CGAL::bounded_side_2(polygon.vertices_begin(), polygon.vertices_end(), Point(xx, yy), - IK()) == CGAL::ON_BOUNDED_SIDE; + traits) == CGAL::ON_BOUNDED_SIDE; } } // namespace cgal_helper -- GitLab From a00ac47ee0c4e6700fbe7eeabc9dc9a206e774d4 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 11:57:42 -0400 Subject: [PATCH 05/11] test5 --- src/csg/cgal_helper_polygon.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 72f164b..fc36195 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -32,10 +32,12 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - //return false; - IK traits = IK(); - return CGAL::bounded_side_2(polygon.vertices_begin(), polygon.vertices_end(), Point(xx, yy), - traits) == CGAL::ON_BOUNDED_SIDE; + std::vector points; + for(const auto &p : polygon) { + points.push_back(p); + } + return CGAL::bounded_side_2(points.begin(), points.end(), Point(xx, yy), + IK()) == CGAL::ON_BOUNDED_SIDE; } } // namespace cgal_helper -- GitLab From 1d5f36d2a436781c70cff73b6ba6d11c979db15c Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:00:32 -0400 Subject: [PATCH 06/11] test6 --- src/csg/cgal_helper_polygon.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index fc36195..7f2ed69 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -32,11 +32,8 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - std::vector points; - for(const auto &p : polygon) { - points.push_back(p); - } - return CGAL::bounded_side_2(points.begin(), points.end(), Point(xx, yy), + Point points[] = { Point(0,0), Point(5.1,0) }; + return CGAL::bounded_side_2(points, points + 2, Point(xx, yy), IK()) == CGAL::ON_BOUNDED_SIDE; } -- GitLab From 02f2bdf1ec69a3f6b596691bdb4ae446b0115a1a Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:38:56 -0400 Subject: [PATCH 07/11] test7 --- src/csg/cgal_helper_polygon.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 7f2ed69..18afbd8 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -32,9 +32,7 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - Point points[] = { Point(0,0), Point(5.1,0) }; - return CGAL::bounded_side_2(points, points + 2, Point(xx, yy), - IK()) == CGAL::ON_BOUNDED_SIDE; + return CGAL::is_simple_2(polygon.begin(), polygon.end(), IK()); } } // namespace cgal_helper -- GitLab From 95bd62468dea5b59fb7720874f7d87ea42c24a9c Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:43:05 -0400 Subject: [PATCH 08/11] test8 --- src/csg/cgal_helper_polygon.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 18afbd8..f8bc241 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -1,8 +1,5 @@ #include "csg_cgal_helper.hpp" -#include -//#include - namespace { typedef CGAL::Polygon_2 Polygon; typedef CGAL::Point_2 Point; @@ -32,7 +29,7 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - return CGAL::is_simple_2(polygon.begin(), polygon.end(), IK()); + return polygon.bounded_side(Point(xx, yy)) == CGAL::ON_BOUNDED_SIDE; } } // namespace cgal_helper -- GitLab From d9c895bbfa8ea104e27ac75182f33c44a2890b8f Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:45:23 -0400 Subject: [PATCH 09/11] test9 --- src/csg/cgal_helper_polygon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index f8bc241..61b32a4 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -29,7 +29,7 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - return polygon.bounded_side(Point(xx, yy)) == CGAL::ON_BOUNDED_SIDE; + return polygon.bounded_side(Point(xx, yy)); } } // namespace cgal_helper -- GitLab From 500eade9d8c099da54e3eb51a90df835c7f1b2a4 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:48:58 -0400 Subject: [PATCH 10/11] test10 --- src/csg/cgal_helper_polygon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index 61b32a4..f9d236c 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -29,7 +29,7 @@ Polygon create_polygon(const std::vector> &points, bool inside(const Polygon &polygon, double xx, double yy) { - return polygon.bounded_side(Point(xx, yy)); + return polygon.is_simple(); } } // namespace cgal_helper -- GitLab From 2081c111e21d4fc90212461091c94381b6c84c77 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Wed, 10 Jun 2020 12:52:38 -0400 Subject: [PATCH 11/11] test12 --- src/csg/cgal_helper_polygon.cpp | 3 +-- src/csg_cgal_helper.hpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/csg/cgal_helper_polygon.cpp b/src/csg/cgal_helper_polygon.cpp index f9d236c..af0c422 100644 --- a/src/csg/cgal_helper_polygon.cpp +++ b/src/csg/cgal_helper_polygon.cpp @@ -1,8 +1,7 @@ #include "csg_cgal_helper.hpp" namespace { -typedef CGAL::Polygon_2 Polygon; -typedef CGAL::Point_2 Point; +typedef CGAL::Point_2 Point; } // namespace namespace cgal_helper { diff --git a/src/csg_cgal_helper.hpp b/src/csg_cgal_helper.hpp index 0326d23..f4daf15 100644 --- a/src/csg_cgal_helper.hpp +++ b/src/csg_cgal_helper.hpp @@ -11,7 +11,7 @@ namespace cgal_helper { typedef CGAL::Simple_cartesian CK; typedef CGAL::Polyhedron_3 Polyhedron; typedef CGAL::Exact_predicates_inexact_constructions_kernel IK; -typedef CGAL::Polygon_2 Polygon; +typedef CGAL::Polygon_2 Polygon; Polyhedron create_polyhedron(const std::vector> &points, -- GitLab