resetGeometry operation

Syntax

  • resetGeometry()

Description

The resetGeometry operation resets the geometry to the initial shape's state. Additional operation properties are:

  • trim planes are removed,
  • shape attributes remain unchanged, but scope and pivot are reset to the initial shape's state,
  • generic attributes, which are declared as rule attributes, remain unchanged (see Attributes),
  • projection matrices remain unchanged.

Related

Example

Recursive setbacks

Setbacks are applied recursively in order to create a sum of floor areas (gross floor area). Each setback shall be applied wrt. the initial shape. Therefore, the geometry is reset before the setback is applied. Note how shape attributes (here the color) are not changed.

const maxGFA      = 5000
const floorHeight = 10
	
Example -->
    color("#FFAA00")
    SetBackRec(0, 0)

SetBackRec(sumGFA, iFloor) -->
    resetGeometry()
    setback(iFloor*3) {
        all       : NIL |
        remainder : 
          Floor(sumGFA + geometry.area, iFloor)
    }

Floor(sumGFA, iFloor) -->
    CreateFloor(sumGFA, iFloor)
    SetBackRec(sumGFA, iFloor + 1)
    
CreateFloor(sumGFA, iFloor) -->
    set(material.opacity,
        case sumGFA > maxGFA : 0.1 else : 1) 
    t(0, iFloor*floorHeight, 0)
    extrude(floorHeight)
Recursive setbacks

In this topic