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

405
1
02-10-2020 03:02 PM
JYoon_GeoXC
Esri Contributor

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


---Sample Below---

Temple -->
Podium
t(0,podiumH,0)
color(Temple_Color)
[ offset(- Diameter /2,inside) extrude(peristyliumHeight) Peristylium ]
[ offset(-Cella_Setback,inside) Cella ]
t(0,peristyliumHeight,0)
offset(- Diameter /2+geisonProjection+architraveD/2,inside) Roof

0 Kudos
1 Reply
CherylLau
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