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 = [(25,0,0), (9,0,8), (5,0,20)] 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, 13), ( 11, 0, 27)] rail_curve = rs.AddInterpCurve(rail_points) # Create a circle as the cross-section of the column at the base. base_plane = rs.MovePlane(rs.WorldXYPlane(), (12,0,0)) circle_radius = 0.4 cross_section = rs.AddCircle(base_plane, circle_radius) # Sweep the circle along the rail curve sweep_result = rs.AddSweep1(rail_curve, [cross_section], closed=False) if not sweep_result: print("Sweep failed or was canceled.") return column_id = sweep_result[0] # 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) #Create a "top ring" using revolve rs.DeleteObject(column_id) print("Created 16 cathedral columns (ribs) with revolve + sweep + array.") create_brasilia_cathedral_columns() # Enable drawing to show the result rs.EnableRedraw(True)