[
https://issues.apache.org/jira/browse/LUCENE-8157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352571#comment-16352571
]
Karl Wright commented on LUCENE-8157:
-------------------------------------
Hi [~ivera], the full code has this helpful comment:
{code}
// Build the new edge
// We need to know the sidedness of the new plane. The point we're
going to be presenting to it has
// a certain relationship with the sided plane we already have for the
current edge. If the current edge
// is colinear with the new edge, then we want to maintain the same
relationship. If the new edge
// is not colinear, then we can use the new point's relationship with
the current edge as our guide.
final boolean isNewPointWithin = currentEdge.plane.isWithin(newPoint);
final GeoPoint pointToPresent = currentEdge.startPoint;
final SidedPlane newPlane = new SidedPlane(pointToPresent,
isNewPointWithin, pointList.get(startIndex), newPoint);
final Edge newEdge = new Edge(pointList.get(startIndex),
pointList.get(endIndex), newPlane, internalEdges.get(startIndex));
{code}
Since the code was already modified to remove colinear points for the polygon,
the question is under what circumstances we ever can't determine the sidedness
of the plane. We can determine that condition by adding:
{code}
if (currentEdge.plane.evaluateIsZero(pointToPresent)) {
throw new IllegalStateException("Not expecting point and plane to be
colinear!!");
}
{code}
As I said, I am flat out this week; hopefully later in the week things will
look better.
> GeoPolygon factory fails in recognize convex polygon
> ----------------------------------------------------
>
> Key: LUCENE-8157
> URL: https://issues.apache.org/jira/browse/LUCENE-8157
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/spatial3d
> Reporter: Ignacio Vera
> Priority: Major
> Attachments: LUCENE-8157-plane.patch, LUCENE-8157-test.patch,
> LUCENE-8157.patch
>
>
> When a polygon contains three consecutive points which are nearly co-planar,
> the polygon factory may fail to recognize the concavity/convexity of the
> polygon. I think the problem is the way the sideness for a polygon edge is
> calculated. It relies in the position of the next point in respect of the
> previous polygon edge which fails on the case explained above because of
> numerical imprecision. The result is that sideness is messed up.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]