Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Verify Point on Object

$
0
0

How do I verify if a point is actually on a curve? Is there something similar to rs.PointCompare(point1, point2) but instead of comparing the 2 points to see if they are equal, it would compare the two objects and see if one is part of the other? At this point I just need to know if a point is on a curve.

Update:
I think I figured out the long way around it but still want to know if there’s a faster way, i…e. a specific function. Here is what I have done so far:

def IsPointOnCurve(MyCurve, MyPoint):
IsCurve = rs.IsCurve(MyCurve)
if IsCurve:
# Verify the point is on the curve
tClosestPoint = rs.CurveClosestPoint(MyCurve, MyPoint)
ClosestPointOnCurve = rs.EvaluateCurve(MyCurve, tClosestPoint)
return rs.PointCompare(MyPoint, ClosestPointOnCurve)
else: return False

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles