CGA Shape Grammar Reference

Operations Shape Attributes Builtin Functions Other Keywords CGA Utilities Misc Information


This page provides an overview of the operations and functions available in CGA.
Visit the CGA Modeling Essentials to learn the foundations of the CGA Shape Grammar.

Operations

Geometry Creation


i (insert)

extrude

envelope

taper

roofGable

roofHip

roofPyramid

roofRidge

roofShed

offset

primitiveQuad

primitiveDisk

primitiveCube

primitiveSphere

primitiveCylinder

primitiveCone

insertAlongUV

footprint

Geometry Subdivision


split

splitArea

splitAndSetbackPerimeter

comp

innerRectangle

setback

setbackPerEdge

setbackToArea

shapeL

shapeU

shapeO

scatter

Geometry Manipulation


cleanupGeometry

convexify

deleteHoles

reverseNormals

setNormals

softenNormals

mirror

rectify

reduceGeometry

resetGeometry

trim

deleteTags

setTagsFromEdgeAttrs

Texturing


texture

setupProjection

projectUV

translateUV

scaleUV

normalizeUV

tileUV

rotateUV

deleteUV

Transformations


t (scope translate)

translate

s (scope size)

r (scope rotate)

rotate

center

Scope


alignScopeToAxes

alignScopeToGeometry

alignScopeToGeometryBBox

rotateScope

setPivot

mirrorScope

Flow Control


pop

push

NIL

Context


label

Attributes


set

color

resetMaterial

setMaterial

report

print



Shape Attributes

Shape Attributes are properties of the current shape. They can always be read (like functions) and some of them can be set with the set operation.

comp initialShape material pivot
scope seedian split trim



Builtin Functions

Functions always return a value and do not alter the current shape (with the exception of probability functions which change the state of the shape's random number generator).

Math Functions

abs acos asin atan
atan2 ceil cos exp
floor isinf isnan ln
log10 pow rint sin
sqrt tan

Probability Functions

p rand

Conversion Functions

bool boolArray float floatArray
isNull sel str stringArray

String Functions

count find len splitString
substring

Geometry Functions

geometry.area geometry.angle geometry.boundaryLength geometry.{du|dv}
geometry.groups geometry.hasTags geometry.height geometry.isClosedSurface
geometry.isConcave geometry.isInstanced geometry.isOriented geometry.isPlanar
geometry.isRectangular geometry.materials geometry.nEdges geometry.nFaces
geometry.nHoles geometry.nVertices geometry.tags geometry.{uMin|uMax|vMin|vMax}
geometry.volume

Material Functions

getMaterial readMaterial

File Functions

fileExists fileSearch / filesSearch readFloatTable readStringTable
readTextFile

Asset and Image Functions

assetInfo assetNamingInfo / assetNamingInfos assetsSortRatio assetsSortSize
imageInfo imagesSortRatio

Occlusion Functions

inside overlaps touches

Context Functions

minimumDistance contextCompare contextCount

Array Functions

array initialization colon operator comp findFirst
index operator nColumns nRows setElems
size sortIndices sortRowIndices sum
transpose

Edge Attribute Functions

edgeAttr.getFloat edgeAttr.getString edgeAttr.getBool

Miscellaneous Functions

convert getGeoCoord getTreeKey print
Simple types operators Array types operators



Other Keywords

attr const extension import
start style with version



CGA Utility Functions Library

String Utility Functions

findFirst findLast getPrefix getRange
getSuffix replace

String List Utility Functions

String lists are a series of strings stored inside one string. The elements are separated by a semicolon (";"). The data type is "string", thus it is not any real type of array as used in other scripting languages.

listAdd listClean listCount listFirst
listFromArray listIndex listItem listLast
listRandom listRange listRemove listRemoveAll
listRetainAll listSize listTerminate listToArray

File, Asset and Image Utility Functions

assetApproxRatio assetApproxSize assetBestRatio assetBestSize
assetFitSize fileBasename fileDirectory fileExtension
fileName fileRandom imageApproxRatio imageBestRatio

Math Utility Functions

clamp max min

Color Utility Functions

colorHexToB colorHexToG colorHexToH colorHexToO
colorHexToR colorHexToS colorHexToV colorHSVToHex
colorHSVOToHex colorRamp colorRGBToHex colorRGBOToHex



Miscellaneous Information

CGA Changelog Annotations Asset Search Builtin Assets
Texturing Euler Angles Context Queries Component Tags

 

Copyright ©2008-2023 Esri R&D Center Zurich. All rights reserved.