Monday, August 31, 2015

Building Simple Urban Development rules Post 4: "Section" (b)

I've had a couple of questions after my previous post about reporting at floor level. One of the questions was: Instead of creating mixed floor use randomly, is it possible to specify the floor usage of each floor manually?

So, here is my answer:

Yes... to a certain degree :)

I decided to create a new rule file, rather than expanding on my existing rule (as per my previous posts). So....lets start:

The aim of the rule is to create 2 to 4 "sections" in my building that will have different zoning attributes (selected manually by the user).

Splitting sections

Attributes

  • Firstly, I created attributes for the building and floor heights. 
  • Second step was to create attributes for the number of floors that each "section" will have (for example section1NumFloors = 4)
  • Step 3: Create zoning attributes for each section 
  • Step 4: Create a numerical attribute to determine the height of each section (by multiplying the floor height with the number of floors) This attribute will be used when we split the building vertically

Functions

The next part describes the functions for this rule:
  • getFloors: Determines the total number of floors of each building by dividing the building height by the floor height and returning an integer
  • testFloors: This functions checks that the total number of floors of all the "sections" are less than the number of floor returned by getFloors. If the total is less than the maximum floors, the building will be divided into 4 sections. If the number of floors exceed the maximum, one section at a time will be removed until the number of floors is less than the maximum. (I could probably have worded that better....)

Rules

Finally we get to the cool part! The rules:

  1. Lot--> Extrudes the building according to building height and splits it into a top part and side parts
  2. SplitBuilding--> This rule uses testFloors as a guide and splits the floors vertically into sections (either 2; 3; or 4 sections)
At this point our building is divided into 4 sections.




Each section calls the appropriate nested split function, for example Section1Floors


  • Section*Floors--> These rules splits each section repetitively vertically until the end of the section has been reached. Each one in turn calls the SetZoningSection rules
  • SetZoningSection--> These rules assigns zoning type of the floor to disply each zone differently.




So to conclude: it is possible to assign individual zoning types per section manually. By dividing the building into sections we have made the rule a bit more robust, as the number of floors per division can also be changed manually. One can always extend this rule to include more "sections" but for most uses I think 4 should be enough.

Thanks for the comments regarding this series.
If you have any additional comments, questions or suggestions regarding this post please feel free to add them below.

Monday, August 17, 2015

Building Simple Urban Development rules Post 4: Reporting on Building Floors

Up to this point in the Building Simple Urban Development series we've had a look at designing parts of the city. Extending on the previous post where I added detail to our rules (in the form of parking), this week I will have a look at creating reports at floor level.

In most cases a building is occupied by various inhabitants. In the example used during this post, we will imagine that each building can have a "Mixed" zone type. These buildings have different uses per floor, these will include Commercial Use, Residential Use and Unspecified. I will also create reports showing revenue generated by all floor types (using the floor area).

Individual Floor Usage

Attributes

In this post, there was only 5 attributes added (see the image below). These were:
  • CommercialFloorUse: The % of floors that will have a commercial use
  • ResidentialFloorUse: The % of floors that will have a residential use
  • CommercialRevenueSquareMeter: Revenue generated per square meter of commercial use
  • ResidentialRevenueSquareMeter: Revenue generated per square meter of residential use
  • VoidRevenueSquareMeter: Minimum Revenue  lost per square meter
     **Another disclaimer: Just ignore the bad attribute naming convention....I didn't spend too much time on the attribute names
  • I also added a "Mixed" type to the ZoneType attribute that we created in Post 2.

Attributes



Rules

Only two rules were added during this post: ColorFloors and ColorFloors2 (once again great usage of my naming convention).

  • ColorFloors checks if a floor has a "Mixed" ZoneType, and calls the ColorFloors2 rule if it does. It also creates a report for all floors created. To read more about reports, click here.
  • ColorFloors2 uses the CommercialFloorUse and ResidentialFloorUse attributes to determine the usage of each floor by applying the "p-function". The remaining floors  are assigned a usage of Unspecified. The rules also create reports on each floor usage as well as the potential revenue generated.

Rules


Reports

The reports that are created with the new rules can be seen in the image below. The N, Sum and Avg, columns returns the Count, Sum and Average of each floor or floor revenue, respectively.
  • All Floors displays the count of all floors (excluding the ground floor) 
  • Commercial Floors, Residential Floors and Unspecified Floors returns the count for each floor usage type
  • Commercial Floors Revenue and Residential Floors Revenue returns the count of each floor type as well as the estimated revenue generated by each (as a sum and average). The revenue is generated by multiplying the square meters of the floor (getArea in the image above) with the price-per-square-meter for the specified floor type (e.g. CommercialRevenueSquareMeter
  • The Unspecified Floors Revenue calculates the estimated amount of revenue lost by having a unspecified/void floor. 

Reporting per Floor





Tuesday, August 4, 2015

Building Simple Urban Development rules Post 3: Adding Detail (Parking)

In the 3rd post of the Building Simple Urban Development rules series, we'll have a look at extending the rules by adding more detail.

In the previous post we divided our building into 4 "types", Commercial, Industrial, Residential and Parks (coloring each one individually). In this post we'll have a look at adding parking areas to our buildings.

Procedural Parking in CityEngine
But first we'll make a couple of assumptions:

  • Parking areas will only be assigned to half of all Commercial buildings
  • Parking areas will start from the floor and will extend to a quarter of the building height.
  • We will add ramps between the parking floors on both sides of the building (up and down)

Attributes

Following the same template for the rest of the post series, we'll first have a look at the attributes added during this post.

Attributes
From the image above, the attributes that were added include:
  • useHeight ( remaining building height after the parking has been subtracted)
  • floorHeight (random number between 2.8 and 4 meters)
  • parkingHeight (roughly a 1/4 of the building height)
  • rampObject (a Collada file for the ramps)
  • Textures
  • Counts for reporting purposes

Rules

There were quite a lot of rules added during this post. The first half of the rules are shown below

Rules added (part 1)

These are:

  • ErrorTracking: Defines whether a building exceeds its height restriction
  • SplitBuilding: Guides 50% of all Commercial buildings to create parking
  • ExtrudeFloor and ExtrudeFloor2: Uses the bottom part of an extruded building (while discarding the sides and top parts) and extrudes it inversely (-Height)
  • CheckDimensions: Verifies that neither sides of the footprint polygon exceed 60% of the length of the other. This helps to cancel out lop-sided buildings
  • HasParking: Checks if a building exceeds it maximum height and splits it accordingly:
    • If it exceeds the max: The building is split into a groundfloor, parking, remaining height and an error
    • If it doesn't exceed the max: It is split into a groundfloor, parking and remaining floors
  • RemainingFloors: Counts and reports on the number of non-parking floors. Splits the remainder of the building into floors and color it
  • CreateFloor: Counts and reports the number of parking floors and uses the bottom part of the floor "cube" to create parking floors.

The second part describing the rules in this post is focused on splitting each floor horizontally into parts in order to create Ramps, General Parking, Ramp Platform and Pillars respectively (see image below).


Splitting the Parking Floors

I think it would be best to look at the above image step-by-step:
  1. 50% of all Commercial buildings are defined as having parking available
  2. Roughly 25% (bottom 1/4) of the building is split into parking floors, and then split again into sections
  3. First, the parking floor is split into three parts (from top to bottom in the image). A ramp on the left, general parking and a ramp on the right
  4. Each ramp is then split into three parts (from left to right). A ramp platform at the top, the actual ramp, and another ramp platform at the bottom
  5. Similarly each ramp platform is split (again) to create pillars.

I know, I know....another long post. So grab a quick cup of coffee and lets wrap this up...



The rules showed in the image above are:

  • ParkingRamps: Splits the parking floor in 3 parts (ramp, parking, ramp)
  • ParkingMain: Textures the general parking area
  • ParkingRampsLeft & ParkingRampsRight splits each ramp into 3 parts (platform, ramp, platform)
  • Each of the ParkingPillar* Rules splits the 4 platforms (4 corners of the building to create pillars)
  • ExtrudePillar: Extrudes the pillar upwards
  • AddRamp: Adds ramps, either upwards or downwards. This rule calls a Collada file and rotates it accordingly
  • Texture: Generic rule that takes a path name to an image as input and applies the texture to the shape

*Disclaimer: This example was made only to show the ability of using procedural rules. These methods are not perfect (far from it) so use the information and techniques on your own risk.