kay.dave

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

Discussion created by kay.dave on May 5, 2017
Latest reply on May 21, 2017 by kay.dave

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

 

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

Outcomes