Editing CGA to add Parallel Parking

663
1
04-08-2014 03:20 PM
SteveRhyne
New Contributor III
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"
Tags (2)
0 Kudos
1 Reply
MatthiasBuehler1
Frequent Contributor
My goal is to check whether there is parallel parking on the left or right side of a road.



Hi,

I'm not sure I understand .. When you create the geometries with the 'Dynamic CityLayouts' system ( shapes ) and then create the actual models in CGA, why do you need to check ? What do you want to check precisely ?

Can you post an image of the goal ?

Lemme know ..

Matt
0 Kudos