|
#coding=utf-8
import rhinoscriptsyntax as rs
import math
#导入rhinoscriptsyntax模块以及math模块
a_radius=input("please enter a_radius:")
b_radius=input("please enter b_radius:")
FloorHeight=input("Please enter floor height of the building:")
FloorNumber=input("Please enter the floor numbers of the building:")
Angle=input("Please enter the floor angle of the rotating_action:")
#用户从命令行输入基本层平面形状的参数:半长轴,半短轴,层高,层数
if Angle<=2.0:
origin=(FloorNumber+1)*[None]
xaxis=(FloorNumber+1)*[None]
yaxis=(FloorNumber+1)*[None]
#建立三个Plane构成参数的List,为后期平面进行在循环条件下的旋转提供参数
for z in range(0,FloorHeight*(FloorNumber+1),FloorHeight):
origin[int(z/FloorHeight)]= (0,0,z)
A=(Angle/FloorNumber)*(z/FloorHeight)
xaxis[int(z/FloorHeight)]= (math.sin(A*math.pi),math.cos(A*math.pi),0)
yaxis[int(z/FloorHeight)]= (math.sin((A+1.0/2)*math.pi),math.cos((A+1.0/2)*math.pi),0)
#在循环条件下根据层高层数为origin列表,xaxis列表以及yaxis列表的索引值更改数据,使之不再是空列表
id=(FloorNumber+1)*[None]
for i in range(FloorNumber+1):
ellipse=rs.AddEllipse(rs.PlaneFromFrame(origin[i],xaxis[i],yaxis[i]),a_radius,b_radius)
id[i]=rs.FirstObject()
print ellipse
select_ellipse=(FloorNumber+1)*[None]
for t in range(FloorNumber+1):
select_ellipse[t]=rs.SelectObject(id[t])
print select_ellipse[t]
shape=rs.AddLoftSrf(id, start=None, end=None, loft_type=0, simplify_method=0, value=0, closed=False)
|
评分
-
查看全部评分
|