Using CGA Rules
To create building geometries through CGA rules, the following general workflow can be used:
- In CityEngine, the “Lots” serving as initial shapes for constructing buildings. Lots are either created in CityEngine (drawn or created based on a graph) or imported.
- To create 3D models, the user selects which Rule File (.cga) and Start Rule to apply to these initial shapes. The user can either assign one rule to all building lots or assign rule sets on a selection of buildings.
Credit: CityEngine Help
- Then, the user can trigger the application of the rules to the selected shapes. Therefore, it is important that the Start Rule of the shape is present in the rule file. Otherwise, no rule can be invoked. Extrusion is the first step in generating a 3D mass from a 2D footprint. The operations provided in CGA such as “extrude” can be adapted to create a complex architectural design. A simple CGA rule for building extrusion can be written as follows:
Lot --> extrude (4) Building Or: attr height = 30 Lot -->extrude(height) Building
Credit: CityEngine Help -
In order to modify the resulting 3D models, different possibilities exist: (1) edit the rules by scripting, (2) overwrite the rule parameters of a rule set on a per-building basis, and (3) if stochastic rules are used (rules with random parameters), the random seed of all or single buildings can be altered. The last method is used in creating virtual cities that should have certain characteristics. These types of randomization are not a representation of reality.
The following figure shows how a rule can be overwritten (2nd method mentioned above). This window provides values to the parameters of a rule. To overwrite the rule, there are some options: (a) to use the rule-defined value, (b) manually add a user-defined value, (c) object attribute, (d) shape attribute, or (e) layer attribute. Layer attribute is to choose attributes based on shapefiles or geodatabases attribute table. For instance, if you have height value as a field in the building footprints’ attribute table, you can use it to automatically generate extrusions. Other instances of fields that can be used for buildings are roof types, roof materials, façade materials, etc.
Credit: ChoroPhronesis LabCredit: ChoroPhronesis Lab - After the design is finalized, the user can export any selected shapes including buildings or streets to other platforms or publish the results online. (CityEngine)