I’ve been scratching my head over this problem for the past several days… I finally got something close to what I was hoping for.

Basically I’m attempting to create a new Mesh, the vertices will make a 2D road that follows a Bezier curve. I finally figured out that Meshes use *Local Space*, after doing the conversations I was able to get the curve to end in the right place. But now I’m stuck trying to figure out how to get both edges of the road to follow a curve. I basically need an extrude point along the sideways Vector of the current curve position.

This is my code for each iteration of a mesh part in the curve:

```
for (var i2 = 0; i2 < curveResolution; i2++) {
var newI2 : float = i2;
var catT : float = newI2 / (curveResolution - 1);
// Get the point on our curve using the 4 points generated above
var p : Vector3 = PointOnPath(catT, points[0], points[1], points[2], points[3]);
var p2 : Vector3 = p;
//What do I do with p2 to give the road thickness?
//and p starts in the center of the transform...
//how do I shift p over while still following the curve?
catVerts.Add(p);
catVerts.Add(p2);
if (catVerts.Count >= 4) {
// We have completed a new quad, create 2 triangles
var start : int = catVerts.Count - 4;
catTris.Add(start + 2);//0
catTris.Add(start + 1);
catTris.Add(start + 0);//2
catTris.Add(start + 0);//1
catTris.Add(start + 3);
catTris.Add(start + 2);
}
}
```

If that was too confusing basically what I need is a way to get the green lines here:

Obviously I have the black line from the PointOnPath function, but now I need the translations of it that will let create thickness for the road mesh.

Thanks! Or if you have your own example of Mesh Generation on a spline, that would be really helpful as well!