将点列表排序为多边形 [英] Sort point list into polygon

查看:88
本文介绍了将点列表排序为多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几点要点.这组点的确定义了一个(非凸面)多边形,但是没有排序.

I have a set of points. This set of points do define a (non convex) polygon but its not ordered.

由于没有命令,所以我不能随便画点画边界.如何以一种可以遍历此点列表并绘制多边形的方式对其进行排序?

Since it's not ordered I cannot just draw from point to point to draw its border. How can I sort it in a way I can walk through this point list and draw a polygon?

我的第一个想法是使用凸包,但是我的多边形大部分时间都是凹的.

My first idea was to use a convex hull but my polygons are, most of the time, concave.

推荐答案

我认为对此没有明确的解决方案.考虑如下五点:

I don't think there's a well-defined solution to this. Consider five points like this:

.   .
  .
.   .

哪个多边形在这里正确?

What polygon would be correct here?

这篇关于将点列表排序为多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