Dealing with multiple geometry conditions

289
1
01-18-2018 12:13 PM
DavidKossowsky1
Esri Contributor

I am working on a rule where a land lot goes through a series of checks, and can only continue to the next part of the rule once all check conditions are met.

 

I need to check the following:

- the area of the shape needs to be larger than 100

- the length of the first edge needs to be greater than 25

 

I’ve got my rule set up so as follows:

  

attr AreaPass = false
attr LinePass = false

Shape -->
                case geometry.area >= 1000:
                                set(AreaPass, true)
                                print(geometry.area + " is area")
                                print(AreaPass + " is area")
                                LineCheck
                else:
                                color(1,0,0) #color the shape to show an error

LineCheck -->
                comp(e) {0: FrontLine}

FrontLine -->
                case scope.sx >= 25:
                                set(LinePass, true)
                                print (scope.sx + " is scope.sx")
                                print (LinePass + " is scope.sx")
                                TestsHavePassed
                else:
                                color(1,0,0) ##fail

TestsHavePassed -->
                case LinePass == true && AreaPass == true:
                                print ("pass")
                                color(0,1,0) #color the LOT green to show that it passed
                                extrude(10) #Extrude the LOT shape by x meters to show that it passed
                else:
                                color(1,0,0) ##fail
                                print ("fail")‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

The issue is that I can't extrude the original lot face by x meters because by this point I've split the object and only have an edge left to work with. Is there any way to run a geometry area test AND an edge test, and if they both satisfy their conditions, then an operation will continue on the original input shape?

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

Unfortunately, this is a limitation with cga.  Once you split a shape into components, edge components in this example, then you can't go back to the parent shape.

However, in this case, there might be a workaround using labeled occlusion testing.  In one branch from your Shape rule, you could split your shape into edges, do the test on each edge, and if the edge passes (or doesn't pass) the test, then create a labeled occluder.  Then, in another branch from your Shape rule, before you split the shape into edges, you could do your area check AND check for occlusion with any labeled occluders.  If you see if the shape intersects the labeled occluder, then you'll know if the edge test passed (or failed).

The catch is that you'll need to create a 3D closed shape which will be the labeled occluder.  This is necessary because occlusion testing will only work with closed occluder geometries.  From the edge shape (which is not 3D), you'll have to create and position a 3D shape which you can test for intersection with the original parent shape.  This 3D shape must not trigger occlusion for other lots.  For example, you could resize the edge into a 3D volume and fill the scope with a primitive cube.  But, you'll want to make sure that this cube only triggers the occlusion testing for the desired shape and not, for example, the neighboring shape.

Here is the help doc page on labeled occlusion:

label Operation 

0 Kudos