jpountz commented on a change in pull request #652: LUCENE-8775: Tessellator: 
Improve the election of diagonals when splitting the polygon
URL: https://github.com/apache/lucene-solr/pull/652#discussion_r279001648
 
 

 ##########
 File path: lucene/sandbox/src/java/org/apache/lucene/geo/Tessellator.java
 ##########
 @@ -248,8 +261,21 @@ private static final Node fetchHoleBridge(final Node 
holeNode, final Node outerN
         p = p.next;
       }
     }
+    //In case more than one hole uses this connection point,
+    // make sure we choose the right one
+    return getBestConnector(connection, holeNode);
+  }
 
-    return connection;
+  private static Node getBestConnector(Node connection, Node holeNode) {
+    Node candidate = connection;
+    Node next = connection.next;
+    do {
+      if (isVertexEquals(next, connection) && isLocallyInside(next, holeNode)) 
{
+        candidate = next;
+      }
+      next = next.next;
+    } while (next.next != connection);
+    return candidate;
 
 Review comment:
   This can run in linear time with the number of vertices?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to