Component split

A typical operation is to deconstruct an architectural design into geometric components. In the CGA shape grammar, the component split allows you to divide shapes into shapes of smaller dimensions.

The operation below splits a predecessor shape, based on its geometry, into its components and runs a set of operations on each component.

comp(component){selector : operations | selector : operations ...}

The component parameter identifies the type of the component to split; for example, it can be set to f for faces, e for edges, or v for vertices. The selector parameters define the selection of components.

As a basic example, the following rule creates a shape B for all faces of shape A's geometry:

 A --> comp(f) { all : B }

Similarly, use the following two rules to split into edges and vertices, respectively:

comp(e) { all : B }

comp(v) { all : B }


To access only selected components, use operation calls such as the following to create a shape that consists of the original shape's third face:

comp(f) { 3 : B }
Such calls are not generic and require the user to be aware of the topology of the predecessor shape's geometry. Therefore, as an alternative, use selectors:

  Building --> comp(f) { side : Facade }

This CGA grammar selects only the vertical side faces of the Building geometry and creates the new facade shapes accordingly. To do this, the rule interpreter analyzes the orientation of the geometry components (the direction of the face normal relative to the orientation of the scope).


Building --> extrude(10)

A building footprint is extruded to a 3D mass model. The resulting scope is illustrated in yellow. The x-, y-, and z-dimensions of the scope are illustrated in red, green, and blue, respectively. The pivot axes are shown in the same colors.

Extruded building footprint
Building --> extrude(10)
 comp(f) { front : color("#FFFF00") Main. |
           side  : color("#00FFFF") Side. }

The mass model is split into one Main facade (front) and a number of Side facades (side). Each face is now the geometry of a new shape (Main and Side shapes). The new shapes' scopes and pivots depend on the faces' orientation. The x-axis points along the first edge and the z-axis points along the face normal. The scope's z-dimension is zero.

Mass model split into many facades

Typically, the facades are then subdivided further into floors. Each of the new Main and Side shapes has its pivot and scope positioned and oriented so that the facade rules can be written conveniently.

See the CGA component split operation for more information.

In this topic
  1. Selectors
  2. Example