# Procedurally generated paths with intersections

The Problem

I've been attempting to create some procedurally generated paths for a while now, but I've reached a problem when it comes to generating the intersections of the paths.

The paths are currently "extruded" along a catmull-rom spline, I used a bezier curve before but catmull made the whole process of placing the points easier.

My plan is to have all of the path nodes as part of one big graph, so that each node has edges to other nodes. This way it will be easier to do pathfinding on the paths later on.

public class PathNode
{
public Vector3 Position;
public float Width;
public List<PathNode> Edges;
}


Here's an illustration that kinda shows what i want, think of existing games like the roads in Cities skylines:

TL;DR I know how generate the mesh along a curve, my biggest problem here is that i don't know how to generate the mesh at the intersections.

I've read something about creating a polygon from all of the closest vertices of an intersection, and the triangulating that polygon. but i fail to see how i would get the right vertices from the mesh, without having to calculate the distances for each of them to the intersection node.