Hi all!
I am having a lot of troubles in making Occlusion queries work correctly.
I guess I am doing something wrong, but the help guide is a bit cryptic at times.
An example:
I have the top plane of a building.
On this I want to create both a Roof AND a chimney stack.
The type of roof is decided by a stochastic attribute used into a Conditional rule.
attr RoofHeight = rand (3,7)
attr RoofType = 50%: "CustomRoof"
20%: "PyramidRoof"
else: "HipRoof"
#--------------------------------------------------------------------------------
BuildingTop-->
set(BuildingLenght,scope.sx)
set(BuildingDepth,scope.sz)
RoofCreation
ChimneyStackCreation
#--------------------------------------------------------------------------------
RoofCreation-->
case RoofType== "CustomRoof": roofGable (byHeight, RoofHeight)
i (CustomRoof)
label ("roofVolume")
RoofComp
case RoofType== "PyramidRoof": roofPyramid (byHeight, RoofHeight)
label ("roofVolume")
RoofComp
else: roofHip (byHeight, RoofHeight)
label ("roofVolume")
RoofComp
RoofComp-->
comp (f){bottom: NIL| all: RoofExtrude}
RoofExtrude -->
extrude (vertex.normal,0.1)
label ("roofVolume")
#--------------------------------------------------------------------------------
The Chimneystack is basically a box create at random on the top surface of the building.
The problem is that this cube does not know how tall it should be to poke out from the roof.
Therefore I want this Chimneystack to be pushed upward until it intersects the roof shape with a conditional parametrized rule. Then i can continue building on this base knowing it is tall enough for the rest.
#--------------------------------------------------------------------------------
ChimneyStackCreation-->
primitiveCube(1,2,0.3)
t(rand(0,BuildingLenght-scope.sx),0, rand(0,BuildingDepth-scope.sz))
ChimneyYPlacement (0)
ChimneyYPlacement(n)-->
case !inside (intra, "roofVolume") || n==20: ChimneyTexture
else: t(0,0.5,0)
ChimneyYPlacement (n+1)
#--------------------------------------------------------------------------------
Problem is.. lt does not work 
The ChimneyStack does not see the roof volume and it is pushed up until n=20, so up to 10 m where it is floating in the air.
Can anybody help me understand what am I doing wrong. I have many of these procedures in my rules and I can not seem to understand what make occlusion queries tick.
Is it because I comp the Roof shape and remove its bottom faces? I do create a "RoofVolume" label right before though. And even after, when I am extruding the roof planes.. Isn't this enough?
Any help will be greatly appreciated
Thanks
A