简体   繁体   中英

Find the underlying polygon bound given the vertices

Given the coordination of the vertices as shown in fig 1, how can we compute the underlying polygon as shown in fig 2? Suppose all the edges are either vertical or horizontal.

Fig 1:

图。1

========================================================================

Fig2:

图2

  • Sort the vertices by x-coordinates
  • Connect vertices with identical x-coordinates
  • Sort the vertices by y-coordinates
  • Connect vertices with identical y-coordinates

Won't work if there are multiple vertices in a line (not just 2), but I'm not sure that's feasible without more information than you gave us.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM