@@ -7637,9 +7637,9 @@ def addSkyLights(spaces=[], opts=dict) -> float:
76377637 sset ["roof" ] = roof
76387638 sset ["space" ] = space
76397639 sset ["m" ] = space .multiplier ()
7640- sset ["sidelit" ] = rooms [space ]["sidelit" ]
7640+ sset ["sidelit" ] = rooms [ide ]["sidelit" ]
76417641 sset ["sloped" ] = isSloped (roof )
7642- sset ["t0" ] = rooms [space ]["t0" ]
7642+ sset ["t0" ] = rooms [ide ]["t0" ]
76437643 sset ["t" ] = openstudio .Transformation .alignFace (vtx )
76447644 ssets .append (sset )
76457645
@@ -7991,11 +7991,11 @@ def addSkyLights(spaces=[], opts=dict) -> float:
79917991 if round (ly , 2 ) < round (sp , 2 ): continue
79927992
79937993 if well :
7994- cols = int (round (width / (wxl + sp )) , 2 )
7995- rows = int (round (depth / (wyl + sp )) , 2 )
7994+ cols = int (round (width / (wxl + sp ), 2 ) )
7995+ rows = int (round (depth / (wyl + sp ), 2 ) )
79967996 else :
7997- cols = int (round (width / (wx + sp )) , 2 )
7998- rows = int (round (depth / (wy + sp )) , 2 )
7997+ cols = int (round (width / (wx + sp ), 2 ) )
7998+ rows = int (round (depth / (wy + sp ), 2 ) )
79997999
80008000 if cols < 2 : continue
80018001 if rows < 2 : continue
@@ -8303,8 +8303,9 @@ def addSkyLights(spaces=[], opts=dict) -> float:
83038303
83048304 # Favour (large) arrays if meeting residual target, unless constrained.
83058305 if "array" in fpm2 :
8306- if round (fpm2 ["array" ]["m2" ], 2 ) >= round (dm2 , 2 ):
8307- if not fpm2 ["tight" ]: pattern = "array"
8306+ if dm2 < fpm2 ["array" ]["m2" ]:
8307+ if "tight" not in fpm2 ["array" ] or fpm2 ["array" ]["tight" ] is False :
8308+ pattern = "array"
83088309
83098310 if not pattern :
83108311 fpm2 = dict (sorted (fpm2 .items (), key = lambda f2 : f2 [1 ]["m2" ]))
@@ -8684,16 +8685,17 @@ def addSkyLights(spaces=[], opts=dict) -> float:
86848685 dY = st ["dY" ]
86858686
86868687 for j in range (st ["rows" ]):
8687- sub = {}
8688- sub ["type" ] = "Skylight"
8689- sub ["count" ] = st ["cols" ]
8690- sub ["width" ] = w1
8691- sub ["height" ] = d1
8692- sub ["id" ] = "%s:%d:%d" % (roof .nameString (), i , j )
8693- sub ["sill" ] = dY + j * (2 * dY + d1 )
8694- if st ["dX" ]: sub ["r_buffer" ] = st ["dX" ]
8695- if st ["dX" ]: sub ["l_buffer" ] = st ["dX" ]
8696- if frame : sub ["frame" ] = frame
8688+ sub = {}
8689+ sub ["type" ] = "Skylight"
8690+ sub ["count" ] = st ["cols" ]
8691+ sub ["width" ] = w1
8692+ sub ["height" ] = d1
8693+ sub ["id" ] = "%s:%d:%d" % (roof .nameString (), i , j )
8694+ sub ["sill" ] = dY + j * (2 * dY + d1 )
8695+
8696+ if "dX" in st and st ["dX" ]: sub ["r_buffer" ] = st ["dX" ]
8697+ if "dX" in st and st ["dX" ]: sub ["l_buffer" ] = st ["dX" ]
8698+ if frame : sub ["frame" ] = frame
86978699
86988700 addSubs (roof , sub , False , True , True )
86998701
0 commit comments