pedestrian + parking spots

2357
2
02-19-2013 02:16 AM
ziadfilfili
New Contributor II
Hello,

I am trying to create a pedestrian street along with the street network with a little modification.
what i need is parking spots for cars, as well as green areas with pedestrians.

I attached an image as a reference for what i am aiming for. (It is marked in red)

Any help ?!
0 Kudos
2 Replies
MatthiasBuehler1
Frequent Contributor
Hi !

I'd create a CGA rule which takes the Sidewalk shape, then splits off a parking strip first which is refined with green spots in between. The rest of the shape is then considered as pedestrian area, textured and people added.

Let me know if you need a start help with how to code this.

M.
0 Kudos
JoanneO_Brien
Occasional Contributor
I just modified the Street Construction.cga to achieve this. I've just used footpaths and parking spaces, but you can modify some of the textures to add the grass too pretty easily:

# -----------------------
#Carparks Attributes
@Group("Carpark",3) @Order(1) 
attr carparks = false

@Group("Carpark") @Order(2) 
attr carparkwidth = 2.5

Sidewalk --> 
 alignScopeToAxes(y) 
 BridgeSide
 SidewalkWithKerbs 
 t(0, Sidewalk_height ,0)
 SidewalkLamps SidewalkTrees SidewalkProps People TrafficLights

SidewalkWithKerbs --> 
 case carparks == true :
 comp(f){ top   : split(y){ Sidewalk_height : CarparkKerbs | ~1 : CarparkPavement } }
        //| side : split(u,unitSpace,0){Crosswalk_width*2 : CarparkKerbs | ~1 : CarparkPavement | Crosswalk_width*2 : CarparkKerbs} }
else: 
 extrude(world.y, Sidewalk_height )
 comp(f){ top : split(y){ Sidewalk_height : Kerbs | ~1 : CarparkPavement }|
         side : Kerbs}

CarparkKerbs-->  
 case carparks == true: 
  split(x){Crosswalk_width*2 : extrude(world.y, Sidewalk_height )Kerbs
  | ~1 : t(0,carparkwidth,0) extrude(Sidewalk_height)Kerbs | Crosswalk_width*2 : extrude(world.y, Sidewalk_height )Kerbs}
  setupProjection(0,scope.xy,~1.1,'1) projectUV(0) 
  texture(kerb_tex)
 else:Kerbs

CarparkPavement -->
 case carparks == true : 
   split(u,unitSpace,0){ Crosswalk_width*2 : extrude(world.y, Sidewalk_height )Pavement 
   | t(0,-0.2,0) split(v,unitSpace,0)
   { carparkwidth : split(u,unitSpace,0){0.2 : extrude(Sidewalk_height)Kerbs 
   |{ ~5 : Asphalt  | { ~0.1:  WhiteLine | ~5 : Asphalt }* |0.2 : extrude(Sidewalk_height)Kerbs} } 
   |  ~1 : t(0,0.2,0) extrude(world.y, Sidewalk_height )Pavement }
   | Crosswalk_width*2: extrude(world.y, Sidewalk_height )Pavement }
  else: Pavement

WhiteLine-->    
 color(White)



I believe that was all the code I modified, but I might have missed something out...gave me the option to turn on and off whether I had a carpark along the street though, but I've attached an image of the sort of thing it gives me.

hope that helps!
0 Kudos