It is possible to make a correct procedural road (mask) from any smooth function of x.
Scale, rotate, translate a get function.
Extract x and z
calculate F(x)
mask1 = hardstep(F(x), z)
calculate F'(x) = dF(x)/dx
v = Atan(F'(x))
rotate z v radians
add road Width to z
mask2 = hardstep(z, F(x))
roadmask = complement(multiply(mask1,mask2))