Creating a degree 2 curve by specifying three edit points

Hi,

I need to change a degree 2, 3 control points curve by moving its middle edit point to a certain location.
In Rhino I just need to turn on the Edit Points and do it manually.

I need to do it via a script - I have tried using AddInterpCrv by specifying 3 points, but it won’t accept a degree of 2.

More in general, even using Rhino’s InterpCrv command, it seems it isn’t possible to build a degree 2 curve given 3 curve points - but if I create a degree 2 curve with the Curve command using three arbitrary points, then I can activate its edit point and move them to the 3 given points, so it seems it would be possible and relatively easy.

I hope my explanation makes sense…

Thanks in advance

If you are using RhinoScript, you can use the ObjectGripLocation method.

http://4.rhino3d.com/5/rhinoscript/object_grip_methods/objectgriplocation.htm

Python’s RhinoScriptSyntax has a similar method.

Does this help?

Dale, thank you for the quick reply.

Yes, I’m using RhinoScript, and I have used the ObjectGripLocation method several times, but as far as I know it only allows to set the “control points”, not the “edit points”, which belong to the curve itself.

My final goal is to change the curve so that it intersects a specific geometric point, but I don’t think this is directly possible by just editing the control polygon. Am I missing something?

If your quadratic is nonrational, with start P0, and end P2, you can get it to go through the point Q by setting the middle control point P1 = 2Q - 0.5*(P0 + P2). The parameter for Q will be midway between the parameters for P0 and P1. This is the edit point. I’m not real familiar with scripting, but I think you can do point and vector arithmetic. Someone else will have to explain how if you don’t already know.

Thank you very much Chuck, it worked perfectly!