tutorial 2: terrain and dynamic city...

22
Tutorial 2: Terrain and Dynamic City Layouts Copyright © 1995-2015 Esri. All rights reserved.

Upload: others

Post on 22-Apr-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Tutorial 2: Terrain andDynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved.

Page 2: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Table of ContentsTutorial 2: Terrain and dynamic city layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 2

Page 3: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Tutorial 2: Terrain and dynamic city layoutsDownload items

• Tutorial data

• Tutorial PDF

Create a terrain

Typically, the starting point of a CityEngine scene is the creation of a terrain. Terrains can be created from simple image files or fromDigital Elevation Models (DEMs). In the latter case—for example, with a GEOTif file—the georeferencing information is supported.

Currently, CityEngine only supports image-based terrains (gray scale height maps); it does not support 3D meshes. If you only have a3D mesh, or any other data type, you need to convert it to a heightmap using a tool such as Leveller by Daylong Graphics(http://www.daylongraphics.com/).

Steps:

1. Open the Terrain_Creation_Start.cej file.

2. Open the maps folder, and drag and drop the elevation.jpg image into the viewport.The Terrain Import dialog box appears.

3. Choose the Raw data (no projection) coordinate system option.

4. Change the Texture file to the topo.png file using the Browse button.

5. Edit the bounds so the dialog box looks like the following screen shot.If you load an image without geolocation information, its pixel resolution is set as the terrain dimensions.

Notice the Keep ratio and Alignment buttons (default value is centered; edit by clicking the icon).

6. Edit the min and max elevation values (= black and white pixel value elevations), and click Finish.

Once the terrain map layer is created, you can select it in the Scene Editor and see its attributes in the Inspector window.

Note: You can edit the Terrain Resolution (the number of subdivisions of the terrain plane) and theWireframe Alpha values. The latter shows the wireframe lines on the terrain, if, in theviewport’s display options, the Wireframe on Shaded/Textured option is activated (toggle with7).

7. Explore the terrain’s attributes.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 3

Page 4: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Grow streets–Heightmap and Obstaclemap

Grow streets–Alignment to the terrain

In Tutorial 1, you learned how to grow streets on a flat grid with no elevation present. You'll now use the Grow Streets algorithm todirectly adapt the grown streets to the actual terrain elevation.

Steps:

1. Open the Grow Streets dialog box, and expand Environment Settings.

2. Change the Heightmap drop-down option to your terrain’s name.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 4

Page 5: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

3. Grow some streets, and see how they automatically align to the terrain.

Grow streets–Obstaclemap

You may have noticed that the Grow Streets functionality grows streets randomly. This includes areas where you may want to haveno streets at all. To allow you to leave those areas empty and minimize the manual cleanup process, CityEngine has anObstacleMap feature. An obstacle map is a black and white image, where the brightness defines the growable regions. To create anobstacle map, complete the following steps:

Steps:

1. Delete your previously generated streets.

2. Click Layer > New Map Layer > Obstacle.

3. Browse to the obstacles.png image file provided in the tutorial maps folder.

4. Define the same extent as your terrain’s extent.

5. Leave the channel on brightness.

6. The Obstacle Threshold defines the image brightness, which distinguishes between obstacle and non obstacle.

Once the Obstacle layer is created, select it and check its Layer Attributes tab in the Inspector. You'll find the following code,which determines the attribute mapping, in this case as a Boolean value (true/false):

attr obstacle = brightness < 0.5

Steps:

1. Hide the Obstacle Layer in the Scene Editor so it does not interfere visually with the terrain.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 5

Page 6: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

2. Open the Grow Streets dialog box again and assign the obstacle map.

3. Grow again.

Notice how the streets try to avoid the black areas of the image.

4. To grow more streets in specific regions, select some existing graph segments before growing more streets.

Streets–Cleanup Graph tool

Under certain circumstances, CityEngine’s Dynamic City Layouts system may not be able to solve a conflicting part of the streetnetwork as proper shapes. In that case, CityEngine highlights the conflicting graph segments in red.

To solve this, you can manually fix the issues by editing street widths, curve radii, or other parameters, but this can be tedious work. Ashortcut is to use the Cleanup Graph tool.

Steps:

1. Find a conflicting graph segment (or create one).

2. Select the objects around the conflicting region. It doesn't matter if shapes or other object types are also selected.

3. Click the Cleanup Graph tool on the toolbar.The Cleanup Graph dialog box appears.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 6

Page 7: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

4. Explore the settings, and read the Cleanup Graph tool documentation in the help.

5. Your network is now cleaned up, similar to the following screen shot:

Align objects

In reality, streets usually follow the surface of the terrain or where buildings are placed on the terrain. It’s rare that newly-created objectsin a scene are directly aligned properly—for example, after importing 2D GIS data—so specific alignment tools are a necessity.CityEngine provides a series of commands to align certain object types to others.

The common alignment types are shown in the following table:

Object Alignment type Example

Graph segments > Terrain Projects street segments onto the terrain

Static shapes * > Terrain Projects footprint shapes onto the terrain

Terrain > Shapes Aligns the terrain to shapes (street bank, etc.)

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 7

Page 8: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Note: *Shapes that are manually drawn or imported are called static shapes. CityEngine’s own system to createshapes—Dynamic City Layouts—creates shapes dynamically, thus they’re called dynamic shapes. Animportant detail is that dynamic shapes cannot be aligned with the alignment tools. Since dynamic shapesare created as children of (dynamic) blocks (the same is true for streets), the Block Subdivisionparameters contain a specific parameter for the alignment. Additional information about BlockSubdivision can be found in the following section in this tutorial.

Steps:

1. Select all graph segments in your scene.

2. Click the Align Graph to Terrain button on the toolbar.

3. Choose your terrain as the Heightmap.

4. Add an offset of 0.2.

5. Click Finish.

Note that not a lot is going to change since the streets were already aligned.

Depending on your terrain, you may need to adapt the Maximal raise distance value.

For more information on the settings, see the manual in the Help Menu F1.

In this scene, there are no static shapes, so continue to align the terrain to the shapes you already have.

Steps:

1. Select all the shapes in your scene (it doesn't matter if you also have graph segments selected).

2. Click the Align Terrain to Shapes button on the toolbar.

Notice how your terrain was adapted. The differences may not be very prominent depending on your terrain. For a strongereffect, edit the terrain’s maximum height.

3. Open the terrain’s Layer Attributes in the Inspector.

4. Toggle the Enable elevationDelta check box a few times.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 8

Page 9: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Notice how the terrain switches back and forth between the unaligned and aligned state. This means that somehow thealignment data (the elevationDelta) must have been stored.

5. Save your scene.

6. Refresh the project’s data folder. (For example, right-click the folder, and use refresh from the context menu).The data folder now contains a new folder that carries the same name as the scene file. This folder and the deltaMap donot exist unless you save your scene after the first terrain alignment.

The (16 bit) delta map that stores the changes (Grey = no change; Black = lower; White = higher) is shown in the followingimage. The image may look quite different in your example.

Dynamic city layouts

Object types

Dynamic City Layouts is a set of tools and functionalities that allow you to quickly create city layouts. The result is a series ofshapes, ready for use with CGA rules to create 3D models. The main elements are streets and blocks. Blocks are created if the streetcenter lines physically enclose an area (and the network is cleanly connected). Blocks are represented with a dashed line, which youcan select.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 9

Page 10: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Both street segments and blocks have individual parameters that drive the creation of their children, the dynamic shapes.

When you explore the streets you've grown so far, you'll find that there are three selectable object types whose parameters drive andinfluence the shape creation: graph segments, graph nodes, and blocks.

Graph segments

Graph nodes

Graph nodes are the "ends" of a graph segment.

Blocks

Common to all three object types is the shapeCreation parameter, which lets you determine whether or not those specific objecttypes can produce shapes. For example, you may want to get street shapes, but no subdivision, in the blocks. Again, dynamic shapesare the result of the shape creation of graph segments, graph nodes, and blocks.

You are now ready to do the following:

• Explore all the parameters of the different object types.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 10

Page 11: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Create some roundabouts, and edit their radii.

• Create some cul-de-sacs.

You'll now focus on the Block Subdivision. Each Subdivision Algorithm has its own parameters and creates a specific pattern.

Note: Shape Creation is a purely interactive task, using Dynamic City Layouts. Shape Creation and BlockSubdivision are tasks that have nothing to do with CityEngine’s rule system (CGA). The shapes mustfirst exist (be created) before a CGA rule can be assigned to the shapes for the final generation of the 3Dmodels.Nevertheless, there is the option to subdivide a full block shape (or any other parcel shape) using CGA.

Streets–Create

In addition to the option of importing graph segments, CityEngine provides two tools on the toolbar dedicated to the creation of streetgraphs: the Freehand Street Creation and Polygonal Street Creation tools.

Steps:

1. Use both tools to draw some streets.

2. Go to Graph > Street Creation Settings.The Street Creation Settings dialog box appears. This dialog box lets you define your street brush.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 11

Page 12: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

3. Explore the Street Creation Settings options, and draw some more streets.

Curved segments

To create streets with curved segments, complete the following steps:

Steps:

1. Select some street segments.

2. Explore the Graph > Set Curves Straight and Set Curves Smooth commands.

When individual graph segments are selected, you can also edit the precision parameter to set the precision of thesubdivision (number of segments) for curved streets. Keep in mind that curved streets produce many polygons; it'sbest to keep them at a minimum.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 12

Page 13: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Streets–Edit

Steps:

1. Click the Edit Streets/Curves tool on the toolbar or press C for the keyboard shortcut.

2. Edit the widths of some streets and sidewalks.

3. Edit some tangents. Depending on the viewing angle, only the horizontal or vertical tangents can be edited.

Streets–Generate a model

Steps:

1. Explore the StartRules of the streets you created in the Inspector. There are five types (you need to change the typeparameter of some street nodes to find them all).

2. Assign the provided simpleStreets.cga rule to all streets, and generate the models.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 13

Page 14: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

3. Continue editing the streets while the models are being regenerated on the fly.

Street pattern examples

Workflow examples as impressions

• Create a separated single street.

• First growth phase with raster pattern.

• Second growth phase with raster pattern.

• The two networks are connected.

Parameter sets

• Raster pattern.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 14

Page 15: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Radial pattern.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 15

Page 16: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Organic pattern.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 16

Page 17: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Radial major streets with raster pattern on minors.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 17

Page 18: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Organic circle pattern.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 18

Page 19: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Honeycomb style.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 19

Page 20: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• The Glasses style.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 20

Page 21: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

• Organic distribution of rasters.

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 21

Page 22: Tutorial 2: Terrain and Dynamic City Layoutsdownloads.esri.com/resources/cityengine/tutorial_2...Tutorial 2: Terrain and dynamic city layouts Download items • Tutorial data • Tutorial

Tutorial 2: Terrain and Dynamic City Layouts

Copyright © 1995-2015 Esri. All rights reserved. 22