几何体的凸包

2024-05-16 10:45:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要得到一个多边形的凸包。我在用shapely。不知道如何应用凸包来获得我需要的结果:

from shapely.geometry import Polygon
p = Polygon(((0,0),(2,0),(2,2),(0,2),(1,1)))

我需要的结果。我不知道如何获得协调,包括重复第一步:

In[]: p.convex_hull   # How to get the resulted coordinates?
Out[]:
((0,0),(2,0),(2,2),(0,2),(0,0)

Tags: thetoinfromimportget多边形how