What does brackets ([, ]) do in .cga rules?

02-10-2020 03:02 PM
Esri Contributor

What does brackets ([, ]) do in .cga rules?

---Sample Below---

Temple -->
[ offset(- Diameter /2,inside) extrude(peristyliumHeight) Peristylium ]
[ offset(-Cella_Setback,inside) Cella ]
offset(- Diameter /2+geisonProjection+architraveD/2,inside) Roof

0 Kudos
1 Reply
Esri Regular Contributor

They are the push and pop operations in the help doc:

pop / push operation—CGA | Documentation 

In the above code, first a translate occurs.  Then, the offset and extrude inside the first set of square brackets are performed ending in Peristylium (which may end here or continue in a rule called Peristylium).  For the second square brackets, the offset and extrude are not done because they are popped off the stack, and the state of the geometry starts with the result of the translate.  An offset occurs, and Cella is created (which may end here or continue in a rule called Cella).  The square brackets again pop the offset off the shape stack.  This means, the translate in peristyliumHeight is done after the translate in podiumHeight.  All the operations inside the square brackets have been undone.  Then, an offset is performed, and the Roof is created.

0 Kudos