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 like:
see Wiki Polygon triangulation
fill convex triangles/polygons
this is easy either use
style
This stuff is more complicated then it sound like at the first hear. For:
outline width pen,stroke
convert outline to polygon by shifting it out or in. For more info see this
outline style pen,stroke
full,dash dot,dot dot,... for more info see this
filling style brush
like hatching which is most complicated from all. It 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With