Tutorial 14a: 2D and 3D shape modeling

CityEngine 2025.0    |    |  

To access the tutorials in ArcGIS CityEngine, click Help > Download Tutorials and Examples. After choosing a tutorial or example, the project is automatically downloaded and added to your workspace.

Variety of drawn shapes in CityEngine

This tutorial walks you through the various manual shape drawing and editing techniques available in CityEngine for both 2D and 3D. Often, shapes are used as the input for procedural model generation, but you can also create more complex 3D shapes for visualizing context such as landmark buildings. The theme for this tutorial is set on footprint creation in the scale of urban blocks.

  • In the first part, you will draw footprints as 2D shapes with increased complexity.
  • In the second part, you will create massings as 3D shapes from the footprints.
  • In the third part, you will create a more complex massing using CGA. Then convert the 3D model to a static 3D shape and refine it using the shape drawing tools.

Create your first shape

To create your first shape, do the following:

  1. Expand the Tutorial_14a_2D_and_3D_Shape_Modeling tutorial folder in the Navigator window.
  2. Double-click the 14A_ShapeModeling.cej file in the scenes folder to open the scene in the Viewport window.

    Empty scene in the Viewport window

    The scene is an empty view from the top down with the grid-enabled size 10 meters. You will use this setup for the following steps to draw basic footprints without having to consider exact measurements every time.

    Tip:

    If you changed the camera position in the drawing process, press Shift+N or click the Start bookmark to reset the camera position to top down.

  3. Click the Polygonal Shape Creation tool Polygonal shape creation tool (S) on the toolbar and click the Rectangular Shape Creation tool Rectangular Shape Creation tool (Shift+S).

    Shape creation tools

    The Rectangular Shape Creation tool Rectangular Shape Creation tool is the fastest method to create a rectangular 2D shape in CityEngine. In total, only three clicks are needed. The first two define the axis and the length of the first side and the third defines the length of the second side. See Draw a rectangle for more information.

    Before you continue, double-check that all snapping options are turned on.

  4. Click the grid and move the mouse horizontally until four cells (approximately 40 meters) are covered. The orange dashed line visualizes the snapping to the global axes.

    Drawing the first edge of shape

  5. Click to create the second point.
  6. Move the mouse four cells vertically to the bottom until it snaps and the orange highlight around the preview is shown, indicating that a square of approximately 40 by 40 meters will be created.
  7. Click to create the third point, completing the shape creation.

    Finished shape

    After creation, the new shape is automatically selected.

    Created shape

There are four individual points at each corner. The points are referred to as vertices. A shape in CityEngine is made of at least three vertices or edges; the area between a closed set of vertices and edges is called a face. Single points, lines, or unclosed polylines are not supported.

Components of an object

Work with multiface shapes

Shapes can exist as a single polygon with only one face as detailed above, but they can also be composed of multiple polygons with multiple faces. In CityEngine, shapes with multiple faces are often used to represent 2D lots or 3D building models. For both cases, procedural CGA rules can be assigned as needed.

To draw a row house footprint as a shape with multiple faces, do the following:

  1. While still in the Rectangular Shape Creation tool Rectangular Shape Creation tool, create another square next to the previous one with the size of four cells.

    Two drawn shapes

  2. Add a second four cell sized square.

    To add it to the previously drawn shape, hover over one of the existing vertices and click to snap to one of the corners.

    Adding a third shape

  3. Repeat this one more time to finish your row house footprint.

    Shape repeated

  4. Another way to create multiple faces is by splitting a shape. Re-create the same shape from before using a different technique.
  5. First, create a rectangle with the size of 2 by 6 grid cells (approximately 20 by 60 meters).

    Creating one shape to match the three combined

  6. Add a 2 by 2 square to it, starting from the third cell.

    Add 2 by 2 square.

    The shape is now split into three faces and the faces can be selected individually.

  7. With the shape still selected, click the Select tool Select tool on the toolbar.

    2 by 2 square selected

  8. Hover over one of the faces and click again to select a single face.

    Component selection mode

    You are now in the component selection mode. With any additional click after the initial selection of the shape, you will select its underlying components: faces, edges, and vertices.

