Spatial relationships to trigger rule application?

824
1
03-15-2017 08:42 AM
JohnArnold1
New Contributor

Greetings! Am just beginning with CityEngine and am doing some CGA scripting to model up a shapefile. I'm finding that some rules might be best applied based on the spatial relationships between polygons (e.g. if distant, takes gable roof; if touching, takes shed roof), but am not finding spatial tools within CityEngine. Is there a set of relational tools somewhere? Thank you!

John

1 Reply
CherylLau
Esri Regular Contributor

I'm not entirely sure what you mean by spatial relationships, but in your example, I think you want some houses to have gable roofs and some to have shed roofs depending on their position in the world.  This you can accomplish by converting scope coordinates to world coordinates with the convert() operation.

convert Function 

In general, knowing information about other shapes is currently difficult and limited in CGA.  There are the occlusion queries that allow you to detect if something intersects/touches another shape, but currently, that's about it.

Occlusion Query Functions 

Python may provide more options for this.  For example, it is possible to get a list of shapes in the scene and get their positions.

0 Kudos