I have a bezier curve and would like to draw it's stroke. To do that, I planned to approximate the stroke to a polygon and fill it with a scanline algorithm. While I feel confident about implementing the conversion and the scanline algorithm, I am unsure how to handle the situation when a polygon intersects itself.
If I don't treat it specially, it will look like on this picture on the left side, but what I am actually looking for is something like on the right side. Is there a popular method how to do that?