I did check out that example, but honestly it left more questions than answers.
It looks like it’s passing the raw coords into CatmullRomCurve3, then grabbing the modified points. That part makes sense.
Then it’s using BufferGeometry, BufferAttribute, 5 road materials, 4 loops, and a whole bunch of vaguely-named variables to generate the mesh. That part is what doesn’t make sense to me (i.e. because I’m a newbie).
It’ll take a while, but I’ll try to make sense of all this. I really wish that creating a basic (1 solid color) road didn’t require creating a custom geometry though.