Path stroke algorithm (convert to triangles/quads) or other suggestions

試著忘記壹切 提交于 2019-12-05 04:47:23

For anyone looking for a solution to this, I found this useful: https://keithp.com/~keithp/talks/cairo2003.pdf

So you can effectively convolve a regular polygon with the line to generate the mesh. Requires a slightly more complicated algorithm than outlined in the pdf in order to output triangles, but it's not actually too difficult to extend it.

You can also write a custom span generator for AGG along the lines of agg::span_gouraud_rgba but one that effectively does texture mapping instead.

Here's another great resource for understanding the mechanics of stroking a path.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!