Grasshopper

I'm summarizing the Grasshopper files I've accumulated from my sophomore year to now, which I've used to create analytical graphics. I'll also provide a simple guide for architects who are interested in using them. If you're interested, why not give a shot at transitioning to a programmer's career? (Just kidding, or am I?)

This post was translated from my Chinese blog post with the aid of ChatGpt.

Grasshopper Introduction

Grasshopper is a parametric tool in Rhino, which can be thought of as a visual programming language. It is currently integrated into Rhino 6, but for Rhino 5, you need to install it separately. It is recommended to use Rhino 6, and you can download it from the Rhino official website. While Grasshopper is a plugin for Rhino, it has its own set of plugins available, such as Ladybug, ELK, and other analysis tools. You can search for and download these plugins on Food4Rhino.

All the Grasshopper files mentioned in this article will be uploaded to my GitHub.

Pedestrian Flow Simulation

Pedestrian flow simulation is just a simulation because architects cannot find precise data. First, here is the download link for the pedestrian flow simulation.gh.

Next is a simple preview I made (using Qingdao as an example), representing the amount of pedestrian flow using different colors and line thicknesses.

Pedestrian Flow Simulation Preview

Obtaining City Road Network

  1. To obtain the city road network, you need the ELK plugin ELK download link. Download and install it yourself. You may need a VPN, and it is recommended to install the latest version, 2.2.2.
  2. You also need to get an OSM file. Go to OpenStreetMap, click on the Export button in the upper left corner, and select Manually select different areas in the left sidebar. If the selected area is large, consider using the Overpass API for export.
  3. Click the Export button, choose a file path and name for the OSM file. You will need it in the next step.
  4. Open the Grasshopper file you downloaded earlier, right-click on the OSM file component on the left, select Select one existing file, and choose the OSM file you just downloaded. Wait for it to load.
  5. Right-click on the Bake Roads component on the left and select Bake to obtain the road network.

Simulating Pedestrian Origins

  1. Right-click on the Pedestrian Origins component, select Select multiple points, and choose densely populated points.
  2. Adjust the Distance and Levels sliders to simulate the density of pedestrian flow.
  3. Right-click on the Land Area component to select the approximate area of the land without coastlines.

Generating Simulated Streamlines

  1. Select the road network that was baked earlier, type the ungroup command, and then type the explode command to break it into smaller segments.
  2. Right-click on the Decompose Road Network component, select Set multiple curves, and select the decomposed road network.
  3. Fine-tune the lines using the Tolerance and Line Thickness sliders.
  4. Right-click on the Streamlines component and select the Bake option. Check the Group option and choose Yes, please behind it.
  5. In Rhino, select the baked streamlines, click File, and select Export Selected. Export it as an Adobe Illustrator file.

Beautification

  1. Open the exported file in Adobe Illustrator.
  2. Adjust the stroke color and thickness.
  3. Set the opacity to around 70% and choose the Multiply blending mode.
  4. Download a map background for the corresponding area from Mapbox and overlay it below the streamlines.

Comprehensive Meteorological Information

Meteorological information charts can represent information such as wind speed, temperature, humidity, precipitation, and more in a single image. Here’s the download link for the comprehensive meteorological information.gh.

Next is a preview (using Qingdao as an example) where the compression is quite severe.

Meteorological Information Preview

Obtaining Meteorological Information Files

Meteorological information requires the use of an epw file for importing. Currently, there are two ways to obtain epw files. One is to download them from the EnergyPlus website, but the data for Chinese cities is limited (Qingdao is not available, and the nearest one is Juxian). The other method is to use the wea files of Chinese cities, which can be found by searching online. Convert these wea files to epw using Ecotect’s weather tool. To do this, open Ecotect’s weather tool, click File in the upper left corner, and select Save as to save the file as epw.

Here is the link to the Qingdao meteorological file Qingdao epw file. If you need files for other areas, you can send me an email.

Adjusting the Analysis Chart

The chart describes the following information:

  • Maximum temperature
  • Minimum temperature
  • Average temperature
  • Relative humidity
  • Wind speed
  • Solar radiation

Adjustment options are marked on the left side of the Grasshopper file. Simply adjust them based on your selections.

Beautification

Bake each option in the chart one by one and group them. Export as an Adobe Illustrator file. In Adobe Illustrator, you can continue to adjust colors and line styles and add relevant information such as units and locations.

Wind Rose

The wind rose chart component can extract wind environment information from epw files. Here’s the download link for the wind rose.gh.

Below is a preview.

Wind Rose Preview

Obtaining Meteorological Files

For wind rose charts, it is recommended to download meteorological files only from the EnergyPlus website because files converted by Ecotect may have issues.

How to Use

