colidescope

/live/ intro-to-python

Welcome! You are not currently logged in. You can Log in or Sign up for an account.

Intro to Python

+Introduction

+Sessions in this webinar series:

Python bootcamp
1Intro to Python
2Elements of Python

+Introduction to Python


+Demo: Data inputs and outputs

In this demo, we get our first hands-on experience working with Python in Grasshopper. As a starting point, we look at how to input data from Grasshopper into a Python script running within a Python component, and how to handle geometric inputs. We also look at how to output data from Python back to the Grasshopper canvas.

⚠️ You need a premium account to access this content.

+Demo: Creating geometry in Python

In this lesson, we look at how we can create geometry in Python using the Rhino.Geometry library. We first import the library using an import statement and then create a circle using a point input from Grasshopper as its center.

⚠️ You need a premium account to access this content.

+Demo: Working with Lists and loops

In this lesson, we extend our script to accommodate multiple points from Grasshopper. We look at how we can work with lists in Python, and how to iterate over the objects in a list using a loop. 

⚠️ You need a premium account to access this content.

+Demo: Adding an attractor point

In the final lesson of the session, we finish our script by adding the ability to control the radius of each circle in the grid based on the distance of each point to another point called the 'attractor'. We first calculate the radius directly from the distance and then use a set of conditional statements to set the radius directly based on the distance meeting certain criteria.

⚠️ You need a premium account to access this content.

+Conclusion