目标:中间平坦,为了建筑/规划建模,z值需要为0;但是一定范围外,存在山地
用到random、math函数,python老朋友了
还用到“狄洛尼三角剖分”这个电池(Delaunay triangulation)
思路/代码来着:http://atlv.org/education/ghpython/
import rhinoscriptsyntax as rs
import random
import math
a = []
for i in range(500):
x = math.cos(i*0.2) * i*0.1
y = math.sin(i*0.2) * i*0.08
if(i<200):
z = 0
#保证200次循环内,z值为0
else:
z = random.random() * (i-200)* 0.02
p = rs.AddPoint(x,y,z)
a.append(p)