rhyne

Editing CGA to add Parallel Parking

Discussion created by rhyne on Apr 8, 2014
Latest reply on Apr 9, 2014 by MBuehler-esristaff
I'm new to CityEngine and the CGA language. I'm trying to edit an existing CGA rule that came from the ArcGIS - 3D City site (http://www.arcgis.com/home/item.html?id=1a58cae727e24927be5a113e52557323). Currently the Street Construction.cga does not have a street parking rule so I've started the process. My goal is to check whether there is parallel parking on the left or right side of a road. I've edited the following sections to include the parallel parking but I'm not sure where in the code it places the texture between the outer lane and edge of pavement. I attached the cga file and any help is very appreciated.

@Group("Parking") @Order(4) @Range(0,0.4)
attr Parking_Width = 1.8    # parking width)
attr Parking_Left = false  # parking left side)
attr Parking_Right = false  # parking right side)

# Street Textures
concrete_tex  = "assets/streets/textures/asphalt.jpg"
sidewalk_tex  = "assets/streets/textures/asphalt_brighter.jpg"
crosswalk_tex =
case Crosswalk_style == "American" : "assets/streets/textures/crosswalk_us2.jpg"
else        : "assets/streets/textures/crosswalk_us.jpg"
curb_tex      = "assets/streets/textures/curb.jpg"
parking_left_tex = "assets/streets/textures/street_left_parking.jpg"
parking_right_tex = "assets/streets/textures/street_right_parking.jpg"


arrows    = case Arrow_marking: "arrows" else: "stop"


getStreetTexture(type,lanes) =
case lanes >= 4 : "assets/streets/textures/street_4lanes_" + type + ".jpg"
case lanes < 1  : "assets/streets/textures/street_1lanes_" + type + ".jpg"
else            : "assets/streets/textures/street_" + lanes + "lanes_" + type + ".jpg"

Attachments

Outcomes