Grasshopper

algorithmic modeling for Rhino

Hi guys,

I have this mathematical function f=(2z+1)y+2(y-1)(x-z)

x is constant (eg. x=4)

∈ [1,4] for example

∈ [0,ymax-1]

So for y=1

z=0, f=1

z=1, f=3

z=2, f=5

z=3, f=7

for y=2

z=0, f=10

z=1, f=12

z=2, f=14

z=3, f=16

for y=3

z=0, f=..... etc etc etc

I have created the GH algorithm (attached), but I have trouble to run all the values of z range for y, before going to y+1 (loop in a loop). Do I have to set it up in VB?

Thanks in advance

Views: 1883

Attachments:

Replies to This Discussion

I bet sometimes you stumble on your 30 inch d@%k

Ok, that all sounds very impressive, congratulations on your fantastic job. Although it strikes me as the type of response when you don't have anything constructive to add or are basically "caught out".

I was never discussing the merits of using code, generative components or whatever you want to call them. When you have a job like yours its undoubtably necessary to be familiar with code and everything that goes with it.

But don't forget where this discussion started - with someone wanting a simple solution to an even simpler problem.

Have you heard of Occam's Razor? It reminds me of this. One interpretation by Thomas Aquinas (in the 13th century): "If a thing can be done adequately by means of one, it is superfluous to do it by means of several; for we observe that nature does not employ two instruments [if] one suffices."

http://en.wikipedia.org/wiki/Occam%27s_razor

You are right.

But, as I'm learning C# in this period I can tell you...

Finding a very simple short c# code, is hard.

Usually you find huge massive code samples, unreadable for newbies.

Short examples like this one are gold.

If the only answer here was Peter's, then John maybe would have some issue XD

But when is an extra like this time, hey ... why not?

There is also <NULL> benefit in terms of computing time, which is the only justification I can see for using code components other than for actually doing something that CAN'T be done in GH.

well put, i believe this is one of the rules in Milkbox and i have to agree it makes sense.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service