import rhinoscriptsyntax as rs def create_glass_sculpture(): # Dimensions for each glass box (in cm) box_width = 25 box_height = 25 box_depth = 25 # Number of boxes along the x, y, and z directions boxes_x = 5 boxes_y = 6 boxes_z = 5 # Base point for the sculpture base_point = (0, 0, 0) # Automatically set to origin (0, 0, 0) # Create the grid of boxes for i in range(boxes_x): for j in range(boxes_y): for k in range(boxes_z): # Calculate the corner point of each box corner_x = base_point[0] + i * box_width corner_y = base_point[1] + j * box_depth corner_z = base_point[2] + k * box_height # Define the 3D box corners box_corners = [ [corner_x, corner_y, corner_z], [corner_x + box_width, corner_y, corner_z], [corner_x + box_width, corner_y + box_depth, corner_z], [corner_x, corner_y + box_depth, corner_z], [corner_x, corner_y, corner_z + box_height], [corner_x + box_width, corner_y, corner_z + box_height], [corner_x + box_width, corner_y + box_depth, corner_z + box_height], [corner_x, corner_y + box_depth, corner_z + box_height] ] # Create a box from corner points box = rs.AddBox(box_corners) # Assign glass material properties (transparency and color) if box: material_index = rs.AddMaterialToObject(box) rs.MaterialTransparency(material_index, 0.7) # 70% transparency rs.MaterialColor(material_index, (200, 255, 255)) # Light blue glass color print("Glass sculpture created successfully.") # Run the function if __name__ == "__main__": create_glass_sculpture()