Grasshopper

algorithmic modeling for Rhino

Hi all,
I m trying to learn a scripting language that would help me write more complex genetic algorithms inside or outside grasshopper. I have three options:
A. Python
B. C#
C. VB.Net
Which one should I choose and why. I m super confused as I have limited knowledge about these languages. Any help to inform my decision will be much appreciated.

Views: 2776

Replies to This Discussion

Im currently using more python than c#, but i would suggest c#. Cuz you can make only dumb 2d game with pygame(modules for python).  But with C# you can do virtual reality... Python is easier comparing to c#, but once you learned c#, you have no difficulty to understand python script... In grasshopper this guys basically could do the same job. If you can, learn both.  

C# is the standard by any yardstick.

Other than that:

1. Take into consideration other apps that may in the future you could use.

2. Take into account the available resources (papers and/or stuff from sites the likes of Code Project etc etc) that may fit to your workflow/goals. Also the available literature/printed manuals/e-manuals/books etc etc. 

3. Take into account the quality of the available editors (like VS etc etc). That said the
"build-in" GH editor is a bit of a crap (but it's OK for smallish/not complex coding).

4. Most importantly: // computing is the holly grail these days  (and it would become the standard in the years to come: either via trad CPU cores or via CUDA/Tesla type of stuff)... thus take into account ... well ... the obvious.

BTW: If 1 is true and there's some workflow around that involves many apps ... try to write code that is as "GH neutral" as possible.

Thanks looper and Peter
I 'm mostly considering this language for genetic algorithm and mathematical calculations. I read somewhere that Python being an interpreted language is slower than c# and VB.net; is that true? Also multithreading is a problem in Python; will this affects he runtime of a Python script inside rhino of GH?

Well ... this is not the "phase" for a race against the stopwatch ... because your problem numero uno is NOT who beats whom ... but the rabbit hole itself: that // programming thingy.

Most people believe/wish/hope that there's some magic red button that once pressed  ballistic things happen in your machine (and pigs do fly).

Truth is that there's no such button (but I'm working on it > Nobel on sight I do hope, maybe this year or the next one).

Read the Master talking // matters and "enjoy":

http://www.albahari.com/threading/

Moral: long is the path (and hilly).

may The Force (the dark option) be with you, best, Lord of Darkness

Ironically the particular Python in Rhino/Grasshopper is extremely easy and effective at parallel programming as long as you invoke core Rhinocommon commands instead of confuse it into slowing down by trying to use node-in-code calls to Grasshopper components, but, Rhino is saddled with IronPython 2.7 abandonware that can no longer even successfully load the advanced math libraries Numpy or Scipy, and many advanced math libraries require these standard support commands. There's a kludge to access .NET libraries including math ones but that is kind of an odd thing to try to learn about and will not suddenly let you get a given Python library working. It's because only IronPython had an efficient data structure with .NET guts that matches what Rhino uses.

For pure geometry work, Python has saved me from the baggage of C# and VB, all those long standard headers that I can't comprehend while debugging, so I can offer a script to a client that they can understand and modify practically in English as long as I comment it. But career-wise, Grasshopper isn't lucrative, only 3% of architecture firms require it, for much lower pay than myriad positions at software based companies for six figures. Funny though, not being paid at a day job enough is what drives me often back into my even own more lucrative home fabrication business where Python is exactly the elegant power tool I need compared to raw Grasshopper.

One hassle in any language is how the object oriented programming cult means computer science majors obfuscate their code so it's very hard for a practical minded beginner to modify online treasure for themselves.

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