I have looked around to find an example of how to take a polyline and create a buffer around it so I end up with a polygon.
So far I found out I need Minkowskis Sums to do so, but I can't get my head around to raw algorithm and translate that in to code.
I would prefer an example in C# or a walkthrough of the algorithm.
You could use the OffsetPolygons() function in the Clipper library, but first you'd need to convert the polyline into a polygon. Do this by appending to the polyline a reverse copy of the polyline. But since duplicate vertices aren't allowed the reverse copy must exclude the first and last vertices: v1,v2,...,vn, v(n-1),...,v2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With