Tutorial 14b: Advanced polygonal modeling

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

Create footprint and extrude

  1. Double-click the 14B_Advanced_01.cej scene in the Navigator.
  2. Select the Polygonal Shape Creation (S) tool Polygonal shape creation tool, and click to set the first point.

    First point using the polygonal shape creation tool

    Note:

    While moving the line, the Tool options Polygonal Shape Creation tool options displays the length of the line. Also, you can set snapping, arc, and planar options in the tool options window.

    Tool options edge length

  3. To set the length of the line to 11, press the Tab key, enter the length in the Edge Length field, and press Enter.

    Set length to 11 m

    The line turns magenta to indicate its a fixed length.

  4. Move the fixed segment to snap to the global axes.

    Second point using the polygonal shape creation tool

  5. Click to set the second point.
  6. For the third point, type 9 and press Enter.

    Third point using the polygonal shape creation tool

    To remove the fixed length, press Esc.

  7. For the next few points, you won't set fixed lengths. Snap to the 90 degrees highlights and create custom lengths.

    Snap to 90 degree lines

  8. To set the last point, click the first point, double-click, or press Enter to finish the shape.

    Final point at the intersection of two snapping lines

  9. You can now perform some fine tuning of the lines. Click the Transform Move (W) tool Move tool and select the edge you want to transform.
    Adjustment handel on the polygon
  10. Drag the blue handle to the location you want for the edge.
    Note:

    Each colored arrows move the edge in a different direction.

Extrusions

  1. Now you can create a 3D shape. Click the Push Pull Tool (P)Push Pull Tool and hover over the polygon.

    Hover to extrude shape

  2. Drag the orange handle and release to finish the 3D shape.

    Drag the orange handle up and release to finish the 3D shape

  3. Hover over the front edge until you see the highlight for the midpoint snapping.

    Cross indicates the midpoint snap

  4. Click to start the segment, and when it snaps perpendicularly to the edge, click to finish.

    Snap on opposite edge of a parallel snap

  5. You can now use the edge handle to drag the edge to create a slanted roof . Hover over the edge and drag the orange handle.

    Handles for the roof for two directions use green to finish the roof

    A reference scene of this can be found in 14_B_Advanced_02.cej.

  6. Drag the green arrow on the back edge to make the roof flatter.

    Drag on the edge to adjust for a flatter roof

    Different colored arrows allow you to extrude the shape in different directions. You can switch between the directions by hovering over the arrow while dragging the edge.

  7. Modify the 3D shape. Hover over the side polygon, and drag the green handle. Again, there are multiple arrows for different directions.

    Green arrow drags parallel to the ground plane and creates a new top polygon

    The colored arrows have different behavior. The green drags parallel to the ground plane and creates a new top polygon.

    blue arrow drags along existing edges without creating a new polygon

    The blue arrow drags along existing edges without creating a new polygon. Both types can be very useful depending on the shape you want to create.

  8. Use the Polygonal Shape Creation (S) tool Polygonal shape creation tool or the Rectangular Shape Creation (Shift+S) Rectangle tool tools to draw a balcony to be extruded. Create a balcony by drawing a rectangle.

    Create balconies with the rectangle tool

  9. Hover over the new polygon and drag the handle.

    Drag the handle in and out to snap to a point

  10. Click the Polygonal Shape Creation (S) tool Polygonal shape creation tool to create a polygon to extrude the wall.
  11. Now drag out the new polygon.

    Create and drag out a new polygon

  12. To inset the balcony, create two segments snapping to the side walls.

    Snapping lines to create the new balcony

  13. Drag the handle of the balcony floor down.

    Drag the balcony floor down to finish

    The balcony is now finished.

  14. Rotate the camera to the back.
  15. To create another balcony, click the Rectangular Shape Creation (Shift+S) tool Rectangle tool and create a rectangle on the wall.

    Create a balcony on the back wall

  16. Drag the balcony out and draw a rectangle on the top.

    Create a rectangle on top of the new balcony

  17. Drag the floor down.

    Drag the floor down

    A reference scene of this can be found in 14_B_Advanced_03.cej.

    Tip:

    Use guides for increased precision when dragging edges and faces.

Make a overhanging roof

