Hi Bastien,
Questions in order:
1. Yes. For other parameters it is adjusted based on the Center_Width parameter, but for the center line you need to adjust the constant set by the 'else:PaintLineWidth*4':
const _centerWidth = case oneWay: 0
case Center_Type=="Barrier":.98
case Center_Type=="Barrier & Shoulder":Center_Width
case Center_Type != "None": Center_Width
else:PaintLineWidth*4
2. Yes, but this is more difficult, and I can really only give you psuedo-code rather than specifics (I don't have access on CE right now-long story). The rules you are interested in is the "ConventionalLane" rule:
LaneReporting(dir,lanestotal,lanenumber,stopType,laneType)-->
report("Lane Width.Actual Lane Width (ft)",geometry.dv(0,unitSpace)*Feet) #Used to provide lane widths in feet
ConventionalLane(dir,lanestotal,lanenumber,stopType) <---This rule
But more importantly, the rule that it calls to create those striping cases:
MainLaneMarkings(dir,lanenumber,"_stripes_white") - for the lane paint not near the intersection
and
LaneMarkings(dir,lanenumber,_stopTex(stopType,lanenumber,lanestotal)) - for the approaches specifically
You will need to inspect these rules and replace them with Asphalt() and AsphaltPainted() rules.
For example for MainLaneMarkings- the code might look like this:
MainLaneMarkings(dir,lanenumber,markings)-->
split(v,unitSpace,0){
~(Lane_Width-PaintLineWidth):Asphalt(true,1,"Auto")| #Might need to flip this
Paint_Line_width:AsphaltPainted("white",1,"Auto") # In the case of those with dashed lines see below.
}
# For Dashed lines another rule like:
# Rule--> split(u,unitSpace,0) {~3:Asphalt(true,1,"Auto")|~3 AsphaltPainted("white",1,"Auto")}*
#NOTE: I HAVE NO Access to CityEngine at this time, this code is not tested and is from memory.
3(ps): Yes. You have to call a rule twice on the shape where it called.
It would look this this:
CenterSpace -->
case Center_Type =="Median":
Raised_Curb("Median",1)# IF a median, and this will be use dto make a different rule
...
...
else:
CenterLineMarkings("double_"+ Centerline_Color )
CenterLineMarkingsModified("double_"+ Centerline_Color )# This one moves it up.
Question for you:
What is the use case for it? Why is it important? I am trying to understand this, and I have some ideas why it might useful, but I don't entirely understand.
Disclaimer:
I have not access to CityEngine, I don't know how much of this code will work and I am going entirely from memory. Just treat it as a sketch.
David Wasserman, AICP