(Tutorial 16) How to clip the grid to the shape area ?

250
0
05-05-2017 08:45 AM
KushanDave
New Contributor

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. 

tut_16_Ref

@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)

0 Kudos
0 Replies