Great. You've now made two row houses.

Create a shape with a hole

Next, you'll create a footprint with a courtyard to the right of your row house.

  1. Click the Rectangular Shape Creation tool Rectangular Shape Creation tool and draw an 8 by 8 cell square.

    8 by 8 square drawn

    If you don’t want to count, you can check the Edge Length value in the rectangle tool options window; it is updated with the current length as you move your mouse. You can also use it to set it to a fixed length, but that will come later in the tutorial.

  2. Next, you'll carve out the inside.
  3. Add a second square inside the shape.

    Second square drawn

    Tip:

    You can get the same results using the Offset Shapes tool in the Shapes menu.

  4. The shape is now split into an outer and inner face. But, for your courtyard, you don’t need the inner face.
  5. Click the Select tool Select tool and select only the center shape.
  6. Press Delete to remove it.

    Shape with hole

    The inner face is removed. You now have a shape with a hole.

  7. To make the footprint a bit more interesting, divide it into two equal parts.

  8. Click the Polygonal Shape Creation tool Polygonal shape creation tool.
  9. Find the midpoint of the top edge by hovering along until the cursor snaps.

    The snapping is indicated by an orange X. Click to set the first point. Move the cursor to the bottom, and when the cursor snaps to the midpoint of the bottom edge, click again.

    Midpoint of shape with hole

    Shape with hole split

    This splits the shape into two faces. You will use this at a later point in the tutorial to create 3D massings with different heights for each face.

Draw more refined forms

You can also create shapes like the one above with the Polygonal Shape Creation tool Polygonal shape creation tool. Next, you will draw two L-shaped footprints.

  1. With the Polygonal Shape Creation tool Polygonal shape creation tool still active, start a new polygon next to the courtyard.

    With each click, an additional vertex gets added. You can finalize the polygon by clicking the start point or pressing Enter.

    L-shaped footprint

  2. Create a second L-shape but this time upside down.

    Multiple L-shaped footprints

  3. Until now, you created new shapes only. However, it is also possible to modify any shape by applying the move, scale, or rotate transformations.
  4. Assuming the right L-shape is still selected, switch to the Transform Rotate tool Rotate tool ( R) on the toolbar.
  5. Click and hold on the green axis ring and move it upward to rotate it slightly to the left.

    L-shaped footprint rotated

  6. Click the Transform Move tool Move tool (W).

    Multiple handles appear on the center of the selected shape. For more information on these transform tools, see Use transform tools.

  7. Drag along the blue arrow to move the shape upward along the z-axis until the top left vertex is aligned horizontally with the previous shapes.

    L-shaped footprint moved

  8. Next, you will align the shape again horizontally with the left L-shape on all corners. To do this, you can use guides. Guides are temporary lines set up to aid in creating consistent alignment across geometric compositions. In CityEngine, you can snap to guides when using the drawing and editing tools.
  9. Click the Guide Creation tool Guide creation tool.

    The easiest way to add guides is by double-clicking existing edges. Add five guides as shown in the following image:

    Guides created on L-shaped footprints

  10. Switch to the Transform Move tool Move tool and select the top left vertex using a left to right rectangular selection.

    Vertex selected

    Alternatively, you can click to select the shape first and select the vertex component with a second click.

    The handles, including the yellow disc from the Transform Move tool Move tool, appear at the position of the selected vertex.

    Selected vertex to move

  11. Drag the yellow disc handle until it snaps to the intersection between the previously created guides and release the mouse again to set the vertex to the new position.

    Yellow disc handle

  12. Repeat this for the other three corners to be aligned horizontally.

    Vertex moved to snap at intersection of guides

  13. Select the three guides on the right L-shape and press Delete to remove them again from the scene.

    Delete guides

    Make sure to keep the horizontal ones, as you will use them as a reference later.

  14. Now, you'll further adjust the right shape by adding another vertex to the longer edge on the inner side.
  15. Double-click the shape with the Polygonal Shape Creation tool Polygonal shape creation tool.
  16. Select the newly created vertex and drag it slightly to the right using the move tool.

    Vertex added to L-shape footprint

