I'm in search of an algorithm that can accept a series of vertices (e.g., v1, v2, v3, ...) defining a path, along with a specified line width, and generate a polygon for each path segment (like v1 to v2). The key requirement is that these polygons should not overlap each other. In cases where overlapping might occur, the areas should be distributed evenly across the relevant segments. The purpose behind this is to draw a pattern along the path, filling each segment's polygon with a pattern that is appropriately rotated and translated to fit.
I have developed a preliminary solution in Rust. However, I've noticed that it struggles with certain edge cases.
Additionally, the solution should account for line joins (bevel, miter) and a miter limit. I'm open to implementations in any practical programming language. Any guidance or suggestions would be greatly appreciated!

