Tower Script |
DayOne_TowerScript
The python script uses a simple rhinoscript functions like rotate, scale, copy object functions to create a loft surface based on the curve input. Script also utilizes math functions like sin() for distribution of the curve profiles along Z axis.CODE:
import rhinoscriptsyntax as rs
import math
strFloor = rs.GetObject("Pick a closed curve representing the floor slab.", 4)
strCenterPt = rs.CurveAreaCentroid(strFloor)
listFloors = []
maxFloors = 50
strFloorCopy = rs.CopyObject(strFloor)
for i in range(0,maxFloors):
print math.sin(i)+1
strFloorCopy = rs.CopyObject(strFloorCopy,[0,0,(math.sin(i)+1)])
strCenterPt = rs.CurveAreaCentroid(strFloorCopy)
strFloorRotate = rs.RotateObject(strFloorCopy,strCenterPt[0],i*(360/maxFloors))
strFloorScale = rs.ScaleObject(strFloorRotate,strCenterPt[0],[0.98,0.98,0])
listFloors.append(strFloorScale)
rs.AddLoftSrf(listFloors)
No comments:
Post a Comment