Grasshopper

algorithmic modeling for Rhino

hello!

I have a list of vectors (x,y,z)  i.e. (1.88,7.43,0.0)

and i want to make them operate as variables in this function:

f() = ( ((x)e-1) , ((y)e-1) , ((z)e-1) )

i always get a syntax error because i have never known how to write correctly functions on grasshopper

could someone please explain me the syntax rules?

thanks in advanced,

gabriel

Views: 2543

Replies to This Discussion

The Grasshopper expression language is based on VBScript. It has a bunch of added operators and symbols specifically for 3D operations. 

I believe the expression you're looking for is:

{p.x * e - 1, p.y * e - 1, p.z * e - 1}

Where p is a variable of type point (or vector). The curly brackets are used to create a new vector. If you only put two numbers in between curly brackets you'll create a Complex number instead. It's also possible to use the multiplier operator directly on vectors:

(p * e) - {1,1,1}

If you multiply a vector/point by a number it amounts to multiplying all coordinates with that number.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you David,

Now i got another question,

As i understand then, i would need to double click on the VBscript component and type my function? or how does it work?

sorry to bother, is just that i really do not understand

gabriel

The Script component use proper VB.NET and C# code. The Expression and Evaluate components use Grasshopper expression language. You'll find all four of them in the Math Tab, Script panel.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Here's the implementation in the GH Function Component.

Attachments:

wow thank you so much ! i was trying without any success!

gabriel

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service