This is a grasshopper recreation of a design pattern 'Controller' found in Robert Woodbury's Elements of Parametric Design. This introductory tutorial demonstrates how to manipulate and evaluate a curve.
This tutorial comprises 3 definitions, with each building upon the previous one. In the first definition, a vertical line is placed along a curve using the all-important slider component. The second definition visualizes this slider in the Rhino model, while the third definition adds a angular controller that determines the line's orientation.
Some quick concepts/ general principles about Grasshopper:
- Components have inputs and outputs. In order for them to work properly, inputs must be of the correct type e.g. you cannot feed a point into a component that expects a curve. The component turns red when an error occurs and turns orange when data is missing.
- Data flows from upstream to downstream (or at the risk of oversimplification - left to right). Organize the definition based on this. For example, controlling components (or important ones) should be built first as their effects will propagate downstream.
- Definitions are generally built starting with inputs from the Rhino scene. For example the interpolated curves in these definitions are built from points that were first created in Rhino. Definitions generally end with baking - this is when geometry created in Grasshopper is drawn to the active Rhino document.
These 'curve basics' definitions are fairly straightforward. In terms of structure, note the separation of the controls from the rest of the definition. The important component to take note of is 'Evaluate Curve'. When we evaluate a curve we need to specify a t-parameter in order to get information about a point along it and its tangential information. This concept of evaluation extends to surfaces where we query information about a surface by providing domain information (u and v parameters).
The component above has some unusual icons at the inputs. At 'C' an icon shows that the curve has been reparameterized i.e. the t-param is 0 at its start point and 1 at its end point. At 't', the asterix icon shows that a mathematical expression has been added. In this example, the expression is t/360 , which maps the value of the angle input (in degrees) to a value between 0 and 1. The flattening action is not strictly necessary in this definition and will be covered later on (in data manipulation).
The grasshopper definitions can be downloaded here.
Videos for Curve basics 1 and 2: