Hello everyone,
Wonder if there is a way to 'clip' the grid that is created by Marker_Based_Building.cga (rule by Matthias Buehler) to just the shape that is being applied to ? Appreciate all the responses.
Thanks.
------------------------------------------------------------ PART RULE BELOW -------------------------------
@StartRule
Building_Marker -->
alignScopeToAxes(y)
s(mainLength, 0, mainDepth)
center(xz)
primitiveCube()
comp(f) {bottom: alignScopeToAxes(y) reverseNormals CreateGrid | all : NIL
}
CreateGrid -->
s(gridWidth * scope.sx + (gridWidth - 1) * gridDistWidth, 0, gridDepth * scope.sz + (gridDepth - 1) * gridDistDepth)
center(xz)
GridSplitX
GridSplitX -->
split(x) {{mainLength : GridSplitZ | ~gridDistWidth : NIL}* | mainLength : GridSplitZ }
GridSplitZ -->
split(z) {{mainDepth : FootprintBase | ~gridDistDepth : NIL}* | mainDepth : FootprintBase }
FootprintBase -->
r(scopeCenter, 0, buildingRotation, 0)
FootprintForm
FootprintForm -->
case footprintForm == "Rectangle":
mirrorScope(footprintMirrorWidth, false, footprintMirrorDepth)
SHAPE_BASED_BUILDING.Footprint (footprint rules)
You could try to use occlusion queries. Create a shape (needs to be closed shape with volume) that has the boundaries of your initial shape. Then, before creating each building, test for occlusion.
Thanks Cheryl. That seemed to do the trick.