Rasterizing a 2D polygon

后端 未结 4 1387
予麋鹿
予麋鹿 2020-12-09 21:54

I need to create a binary bitmap from a closed 2D polygon represented as a list of points. Could you please point me to efficient and sufficiently simple algorithms to do th

4条回答
  •  渐次进展
    2020-12-09 22:11

    The magic google phrase you want is either "non-zero winding rule" or "even odd polygon fill".

    See the wikipedia entries for:

    • non-zero winding rule
    • even odd polygon fill

    Both are very easy to implement and sufficiently fast for most purposes. With some cleverness, they can be made antialiased as well.

提交回复
热议问题