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