AnsweredAssumed Answered

Looking to Subdivide a parcel based on calculated total building square footage

Question asked by seanlax5 on Jul 18, 2013
Latest reply on Jul 29, 2013 by seanlax5
I am trying to subdivide a parcel based on the calculate building height. In my code I first have calculated a random building height based on zoning codes.  I then am trying to subdivide a lot based on whether or not the building can be legally built on that parcel.  Let me sketch it out the loop I am trying to create:

If LotSize >= 5000:
  While TotSqft > 43711.30436:
     Split the Parcel
Else: Build the Building

Right now I am trying to incorporate this into my cga file.  I am wondering if I should just write a separate python script to do this. 

Copy+Pasted my code below:

#-----------------------------
#Maryland Department of Planning
#Planning Data Services
#301 West Preston Street
#Baltimore, MD  21201

/**
* File:    developmentCap.cga
* Created: 12 Jul 2013 13:48:20 GMT
* Author:  ----------
*/
#revised 7/18/13
version "2012.1"

###################
#SET UP ATTRIBUTES
###################
#maximum 75 foot building height
#using 11.5 for minimum of 3 storeys (mixed use)
@Hidden
attr height = rand (11.5, 22.86)
@Hidden
attr LotSize = geometry.area / 0.09290304
#attr LotWidth =
@Hidden
#Maximum 40 units per acre.
#Average Unit Sqft size in downtownSby: 1092.782609ft2 = 101.52m2
#40 * 101.52 = 4060.8 total sqft.
@Hidden
attr distanceStreet = 1.524
@Hidden
attr distanceInnerLot = 3.048
@Hidden
attr floorH = 3.5
@Hidden
attr utilH = floorH/2
@Hidden
attr groundFloorH = 4
@Hidden
attr windowW = 2.5
@Hidden
attr doorW = 3.5
@Hidden
attr white = "#ffffff"
@Hidden
attr storeys = (1.15 + height)  / (floorH)
@Hidden
attr tileW = 3
const groundEntrance = "facade/ModernEnt.png"
const window_tex = "facade/windows/1_glass_2_blue.tif"
const roof_tex = "otherTex/blackRoof.png"

#########################
#CBD ZONING REGULATIONS
#########################

#Maximum building height of 75 feet,
#accounted for in attribute setup.

#Lot width minimum of 50 ft;
#Not possible to code in an iterator code
#Need a hard value

#Maximum 40 units per acre.
#Average Unit Sqft size in downtownSby: 1092.782609ft2 = 101.52m2
#40 * 1092.782609 = 43711.30436 total sqft per building
#Multiply lot size by storeys to find total sqft.
TotSqft = LotSize * storeys
#Also; Lot area minimum of 5,000 square feet:

@StartRule
ParcelStart -->
case LotSize < 5000: ParcelFront
case TotSqft > 43711.30436 : BlockSplit
else: NIL

BlockSplit -->
split(z) {'1 : ParcelFront | '1 : OpenSpace}*
#Minimum 5 foot setback from street:
#Minimum 10 foot setback from interior lot lines * Wicomico River:
#Using 10 setback all around for better pedestrian access
ParcelFront -->
setback(distanceInnerLot){ street.front: OpenSpace | remainder: ParcelRear }
ParcelRear -->
setback(distanceInnerLot){ street.back: OpenSpace | remainder: ParcelSide }
ParcelSide -->
setback(distanceInnerLot){ street.side: OpenSpace | remainder: Lot }
OpenSpace -->
color("#77ff77")

########################
#CREATING THE BUILDING 
########################

Lot -->
extrude(height) Building
Building -->
comp(f){ front : FrontFacade | side : SideFacade | top : Roof }
FrontFacade -->
split(y){ groundFloorH : GroundFloor | { ~floorH : Floor }* }
SideFacade -->
split(y){ groundFloorH : Floor | { ~floorH : Floor }* }
Floor -->
split(x){ 1 : Wall | { ~tileW : Tile }* | 1 : Wall }
GroundFloor -->
split(x){ 1 : Wall | { ~tileW : Wall }* | ~tileW : EntranceTile | 1 : Wall }
Tile -->
split(x){ ~1 : Wall | 2 : split(y){ 1 : Wall | 1.5 : Window | ~1: Wall } | ~1 : Wall }
EntranceTile -->
Entrance

#######################
#CREATING THE WINDOWS
#######################

Window -->
s('1,'1,0.4)
t(0,0,-0.05)
Glass

############
#TEXTURING
############

Wall --> color(BuildingColor)
Blind --> color(WindowTop)
Frame --> extrude (frameE) color(white)
Glass -->
projectUV(0)
texture(window_tex) color(white)
set(material.specular.r,0.4)
set(material.specular.g,0.4)
set(material.specular.b,0.4)
set(material.shininess,4)
set(material.reflectivity,0.3)
Entrance -->
setupProjection(0, scope.xy, scope.sx, scope.sy) projectUV(0)
set(material.colormap, groundEntrance)
Roof -->
setupProjection(0, scope.xy, scope.sx, scope.sy) projectUV(0)
set(material.colormap, roof_tex)

@Range(0,4)
@Hidden
attr OuterWall = 25%:1 25%:2 25%:3 25%:4 else:0

BuildingColor =
case OuterWall == 1: "#FFB870"
case OuterWall == 2: "#E0C266"
case OuterWall == 3: "#FFE6B6"
case OuterWall == 4: "#ECDAA3"
else : "#99FF99"

#HISTORIC regulation
#Must use appropriate colors and design



Thanks for any and all help!

Outcomes