Realised the way Iwas doing this is inefficient.
SO working on a new technique. Again.
Now after I have read in all the points , I read in all the paths and store all the connections made to each point.
Then I iterate over the points generating new points based on the number of connections.
If a point only has one connection, it is trivial. You create a direction from this point to the connected point, cross it to generate a right vector, and multiply that by half the width. Then I use this to generate two points and store then in the point structure.
If it has two points, I start off the same. Generating a direction to the next point and the right vector, but this time I do the same for the other connection. so I end up with four points and two directions. I then use these points and directions to generate four lines and calculate the intersection points of these lines, and store those two intersections.
After that it gets more complex, but basically I generate directions from the current point to all connected points. I then sort these so they are counter clockwise. Then it's the same process of generating right vectors, generating lines, computing intersections, and storing the points.
This image attempts to explain the process
Then I iterate over the paths using the generated points to build triangles.
So you end up with something like this
It can handle changes in width as you go along no problem, and in the fist pass doesn't look too bad.
However I am thinking that by storing the direction of each line and doing a bit more logic , I can make it better by using splines