In Grasshopper, nodes are essentially methods and functions that are connected with wires. In Python, we can define our own functions. In this video, learn how to create a function that would be unachievable in Grasshopper otherwise.
- [Instructor] In an earlier class,…we learned how to create a list of numbers…using the range function.…This built-in function takes a number as a parameter…and generates a list of sequential numbers…based on that parameter.…We can also create our own functions…if we find we are reusing the same…piece of script over and over.…Functions are simply chunks of code…that perform a specific task…that have been wrapped up and named,…so we don't need to rewrite the task it performs,…we can simply call it by its name.…
This is how components work in Grasshopper.…Each component performs a specific task…which can be called and reused.…So let's go ahead and create our own functions in Python.…Using the random components,…I've simply created 100 different random numbers…to drive the X and Z coordinates of a point component,…creating 100 random points.…Let's go ahead and we'll place a new Python component…and we'll remove the Y input…and change X to points…which are a list and type of Point3d.…
Then let's go ahead and plug the points…
- Python components
- Accessing the Rhino API
- Python programming basics
- Importing modules and libraries
- Grasshopper workflows
- Evaluating surfaces
- Creating and splitting surfaces
- Transforming geometry
- Baking geometry from Python into Rhino
- Adding text objects
- Exporting rendered frames for animation
Skill Level Intermediate
1. Working with Python
2. Python Basics
3. Importing Modules and Libraries
4. Grasshopper Workflows
Next steps3m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.