-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds point in polygon to Point3. #388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @d3ssy :)
/// <param name="point">The point to test.</param> | ||
/// <param name="polygon">The polygon to test against.</param> | ||
/// <returns>Returns 0 if the point is outside the polygon or 1 if it is inside.</returns> | ||
public int InPolygon(Polygon polygon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it returns if it is coincident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated method to test for coincidence edge cases.
/// <param name="point">The point to test.</param> | ||
/// <param name="polygon">The polygon to test against.</param> | ||
/// <returns>Returns 0 if the point is outside the polygon or 1 if it is inside.</returns> | ||
public int InPolygon(Polygon polygon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have this operation at the level of the Curve
It sounds natural to think we are operating on the curve instead of the point.
What about moving this method to NurbsBase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is only applicable to Polygon as they are guaranteed to be planar curves. PointInCurve() given an arbitrary 3d curve is another can of worms.
I placed it in Point3 to match the Point3.InPlane() method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't every curve be planar to perform this operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try and it in rhino and see 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless of planarity, we will need a more computationally intensive method for NURBS that calculates ray intersections, and does closest point for coincidence checks. The logic should be the same. We can limit it to planar curves in the case of NURBS and throw error if it ain't.
…incidence edge cases.
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Closes #86
Added tests?
Added to documentation?