Tuesday, January 6, 2015

Building Simple Urban Development rules Post 1: Coverage areas


First thing first... Happy New Year! I've got a feeling that 2015 will be a big year for 3D.

After the long off period, I find it difficult to start being productive straight away... I'd much rather focus on a little bit of 3D first.

Normally when writing a blog post I get a bit carried away and end up writing very long posts. So I've decided to start writing shorter, more to the point posts. This will probably help me write more often...call it a New Year's resolution if you want :)

Building Simple Housing Development rules

The focus for this series (for lack of a better word) will be back to the basics in the sense that it will focus on Urban Development (CityEngine's original purpose believe it or not).

It is probably worth mentioning that I am expanding this series as I go along, so I have no idea what will be the follow up post, or how many parts there are - guess we'll find out together.

Post 1: Coverage areas

In short, coverage areas (in this post anyway) refer to the percentage of the lot/property area that is covered by a building footprint. As I am not from a town planning background, I don't necessarily need to know about the HOW and WHERE of using coverage areas, I only want to be able to represent the rules procedurally. The best way of achieving this is to create a robust RuleFile that can be used with a number of different inputs.

Coverage refers to the % of property that is covered by a building


The first part of creating the rule files is - as in most cases - is setting up some attributes and functions. Normally writing a rule file is an iterative process, and this part will most probably be re-visited.


   
In the image above, we can see two coding blocks for attributes and functions. Lets start from the top and work our way down:

The first line creates a constant called Area. The value of Area is determined by calling the getArea function. The getArea function in turn executes a CE system function (geometry.area()), which returns the surface area of the property. Area is set as a constant so that it can not be changed by the user.

The ValidArea attribute value is determined by the getAreaValidation function. This function checks if the area of the property is larger than 100 m² and returns a 1 if is, otherwise it returns a 0. This attribute will be used at a later stage to ignore areas that are too small.

The remaining attributes define values for the Minimum Coverage, Maximum Coverage and the offset area.


The image above shows the simple rules to procedurally represent coverage areas.
The First step (Lot) is to check whether the area is large enough to contain a building. The second part (TopArea) makes sure the rule works with the top part of the the property.

The FootprintOffset rule then creates an offset using the OffsetDist attribute. The offset size can be changed as needed by the user. It then calls the SplitFootprint rule.

The SplitFootprint rule applies different rules to each of the shapes created by the offset tool: border and inside. The border is colored RED, while the inside shape calls the CheckCoverage rule.

Lastly, the CheckCoverage rule checks whether the Coverage (new shape area ÷ original area) is within the Minimum- and Maximum Coverage range. The tool also display the Coverage in a report that can be seen in the Inspector window in CE (see video below). If the Coverage is within the valid range, it is displayed as Green, else it is colored yellow.

The video below shows how the coverage area changes dynamically when the attributes are altered. You can see the changes in the area (Yellow vs Green), as well as the report (Coverage) when the Maximum Coverage, Minimum Coverage and Offset attributes are changed.




2 comments: