Vanishing thickness on Polyline segment coming back to itself
Hello!
I want to create a segment that comes back to itself. Ignoring z, the coordinates of the three points of this polyline are:
- (0, 1)
- (2, 1)
- (0, 1)
The result is the segment in the screenshot:
I don't understand why the segment draws as a single triangle rather than a quad. I imagine this has to do with the join type.
Using rounded joins makes it slightly better, but not exactly what I'm after.
The best I've come to is to use Bevel joins with "almost" equal segments:
But adding an extra 9 (0.999999) makes it revert to the previous result.
Is this the expected behaviour?
Is there a way to treat these two segments such that they don't vanish at the join point?
Thanks!
Ale
You're totally right - it's relatively easy to change my code to create these dummy points when doing sharp angles. Leaving this screenshot here in case anyone else is interested in what worked for me:
Thanks for your help!