Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] optimal_convex_partition_2 produces invalid decomposition

Subject: CGAL users discussion list

List archive

[cgal-discuss] optimal_convex_partition_2 produces invalid decomposition


Chronological Thread 
  • From: Manoj Bist <>
  • To:
  • Subject: [cgal-discuss] optimal_convex_partition_2 produces invalid decomposition
  • Date: Thu, 1 Oct 2020 11:37:34 -0700
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:oB7tdhypsYa3VgnXCy+O+j09IxM/srCxBDY+r6Qd2+oQIJqq85mqBkHD//Il1AaPAdyErakYwLOM7ujJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhjexe71/IRq5oQnMqMUbgZZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8N/jKxVrhGvqQFhzYHIe4yVMeZyc7nHcN8GWWZMXMBcXDFBDIOmaIsPCvIMM+FCoIn7oFsOrwa1CBStBOP01j9Dm3j73agg3OQnFgHG3hYsEMkPsHTPsNX5KbwfUe+wzKbSzDXDa+la1iv66IjNax0sp+yHUr1sf8TL00YvCx/FgUuKqYzjJz6Y0uYAvmeb4ed9VeyihG4ppx9zrzWvxcohhIvEiI0Ix13a6Sl0zoY7KNOmRENlYtOpDZRduzyEO4Z5QM4vXWNltSAnwbMFoZ62ZDYGxIgjyhLFaPGKc5KE7g/iWeuQOzt0mXBodbO5ih2v60av0Pf8WdOx0FtSripKjN3MtncV2hzW8MeHS/998l6g2TaLygzf8+9ELV02mKfaMZIhzbkwlp0csUTHACD6gln5jKiTdkk8++io7froYqn+q5OCK4N5jhvyP6cul8ClHOg1MwkDU3KG9em+1bDv5Uj5T69Ljv0ynKnZqpfaJcEDq668GQBV1IEj6xSlAzi90dQYhmUHIE9edRKIiojmIVDOIPTiAfijhFSslS9nx+raMb35HpXNMn/Dna/9crZy8UFczBM/ws1e55JPFr4BPenzWlTqudzDDh45NhS0zPz9BNV80IMeQ2OPDbWDPKPcq1/brt4oduKDbYtQtDfmIOU+/Nbvi2U4kBkTZ/qHx5wSPVWxGPNka2+Yemak1tIIF2AI+AA/V/CzoFKHWD9XIX21WvRvtXkAFIu6ANKbFciWi7ub0XLjR8AEViV9ElmJVEzQWcCEVvMLMnzAJ8ZglnkFUeHkRdZ+i1ehswj1z7chJe3RqHVB5MDTkeNt7uiWrikcsDl9DsCTyWaIFjgmkWYBRjtw16d68xUklgWzlJNgivkdLuR9outTW15jZ5HZxu1+Tdv1X1CZcw==

 have attached a testcase that illustrates the issue. Its a cpp file that you can compile to reproduce the issue. 

Please note that the input is valid. Approximate decomposition works correctly. Optimal decomposition fails in CGAL_partition_postcondition. Please do not be confused by the name of CGAL ERROR: precondition violation. It is actually failing in the post condition, where in it verifies that the decomposition is correct.

1. I've verified that the input polygon is  a simple counter clockwise polygon. I have put the following two asserts to ensure this invariant.

 assert(CGAL::is_simple_2(polygon.vertices_begin(), polygon.vertices_end(), Traits()));
assert(CGAL::orientation_2(polygon.vertices_begin(), polygon.vertices_end(), Traits()) == CGAL::COUNTERCLOCKWISE);
 assert(!hasDuplicatePoints(polygon));

2. To test the logical correctness for the input polygon, I have also done the following.

I've identified a point that is outside the input polygon. A point that is outside the input polygon should be outside all the polygons in convex decomposition.

Approximate decomposition passes this.

3. First I run the approximate decomposition CGAL::approx_convex_partition_2. It works as expected.

4. This post condition fails for optimal decomposition.

      CGAL_partition_postcondition(
             convex_partition_is_valid_2(polygon.begin(), polygon.end(),
                                      res.output_so_far_begin(),
                                      res.output_so_far_end(), traits)


Attachment: testcase.cpp
Description: Binary data




Archive powered by MHonArc 2.6.19+.

Top of Page