I try to draw thick Bezier lines (for a custom Sankey diagram).
I use SVG Paths, with Bezier curves in the form of C x1 y1, x2 y2, x y
. I use stroke
rather than fill
, so that they have constant width (and can represent flows).
It works very well if the lines are thin or if the vertical difference is relatively low. However, if they are very thick, I get some nasty artifacts (looking like horns) - see the bottom right curve from the picture below:
Source: http://jsfiddle.net/stared/83jr5fub/
Is there a way to avoid artifacts, i.e.:
- ensure there is nothing on the left of
x1
or right ofx
, - actual widths on the left and right match
stroke-width
?
fill
shapes but then their widths was visibly uneven (though maybe some tweaking would help). Withstroke
- I am thinking that maybe some mask would help. – Piotr Migdalstroke-linecap: rect
but this will add the stroke-width at start and ending points of your path. make a closed path and fill it. Be sure that your stroke-width is never more than the angle... I dont know how to clearly say that but just be sure the dashes in this fiddle never collapse : jsfiddle.net/83jr5fub/3 And that's almost all of what I can think of. I don't think the mask would help since IMMind you'd need the closed path too. – Kaiido