The basic shape is now ready, let’s create a nicer roof.

  1. Drag the green arrow up to separate the roof from the building.

    Modify the roof by editing using the Control key

    Press the Ctrl key to insert edges along the initial positions. For now, make the roof thick for easier editing, then you can make it thinner later.

  2. Do the same for the other polygon. When dragging, snap to the first polygon.

    Modify the other roof polygon and snap to the first polygon

    A reference scene of this can be found in 14_B_Advanced_04.cej.

  3. Drag the sides to make it overhang.

    Overhang created by dragging out the sides

  4. Drag the second face until it snaps to the other face.

    Drag a second face until it snaps

  5. Do the same for the other side of the roof until it looks like this:

  6. Drag additional faces but stop before they snap to the overhang faces.

  7. Drag the last face until in snaps to the previous face.

    Continue to drag a third and fourth face to shape the building

  8. Rotate the camera to get a nice view on the side.
  9. Drag the side roof face down with the blue arrow.

    Green and blue arrows indicate the direction, use blue in this instance

  10. Repeat on the other side.

    Repeat on opposite side using the blue arrow

  11. Finally, go to the back, and drag out both roof faces.

    Adjust both faces by dragging out

    A reference scene of this can be found in 14_B_Advanced_05.cej.

  12. When you rotate to the front again, note that a few extra, unnecessary lines are now on the roof. To clean this, click the Select tool Select tool to select the whole building.
  13. Click the Cleanup shapes tool Cleanup shapes.

    Use the cleanup shape tool to remove unnecessary lines on the roof

  14. Keep the defaults as they are and click Finish.

    Cleanup Shape dialog box

    Most of the lines are now gone. You may have to use this tool twice to remove all lines.

    A reference scene of this can be found in 14_B_Advanced_06.cej.

Modify roofs, windows, and doors

  1. Make the roof thinner: To move multiple polygons at once, use the standard selection and the transform tools.
  2. Select the first polygon with the Select tool Select tool. Press Ctrl and click the second polygon.
  3. Click the Transform Move (W) tool Move tool and drag along the green arrow.

    Standard selection and the transform tools are used to make the roof thinner

  4. You can now fine-tune the building by dragging planes using the Push Pull Tool (P) Push Pull Tool.

    Fine-tune the building by dragging planes using the arrows of the polygonal tool

    Fine-tune the building by dragging planes using the blue arrow to keep the roof attached

    A reference scene of this can be found in 14_B_Advanced_07.cej.

  5. Start decorating the building. Draw two rectangles for the windows.

    Create windows using the rectangle tool

  6. Click the Push Pull Tool (P) Push Pull Tool to drag rectangles inwards.

    Use the arrows to drag in or out

  7. Now create two doors. Rotate and zoom the camera a bit to get a clear view.

    Create the first door on the bottom level

    Create the second door on the balcony

  8. Rotate the building, create a back window, and drag the window frame.

    Rotate the building and create more windows

  9. Rotate and drag out the roof along the green arrow. This creates an open garage.

    Create the garage roof

  10. To create columns, first rotate down. Draw two rectangles, and drag them down to the ground.

    Create the support columns for the roof of the open garage

    A reference scene of this can be found in 14_B_Advanced_08.cej.

Texturing

Let us add some textures.

  1. Click the Select tool Select tool to select the whole house.
  2. Click the Texture shapes tool Texture shapes.
  3. Click Browse, select wall_white.png in the \assets folder of the tutorial.

    Shape Texture Tool dialog boxes

  4. To get a uniform look, select Mode > Dimensions.

    The numbers indicate how large the texture is in meters.

  5. Enter 10 for both values and click Assign.

    Mode set to Dimensions for uniform texture

  6. Texture the roof now. Select all roof polygons with the Select tool Select tool. Press Ctrl while clicking the other polygons to select all of them.
  7. Pick the roof texture in the Texture shapes tool Texture shapes dialog and click Assign.

    Roof polygons selected to pick the roof texture

  8. Let’s now texture the doors and windows. Click the Select tool Select tool to select the two windows.
  9. In the Texture shapes tool Texture shapes select the window.png file.
  10. Set the mode to Stretch to polygon and click Assign.

    Window texture set to Stretch to polygon

  11. Select the two doors, choose the door.png texture file, and click Assign.

    Select both doors then pick the texture

  12. Rotate to the back, select the windows, choose the window.png texture file , and click Assign.

    It is now stretched even more.

  13. Enter 4 for Horizontal repetitions and click Assign again.

    For window texture adjustments set to 4 at Horizontal repetitions to minimize stretch

  14. To add a chimney, draw a rectangle on the roof. Drag it up along the green arrow.

    Add a chimney by drawing a rectangle on the roof and drag up with the green arrow

  15. Now drag the back edge down along the green arrow until it snaps to the front edge.

    Chimney completed by dragging the back edge along the green arrow and snap to front edge

  16. Select all the faces of the chimney.
  17. Select the wall_concrete_6.png texture file, set the Dimensions option to 10, an click Assign.

    Add concrete texture, with a dimension of 10, to the chimney

  18. Next, add a dormer. Draw a rectangle, and drag it up.
  19. Drag the back edge down until it snaps.

    Create a dormer on the roof with the rectangle tool

  20. Texture the sides.
  21. Draw a window on the front as you did above.

    Create a window on the front of the dormer

    The house is now finished. You can still fine-tune the parts such as making the chimney smaller.

    Completed house can still be adjusted on the various parts, the chimney is being made smaller

    A reference scene of this can be found in 14_B_Advanced_09.cej.

    Tip:
    Use the shaded mode (View settings > Shaded) when editing textured shapes to better see the drawing highlights.