[032] How to Create 3D Volumes Using Extrude in Esri CityEngine
Understand the extrude command to transform flat 2D shapes into 3D building volumes with precise control over verticality and roof flatness.
This tutorial marks the transition from 2D procedural modeling to 3D space in CityEngine. You will learn the syntax of the extrude command, how to handle extrusions on sloped surfaces using world coordinates, and how to ensure building rooftops remain perfectly level regardless of terrain inclination.
Recommended Audience: Beginners in CGA modeling and GIS professionals looking to generate basic building masses from footprint data.
We are finally moving from planes to 3D volumes.
While the transition to 3D might seem like the most critical topic to cover, it is actually one of the simplest commands in CGA, with almost no complex parameters to manage.
The syntax is as follows:
Syntax
extrude (distance)
extrude (extrusionType, distance)
Reference: CityEngine CGA Extrude Documentation
Simply inputting a height value will automatically raise the shape by that specific distance. I will explain a few points to be careful about and then wrap up.
Take a look at the image below.
In this scene, one face is standing vertically, one is flat on the ground plane, and another is tilted at an angle. Let's give each object a height value of 50m and extrude them.
Lot --> extrude (50)
The syntax is straightforward. Let's examine the results.
As you can see, the objects protruded in the perpendicular direction of the face—more precisely, along the face normal. The one on the right extruded at an angle, much like the Leaning Tower of Pisa.
Performing an extrusion by only providing a height value without an
extrusionType means that face.normal is applied by
default.
So, how do we make even a tilted shape extrude vertically upward?
You can enter world.up for the extrusionType as
shown below.
Lot --> extrude (world.up, 50)
And the result?
Yes, the objects have risen vertically regardless of the shape's inclination. The object on the far left simply shifted upward without forming a meaningful solid volume. The one on the right rose vertically, but the original slope of the shape was maintained at the top.
However, in a typical building, the top of the building doesn't usually slope just because the terrain is inclined. We need to "trim" the top to be flat.
Lot --> extrude (world.up.flatTop, 50)
You can achieve this by entering world.up.flatTop as the
extrusionType.
The results:
Indeed, the top has become flat. The flatTop height is determined relative to the lowest vertex of the original shape. For both the left and right examples, the height was capped at the 50m line relative to that lowest point.
This covers most of what is used in actual professional practice. It's quite simple, isn't it?
While there are other extrusion types like face.normal and
vertex.normal, you can easily understand them by looking at the
diagrams in the
CGA reference without further explanation.
This concludes the overview of the extrude command.
Next, we will cover comp (Component Split), which is used just as
frequently as split in CGA.
- Learn previous workflow in [031] How to Create Nested Split Structures in Esri CityEngine
- Continue learning with [033] How to Use the Comp Command in Esri CityEngine for Component-Based Modeling
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)