import rhinoscriptsyntax as rs import random as ran # delete everything and start from scratch rs.DeleteObjects(rs.AllObjects()) rs.EnableRedraw(False) # defining variables rad = 20 # radius of the tower hgt = 172 # height of the tower angle = 25 # twist angle # generating the main body of the tower : # base shape of the tower base_crv = rs.AddPolyline([[0,0,0], [0,20,0], [18,29,0], [36,20,0], [36,0,0], [18,-9,0], [0,0,0]], None) #base_crv_srf = rs.AddPlanarSrf(base_crv) rail_1 = rs.AddLine([18,10,0],[18,10,150]) upper_crv=rs.CopyObject(base_crv, (0,0,150)) rs.RotateObject(upper_crv, [18,10,0], 360*0.4) rs.AddLine([0,0,0],[36,20,0]) len=rs.Distance([0,0,0],[36,20,0]) spi=rs.AddSpiral([18,10,0],[18,10,150], 150*(1/0.4), 0.4, len/2) rs.RotateObject(spi, [18,10,0],30) rs.AddSweep2((spi,rail_1),(base_crv, upper_crv)) def sweep(base_crv=base_crv, upper_crv=upper_crv, rail_1=rail_1): base_crv_srf = rs.AddPlanarSrf(base_crv) upper_crv_srf = rs.AddPlanarSrf(upper_crv) rail_1 = rs.AddLine([18,10,0],[18,10,150]) new_upper_srf = rs.RotateObject(upper_crv_srf, [18,10,150], angle, None, False) main_body = rs.AddSweep2(rail_1, (base_crv, upper_crv), True) return(main_body) """ main_body=sweep() # dividing the tower #pt = rs.AddPoint([18,10,100], None, None) #main_body = rs.AddSweep1(rail_1, base_crv_srf, new_upper_srf, True) help_crv = rs.CopyObject(base_crv, None) rs.MoveObject(help_crv, [-15,-10,100]) rs.ScaleObject(help_crv, [0,0,0], [5,5,1], False) help_srf = rs.AddPlanarSrf(help_crv) #split_part = rs.BooleanIntersection(main_body, help_srf, True) rs.DeleteObjects((base_crv, upper_crv)) # shape and proportions #rs.MoveObject(split_part, [18,10,165]) #rs.RotateObject(split_part """ "---> CAP MAIN BODY PARTS!" """ # create the columns base_circ = rs.AddCircle([18,10,0],14) small_circ = rs.AddCircle([0,0,0], 1) pts = rs.DivideCurve(base_circ, 10, True, True) #col_circs = rs.MoveObject(small_circ, pts) for i in range(10): col_circs = rs.CopyObject(small_circ, pts) cols = rs.ExtrudeCurves(col_circs, rail_1) """ # create the side part of the tower help_pt1 = rs.AddPoint([0,10,0]) help_pt2 = rs.AddPoint([0,10,160]) help_pt3 = rs.AddPoint([18,10,160]) rail_sidep = rs.AddPolyline((help_pt1, help_pt2, help_pt3), None) rect = rs.AddPolyline(([5,5,0], [-7,5,0], [-7,15,0], [5,15,0], [5,5,0]), None) #sweep_rect = rs.AddSweep1(rail_sidep, rect, True) # create the plinth # cylindric plinth rs.AddCylinder([18,10,0], -25, 35, True) # cubic plinth rs.AddBox(([-20,-28,-55],[-20,48,-55],[56,48,-55],[56,-28,-55],[-20,-28,-25],[-20,48,-25],[56,48,-25],[56,-28,-25])) # create top part of the tower # details