Grasshopper

algorithmic modeling for Rhino

Greetings, Grasshopper users!

First of all, I want to congratulate David for this amazing gift, crafted by gods: Grasshopper. Keep up the good work!

It's my first post here, since it's the first time I am really stuck on writing some simple VB code on Grasshopper...The problem is, I need to intersect a line with a curve, and I've read an article saying I need to convert the line to curve first, and then initiate the CurveCurve intersection... However, I can't seem to make GH_Convert.ToCurve to work... I'm not really sure what the arguments this method needs...

Thanks,

Chris

Views: 11279

Replies to This Discussion

Hi Chris,

if you're dealing with pure RhinoCommon lines and curves (which you probably are), then you don't need GH_Convert. GH_Convert is mostly for conversions involving IGH_Goo types and for when you don't know exactly what you have and whether it could be converted into something else.

To go from Line to Curve, you can choose either one of two ways (well, more, but these are the only ones that make sense).:

Line.ToNurbsCurve()

and

New LineCurve(Line)

Both of these methods will create a curve (one NurbsCurve, the other LineCurve) which can be used in curve curve intersection.

--

David Rutten

david@mcneel.com

Tirol, Austria

Dim temp_crv As curve = NurbsCurve.CreateFromLine(temp_line) did it's job. Thank alot!

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service