From the course: Grasshopper and Rhino: Python Scripting
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Attractors
- [Instructor] A common method of patterning for sides is through the use of an attractor script. This is achieved by scaling for side elements based on their distance to an object, or what we call an attractor. Let's try creating our own attractor function from within Python, which scales the surfaces based on their distance to an attractor which we'll use a point for. To start, let's remove the list item components and we'll place a new Python component. We'll change the x input for this to panels, which will be a type of list and a type of surface. In the last video we sorted a list of surfaces and output them from the output sortedP. So let's plug that into the panels input. Next, we're going to need a point which will act as the attractor. So working in Rhino, let's simply create a point using the single point command. And as you can see, I've got Project selected in the object snaps. And then I'm gonna select somewhere near the surface and this ensure that it's on the x, y…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.