6

I have two polygons (Polygon_with_holes_2) how joining it into thirth Polygon_with_holes_2

I need general solution. Get any polygon_with_holes (or not if empty hole list but still polygon_with_holes structures) and joining it with other and get polygon_with_holes. How check orientation (cgal not can joining if it not good), reducing points etc. How to do this with good code without memory leak.

Eliasz Łukasz
  • 478
  • 1
  • 3
  • 17
  • Have you tried to read any sort of documentation, https://doc.cgal.org/latest/Boolean_set_operations_2/group__boolean__join.html and without your code you are expecting us to be Yoda!! – farhan Nov 11 '17 at 22:59
  • @Frrank on docummentation no exist any example with Polygon_with_holes_2 If You clever show me. – Marek Kaski Nov 12 '17 at 10:42
  • 4
    At least in [this example](https://doc.cgal.org/latest/Boolean_set_operations_2/Boolean_set_operations_2_2symmetric_difference_8cpp-example.html) boolean operation is done on polygon with holes. – sloriot Nov 12 '17 at 10:45
  • 1
    @sloriot You are clever.Thanks, I search this a few day. I cant vote Your ansver, sorry – Marek Kaski Nov 12 '17 at 11:58
  • How defining Polygon_with_holes_2 without any holes? Empty? Polygon_2 outP; Polygon_2 holesP[1]; outP.push_back (Point_2 (0, 0));.... 4 point Polygon_with_holes_2 P (outP, holesP, holesP + 1); i get Explanation: Holes of the PWH intersect amongst themselves or with outer boundary Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html terminate called after throwing an instance of 'CGAL::Precondition_exception' what(): CGAL ERROR: precondition violation! Expr: is_valid_unknown_polygon(p, t) – Eliasz Łukasz Nov 13 '17 at 09:39
  • @Please share the code that show how you are creating the polygon. Then we can talk about boolean on the polygon. – qqqqq Feb 05 '23 at 01:40

0 Answers0