Extend curve on surface

Hi all,

I have a quick question: Is there a method in GhPython equivalent to ‘ExtendCrvOnSrf’?
If there is no such method, I may need to use rhino command, but rhino command needs a lot of manual operation(when you have multiple curves and surfaces. Is that possible to predefine which curve will be extend on which surface? So I don’t have to manually pick each curve and surface.

Thanks you in advanced,

Jack

If you use RhinoCommon directly, you can use the Curve.ExtendOnSurface function. There seems no way to do this in GhPython or rhinoscriptsyntax.

http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Geometry_Curve_ExtendOnSurface_1.htm

Hi menno,

Thanks for your reply. I try the way you suggested but got some error…
Did I miss something?


ExtendOnSurface.gh (7.9 KB)

Thanks,

Jack

For the ‘CurveEnd’ parameter in ‘ExtendOnSurface’, I try 0,1,2and3 but none of them works…

You need to specifically call out the curve end style using

Rhino.Geometry.CurveEnd

This works for me:

ExtendOnSurface-msh.gh (8.1 KB)

–Mitch

1 Like

Hi Mitch,

Thanks for your help!
I just want to get a better understanding of using Rhino.Geometry methods.
Why it does work while using ‘List Access’ but it works with ‘Item Access’?
I tested and found that when you use ghpythonlib you can make it work in both way…


ExtendOnSurface 02.gh (14.2 KB)

Thanks,

Jack

The script components are designed to be intelligent, so list creation is implicit. If you connect a single item, you get a single item out, if you connect a list, you get a list out, if you connect a tree, you get a tree out. I find it’s generally much better to let the component do its own thing rather than trying to manage lists in the script in Python, which can conflict with the above behavior. So in general I write my Python/GH scripts as if they act on a single item and let the component manage the rest. But then again I’m not a power user.

–Mitch

Has common got a type of line extension?

Not quite sure what you are asking, but maybe this?

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Line_Extend.htm