The wind rose chart component is straightforward to use, and here are the steps:

  1. Double-click on the Import epw file component’s false button to activate it to true.
  2. In the pop-up file manager, select the epw file you want to use.
  3. Adjust the Start Month and End Month sliders to specify the months you want to display on the wind rose.
  4. Use the Scale Factor, Grid Size, and Radius sliders to adjust the size of the wind rose. It’s recommended not to set these too high to avoid performance issues.
  5. Adjust the X-Axis Count and Y-Axis Count to change the arrangement of the wind roses.
  6. Use the Color Scheme slider to select color schemes from the Ladybug collection.
  7. Use the Swatch component to adjust the background color of the wind rose.
  8. Double-click on the Start Calculation component’s false button to activate it to true. Wait for a while, and you will see the generated wind roses in Rhino.

Site Elevation Map 1

The principle behind the first type of site elevation map is quite simple (so it might not look that great). It generates grid points on the terrain surface. The elevation is determined based on the z-axis coordinates of these grid points, and different colors are assigned accordingly. Here’s the download link for the site elevation 1.gh.

Here’s a preview image:

Site Elevation 1 Preview

Obtaining Terrain Data

Obtaining terrain data is relatively simple. Use SketchUp to add location information and import maps. Save in a lower version and then import it into Rhino. The downside is that the accuracy might be relatively low, but it’s sufficient for many cases.

How to Use the Component

  1. Right-click on the Terrain Surface component on the left and choose Set one surface. In Rhino, select the imported terrain surface.
  2. Adjust the density of elevation points using the X-Axis Grid Count, Y-Axis Grid Count, and Grid Size sliders.
  3. Set the Edge Thickness slider to 0 to display solid color blocks.
  4. In Rhino, use the ViewCapturetoFile command to save the elevation image.

Heatmap

The heatmap uses the ELK plugin to extract information from the map and generates different colors and sizes of hotspots based on proximity. To use the heatmap component, you’ll need to download and install the LunchBox and ELK plugins. You can find them on Food4Rhino. Here’s the download link for the heatmap.gh.

Here’s a preview image:

Heatmap Preview

How to Use the Component

  1. Right-click on the File Path component and choose Select one existing file. Locate the corresponding osm map file.
  2. Right-click on the OSM Data component on the right. In Feature type, select the type for which you want to generate hotspots.
  3. Right-click on the Range component and draw a rectangle in Rhino to define the analysis area.
  4. Adjust the hotspot density using the X-Axis Count and Y-Axis Count sliders.
  5. Adjust the line thickness of hotspots using the Circle Width slider.
  6. Use the Scale slider to control the size of the circles. Coordinate it with the two components mentioned above.
  7. Use the Gradient component to adjust colors.
  8. In Rhino, use the ViewCapturetoFile command to export the image for post-processing in Photoshop.

Site Rainwater Runoff

Site rainwater runoff mainly uses the Mosquito plugin. It simulates the movement trajectory of rainwater projected onto the site’s terrain surface from different points to simulate the flow of rainwater. Here’s the download link for the runoff.gh.

Here’s a preview image:

Runoff Preview

How to Use the Component

  1. Import the terrain as a surface into Rhino and select it.
  2. Open the GH file, right-click on the Surface component, and choose Set one surface.
  3. Adjust the accuracy of the simulation with the following two components. Keep in mind that higher values will slow down the simulation.
  4. Use the U Count and V Count sliders to adjust the density of rainfall points, simulating rainfall size.
  5. When adjusting parameters, make sure the SDivide component remains closed; otherwise, it might slow down the process significantly. Only open it after adjusting other parameters.
  6. In Rhino, use the ViewCapturetoFile command to export an image for further post-processing.

Sunlight Analysis

This component can be used as an alternative to Tianzheng’s sunlight analysis when creating technical drawings. It analyzes the sunlight hours.

Here’s the download link for sunlight analysis.

How to Use the Component

  1. Double-click on Import and select the epw file in the pop-up window.
  2. Set the north direction using vectors.
  3. For the date, it’s recommended to choose a date with the least sunlight, but standards may vary depending on the location.
  4. Calculations can overlap for objects and obstructions.
  5. Adjust the gridSize and disFromBase for calculation accuracy, but don’t set them too high, or it might become very slow. If you see a large area of the same color in the result, it means the accuracy is too low.
  6. The four buttons in the lower-left corner are used to adjust output details.
  7. Double-click on Start Calculation to initiate the process. The time it takes depends on accuracy and model size.

Some Additional Features

  • Vertical Tides
  • Fragmented Skin

Update

June 24, 2020

Nothing below this point…

Due to the excitement after submitting the graduation project, I accidentally deleted all the architectural data and forgot to upload it. I just remembered that I had an unfinished blog post… (Escape… ε=ε=ε=┏(゜ロ゜;)┛)