How can I select a point on a curve and split the curve at that point. SplitCurve in the script below splits the curve but how do I use the point I’ve picked to make the correct Domain, or is there some other way of doing this just picking one point.
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select a curve to split", rs.filter.curve)
if rs.IsCurve(curve):
point = rs.GetPointOnCurve(curve, "Point on curve")
if point: rs.AddPoint(point)
domain = rs.CurveDomain(curve)
parameter = domain[1] *.9
rs.SplitCurve( curve, parameter )
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select a curve to split", rs.filter.curve)
if curve:
point = rs.GetPointOnCurve(curve, "Point on curve")
if point:
rs.AddPoint(point)
param=rs.CurveClosestPoint(curve,point)
rs.SplitCurve(curve, param)
CurveClosestPoint() gets the parameter on the curve closest to given point.