Constrain lengths and use the arc mode

The Polygonal Shape Creation tool Polygonal shape creation tool can be used for more than just drawing point after point. It allows the input of fixed lengths, and it has a sub mode for arc creation. Next, you'll use these features to draw a more precise L-shape with rounded corners.

  1. Before you start, hide the grid by unchecking it in the Visibility settings Visibility settings of the Viewport window or pressing D,G.

    Turn grid on and off

    You won't need it when working with exact numbers

  2. Start by creating two vertical guides 20 meters apart. Together with the two horizontal guides, they are used as a boundary when drawing the L-shape with rounded corners.
  3. Click the Guide Creation tool Guide creation tool and click the leftmost edge of the unrotated L-shape and drag it to the right.

    To be exact, define an offset in the tool options. The two guides should be 20 meters apart. If you followed along, it will be 100 meters for the first and 120 meters for the second guide.

    Guide Creation Tool offset

    Tip:

    Press Tab to directly jump into the offset input field and type the distance. Lock the value by pressing Enter.

    Guides created with offset

  4. Click the Polygonal Shape Creation tool Polygonal shape creation tool and set the first point at the intersection of the top horizontal and left vertical guide.
  5. Set the length to 70 meters.
  6. Click again to add the second point.

    Use guides to create shape

  7. Turn on the Arc Mode toggle button or press A and move the cursor down and right until it snaps to the bottom horizontal guide.

    Change the resolution to 20 using the scroll wheel or by entering it in the box next to the Arc Mode toggle button.

    Arc Mode

    The resolution controls the number of points or lines used to form an arc. The lower the value, the more round the arc will look. Click to add the points.

    Create arc

  8. Turn off the Arc Mode toggle button and set the length of the next edge to 70 meters.

    Click again to create the next point.

    Segment after turning Arc Mode off

  9. Create one point upward with the length 20 meters and one back to the left with 55 meters.

    Create shape with combined arc

  10. For the inner corner, zoom in slightly and turn on the Arc Mode toggle button again.
  11. Set the resolution to 25 and click while snapping to the right vertical guide.

    Create inner arc

  12. Zoom out again and add the next point at the top where the horizontal and vertical guides intersect.

    Segment at guides intersection

  13. Finish the drawing by pressing Enter or by clicking the first point.

    Finished shape

  14. Remove the two guides again.

    Guides removed

  15. Next, create the same shape but flipped. Instead of going through the full drawing process again, you can copy the shape and rotate it by 180 degrees.
  16. Select the shape and switch to the Transform Move tool Move tool.

    Turn on the Copy on Move toggle button.

  17. Move it to the right by dragging the red arrow.

    Copy shape

  18. Turn off the Copy on Move toggle button.
  19. Click the Transform Rotate tool Rotate tool and rotate the copy 180 degrees using the green handle or by typing the value in the respective axis input box.

    Rotate copied shape

  20. Move it back using the yellow disc handle of the Transform Move tool Move tool until both shapes overlap.

    Overlap shapes

You have now created a footprint with overlapping shapes. However, this is not ideal because two shapes occupying the same space in CityEngine can result in z-fighting. In the next chapter, you will look at different ways to transform the overlapping shapes into something more useful.

Shape editing tools

You can use the tools and commands in the Shapes menu to edit shapes. Next, you will explore the following tools: Union Shapes, Subtract Shapes, and Separate Faces.

  1. Select the overlapping shapes and create two copies below along the z-axis.

    Copied overlapping shapes

  2. Select the shapes of the first copy and click Shapes > Union Shapes in the main menu.

    Shapes before union

    A single face shape is created with all the edges in between removed.

    Shape after union

  3. Select both shapes of the second copy and click Shapes > Subtract Shapes from the main menu.

    Selected shapes before subtraction

    Now, you have one L-shape cutting through the other L-shape, which is split into three faces. To determine which shape gets subtracted from the other(s), the lead selection is used.

    Shapes after subtraction

  4. Another option available is to separate the faces into individual shapes.
  5. To illustrate this, copy the previously subtracted shapes and click Shapes > Separate Faces from the main menu.

    Shapes before separating

    The previous multiface shape is now split into separate shapes for each face.

  6. Move all the new shapes slightly apart.

    Shapes moved apart

