Thursday, July 16, 2015

Building Simple Urban Development rules Post 2: Applying Scenarios

I started my previous post by talking about New Years resolutions, and posting more often....I then went on to publish the follow up post 6 months later.... My apologies for the very late response.

In my previous post I started look at the basics of CityEngine to create easy-to-use rules that incorporate  commonly found Urban Development rules. This post will extend that theme by applying various scenarios to a city. The post shows the ease at which CityEngine quickly updates the 3D content using different sets of attributes.

Applying different Zoning scenarios on the same data

Continuing from the 1st post of this series, we'll start by adding some more attributes. The first two attributes in the image below specifies the themes that will be applied to the scene.
  • Scenario: This attribute defines the Zoning theme that will be applied to the scene; either predominantly Residential, Commercial, Industrial or Mixed
  • ErrorScenario: If true, the scene will show buildings that exceed its height restriction. If set to false, the scene does not allow the buildings to exceed the height restriction at all.
The remaining new attributes are:
  • ZoneType: Assigns a percentage of the shapes to a ZoneType, according to the specified Scenario
  • Height: This attribute is determined by the getHeight function (described below)
  • HeightRatio: Assigns a value to HeightRatio according to the ZoneType. This value will be used later by the getHeight function.
  • MaxHeight: This is the height restriction associated with each ZoneType 

Adding rule attributes


This post adds one function to the rule, namely the getHeight function. The height is determined by multiplying the HeightRation with the square root of the shape area.
Functions

Finally, the Rules that were added were:

  • CreateBuilding: If the ZoneType is "Parks", go-ahead and color the shapes green, else call the ExtrudeBuilding rule
  • ExtrudeBuilding: If the ErrorScenario is set to true call ErrorTracking, else compare the building height to the maximum height. 
    • If height exceeds the max, extrude the building to the max, otherwise just extrude the building according to the height. (So to recap: if the ErrorScenario is set to false, the height exceeding errors will not be visible)
    • ErrorTracking: Checks whether the Height attribute exceeds the MaxHeight, if it does it will call the SplitBuilding rule.
  • SplitBuilding: This rule splits the building into a top (and colors it) and then into sides (which calls the ValidateBuildingHeight
  • ValidateBuildingHeight: This rule splits the sides of the building horizontally at the maximum height. Everything below this split is colored according to the ZoneType while the parts exceeding the maximum height is colored as red.

New Rules
To see the ErrorScenario theme in action, have a look at the video below.


No comments:

Post a Comment