Forgot password?

Create an account!

Forum

« back

RhinoScript – deform a curve around a point

Messages

Please log in to write a message.

  • 2. Hanno (Dec 22, 2010 12.04):

    Hi,

    you cannot move the control points of an existing curve, so you have to get the control points of your input curve (use CurvePoints for that), change the array according to your needs, and then build a new curve. AddCurve takes an array of control points as parameter; if you want to have detailed control, you could even use AddNurbsCurve, which lets you set the knot vector and cv weights.

    Hope that helps!

    Hanno

  • 1. ledisnomad (Dec 21, 2010 20.00):

    I'm just starting to conceptualize a script and I could use some help, since I only dabble with Rhinoscript. The nugget if the script is this: deform a straight curve around a point based on the distance from that point to the closest point on the curve. The closer the point is to the curve, the more the curve is deformed. The pseudo-code I imagine is something like this (I know these are the Rhino commands):

    CP = Rhino.CurveClosestPoint(Point, Line)
    Dist = Rhino.Distance(CP, Point)
    Rebuild Line with three more control points at CP, at CP+u, at CP-u
    Move control point at CP away from Point by 1/Dist

    I haven't dealt with manipulating curves via control points, so I'm at a loss where to start. Any help would be greatly appreciated.

Recommend

Why are these buttons gray?