Note:

It’s also possible to combine multiple separate shapes into a single shape using the Combine Shapes tool. The tool also works for shapes which are not connected.

Model 3D shapes manually

The next part of this tutorial uses the Push Pull tool Push Pull tool. You will use the Push Pull tool to manually model 3D building massings out of your drawn 2D footprints.

The Push Pull tool Push Pull tool manipulates the shapes directly, so it’s good practice to have your original footprints backed up. Copying all the shapes to a different layer is one way to do this, but for this tutorial, you can duplicate the existing scenario.

  1. Right-click Scenario 1 in the Scene Editor window and choose Duplicate.

    Duplicate scenario

  2. On the dialog box, change the name to 3D shapes and click OK.

    Duplicate scenario dialog box

    Nothing changed except the newly created scenario is selected in the Navigator window and Viewport window.

  3. Click the Push Pull tool Push Pull tool and hover over one of the previously moved shapes.

    The shape or face which is available for action is highlighted with an orange outline. Additionally, an orange ball appears in the center. The Push Pull tool Push Pull tool does not work in top-down view, so before proceeding, tilt the view slightly by pressing Alt while clicking and drag.

    Push Pull tool before extrusion

  4. To extrude the shape, click the orange ball and drag it upward.

    The geometry is immediately updated.

    Extruded shape

  5. Continue with extruding the other variations above.

    When snapping is enabled (default), the extrusion snaps to other faces at the same height, marking them in orange. The difference between the edited shapes gets more visible after the extrusion.

    Additional shapes extruded

    Extruded overlapping shapes

  6. Continue to extrude all the previously drawn footprints.

    You can create your own heights.

    Extruded U-shaped footprints

    All footprints extruded

You have successfully modeled a variety of building massings.

Force the creation of new shapes

Previously, you learned when drawing shapes on top of existing shapes, it gets added as a new face to that shape. As this behavior is not always what you want, the shape creation tools have an option to force the creation of a separate shape. Next, you will look at an example of using the shape creation tools to force a new shape.

  1. Create two adjacent rectangles with 60 by 20 meters and 40 by 20 meters as arranged in the following image:

    Create adjacent rectangles

  2. Remove the inner edge using the Union Shapes tool in the Shapes menu.
  3. Turn on the Force New Shape toggle button.

    Use Force New Shape tool

    Draw a 20-meter square starting from the inner corner.

    New shape created after

    As indicated by the change of the selection, a separate shape is created.

  4. Create another adjacent square at the bottom.

    Rectangle created at bottom

  5. Next, scale down the corner shape.
  6. Select the shape and click the Transform Scale tool Scale tool (E).

    Scale square

    With this tool, you can scale in any direction or maintain uniform proportions using the handles or by setting a value in the tool options. The scaling is applied based on the center position of the handle. In this case, however, you want to scale it based on the position of the top left vertex.

  7. Turn on the Adjust Position and Orientation toggle button and click the vertex in the upper left corner to move the handle position to the new location.

    Adjust Position and Orientation tool

  8. Turn off the Adjust Position and Orientation toggle button and scale the shape based on the new position.

    Scale corner

  9. Type 75 in one of the three axis input boxes and press Enter.

    Scale 75 percent

    The shape is now smaller.

  10. Next, you will move the first square back to the new inner corner position.
  11. Select the square and click the Transform Move tool Move tool.

    Again, adjust the handle position to the top left of the square and move it onto the inner corner using the orange ball.

    Handle position adjusted before move

  12. Select the bottom edge of the corner shape and move it to the upper edge of the bottom square shape.

    Move shape to intersect with another one

    For exact snapping, you need to adjust the position of the handle again to the left vertex of the edge and drag it using the orange ball until it snaps to the top left vertex of the square shape.

  13. Next, you will use both the Transform Move and Transform Rotate tools to finalize this block.
  14. Create a copy of the three shapes and flip them.

    Shapes copied and rotated

    Align them to the top horizontal guide.

    Selected shapes aligned to guide

  15. Extrude its parts individually using the Push Pull tool Push Pull tool.

    Keep the corner shapes a bit lower and make the square shapes higher so that you get towers and L-bars as shown in the following image:

    Extrude towers and L-bars

  16. To align the heights of the towers temporarily, create a guide from your reference edge.

    Align towers

    This allows you to extrude to match positions without measuring and using a fixed distance.

  17. Drag on the inner edges of the inner towers to customize the shapes further.

    To make the top narrower, move in the opposite direction of the orange arrow.

    Create a pyramid

    You can change the extruded height later.

  18. Drag along the blue arrow axis to extrude along nonrectangular angles.

    Extrude at nonrectangular angles

    Finished extruded shapes

