My Plint Area. Need Help.

617
3
08-02-2012 10:10 PM
RamliJannatul_Alia
New Contributor
Hi all City Engine cga coder 🙂 ...

im trying to create a cga rule for plint area..

this is my idea..

1) i do setback (street) for a lot

Lot--> 
setback(setBackRoad) {streetSide: Garten | remainder : Lot2 }


2) I try to split into 4 small lot...
Lot2--> 
 split(x){ '0.5 : one |   '0.5 : two }      
 split(v, uvSpace, 0) { 0.5 : three}               


But it do not generate like i want

heres the pic [ATTACH=CONFIG]16625[/ATTACH]

its should split v..


how can i save the value of area Splitted in a attr? ive tried but failed...

basically in plint area i have to find remainder area after setbackroad has been applied and building are allowed to build in plint area only.. for example 25% of geometry.area...
0 Kudos
3 Replies
MatthiasBuehler1
Frequent Contributor
hi !

first, 3 things :


1] shape copies

if you write :

A -->
    B
    C


you get 2 copies of the incoming shape (A), named B and C which are identical. this is sometimes useful, but not in your case.

if you write :

Lot2--> 
    split(x){ '0.5 : one |   '0.5 : two }      
    split(v, uvSpace, 0) { 0.5 : three}


you basically first make 2 copies of Lot2. thus you get wrong geometry. what you want is to split 'one' and 'two' further in the opposite direction, so you either need to define a new rule for this or write the same operation in the same line. CGA, in this case, does not go down step by step through each line.



2]
familiarize yourself more with the scope here :
http://forums.arcgis.com/threads/44417-CGA-Understanding-the-concept-of-the-scope

and notice that for splitting in u and v directions, you first need to set the UVs properly first with setupProjection() and projectUV(). but in your case, you rather just want to split in x and z directions.

only Street and Sidewalk shapes have already properly layouted UVs so you can split them nicely. on Lot shapes, I'd never use UV splits.



3]

you can use the so-called 'generic attributes'

define an attr, e.g. :
attr remainingLotArea = 0


then, after the setback where you get the remainder shape, set the attr :
set(remainingLotArea, geometry.area)

after that, you can access this attr in the rest of your code.


hope this helps you further.
0 Kudos
RamliJannatul_Alia
New Contributor
Mathias!! thanks for your reply. yup you were right actually what i need is to split in x and z direction... i didnt notice about z by using split(z) until you mention. here update of my splitting! thanks!!

[ATTACH=CONFIG]16671[/ATTACH]

the geometry.area attr you post here.. i ve used it! it works!! thanks... do you have any idea where can i get more tutorial on city engine T_______T. most of time i use the help ..
0 Kudos
MatthiasBuehler1
Frequent Contributor
there's tutorials with help HTML files you can download from within CE.

Help --> Download Tutorials and Examples
0 Kudos