[ 
https://issues.apache.org/jira/browse/LUCENE-8157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16353498#comment-16353498
 ] 

Ignacio Vera edited comment on LUCENE-8157 at 2/6/18 8:40 AM:
--------------------------------------------------------------

I think what we need is a method that checks coplanarity. For example, if we 
accept that Geo3d coplanarity is defined as coplanar to any of the planes that 
three points can construct:

 
{code:java}
static boolean pointsCoplanar(GeoPoint A, GeoPoint B, GeoPoint C) {
  Plane AB = new Plane(A, B);
  Plane AC = new Plane(A, C);
  Plane BC = new Plane(B, C);
  return AB.evaluateIsZero(C) ||  AC.evaluateIsZero(B) || BC.evaluateIsZero(A);
}{code}
 

In this way we encapsulate what is the definition and can be used whenever we 
check for such a property.


was (Author: ivera):
I think what we need is a method that checks coplanarity:
{code:java}
static boolean pointsCoplanar(GeoPoint A, GeoPoint B, GeoPoint C) {
  Plane AB = new Plane(A, B);
  Plane AC = new Plane(A, C);
  Plane BC = new Plane(B, C);
  return AB.evaluateIsZero(C) ||  AC.evaluateIsZero(B) || BC.evaluateIsZero(A);
}{code}
Then we encapsulate what is the definition and can be used whenever we check 
for such a property. Maye a method in Plane class?

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to