How to represent a polygon with hole(s)?

前端 未结 6 1841
野趣味
野趣味 2021-01-02 10:17

It\'s usually popular to work with polygons with their vertices sorted CW or CCW in vectors(2*1 or 1*2 matrices). However, how to state polygons with holes in vectors?

6条回答
  •  迷失自我
    2021-01-02 11:06

    What exactly do you mean under "a visibility graph" ?

    Two "full" poligons, two states possible, either +1 or -1.

    If you're representing a hole, you've got one with state +1 and one with state -1, which represents a hole, resulting in state 0.
    If you've got overlapping polygons, you'll end up with resultant state >1. Then you can calculate the borders of a new polygon.
    If you've got two polygons with holes that intersect, then first calculate the state of a new polygon which consists of outer borders of the two old ones, then deal with holes.

    Anyways, ... I think you get the general principle.

    Have no idea how to do it in matlab, I used it only marginally so far, and even that for very simple things.

提交回复
热议问题