brendan-duncan / image

Dart Image Library for opening, manipulating, and saving various different image file formats.
MIT License
1.17k stars 267 forks source link

roundedCorners support in drawPolygon #451

Open ekuleshov opened 1 year ago

ekuleshov commented 1 year ago

Here is an interesting algorithm for drawing polygons with rounded corners that can be implemented without Bezier curves.

https://gorillasun.de/blog/an-algorithm-for-polygons-with-rounded-corners https://stackoverflow.com/a/44856925

image
brendan-duncan commented 1 year ago

That's interesting. Though I think cubic splines might have more control (without having looked at that article too close). I started writing a Path class with lines and cubic splines implemented for outline drawing so far, but then work started up again and I have pick away at it a bit more slowly now.

ekuleshov commented 1 year ago

Right. At the end of the linked article and in SO answers there is a variant based on Bezier curve too