Detect Instesection of shapes Cityengine

846
1
01-14-2017 03:16 AM
AntoniaWeber
New Contributor

Hi!

If i have two different shape files in one scene, how could I find out if they intersect at a certain point and if they do so to selet the polygon where it happens?

Thank you a lot!

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

You can write a CGA rule and use the occlusion testing operations inside(), overlaps(), and touches() to see if any shape intersects any other shape using the "inter" option.  Occlusion Query Functions   However, this will also detect intersections that may exist between shapes coming from the same shapefile.

In the rule, you can create an attribute that is by default set the empty string.  The purpose of this attribute is to tell you if the shape intersects another or not.  For shapes that intersect (as determined by the occlusion tests), set this attribute to something like "intersectsWithOtherShapes".  Then, in the scene editor you can try to search for "intersectsWithOtherShapes", and the intersecting shapes will be selected.  Alternatively, you could also make a boolean attribute and then use a python script to select the objects that have this attribute set to true.

I know this may not be the ideal workflow, but I think it should work.

0 Kudos