Convert CGA models to shapes

Another way to create 3D buildings is to import models created in a different 3D modeling app and import them as static models or to create models procedurally using CGA.

Next, you will look at how you can further customize such models using the built-in shape modeling tools.

  1. Create an 80 by 80-meter shape using the grid or tool options.

    80 by 80 shape

  2. Next, you'll assign the Simple_Tower.cga rule file, located in the rules/Components/Massing/Point_Block folder in the ESRI.lib project, to the shape.
  3. Drag the .cga file onto the shape to create a tower massing.

    Assign tower massing rule

    Tower after rule applied

    ESRI.lib comes with a variety of rules for mass creation.

  4. Refine the model by changing some of the attributes in the Inspector window.

    Set the Height attribute to 60 meters, the Shape attribute to Amoeba, and the Position attribute to Center-Center.

    Set tower shape to Amoeba

  5. With the model still selected, click Shapes > Convert Models to Shapes in the main menu.

    Convert Models to Shapes

    This tool transforms the procedurally generated 3D model into a static 3D shape (you can think of it as a snapshot of the current 3D model).

    Model after converting to shape

    The model is now editable using all techniques that were previously addressed in this tutorial, but it can no longer be controlled through the attributes in the Inspector window.

  6. Delete the faces at the bottom, as you no longer need them.

    Delete faces

    Model with faces deleted

  7. Switch to the Circular Shape Creation tool Circular Shape Creation tool (Shift+C).

    It works very similar to the Rectangular Shape Creation tool, except you only need to define the starting point and the radius. With the Segments tool option, you can control the number of edges of the circle. The preview updates immediately. Valid numbers are between 3 (triangle) and 72 (very round circle).

  8. Set the Segments value to 24.
  9. Before you start drawing the circle, turn off the Force New Shapes toggle button.
  10. Click the center of the bottom of the amoeba roof and drag the mouse outward until there is only a smaller border remaining.

    Circle created on top of model

    You can press Esc to reset to the initial position of your starting point.

  11. Click again and the circle is added to the top face.

    Circle added to model

  12. You'll do something similar for the upper part. But, here the form is not as round as in the lower part.
  13. Use the Polygonal Shape Creation tool Polygonal shape creation tool with the Arc Mode toggle button turned on to trace along with a slight inset.

    Creating arc on the model

  14. Adjust the segments and the distance as needed on the fly.

    Adjust segments of arc

    After each click, you can see the additional points added. To adjust the segment count or the tangent, use the blue handle. Press Ctrl+Z to undo the points at any time.

  15. Press Enter or click the starting point to add the face to the top.

    Finished arc

  16. Deselect the shape and switch to the Push Pull tool Push Pull tool, hover over the circle face, and click the orange ball and drag downward.

    Use Push Pull tool to create a hole in model

  17. Extrude the freeform face upward.

    Model with circle extruded upward

As a final step, you now can view your footprints and their potential 3D representation by switching between scenarios 1 and 2.

Final models from footprints

2D footprint shapes

In this tutorial, you learned how to do the following:

  • Use different drawing techniques for 2D shapes.
  • Edit shapes.
  • Create 3D shapes from 2D shapes.
  • Convert CGA models to 3D shapes.

To continue your learning with CityEngine, see the complete CityEngine tutorial catalog.