refactor(basetype): Make isInRegion consistent across Region types - #3428
Conversation
This comment was marked as spam.
This comment was marked as spam.
|
|
Perhaps I'll add a set of |
xezon
left a comment
There was a problem hiding this comment.
Makes sense for the current users. It is strange that they did not choose <= to begin with. It is especially apparent on floating points.
A difference of 0.0 means it is not inside, but 0.000001 means it is inside. But for integers that threshold is 1, which is much further away.
Having an inclusive one makes sense, because that covers the default use case for region inclusion checks. Imo the current isInRegion should be the exception, not the norm.
IRegion2D,Region2D,IRegion3D,Region3D) now have the sameisInRegionoverloads: separate values, a point, and a whole region.Every check uses<=, so points on the edge count as inside.isInRegionNoZis gone. The 3D types take a 2D point instead, and callers convert withasCoord2D(). Inlines completely.AI was used.