Select to view content in your preferred language

Create border lines on roads Joint, CGA rule

1077
2
Jump to solution
08-16-2023 03:30 AM
AdamChełstowski
Emerging Contributor

I am trying to create road white border lines visible here:

RealWorldExample.png

So far I modified the original Street_Modern_Standard.cga in the Lanes method, adding the "AsphaltPainted" with small 0.05 width:

split(v,uvSpace,0){ _sidelineWidth : AsphaltPainted("White")
					  | NbrOfRightLanes-_centerlineWidth/2 - _sidelineWidth: Lanes(case rightHandTraffic: StopEnd else: StopBegin)		# in case of right-hand traffic, these lanes are in the direction of the graph segment
					  |	~_centerlineWidth				  : CenterLine
					  | nLanesLeft-_centerlineWidth/2 - _sidelineWidth  : translateUV(0,0,-geometry.vMax) scaleUV(0,-1,-1)    # mirror the uv coords
						  									Lanes(case rightHandTraffic: StopBegin else: StopEnd) 
					  | _sidelineWidth : AsphaltPainted("White")}

The problem is with the texture being cut when two roads with different widths are joining with Joint. On one side white line is being cut, as the UV mapping seems to be outside the mesh:

AdamChestowski_0-1692181326758.pngAdamChestowski_1-1692181443259.png

Is there anything I can do to fix this? I am currently using CityEngine 2021.0.7316.

 

 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
JonasObertuefer
Esri Contributor

Hi @AdamChełstowski,

I don't see a way to fix this on the street level, because in this case one of the UV tiles will always be cut:

JonasObertuefer_0-1692949134509.png

 

What you could do instead is to create a seperate cga file for the sidelines which you then assign to the sidewalks:

JonasObertuefer_1-1692949206876.png

On the node I suggest to increase the curb radius & precision to get a smoother line

Hope this helps!

Cheers
Jonas

View solution in original post

2 Replies
JonasObertuefer
Esri Contributor

Hi @AdamChełstowski,

I don't see a way to fix this on the street level, because in this case one of the UV tiles will always be cut:

JonasObertuefer_0-1692949134509.png

 

What you could do instead is to create a seperate cga file for the sidelines which you then assign to the sidewalks:

JonasObertuefer_1-1692949206876.png

On the node I suggest to increase the curb radius & precision to get a smoother line

Hope this helps!

Cheers
Jonas

Bee-am
by
Emerging Contributor

Hi @JonasObertuefer

Isn't there a way to map the UVs such that one can pick the edge/side of the texture that clips (by using some form of edge index or similar)? I'd imagine different use cases where such would be useful.

0 Kudos