本帖最后由 yesmely 于 2013-9-22 15:46 编辑
板块冷清,来点小代码,顺便提示下喜欢rhino.python的朋友可以来这个裙交流:253347427- import rhinoscriptsyntax as rs
- def lsnow1(line):
- points = rs.DivideCurve(line,3,False,True)
- point3=rs.AddPoint(points[2])
- ptm=rs.RotateObject(point3,points[1],-60.0,None,copy=True)
- points.insert(2,ptm)
- pl=rs.AddPolyline(points)
- rs.DeleteObjects([line,point3,ptm])
- linesID=rs.ExplodeCurves(pl,True)
- return linesID
- def lsnows(lines):
- list=[]
- for x in lines:
- for y in lsnow1(x):
- list.append(y)
- return list
- def lsnow(line,num):
- if num==0:
- return line
- elif num==1:
- return lsnow1(line)
- else:
- return lsnows(lsnow(line,num-1))
- line = rs.GetObject("Select a line:")
- degree=rs.GetInteger("Degree(Integer)=?,better <5")
- if line and degree:
- lsnow(line,degree)
复制代码 高手见笑,哪位有兴趣做个分形生成器?
GH附件:
lsnow.rar
(10.59 KB, 下载次数: 386)
|