如何填充路径呈现? [英] How are filled paths rendered?
问题描述
什么是矢量图形中使用的标准算法,渲染填充路径?
我不是只关心呈现招的过程中,我也想知道怎么形状填充 - 如何如果有一点是确定的内部或路径之外(我相信即使指定什么样的规则内外均不是一个简单的事情)。
-
查找纲要(周长多边形)
- 在此我想你已经有
-
三角(或切到凸多边形)
- 有很多方法
- 夹耳
- 德劳
- 在看到这里
-
填补凹凸的三角形/多边形
- 这是很容易
- 在任一使用GFX的lib,比如OpenGL,DirectX的,...
- 或API类似GDI
- 或栅格化在自己喜欢的这
-
风格
What are the standard algorithms used in vector graphics for rendering filled paths?
I'm not only interested in the process of rendering strokes, I also would like to know how the shapes are filled - how it is determined if given point is inside or outside the path (I believe even specifying the rules of what inside and outside mean is not a straightforward thing).
find outline (perimeter as polygon)
- this I think you already have
triangulate (or cut to convex polygons)
- there are many approaches
- clip ear
- Delaunay
- see here
fill convex triangles/polygons
- this is easy
- either use gfx lib like OpenGL,DirectX,...
- or api like GDI
- or rasterize on your own like this
style
- this stuff is more complicated then it sound like at the first hear
- outline width [pen,stroke] (convert outline to polygon by shifting it out or in) see this
- outline style [pen,stroke] (full,dash dot,dot dot,...) see this
filling style [brush] (like hatching which is most complicated from all)
- involves heavy polygon tweaking similar but much harder then outline width
- some styles are simpler some extremly complicated
- for example for equidistant line fill simple loop + intersection + inside polygon test will do
- to test polygon inside you can use hit test
这篇关于如何填充路径呈现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!