How to generate the stair step curve(outline) for any 2d shape(or curve)?

前端 未结 2 1565
旧时难觅i
旧时难觅i 2020-12-10 22:44

If I have the coordinates of the points on the outline of an arbitrary 2D shape, how can I find the coordinates of points composing the outline of a stair step curve, which

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 23:17

    Seems you need any line rasterization algorithm (that gives coordinate of integer grid points approximating line segment).

    Consider Bresenham algortihm or DDA one.

提交回复
热议问题