POST
|
Thanks for the feedback Mattias. I tried several iterations of plugging in the code you supplied but I get some strange results. The roof doesn't appear, there ar some lines that run acros the roof but the actual texture is not there. I also noticed that the tiles on the ground floor and upper flors are handles differnetly depending on the side of the building you are looking at. The window textures are sometime missing altogether so there appears to be a hole in the building. The same for the entranceTile, there will be a hole where the door should be. I also noticed that when using my original code there was anothe mistake in that the entranceTile is used on all floor, the groundfloor get that tile on the front of building burt the upper florrs, which shouldn't have them at all, has them on a differnet side. With the new code, the inserted code below, the same thing happens only now on the opposite side of the building where the entranceTile is, there is a hole in the building. It's sort of hard to explain so I'll load a couple of images to clarify. I think I'm close but I've obviously got something in the wrong place or perhaps I've left code in there that should no longer be there. [ATTACH=CONFIG]24144[/ATTACH] [ATTACH=CONFIG]24145[/ATTACH] The Code: version "2012.1"
/* Attributes *************************************/
@Group("SETBACKS",0)
attr FSetback = 3
@Group("SETBACKS")
attr BSetback = 3
@Group("SETBACKS")
attr LSetback = 3
@Group("SETBACKS")
attr RSetback = 3
@Group("HEIGHTS",1)
attr GroundFloorHeight = 5
@Group("HEIGHTS")
attr UpperFloorHeight = 4
@Group("COLORS",2)
attr LUColor = "#FFFFE0"
@Hidden
attr height = 50
@Hidden
attr tile_width = 4
@Hidden
attr wallColor = "#FFFFE0"
#attr wallColor = "#fefefe"
@Hidden
attr parcelArea = 0
@Range ("transparent", "as is")
@Group("VISIBILITY MODE",3)
attr vizMode = "transparent"
attr LOD = 1
/* Assets *************************************/
// geometries
window_asset = "facades/window.obj"
// textures
frontdoor_tex = "facades/textures/shopdoor.tif"
wall_tex = "facades/textures/brickwall2_bright.tif"
dirt_tex = "facades/textures/dirtmap.15.tif"
roof_tex = "roof/F_roof5.tif"
# this function will get one of the 9 window textures in the assets folder
randomWindowTexture = fileRandom("*/facades/textures/window.*.tif")
# this function will get one of the 6 roof textures in the assets folder
randomRoofTexture = fileRandom("*/roof/F_roof*.tif")
/* Initial Shape starting rule *************/
# scale the lit to leave a small border and extrude the lot to building height
Lot -->
set ( parcelArea, geometry.area )
report ( "Parcel Area", parcelArea )
setback(FSetback) { street.front : NIL | remainder :
setback(BSetback) { street.back : NIL | remainder :
setback(LSetback) { street.left : NIL | remainder :
setback(RSetback) { street.right : NIL | remainder :
FootprintReach
}
}
}
}
@StartRule
Footprint -->
extrude(height) Building
NIL
#comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
Reporting -->
report("GFA", geometry.area(bottom))
report("FAR", geometry.area(bottom) / parcelArea )
NIL #NIL the geometry
#Visualization -->
# case vizMode == "as is" :
# Done.
# case vizMode == "transparent" :
# set (material.opacity, 0.8)
# Done.
# else :
# comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
# inner lots are dropped
LotInner --> NIL
# split the building geometry into its facade components
Building -->
#comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
split(y) { GroundFloorHeight : Volume(0) | ~1 : UpperFloors }
UpperFloors -->
split(y) { ~UpperFloorHeight : Volume(split.index + 1) }*
Volume(floorIndex) -->
case floorIndex == 0 :
Groundfloor
case floorIndex == split.total :
TopFloor
else :
Floor
# the front facade is subdivided into one front groundfloor
# and upper floors
#Frontfacade -->
# setupProjection(0, scope.xy, 1.5, 1, 1) # setup 1.5m x 1m texture tiles along scopes xy plane (and distortion in z)
# setupProjection(2, scope.xy, scope.sx, scope.sy)
# split(y){ GroundFloorHeight : Groundfloor
# | {~UpperFloorHeight : Floor}* }
# a side facade is subdivided into one bottom floor
# and upper floors.
#Sidefacade -->
# setupProjection(0, scope.xy, 1.5, 1, 1) # setup 1.5m x 1m texture tiles along scopes xy plane (and distortion in z)
# setupProjection(2, scope.xy, scope.sx, scope.sy)
# split(y){ GroundFloorHeight : Floor
# | {~UpperFloorHeight : Floor}* }
# a roof texture is applied to the roof face
Roof -->
setupProjection(0, scope.xy, scope.sx, scope.sy, 0, 1)
#texture(randomRoofTexture)
texture(roof_tex)
projectUV(0)
# each floor is horizontally split into two narrow corner areas on
# each side of the floor, and into a set of window tiles in between
Floor -->
#extrude(height) comp(f) { side : Facade | top(0): Roof }
split(x){ 1 : Wall | { ~tile_width : Tile }* | 1 : Wall }
TopFloor -->
split(x){ 1 : Wall
| { ~tile_width : Tile }*
| 1 : Wall }
split(y) { 1 : Roof }
# similarily, the front groundfloor is horizontally split into
# two narrow corner areas on each side of the floor,
# a special entrance tile on the right
# and into a set of window tiles in between
Groundfloor -->
split(x){ 1 : Wall
| { ~tile_width : Tile }*
| ~tile_width : EntranceTile
| 1 : Wall }
# a tile consists of a centered window element and
# wall elements above, below, left and right
Tile -->
split(x){ ~1 : Wall
| 2 : split(y){ 1: Wall | 1.5: Window | ~1: Wall }
| ~1 : Wall }
# similarily, the EntranceTile contains a centered Door element,
# but with no wall on spacing below
EntranceTile -->
split(x){ ~1 : SolidWall
| 2 : split(y){ 2.5: Door | ~2: SolidWall }
| ~1 : SolidWall }
# firstly, the depth and the depth position of the future window is set
# secondly, one of nine window textures is randomly selected
# finally, the window geometry asset is inserted
Window -->
case LOD > 0 :
s('1,'1,0.5)
t(0,0,-0.15)
texture(randomWindowTexture)
i(window_asset)
else :
setupProjection(0,scope.xy,scope.sx,scope.sy)
texture(randomWindowTexture)
projectUV(0)
# same for the door asset. Scaling, positioning, texture selection
# and geometry insert
# TODO: fix door uv bug (problem with uv handling on split?)
Door -->
case LOD > 0 :
s('1,'1,0.1)
t(0,0,-0.5)
texture(frontdoor_tex)
i("builtin:cube")
else :
setupProjection(0,scope.xy,scope.sx,scope.sy)
texture(frontdoor_tex)
projectUV(0)
# for the wall asset, setting the texture scale params u and v
# guarantees a texture mapping that nicely fits over the whole facade
Wall -->
color(wallColor)
texture(wall_tex)
#set(material.dirtmap, dirt_tex)
projectUV(0) projectUV(2)
SolidWall -->
case LOD > 0 :
color(wallColor)
s('1,'1,0.4)
t(0,0,-0.4)
texture(wall_tex)
#set(material.dirtmap, dirt_tex)
i("builtin:cube:notex")
projectUV(0) projectUV(2)
else :
Wall
#
@Group("FAR",4)
attr targetFAR = 5
@Hidden
attr currentFloorIndex = 1
@Hidden
attr CalculatedHeight = 0
floorHeightFunction =
case currentFloorIndex == 1 :
GroundFloorHeight
else :
UpperFloorHeight
FootprintReach -->
#always use the 2D flat shape for the floor footprint!!
Reachrecursion( targetFAR * parcelArea )
Reachrecursion( restArea ) -->
case restArea < geometry.area(bottom) :
Done.
else :
extrude(world.y, floorHeightFunction)
VisualizationReach ( currentFloorIndex )
set (currentFloorIndex, currentFloorIndex + 1)
Reporting
comp(f){top : Reachrecursion( restArea - geometry.area ) | all : NIL}
VisualizationReach(volumeType) -->
case volumeType == 1 :
set (CalculatedHeight, CalculatedHeight + 5)
report("Calc Height", CalculatedHeight)
Building
#Volume("GF")
else :
set (CalculatedHeight, CalculatedHeight + 4)
report("Calc Height", CalculatedHeight)
Building
#Volume("UF") Any idea what I have done wrong here?
... View more
05-08-2013
01:56 PM
|
0
|
0
|
326
|
POST
|
I've solved the rpoblem with the mottles appearance of the texture, I needed to remove those first references to "Visualization", it appears I was duplicating things. I still have the rpoblem with the roof texture displaying though. I assume this is again a case where I am adding the roof at the wrong time, but I can't quite see where I should place it i the code to make it appear on the actual top of the building vs. on each of the floors.
... View more
05-03-2013
05:29 AM
|
0
|
0
|
326
|
POST
|
I'm using one of the sample cga file that does texturing and I've added some code for reporting purposes and edited the settings for the attribute values. Wehn I run this against a parcel polygon the resulting building has a mottles effect on it that changes as I rotate the view around the building. I've ried all of the light settings and nothing helps this problem. The code includes a random roof texture selection but what I find is that no roof texture is applied to the actual top of the building. When I accidentally went into the interior of a building I saw that the floor had the roof texture on it. The actual roof is just white, no texture at all. Below is a screen capture that shows both phenomenon, the mottl;e colors and the non-textured roof: [ATTACH=CONFIG]23981[/ATTACH] The code I'm using is as follows: version "2012.1"
/* Attributes *************************************/
@Group("SETBACKS",0)
attr FSetback = 3
@Group("SETBACKS")
attr BSetback = 3
@Group("SETBACKS")
attr LSetback = 3
@Group("SETBACKS")
attr RSetback = 3
@Group("HEIGHTS",1)
attr GroundFloorHeight = 5
@Group("HEIGHTS")
attr UpperFloorHeight = 4
@Group("COLORS",2)
attr LUColor = "#FFFFE0"
@Hidden
attr height = 50
@Hidden
attr tile_width = 4
@Hidden
attr wallColor = "#FFFFE0"
#attr wallColor = "#fefefe"
@Hidden
attr parcelArea = 0
@Range ("transparent", "as is")
@Group("VISIBILITY MODE",3)
attr vizMode = "transparent"
attr LOD = 1
/* Assets *************************************/
// geometries
window_asset = "facades/window.obj"
// textures
frontdoor_tex = "facades/textures/shopdoor.tif"
wall_tex = "facades/textures/brickwall2_bright.tif"
dirt_tex = "facades/textures/dirtmap.15.tif"
roof_tex = "roof/F_roof5.tif"
# this function will get one of the 9 window textures in the assets folder
randomWindowTexture = fileRandom("*/facades/textures/window.*.tif")
# this function will get one of the 6 roof textures in the assets folder
randomRoofTexture = fileRandom("*/roof/F_roof*.tif")
/* Initial Shape starting rule *************/
# scale the lit to leave a small border and extrude the lot to building height
Lot -->
set ( parcelArea, geometry.area )
report ( "Parcel Area", parcelArea )
setback(FSetback) { street.front : NIL | remainder :
setback(BSetback) { street.back : NIL | remainder :
setback(LSetback) { street.left : NIL | remainder :
setback(RSetback) { street.right : NIL | remainder :
FootprintReach
}
}
}
}
@StartRule
Footprint -->
extrude(height) Building
NIL
comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
Reporting -->
report("GFA", geometry.area(bottom))
report("FAR", geometry.area(bottom) / parcelArea )
NIL #NIL the geometry
Visualization -->
case vizMode == "as is" :
Done.
case vizMode == "transparent" :
set (material.opacity, 0.8)
Done.
else :
comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
# inner lots are dropped
LotInner --> NIL
# split the building geometry into its facade components
Building -->
comp(f) { front : Frontfacade | side : Sidefacade | top: Roof}
# the front facade is subdivided into one front groundfloor
# and upper floors
Frontfacade -->
setupProjection(0, scope.xy, 1.5, 1, 1) # setup 1.5m x 1m texture tiles along scopes xy plane (and distortion in z)
setupProjection(2, scope.xy, scope.sx, scope.sy)
split(y){ GroundFloorHeight : Groundfloor
| {~UpperFloorHeight : Floor}* }
# a side facade is subdivided into one bottom floor
# and upper floors.
Sidefacade -->
setupProjection(0, scope.xy, 1.5, 1, 1) # setup 1.5m x 1m texture tiles along scopes xy plane (and distortion in z)
setupProjection(2, scope.xy, scope.sx, scope.sy)
split(y){ GroundFloorHeight : Floor
| {~UpperFloorHeight : Floor}* }
# a roof texture is applied to the roof face
Roof -->
setupProjection(0, scope.xy, scope.sx, scope.sy, 0, 1)
texture(randomRoofTexture)
#texture(roof_tex)
projectUV(0)
# each floor is horizontally split into two narrow corner areas on
# each side of the floor, and into a set of window tiles in between
Floor -->
split(x){ 1 : Wall
| { ~tile_width : Tile }*
| 1 : Wall }
Visualization
# similarily, the front groundfloor is horizontally split into
# two narrow corner areas on each side of the floor,
# a special entrance tile on the right
# and into a set of window tiles in between
Groundfloor -->
split(x){ 1 : Wall
| { ~tile_width : Tile }*
| ~tile_width : EntranceTile
| 1 : Wall }
Visualization
# a tile consists of a centered window element and
# wall elements above, below, left and right
Tile -->
split(x){ ~1 : Wall
| 2 : split(y){ 1: Wall | 1.5: Window | ~1: Wall }
| ~1 : Wall }
# similarily, the EntranceTile contains a centered Door element,
# but with no wall on spacing below
EntranceTile -->
split(x){ ~1 : SolidWall
| 2 : split(y){ 2.5: Door | ~2: SolidWall }
| ~1 : SolidWall }
# firstly, the depth and the depth position of the future window is set
# secondly, one of nine window textures is randomly selected
# finally, the window geometry asset is inserted
Window -->
case LOD > 0 :
s('1,'1,0.5)
t(0,0,-0.15)
texture(randomWindowTexture)
i(window_asset)
else :
setupProjection(0,scope.xy,scope.sx,scope.sy)
texture(randomWindowTexture)
projectUV(0)
# same for the door asset. Scaling, positioning, texture selection
# and geometry insert
# TODO: fix door uv bug (problem with uv handling on split?)
Door -->
case LOD > 0 :
s('1,'1,0.1)
t(0,0,-0.5)
texture(frontdoor_tex)
i("builtin:cube")
else :
setupProjection(0,scope.xy,scope.sx,scope.sy)
texture(frontdoor_tex)
projectUV(0)
# for the wall asset, setting the texture scale params u and v
# guarantees a texture mapping that nicely fits over the whole facade
Wall -->
color(wallColor)
texture(wall_tex)
set(material.dirtmap, dirt_tex)
projectUV(0) projectUV(2)
SolidWall -->
case LOD > 0 :
color(wallColor)
s('1,'1,0.4)
t(0,0,-0.4)
texture(wall_tex)
set(material.dirtmap, dirt_tex)
i("builtin:cube:notex")
projectUV(0) projectUV(2)
else :
Wall
#
@Group("FAR",4)
attr targetFAR = 5
@Hidden
attr currentFloorIndex = 1
@Hidden
attr CalculatedHeight = 0
floorHeightFunction =
case currentFloorIndex == 1 :
GroundFloorHeight
else :
UpperFloorHeight
FootprintReach -->
#always use the 2D flat shape for the floor footprint!!
Reachrecursion( targetFAR * parcelArea )
Reachrecursion( restArea ) -->
case restArea < geometry.area(bottom) :
Done.
else :
extrude(world.y, floorHeightFunction)
VisualizationReach ( currentFloorIndex )
set (currentFloorIndex, currentFloorIndex + 1)
Reporting
comp(f){top : Reachrecursion( restArea - geometry.area ) | all : NIL}
VisualizationReach(volumeType) -->
case volumeType == 1 :
set (CalculatedHeight, CalculatedHeight + 5)
report("Calc Height", CalculatedHeight)
Building
#Volume("GF")
else :
set (CalculatedHeight, CalculatedHeight + 4)
report("Calc Height", CalculatedHeight)
Building
#Volume("UF") I've checked the path for the various textures and it they are correct. I've no idea why the rule behaves the way it does when applied to a polygon, it looked pretty straight forward but I'm obviously missing something.
... View more
05-02-2013
01:21 PM
|
0
|
4
|
2862
|
POST
|
Thanks for the response Mattias, the code works perfectly but the real gem was the video, it was very valuable in getting to know some of the flow of CGA and how the various rules work together, some things just became clearer while I was watching it. Sorry for my slow reply, other project pushed me away from CityEngine for a while but I was glad to get back at it and try out the code you supplied and experiment with the insites I learned from the video. Thanks again.
... View more
04-30-2013
10:58 AM
|
0
|
0
|
85
|
POST
|
So I managed to get the buildings back the way I wanted them and I started to do some further testing. The way I have the CGA rules set up is there is a central CGA rule that looks at the land use attribute value on the parcel polygon and then calls up the rule for that land use. I've modified all of my land use rules to include the report mechanism and they all work when I select 1 or more parcels add apply the rule directly. If I use the central rule that calls the land use rule based on the value of the land use attribute on the parcel the report appears to have the right floor area but the FAR values are all set to 0, even the number of floors. This happens whether I select 1 parcel or a number of parcels, the FAR is always 0. The code for the central CGA rule that calls up the appropriate land use CGA rule based on the object attribute value for the land use is as follows: // land use types from the parcel object attribute.
attr PROPERTY_USE = " "
## importing.cga
import ruleC2: "Report_C-2.cga"
import ruleC3: "Report_C-3.cga"
import ruleC3_23: "Report_C-3_23.cga"
import ruleCCCOR: "Report_CC-COR.cga"
import ruleCCMH: "Report_CC-MH.cga"
import ruleCCMHX: "Report_CC-MHX.cga"
import ruleCCOR1: "Report_C-COR1.cga"
import ruleCCX: "Report_CC-X.cga"
import ruleCM1: "Report_CM-1.cga"
import ruleCM2: "Report_CM-2.cga"
import ruleI2: "Report_I-2.cga"
import ruleRM7: "Report_RM-7.cga"
import ruleSCS: "Report_S-CS.cga"
import ruleOther: "Report_Other.cga"
@StartRule
Lot-->
case geometry.area > 200:
case PROPERTY_USE == "C-2" : ruleC2.Lot
case PROPERTY_USE == "C-3" : ruleC3.Lot
case PROPERTY_USE == "C-3(23)" : ruleC3_23.Lot
case PROPERTY_USE == "CC-COR" : ruleCCCOR.Lot
case PROPERTY_USE == "CC-MH" : ruleCCMH.Lot
case PROPERTY_USE == "CC-MHX" : ruleCCMHX.Lot
case PROPERTY_USE == "C-COR1" : ruleCCOR1.Lot
case PROPERTY_USE == "CC-X" : ruleCCX.Lot
case PROPERTY_USE == "CM-1" : ruleCM1.Lot
case PROPERTY_USE == "CM-2" : ruleCM2.Lot
case PROPERTY_USE == "I-2" : ruleI2.Lot
case PROPERTY_USE == "RM-7" : ruleRM7.Lot
case PROPERTY_USE == "S-CS" : ruleSCS.Lot
case PROPERTY_USE == "Other" : ruleOther.Lot
else: ruleOther.Lot
else: NIL
The rules that are called up are all similar to the below, only the attribute settings are different: attr FSetback = 1.5
attr BSetback = 5
attr LSetback = 5
attr RSetback = 5
attr height = 46
attr LUColor = "#ff6464"
attr GroundFloorHeight = 5
attr UpperFloorHeight = 4
attr SHAPE_Area = 0 #parcel polygon area from GDB
@Group("Viz",4)
@Range("massOnly", "floors", "massAndFloors")
attr vizMode = "massAndFloors"
attr plotArea = 0 # used to calc FAR
@StartRule
Lot -->
setback(FSetback) { street.front : Concrete | remainder : Sub1 }
Concrete --> color("#CCCCCC") #Grey
Sub1 --> setback(BSetback) { street.back : Concrete1 | remainder : Sub2 }
Concrete1 --> color("#CCCCCC") #Grey
Sub2 --> setback(LSetback) { street.left : Concrete2 | remainder : Sub3 }
Concrete2 --> color("#CCCCCC") #Grey
Sub3 --> setback(RSetback) { street.right : Concrete3 | remainder : Building }
Concrete3 --> color("#CCCCCC") #Grey
Building -->
set(plotArea, geometry.area)
extrude(world.y,height)
color(LUColor)
BuildingVolume3D
BuildingVolume3D -->
MassViz
# the 3d volume will not be split into smaller 3d volumes ! 1 ground floor volume will be created.
split(y) {GroundFloorHeight : Volume("GF") | ~1 : AllUpperFloors}
AllUpperFloors -->
# the rest of the volume is not split into upper floor volumes, as many times as possible ('*' sign)
split(y) {~UpperFloorHeight : Volume("UF")}*
Volume(volumeType) -->
case volumeType == "GF" :
color ("#646464")
Floor
else :
color (LUColor)
Floor
Floor --> comp(f){ bottom: reverseNormals FloorBottom }
FloorBottom -->
report("GFA",geometry.area)
report("FAR",geometry.area/SHAPE_Area)
MassViz
MassViz -->
case vizMode == "massOnly" :
Mass.
case vizMode == "massAndFloors" :
set(material.opacity,0.8) BuildingVolume3D.
else:
NIL I'm not sure why the FAR is being wrongfully calculated or reported when I use the central CGA rule. The only thing I can think of is that some varialbe needs to be reset between each call, but if that is the case I don't know what that would be. Do you see anything in the code that would cause this problem?
... View more
04-17-2013
11:03 AM
|
0
|
0
|
651
|
POST
|
That was quick, thanks so much for getting back to me. I think I screwed up the cut and paste, the code I included in the last note was actually the code before the change. I do have the "set()" line before the extrude and the numbers in the report for the floor area and FAR are now being calcualted correctly. My only problem now is that when I apply the CGA code to a parcel the building doesn't look the way I want it to. The only thing visible is the floor plates, the building outline is missing. If I remove the line that contains the "comp(f)" the building is back to the way it should appear but the numbers on the report are no longer valid. The actual latest code is as follows: attr FSetback = 1.5
attr BSetback = 5
attr LSetback = 5
attr RSetback = 5
attr height = 46
attr LUColor = "#ff6464"
attr GroundFloorHeight = 5
attr UpperFloorHeight = 4
attr SHAPE_Area = 0 #parcel polygon area from GDB
#@Hidden
attr plotArea = 0 # used to calc FAR
@StartRule
Lot -->
setback(FSetback) { street.front : Concrete | remainder : Sub1 }
Concrete --> color("#CCCCCC") #Grey
Sub1 --> setback(BSetback) { street.back : Concrete1 | remainder : Sub2 }
Concrete1 --> color("#CCCCCC") #Grey
Sub2 --> setback(LSetback) { street.left : Concrete2 | remainder : Sub3 }
Concrete2 --> color("#CCCCCC") #Grey
Sub3 --> setback(RSetback) { street.right : Concrete3 | remainder : Building }
Concrete3 --> color("#CCCCCC") #Grey
Building -->
set(plotArea, geometry.area)
extrude(world.y,height)
color(LUColor)
BuildingVolume3D
BuildingVolume3D -->
# the 3d volume will not be split into smaller 3d volumes ! 1 ground floor volume will be created.
split(y) {GroundFloorHeight : Volume("GF") | ~1 : AllUpperFloors}
AllUpperFloors -->
# the rest of the volume is not split into upper floor volumes, as many times as possible ('*' sign)
split(y) {~UpperFloorHeight : Volume("UF")}*
Volume(volumeType) -->
case volumeType == "GF" :
color ("#646464")
Floor
else :
color (LUColor)
Floor
Floor --> comp(f){ bottom: reverseNormals FloorBottom }
FloorBottom -->
report("GFA",geometry.area)
report("FAR",geometry.area/SHAPE_Area)
set(material.opacity,0.6) Do you see a reason why the building outline doesn't appear and I see only te floor plates?
... View more
04-17-2013
07:09 AM
|
0
|
0
|
651
|
POST
|
Thanks for the quick reply. I did look at that thread you mentioned earlier and because the CGA code is not really documented, i.e. there's no comments on the code, it wasn't any more helpful than the CGA from the tutorials which is what I had used for reference. I made the change that you recomended and the FAR and floor area calculations are now correct. That said, I'm still confused with the plotArea attribute, where does that come from, is it supposed to be an attribute on the shape or is it something that is built into CGA/CityEngine, a reserved attribute of some type? I'm also confused over why the building envelope keeps disappearing when I run his rule and only the "floors" are displayed. I see nothing in the code that says turn off the building and just show the floors, to be honest I woudn't have a clue how to do such a thing. my code now looks like the following: attr FSetback = 1.5 attr BSetback = 5 attr LSetback = 5 attr RSetback = 5 attr height = 46 attr LUColor = "#ff6464" attr GroundFloorHeight = 5 attr UpperFloorHeight = 4 attr SHAPE_Area = 0 #parcel polygon area from GDB #@Hidden attr plotArea = 0 # used to calc FAR @StartRule Lot --> setback(FSetback) { street.front : Concrete | remainder : Sub1 } Concrete --> color("#CCCCCC") #Grey Sub1 --> setback(BSetback) { street.back : Concrete1 | remainder : Sub2 } Concrete1 --> color("#CCCCCC") #Grey Sub2 --> setback(LSetback) { street.left : Concrete2 | remainder : Sub3 } Concrete2 --> color("#CCCCCC") #Grey Sub3 --> setback(RSetback) { street.right : Concrete3 | remainder : Building } Concrete3 --> color("#CCCCCC") #Grey Building --> extrude(world.y,height) color(LUColor) BuildingVolume3D BuildingVolume3D --> set(plotArea, geometry.area) # the 3d volume will not be split into smaller 3d volumes ! 1 ground floor volume will be created. split(y) {GroundFloorHeight : Volume("GF") | ~1 : AllUpperFloors} AllUpperFloors --> # the rest of the volume is not split into upper floor volumes, as many times as possible ('*' sign) split(y) {~UpperFloorHeight : Volume("UF")}* Volume(volumeType) --> case volumeType == "GF" : color ("#646464") Floor else : color (LUColor) #set(plotArea, geometry.area) set(material.opacity,0.6) Floor Floor --> comp(f){ bottom: reverseNormals FloorBottom } FloorBottom --> report("GFA",geometry.area) report("FAR",geometry.area/SHAPE_Area)
... View more
04-16-2013
08:50 AM
|
0
|
0
|
651
|
POST
|
One more thing, the numbers in the report for the FAR don't make a lot of sense. Under the "N" is the number 10, which seems to reflect the number of floors. This would be correct if the area of the parcel and the area of the base of the building were the same, and that may be my problem. I'm using various sample "report" CGA files to get an idea of how to do the report I need and in tose CGAs there was a variable called "PlotArea". Is this a special term for CGA? Shoudl I be using it or should I be using the Object attribute SHAPE_Area from my GDB layer? I've tried both and it didn't seem to make any difference. to get the FAR I think that the "geometry.area/PlotArea" calcualtion is dividing the total floor area of the building not by the area of the parcel but by the area of the base of the building, but I can't see how to change that if it is.
... View more
04-15-2013
12:18 PM
|
0
|
0
|
651
|
POST
|
I should add that the building is not presented graphically the way I expected and the way that it was prior to adding the section for the report: [ATTACH=CONFIG]23521[/ATTACH]
... View more
04-15-2013
12:06 PM
|
0
|
0
|
651
|
POST
|
I have a CGA rule that extrudes the building and then splits it into the ground floor that has a height of 5M and the remainder are upper flooors that have a height of 4M. The rule then goes on to report the GFA and FAR but in both of those the number of floors appears to be 1 less than the total, I believe it is because the last split was for the upper floors and the ground floor is being ignored. How do I get the report to include all of the floors? The CGA code is below: attr FSetback = 1.5 attr BSetback = 5 attr LSetback = 5 attr RSetback = 5 attr height = 46 attr LUColor = "#ff6464" attr GroundFloorHeight = 5 attr UpperFloorHeight = 4 @Hidden attr plotArea = 0 # used to calc FAR @StartRule Lot --> setback(FSetback) { street.front : Concrete | remainder : Sub1 } Concrete --> color("#CCCCCC") #Grey Sub1 --> setback(BSetback) { street.back : Concrete1 | remainder : Sub2 } Concrete1 --> color("#CCCCCC") #Grey Sub2 --> setback(LSetback) { street.left : Concrete2 | remainder : Sub3 } Concrete2 --> color("#CCCCCC") #Grey Sub3 --> setback(RSetback) { street.right : Concrete3 | remainder : Building } Concrete3 --> color("#CCCCCC") #Grey Building --> extrude(world.y,height) color(LUColor) set(plotArea, geometry.area) BuildingVolume3D BuildingVolume3D --> # the 3d volume will not be split into smaller 3d volumes ! 1 ground floor volume will be created. split(y) {GroundFloorHeight : Volume("GF") | ~1 : AllUpperFloors} AllUpperFloors --> # the rest of the volume is not split into upper floor volumes, as many times as possible ('*' sign) split(y) {~UpperFloorHeight : Volume("UF")}* Volume(volumeType) --> case volumeType == "GF" : color ("#646464") else : color (LUColor) set(material.opacity,0.6) FloorCalc FloorCalc --> report("GFA",geometry.area) report("FAR",geometry.area/plotArea)
... View more
04-15-2013
09:21 AM
|
0
|
10
|
883
|
POST
|
Sorry its taken so long to get back, I got caught up on other matters. I did manage to get the python scripts to work correctly and was able to apply setbacks to front, back and sides for my properties. I found that I needed to run the "Simplify" tool on the layer in ArcGIS prior to going in to the CityEngine project and applying the python scripts, but it did work for 99% of the parcels I was testing. Thank you for all of your help with this, I think I can now move forward with my project.
... View more
04-15-2013
09:01 AM
|
0
|
0
|
301
|
POST
|
Thanks for the reply Matthias, unfortunately I know very much about CGA so I'll just tell you what I gleaned from your response and what I have read in the notes in the pythion scripts. 1) GDB layers are in fact Static Shapes. 2) I'm to run both of the scripts, first alignStaticShapesToDynamicStreet_v1.py to align the parcel shapes to the street segments, then the SetStreetEdge.py script to identify the street edge of the parcel. 3) the SetStreetEdge.py script creates a streetWidth "attribute" in the parcel layer shapes, this helps identify the street edge of the shape, i.e. the edge of the parcel shape that faces the nearest street line. Questions: 1) Do I need to select all of the parcel polygon shapes and the street network lines when I run these python scripts? 2) How can I tell these scripts are running and/or completed? I see no indication that anything is happening when I run the scripts with all street network lines and parcel shapes selected. I also don't see a streetWidth "attribute" in the parcel shape object attributes list after running the scripts so I assume they did nothing. 3) If I were to get this to work, i.e. get the streetWidth attribute on the parcel shapes, is there anything I need do in the CGA script assigned to the parcel shapes when I'm assigning setbacks?
... View more
04-08-2013
12:04 PM
|
0
|
0
|
301
|
POST
|
I finally got the "Set Street Edges" command to be available and when I used it it did add the "Streetwidth(10)" attribute and set the value to 1. The problem is that I have thousands of parcels and this process only appears to work on one at a time. Even selecting the parcels 1 at a time didn't work. I was able to do it one on one parcel then when I tried the exact same thing on the a neighboring parcel the "Set Street Edges" command was not available. When I tried to select the street side on multiple parcel it wouldn't do it, it just selected the entire parcel in all cases. What can I do to set the street edge of all of my parcels at once, or at least do more than one at a time, assuming I can get it to work again at all.
... View more
03-21-2013
07:13 AM
|
0
|
0
|
283
|
POST
|
I have the same problem, my parcels and street network are 2 seperate geodatabase layers I am importing into my CityEngine project and I can't do anything with the parcels that require knowing the front, side or back of the shape, i.e. doing setbacks or texturing. I looked on the "Shapes" menu and the "Set Street Edges" option is no availalbe, i.e. it's grayed out. As for double clicking the street side of the shape, that doesn't appear to do anything, for instance I don't see that it adds anything to the attribute list?
... View more
03-21-2013
07:01 AM
|
0
|
0
|
283
|
POST
|
I've got land parcels in an ESRI Geodatabase polygon layer that I'm trying to genereate models from. The polygons have landuse designation on them and that's about all the attribution there is. The plan is to write CGA rules for each land use and apply it to parcel based on the land use attribute value. That part works but in order to do anything that requires knowing the front/side or back of the shape it appears it needs to know where the street is. I have a road network, also from a geodatabase, but there is no connection between the parcel shape layer and the road network layer. From what I can tell geodatabase layers are not static shapes in CityEngine and the Python scripts you have suggested in this thread that will identify the "street side" of a shape apparently only work with static shapes, is that correct? If so, is there any way for me to indicate what the street side is for my parcels of land shapes that are coming from an ESRI geodatabase? This problem has brought our development to a stand still becuase to develope land use CGA rules we need to take into consideration setback for the front sides and back if parcels and we can't tell where the front is.
... View more
03-20-2013
02:32 PM
|
0
|
0
|
1083
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|