You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a convex shape, but for some reason the validator says it is. This might be related to #218 although I am not repeating my start/end points so there is probably a different issue.
The text was updated successfully, but these errors were encountered:
Okay I think I figured it out. When constructing a Polygon, it'll generate the convex hull and strip out the remaining points. So in my screenshot, just points 1, 6, 7, 8 will remain. This all happens before validate can be called. So by the time you try to validate it, the shape has already been changed to a convex hull and so it'll be true.
It seems like the validate method should be static on the Polygon class since it doesn't work after the polygon has already been constructed.
I only find one testbed example where this is used, I guess this was made to test the conversion code (rather than validate user input). Anyway, if you would like please free to make a pull request and convert it to a static method.
Example code:
Screenshot of the points on a coordinate plane:
This is not a convex shape, but for some reason the validator says it is. This might be related to #218 although I am not repeating my start/end points so there is probably a different issue.
The text was updated successfully, but these errors were encountered: