BIM World
A Professional BIM Learning Platform


BIM Q&A: How Does Grasshopper Quickly Generate Terrain? Find Out Here!

This article is brought to you by the official account: ACND STUDIOS.

Overview

This guide explains how to quickly generate terrain models in Grasshopper using CAD elevation points and elevation data.

Required files: CAD terrain files

Required software: Rhino, Grasshopper

Plugins: Human, Weaverbird, Meshtools, Meshedit (can be downloaded from the Food4Rhino website or the official plugin sites)

1. Initial Setup

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 1:

Import the CAD terrain file into Rhino. If the import fails or data is missing, convert the CAD file to an earlier version or use Tianzheng to convert to T3 format before importing. We only need elevation points and their corresponding elevation text data. Use the group command to separately group the elevation numbers and point selections. It’s recommended to copy these two groups into a separate Rhino file to avoid conflicts when selecting text later on.

Ensure each elevation point corresponds to one elevation text. Some CAD drawings may have incomplete or duplicated data. Use Rhino’s SelDup command to find duplicate objects, and SelPt and SelText to quickly select points and text respectively. If your data is organized in layers, use SelLayer to select by layer.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

2. Terrain Generation

2.1 Data Extraction

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.1:

In this example, the CAD elevation points are circular shapes. We need to import all these circular curves into Grasshopper and calculate their centers. Note that elevation points or numbers are often grouped into blocks in CAD; remember to explode these blocks before working in Grasshopper.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.1 (continued):

Use the Dynamic Geometry Pipeline component from the Human plugin to import text objects from Rhino into Grasshopper. This component allows you to filter objects by layer, type, or name. Here, we use the selection filter option. Initially, the output geometry is text without data, so use the Text Object Info component to extract details such as the text plane, content, and size.

2.2 Matching Elevation Points to Text

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.2:

Since the previous step simply collected all circles and text without order, the points and texts don’t correspond correctly. To fix this, use the Closest Point component to find the nearest text to each circle’s center.

This step may require a moment to understand. Each circle’s center point should be placed in a separate group (or “bag”), while the text points remain in a flat list. This setup ensures each center point finds its closest matching text point correctly. If both inputs were flat lists, the matching would fail.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.2 (continued):

Using the Closest Point component provides the index of the nearest text for each circle center. Use these indices with the List Item component to extract matching text from the list. Make sure the circle centers and text share the same list structure to synchronize them properly.

Note: The List Item input here is text objects (not planes), because the order of planes matches that of the text, and we ultimately need the text data. Essentially, this step reorders the text to align with the circle centers.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.2 (validation):

If you want to verify results, randomly select points using List Item and middle-click the component to zoom in and check if the matched data corresponds correctly to the original list.

2.3 Creating the Terrain Surface

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.3:

Use the Move component combined with a Z-axis vector to raise the elevation points according to their elevation values.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 2.3 (continued):

Generate faces using the Delaunay Mesh component. If the mesh faces appear too sharp, the Weaverbird plugin’s Subdivision component can be used to smooth them.

3. Final Touches

3.1 Contour Lines

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 3.1:

Similar to the Contour command in Rhino, start by creating an external bounding box around the terrain using the BoundingBox component. Explode the box to get the center point of each face, then decompose these points into X, Y, and Z coordinates.

Sort the Z coordinates using the Sort List component, connecting the initial area center point to the value input. This sorts the center points from lowest to highest based on elevation. The first point from the sorted list is the lowest elevation.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 3.1 (continued):

Use the Contour component to generate contour lines across the surface at your specified elevation intervals, enabling you to analyze the terrain slope.

3.2 Color Mapping

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 3.2:

Use the Face Boundaries component to visualize the subdivided mesh by exploding the output from the Subdivision step.

BIM Q&A | How does Grasshopper quickly generate terrain? Click in to tell you!

Step 3.2 (continued):

Apply gradient coloring based on the Z-coordinate of each mesh face’s center point. This helps visualize the elevation distribution across the terrain model.

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » BIM Q&A: How Does Grasshopper Quickly Generate Terrain? Find Out Here!

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up