RC: Check if point is inside a closed curve


#1

Hi,

Does RC has a method for checking status of the point in regards to location inside or outside of closed curve?
Similar as Brep.Isinside method for breps? Cannot find anything suitable.

Thanks,
Dmitriy


(Dale Fugier) #2

Use Rhino.Geometry.Curve.Contains().


#3

Great!
Thanks Dale!


#4

Does the point need to be planar with the curve?
Or is it view dependent?


(Willem Derks) #5

Both are projected to the plane provided:

Contains(self: Curve, testPoint: Point3d, plane: Plane, tolerance: float) -> PointContainment

    Computes the relationship between a point and a closed curve region.    This curve must be closed or the return value will be Unset.


    testPoint: Point to test.
    plane: Plane in in which to compare point and region.
    tolerance: Tolerance to use during comparison.
    Returns: Relationship between point and curve region.

@dale
Documentation online does not provide the full range of possible arguments and is limited to the point3D argument:
http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_Contains.htm

-Willem


#6

Interesting. Thanks for the explanation :slight_smile:


(Dale Fugier) #7

@Willem, sorry for being dense, but I see all three overrides in the online documentation. Am I missing something?


(Willem Derks) #8

You are right, I’m the one being dense here, was looking only at the right pane; missing the left pane completely.

Thanks
-Willem


#9

Hi,

is there a C++ version of Rhino.Geometry.Curve.Contains()?

Thanks!


(Dale Fugier) #10

For points, use RhinoPointInPlanarClosedCurve. See rhinoSdkUtilities.h for details.

– Dale