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
When a point is inside a circle, the resulting status is "Inside". However, when a shape is inside a rectangle the resulting status is "No Intersection".
The text was updated successfully, but these errors were encountered:
marcospassos
changed the title
Intersection inside rectangle reports no intersection
Intersection inside rectangle reports "No intersection"
Sep 14, 2017
Yeah, that functionality is really a remnant of when this code was first written for kevlindev.com. I would show status live as the user manipulated items in the UI. When I moved this code over to github, I wanted those examples to use the same code and not be broken. Really, I should remove the whole concept of "status" from the intersection algorithms and move those to queries.
As a workaround, you check if each point in your shape is within the rectangle. You would have to convert the rectangle to a polygon, then check if each point of your first shape is within the polygon. Of course, this assumes you are checking polys against the rectangle.
@marcospassos Could you follow up the rectangle status of "No intersection" by drawing a circle which is the same diameter of the rectangle and testing the shape against that? If the shape says "Inside" the circle, then it's likely inside the rectangle as well. For better accuracy you could use an ellipse instead of a circle to mimic the rectangular shape, assuming ellipses give an "Inside" value as well.
When a point is inside a circle, the resulting status is "Inside". However, when a shape is inside a rectangle the resulting status is "No Intersection".
The text was updated successfully, but these errors were encountered: