Code Analysis: International City, Part 4

What's Covered:
  • Lot and LotInner

  • translate( )

  • setback( )

  • alignScopeToGeometry

Part of the rule tree that involves Residential land use.

This installment examines how Lots and Inner Lots in the InternationalCity.cga rule file work to recursively split lots into many pieces.

As noted previously, there are five land use types in the model: Open Space, Residential, Apartment Building, Office Building and Highise Block. We will follow the rules for dividing up Residential land parcels. This portion of the rule hierarchy “tree” is shown above.  The diagram of the entire rule tree is available in an earlier installment.

  • We begin by importing an external document, Street_Modern_Standard.cga. This would enable us to call rules from this rule file in our code.
  • Note the colors we will assign to various rules in lines 11-18.
  • There are three start rules: Lot, LotInner and Street.

Blocks divided as Offset Subdivisions have Lots (in red) of a specified width that parallel the street edges. Shapes within this outer ring are all InnerLots (blue).  Streets are colored gray as programmed in the Street rule.

The translate operation simply moves all Lot and LotInner shapes along their y-axes (vertically) in relative mode (the translation is added to the existing value) to the elevation of 0.2 specified by the SidewalkHeight parameter in the Street_Modern_Standard CGA file, Line 58. The x and z translate values are 0. Streets, of course are not treated in this manner. Note the how the following code is added in the example below.

const SidewalkHeight = 0.2   (StreetModernStandard.cga, Line 58) 

translate(mode, coordSystem, x, y, z) Street_Modern_Standard.SidewalkHeight the y coordinate on Lines 25 and 29.

In this illustration, I've exaggerated the y elevations of Lots and InnerLots to show how this works.

Lot shapes in the InternationalCity.cga rule file have already been assigned with Stochastic rules as Residential, Commercial, Apartment Blocks, Commercial Blocks, Highrise Blocks or GreenGround, based in part on whether a calculated distanceToCenter is greater or less than minimum values for each use type.

On Line 32, we begin by splitting Lot shapes along the x-axis. If a Lot shape’s x-axis scope is more than 25 wide, add a random-width setback of between 5 and 10 along the x-axis (the side closest to the street) and point the new shape to ResidentialBlockStripe. In the illustration below, note that wider Lots that edge the streets are given setbacks, highlighted in yellow, while narrower Lots are untouched and remain blue.

Whatever Lot portions are a) NOT PART of a setback or; b) have an x-axis not wider than 25 and were given no setback are pointed to ResidentialBlockBack, in blue. Meanwhile, the LotInner rule has pointed all LotInner shapes to ResidentialBlockBack, also in blue. Therefore, any shape not pointed to ResidentialBlockStripe and dedicated as a setback (yellow) will be handled by the ResidentialBlockBack rule.

Starting on Line 42, we will split Lot and InnerLot shapes on their z-axes, which run perpendicular to the z-axes.

If a shape’s z-axis scope is more than 20 wide, add a random-width setback of between 20 and 35 along the z-axis and point the left portion of the lot to ResidentialBlockStripe. Point the remainder (right side) of the lot to ResidentialBlockRight. Whatever lot portions are a) PART of a setback or; b) have a z-axis not wider than 20 and were given no setback are pointed to ResidentialBlockStripe.

The ResidentialBlockStripe setbacks are indicated in brown and the ResidentialBlockRight shapes are indicated in yellow.  Setbacks applied adjacent to streets in the previous step still appear in the geometry. We now have divided lots across entire blocks.

The ResidentialBlockRight rule (line 47) works to split shapes along the z-axis. If their z-scope is greater than 20, they will be split (setbacks between 5 and 10) with their left halves assigned to the ResidentialBlockStripe rule and the remainder to GreenGround and Trees.

Throughout the process, Setback areas have been routed to the ResidentialBlockStripe (Line 37) and then to the ResidentialBlockStripeSubdivide (Line 52) rule.  Note the p() or probability function previously explained, gives certain conditions a 30-percent chance of being applied.

Each time ResidentialBlockStripeSubdivide is invoked, this rule:

  • Splits shapes with a of greater than 30 into random widths between 5 and 10, OR;
  • Finds concave-shaped Lots with a of greater than 25, OR;
  • With a 30-percent chance, finds concave-shaped Lots with a of greater than 25, OR;
  • With a 30-percent chance, finds where a shape's geometry is rectangular to a tolerance of 25 degrees of angle and the z-scope dimension is greater than the x-scope-dimension-times-3...

...and repetitively re-applies the function as many times as possible.

The great number of recursive divisions is apparent in the illustration above. Those areas shaded green have been assigned to the GreenGround rule. There are still plenty of large lots.

Leave a Reply

Your email address will not be published. Required fields are marked *