Is Point on Curve?

Hi everyone…
I have some points and curves (edges). How to decide that a point is on a particular curve, is there some function in Rhino SDK?

Not sure if there’s a specific function that does what you want, but you could try Curve.ClosestPoint():

Setting the max distance appropriately low should return false if the point is not on the curve.

There is the method on the Curve class class Contains:

// small example
Curve c;
PointContainment pc = c.Contains(pt);
bool isOnCurve = pc.Equals(PointContainment.Coincident);

How about this:

bool IsPointOnCurve( 
  const ON_Curve* curve,
  const ON_3dPoint& point,
  double tolerance
  bool rc = false;
  if (0 != curve)
    if( tolerance < ON_SQRT_EPSILON )
      tolerance = ON_SQRT_EPSILON;

    double t = 0.0;
    if( curve->GetClosestPoint(point, &t) )
      ON_3dPoint pt;
      if( curve->EvPoint(t, pt) )
        if( point.DistanceTo(pt) <= tolerance )
          rc = true;

  return rc;