[
https://issues.apache.org/jira/browse/LUCENE-8157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16353456#comment-16353456
]
Karl Wright commented on LUCENE-8157:
-------------------------------------
So let's look at this test case and see if I understand it:
{code}
public void testLUCENE8157() {
// These better be three non-colinear points
GeoPoint A = new GeoPoint(PlanetModel.SPHERE, 0.281855362988772,
-0.7816673189809037);
GeoPoint B = new GeoPoint(PlanetModel.SPHERE, 0.28185536309057774,
-0.7816673188511931);
GeoPoint C = new GeoPoint(PlanetModel.SPHERE, 0.28186535556824205,
-0.7816546103463846);
//check to be sure all points are legal with respect to other points
Plane AC = new Plane(A, C);
Plane BC = new Plane(B, C);
Plane AB = new Plane(A, B);
assertFalse(AC.evaluateIsZero(B));
assertFalse(BC.evaluateIsZero(A));
assertFalse(AB.evaluateIsZero(C));
SidedPlane AB = new SidedPlane(new GeoPoint(1, 0,0), A, B);
assertFalse(AB.evaluateIsZero(C));
boolean isConvex = AB.isWithin(C);
SidedPlane BC = new SidedPlane(A, isConvex, B, C);
//fails here!!
assertFalse(BC.evaluateIsZero(A));
assertTrue(BC.isWithin(A) == isConvex);
}
{code}
> 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]