Select to view content in your preferred language

Using FAR to generate building volumes

597
3
11-02-2012 06:20 AM
NicolaiSteinø
Regular Contributor
I am interested in using the Floor Area Ratio (FAR) as a basis for generating building geometry. Say you have a 2.000 sqm lot with an allowed FAR of 0.75. I could then place a building with a total floor area of 1.500 sqm. Depending on the size of the footprint this would result in a given number of possible floors. For instance, a 300 sqm footprint would allow 5 floors.

In order to do so, I need to call the area of the lot (using the geometry.area function, I assume), as well as the are of the foot print. But I can't figure out how to get the areas of the lot and the footprint and then use it to calculate the possible number of floors for my extrude.

How do you do that?

I am new to CE (and to scripting altogether) but I kind of get the general works of it. I made a very crude script (see below) which hopefully gives and idea of where I want to go. It doesn't call the mentioned areas though, as I can't figure it out.

Best,

Nic

--


/**
* File:    FAR_rule.cga
* Created: 30 Oct 2012 17:49:06 GMT
* Author:  nic
*/

version "2012.1"

attr FAR = 1.5
attr SCALING = 0.5
attr floorHeight = 3
attr groundfloorSetback = 0.5
attr topfloorSetback = 2
attr facadeColor = listRandom("#FFDEAD;#F5DEB3;#DEB887;#D2B48C;#CD853F")

Lot --> color("#A9A9A9") Ground. s('SCALING,0,'SCALING) center(xz) Building
Building --> innerRect
extrude(floorHeight/SCALING/SCALING*FAR) Envelope
Envelope --> split(y){ ~floorHeight : Floor }*
Floor --> case (split.index == 0) :
       s(scope.sx-groundfloorSetback,'1,scope.sz-groundfloorSetback)
       center(xz)
       color("#808080") X
  
       case (split.index == split.total-1) :
       s(scope.sx-topfloorSetback,'1,scope.sz-topfloorSetback)
       center(xz) Topfloor
      
       else:
       color(facadeColor) X

Topfloor --> comp(f) {side : TopFloorFacade | top : Roof }
   TopFloorFacade --> color("#87CEFA")
   Roof --> color(listRandom("#D3D3D3;#A9A9A9;#696969"))
Tags (2)
0 Kudos
3 Replies
NicolaiSteinø
Regular Contributor
Hi again,

I thought for a moment that I had worked out a solution by using the const function. But it doesn't work out the way I did it. See below. Am I on the right track and if yes, what do I do wrong?

Nic

--

/**
* File:    FAR_rule.cga
* Created: 30 Oct 2012 17:49:06 GMT
* Author:  nic
*/

version "2012.1"

attr FAR = 1.5
attr buildingLength = 20
attr buildingWidth = 10
attr floorHeight = 3
attr groundfloorSetback = 0.5
attr topfloorSetback = 2
attr facadeColor = listRandom("#FFDEAD;#F5DEB3;#DEB887;#D2B48C;#CD853F")

Lot -->
color("#A9A9A9") Ground
const lotArea = geometry.area()

Ground --> innerRect
s(buildingLength,0,buildingWidth) center(xz) Building

Building -->
extrude(floorHeight*(lotArea/geometry.area()*FAR)) Envelope
Envelope --> split(y){ ~floorHeight : Floor }*
Floor --> case (split.index == 0) :
       s(scope.sx-groundfloorSetback,'1,scope.sz-groundfloorSetback)
       center(xz)
       color("#808080") Facade.
  
       case (split.index == split.total-1) :
       s(scope.sx-topfloorSetback,'1,scope.sz-topfloorSetback)
       center(xz) Topfloor
      
       else:
       color(facadeColor) Facade.

Topfloor --> comp(f) {side : TopFloorFacade | top : Roof }
   TopFloorFacade --> color("#87CEFA")
   Roof --> color(listRandom("#D3D3D3;#A9A9A9;#696969"))
0 Kudos
MatthiasBuehler1
Deactivated User
Hi !

you cannot declare consts inside a rule body, same with attributes.

cheers !
0 Kudos
LaimonasLiskauskas
Occasional Contributor
Hi, have you found a solution? I'm very interested in this too:). Regards, Laimonas.
0 Kudos