0
我试着用matplot.Delaunay对2D中的一个简单多边形进行三角剖分......这里的问题是我需要规则的三角形。多边形是由numpy随机创建的,也许Delaunay不是要走的路。使用matplotlib对多边形进行三角剖分
import matplotlib.delaunay as triang
import pylab
import numpy
# 10 random points (x,y) in the plane
x,y = numpy.array(numpy.random.standard_normal((2,10)))
cens,edg,tri,neig = triang.delaunay(x,y)
for t in tri:
# t[0], t[1], t[2] are the points indexes of the triangle
t_i = [t[0], t[1], t[2], t[0]]
pylab.plot(x[t_i],y[t_i])
pylab.plot(x,y,'^')
pylab.show()
只是一个问题,什么是 'n_radii' 呢? – PrintName
'numpy.repeat(a,repeatats,axis = None)' - 'a'数组的重复元素'重复次数:http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/ numpy.repeat.html – Serenity