Grasshopper

algorithmic modeling for Rhino

Learn Python for Rhino First, Before Python for Grasshopper?

Hi all, quick question about the direction I should take when starting to learn Python for Grasshopper. Should I first learn how to use Python for Rhino, and then move to Python for Grasshopper? There just seem to be many more Python+Rhino-related resources out there to start from. But I want to make sure not to start learning something that won't be applicable if my main goal is to use Python for Grasshopper. Thanks for any suggestions!

(I have fair experience with Rhino and intermediate experience with Grasshopper -- I'm almost completely new to Python)

Andrew

Views: 1940

Replies to This Discussion

Also if I may add another point: I'm completely new to Python. My goal is to use it to generate parametric geometry, e.g. city blocks of buildings, etc. I have had limited success with this using Grasshopper components but have heard that to really do this well and have flexibility, custom scripts are the way to go. I want to hear some motivation from the community that this is actually the case. Thanks for any input either way!

Andrew,

Using python or indeed any other programming language can be very beneficial to extending the kit of tools we have. Grasshopper at it's core is essentially a visual scripting language where the user literally can plug and play with pre-built functions. Where learning to write code can help is when you have a specific function in mind that is not covered by the extensive list of components both native to Grasshopper or already made in the list of plugins developed by the community, many of which can be found at food4rhino.

The benefit of something like python is it is a very user friendly language (IMO) where there is less focus on semantics which makes it easier for a designer to get a result rather than spend time optimizing variable types and memory usage. The trade off of course is that a script or program written in something like C# could use less computational resources and be faster, this is a generalization of course, it completely depends on the use and code written.

If you're keen to get started with Python I'd almost suggest learning to write code in a sperate environment to understand the fundementals. Something like www.codeacademy.com will take you through the basics and teach to the syntax quite quickly as well as introduce you to Object Oreinted Programming. It's also free and is entirely done through your web browser.

Once you've got a feel for how to code in Python you should start to get your head around the RhinoCommon SDK or the RhinoScript library. As you've noted there are plenty of examples on the Rhino Wiki page. This is probably the biggest leap. At first it took me some time to understand how the object types and instances found in the SDK could be correctly accessed and used in a script. At this point it's best to seek specific advice from forums like this one or the rhino discourse site.

Hope that helps. Good luck.

Mat, thanks for the reply-- rich and to the point, I'm now sure that this is something I want to pursue. And thanks for the Codecademy link, I've heard about it from others and think it's something I'll have to go through before I can get too deep into python specifically for GH. 

Greatly appreciated. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service