10.014 CTD
  • Overview
  • Schedule
  • Administrative
    • Accessing Rhino remotely
    • Rhino for Mac
  • ASSIGNMENTS
    • Dates and rubrics
    • Generative design
      • Generative design
    • Parametric design
      • Parametric design
    • Simulated design
      • Simulated design
      • Simulated design
  • SESSION 1B
    • Computer Aided Design
    • Ranges and expressions 1
      • Ranges and expressions 2
      • Ranges and expressions 3
      • Ranges and expressions 4
      • Ranges and expressions 5
      • Ranges and expressions 6
  • SESSION 2A
    • Visual programming 1
      • Visual programming 2
      • Visual programming 3
      • Visual programming 4
    • Associative modelling 1
      • Associative modelling 2
      • Associative modelling 3
  • SESSION 2B
    • Logical Patterns 1
      • Logical patterns 2
      • Logical patterns 3
  • SESSION 3A
    • Spatial geometry 1
      • Spatial geometry 2
      • Spatial geometry 3
      • Spatial geometry 4
      • Spatial geometry 5
      • Spatial geometry 6
      • Spatial geometry 7
    • Curve geometry 1
      • Curve geometry 2
      • Curve geometry 3
      • Curve geometry 4
  • SESSION 3B
    • Surface geometry
    • Parametric modelling 1
      • Parametric modelling 2
      • Parametric modelling 3
      • Parametric modelling 4
  • SESSION 4A
    • Information nesting 1
      • Information nesting 2
      • Information nesting 3
    • Data landscapes 1
      • Data landscapes 2
      • Data Landscapes 3
      • Data landscapes 4
  • SESSION 4B
    • Mesh geometry 1
      • Mesh geometry 2
      • Mesh geometry 3
  • SESSION 5A
    • Space and time 1
      • Space and time 2
    • Modelling entities 1
      • Modelling entities 2
      • Modelling entities 3
  • SESSION 5B
    • Multibody dynamics 1
      • Multibody dynamics 2
    • Material elasticity 1
      • Material elasticity 2
      • Material elasticity 3
  • SESSION 6A
    • Form-finding 1
      • Form-finding 2
      • Form-finding 3
      • Form-finding 4
  • SESSION 6B
    • AI Image generation 1
      • AI Image generation 2
      • AI Image generation 3
  • APPENDIX
    • Spirograph 1
      • Spirograph 2
    • Curves
    • Swarm Intelligence 1
      • Swarm Intelligence 2
    • Hybrid programming 1
      • Hybrid programming 2
Powered by GitBook
On this page
  • Component Palettes
  • Input Parameters
  1. SESSION 2A
  2. Visual programming 1

Visual programming 2

Introduction to Grasshopper

PreviousVisual programming 1NextVisual programming 3

Last updated 9 months ago

Component Palettes

Components are organized semantically into palettes. The application contains a few hundreds of components supporting basic operations such as number arithmetic to exotic geometric functions such as Voronoi diagrams and meta-ball blobs.

We cannot possibly cover but a fraction of the most common and useful components relevant to building foundations in computational design. Additional palettes visible above, but not in your computer, are component libraries available online.

Input Parameters

Input sources for components may be constant values, geometries linked from the CAD document, files loaded from the disk or more commonly other components’ outputs. Generic primitive input components are found in the “parameters” palette.

Data Primitives

There are multiple and often equivalent ways to create simple constant values. For text strings, the “panel” component is typically used. It captures the convenience of a plain text editor, where we can input arbitrary string fragments. To activate the editor we need to double-click on the component. Notice that depending of the zoom level the editor may appear in-place or in a new window.

For numeric values we often use the “slider” component. Certain components such as the “slider” contain special customization options accessible by either double clicking or using the context menu and selecting the appropriate item. The slider component options allow us to define whether the number output is an integer or a real, as well as the upper and lower limits of the slider’s range.

Most components accept values via their “set” context menu option. For constants it is common to assign values that will never change using this approach. The benefit of using the “set value” context menu option, is in that it does not clutter the graph with components. As a good principle we may rename a component holding a constant value as seen below, for legibility purposes.

Geometric Primitives

The most common source of input parameters comes from selecting already drawn shapes in the CAD document. To import geometries we use geometric primitive components and select objects from the viewports using the context menu “set one” item.

It is also very common to import more than one geometric entities using the same approach. Instead of the “set one” context menu, we need to use the “set multiple” menu. The geometry, one or many, is stored in the geometric primitive component as “referenced” data. This means that changes of the geometry in the CAD document will cause all components that “reference” it in the visual programming environment to be updated automatically.

Some geometric primitives, such as points, are so basic and useful that we can create them directly via the input parameters. Note that geometry created from this type of primitives is not stored in the CAD document but only within the visual programming environment.

In this example we create a point by first selecting the “set one” option, then in the command line we select by “coordinate” to express the desire to draw a new point instead of selecting an existing one, and then add one point in the viewport using the mouse. Notice that points created using the approach can be moved by using their on screen handles. The handle appear only when the point primitive component is selected in the visual programming window.

Undefined Values

Primitive parameters, either geometric or non-geometric, when first created have no value assigned. This is represented by the orange colour tint and popup menu item notification. Connecting such “undefined” values to other components propagates the warning forward. This is also visually represented by an orange colour wire.

Components organised in palettes
"Hello World' text in Panel
Creating and editing a slider
Setting geometry by reference
Creating a point in Grasshopper
Undefined error (Orange)