import rhinoscriptsyntax as rs def create_brasilia_cathedral_columns(): # Delete all existing objects allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) # Create a "top ring" revolve_line_pts = [(30,0,0), (6,0,6), (6.5,0,23.5)] revolve_curve = rs.AddCurve(revolve_line_pts, 3) # Define the revolve axis along the Z-axis from (0,0,0) to (0,0,1). axis_start = (0,0,0) axis_end = (0,0,1) # Revolve the line 360 degrees around the Z-axis to form a thin ring. top_ring_id = rs.AddRevSrf(revolve_curve, (axis_start, axis_end)) # Create one "column" rail_points = [(25, 0, 0), ( 8, 0, 14), ( 6.5, 0, 29)] rail_curve = rs.AddInterpCurve(rail_points) # Bottom circle (for example, radius 2) bottom_plane = rs.MovePlane(rs.WorldXYPlane(), [32,0,0]) bottom_circle_id = rs.AddCircle(bottom_plane, 1.2) # Top circle with a very small radius top_plane = rs.MovePlane(rs.WorldXYPlane(), [12,0,30]) top_circle_id = rs.AddCircle(top_plane, 0.08) # Sweep1 using the list of cross-sections (bottom and top circles) pts_rail=rs.DivideCurve(rail_curve,3) middle_circle_1=rs.AddCircle(pts_rail[1],1.2) middle_circle_2=rs.AddCircle(pts_rail[2],1) column = rs.AddSweep1(rail_curve, [bottom_circle_id, middle_circle_1, middle_circle_2, top_circle_id], closed=False) #return column # Create 16 columns with polar array num_columns = 16 for i in range(num_columns): rs.RotateObject(revolve_curve, (0,0,0),i*360/num_columns,copy=True) rs.RotateObject(column, (0,0,0),i*360/num_columns,copy=True) #Create a "top ring" using revolve rs.DeleteObject(column) print("Created 16 cathedral columns (ribs) with revolve + sweep + array.") create_brasilia_cathedral_columns() # Enable drawing to show the result rs.EnableRedraw(True)