Grasshopper

algorithmic modeling for Rhino

Hi every one,
I am trying to script DIVIDING CURVES, in VBscrip/Grasshopper and I don't know how?
Could any of you help me about it?
Also so appreciating for intuducing a good VBscript wiki?
Cheers,

Views: 3360

Replies to This Discussion

Hi Mohammad,

are you using VBScript or are you using the VB.NET script component?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David,

I use VBScript.

 

Thanks

Then Grasshopper is probably not for you. There's a RhinoScript interface to the Grasshopper plugin but it is very limited. Dividing curves using the RhinoScript SDK would be much easier to achieve. The RhinoScript helpfile is shipped with Rhino help menu (Plug-ins -> RhinoScript) it will have examples for the DivideCurve, DivideCurveLength and DivideCurveEquidistant functions.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

hey, speaking of curve lengths, I recently found myself unable to extract the length parameter of a curve from a standard curve parameter value...I seem to remember that the evaluate curve component used to have an "L" output.  I couldn't find any curve methods that would allow me to extract the length of a curve at a given parameter (either normalized or not).  I'm sure I'm just missing something really simple...

Are we talking VB/C# or components? There's a bunch of Curve Length and Evaluation components, some of which work on parameters, others on lengths, others on normalised lengths. 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Yes...in VB. Correct me if I'm wrong:

curve.(normalized)lengthparameter gives me the t for a given L, normalized or otherwise.

curve.pointat and curve.pointat(normalized)length give me the point at t and L respectively...I just can't seem to find a method to get an L for a given t.

Is my best option to get a point at a given length and then find the "t" for the closest point on the curve to that point?

Curve.NormalizedLengthParameter() gives you the parameter along the curve using normalized length (0.0=start, 0.5=mid, 1.0=end).

Curve.LenghtParameter() gives you the parameter along the curve using regular length (0.0=start, length=end)

Curve.PointAt() gives you the point at a given curve parameter. Nothing to do with length.

Curve.GetLength() gives you the length of a curve up to the parameter t or of a subcurve domain (again expressed using curve parameters).

--

David Rutten

david@mcneel.com

Poprad, Slovakia

GetLength!  For whatever reason I thought that actually gave me the length of the whole curve.  Standard issue facepalm.

Hi,

I'm very interested in what access exactly is possible via the RhinoScript interface to Grasshopper. I couldn't yet find any more information on that except this thread here - could you please help me with any hints and/or links, on how can I learn more? I'd be very grateful.

Specifically, I'm interested if it is maybe possible via RhinoScript to make Grasshopper load a particular .ghx file, attach its inputs to some objects in Rhino, run it (to render the results in Rhino) and then make it close?

Also, is there possibly some other way to do that, except maybe some kind of mouse movement recording?

I'd be very grateful for help!

Ahh, I think I found it, via your comment in other thread - by running Grasshopper -> Help -> Download SDK Help... -> (awesome animation during download) -> Grasshopper SDK.chm -> Grasshopper Namespace -> Grasshopper.Plugin Namespace -> GH_RhinoScriptInterface Class -> GH_RhinoScriptInterface Members.

Is this it? I hope yes; and seems to have functions like what I need. Only I can't see "Close", but for now I hope it will just close when all COM references are destroyed.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service