Occlusion rules work in 2016.1 but not in 2017.0

736
2
07-20-2017 02:45 PM
KushanDave
New Contributor

Hi everyone, 

So my master rule file generated two masses (a low rise and a high rise whose location is controlled by a slider). I have built in an occlusion test that, when I move high rise around with my sliders, checks and returns red floors if it overlaps with low rise mass - basically to avoid double counting areas and reduce my error. The following rule works in 2016.1 but not in 2017.0 and I can't figure out why.  

BuildingEnvelope --> 

      split(y){ ~Ground_Floor_Height: FloorEnvelope(split.index,split.total)
                      |~Upper_Floor_Height: OccluTest  // testing occlusion only for first 2 floors
                      |~Upper_Floor_Height: OccluTest // testing occlusion only for first 2 floors
                     |{ ~Upper_Floor_Height: FloorMassing }*
                     | Top_Floor_Height : FloorEnvelope(split.index,split.total) }

OccluTest -->
case overlaps (all) && touches (all):
   color("#ff0000")
   X.   // basically it doesn't count area of those floors to reduce the overall error when applied to 100 parcels  
  else: FloorEnvelope(split.index,split.total)

Screenshot of 2017.0 below. 

thanks,

k

0 Kudos
2 Replies
LR
by
Occasional Contributor III

Occlusion query has always been janky at best but I think it's plain broken in 2017.0. As far as I can tell, it only triggers once per scene "session". Try moving your building, save/close the scene and open it again.

See also my thread here, which unfortunately went unaddressed: https://community.esri.com/thread/198001-inconsistent-and-non-updating-occlusion-query-results-ce-20... 

CherylLau
Esri Regular Contributor

The occlusion test above should work.

In Edit -> Preferences -> General -> Procedural Runtime, what is the value for Maximum distance for occlusion?  If this is 0, then overlaps() will return true (due to numerical imprecision) because the floors are touching the neighboring floors (above and below) that were created in the split.  This value is by default 0.001.  So, if this value is zero, this might be a reason why the floors are red even when they are not touching the lower building.  (Note:  You can also add the keyword inter to your occlusion tests to only test between objects in the scene and not within objects.  This is faster than using the keyword "all".)

What is the rule FloorEnvelope doing?  I tested the code with FloorEnvelope as a terminal shape, and this seems to work for me.  In this rule, are other shapes being created that might interfere with the occlusion testing?  Is there a comp split?  comp splits create ghost shapes that are used in occlusion testing.

As a note, if shapes are generated, then occlusion testing should work between them.  You should not need to reopen the scene if you move your query object.  If you change the cga code of the occluder object without regenerating, then you might get some unexpected results.

Would you be willing to post your scene and code?  I'm not really sure why it's not working.

0 Kudos