# -*- coding: utf-8 -*- """ Rhino Python script to generate a simple thesis model: - room box - south facade glazing - horizontal shading canopy - basic layers Run in Rhino via EditPythonScript > Run """ import rhinoscriptsyntax as rs rs.EnableRedraw(False) # Clean start for obj in rs.AllObjects() or []: rs.DeleteObject(obj) # Layers layers = [ "Room_Walls", "Floor", "Ceiling", "Glazing", "Shades", ] for lay in layers: if not rs.IsLayer(lay): rs.AddLayer(lay) # Parameters (meters) L = 6.0 W = 4.0 H = 3.0 wwr = 0.55 window_w = 3.0 window_h = H * wwr sill = 0.9 canopy_depth = 0.8 canopy_thickness = 0.08 # Rhino uses current units; geometry created as-is. # Base points p0 = (0, 0, 0) p1 = (L, 0, 0) p2 = (L, W, 0) p3 = (0, W, 0) # Room surfaces / box # Floor floor = rs.AddPlanarSrf([p0, p1, p2, p3]) rs.ObjectLayer(floor, "Floor") # Ceiling c0 = (0, 0, H) c1 = (L, 0, H) c2 = (L, W, H) c3 = (0, W, H) ceiling = rs.AddPlanarSrf([c0, c1, c2, c3]) rs.ObjectLayer(ceiling, "Ceiling") # Walls walls = [] wall_pts = [ [p0, p1, c1, c0], [p1, p2, c2, c1], [p2, p3, c3, c2], [p3, p0, c0, c3], ] for pts in wall_pts: srf = rs.AddPlanarSrf(pts) walls.append(srf) rs.ObjectLayer(srf, "Room_Walls") # South facade window opening centered on y=0 wall # Create glazing as a planar surface x_start = (L - window_w) / 2.0 x_end = x_start + window_w y = 0.0 z0 = sill z1 = sill + window_h win_pts = [(x_start, y, z0), (x_end, y, z0), (x_end, y, z1), (x_start, y, z1)] glazing = rs.AddPlanarSrf(win_pts) rs.ObjectLayer(glazing, "Glazing") # Canopy above glazing shade_z = z1 + 0.05 shade_pts = [ (x_start - 0.05, y, shade_z), (x_end + 0.05, y, shade_z), (x_end + 0.05, y + canopy_depth, shade_z), (x_start - 0.05, y + canopy_depth, shade_z), ] shade = rs.AddPlanarSrf(shade_pts) rs.ObjectLayer(shade, "Shades") # Add thickness to shade shade_brep = rs.ExtrudeSurface(shade, (0, 0, canopy_thickness)) if shade_brep: rs.ObjectLayer(shade_brep, "Shades") # Optional label points rs.AddTextDot("Thesis Daylight Model", (L/2.0, W/2.0, H+0.4)) rs.EnableRedraw(True) print("Model generated successfully.")