@@ -6118,6 +6118,61 @@ def roofs(spaces = []) -> list:
61186118 return rufs
61196119
61206120
6121+ def isDaylit (space = None , sidelit = True , toplit = True , baselit = True ) -> bool :
6122+ """Validates whether space has outdoor-facing surfaces with fenestration.
6123+
6124+ Args:
6125+ space (openstudio.model.Space):
6126+ An OpenStudio space.
6127+ sidelit (bool):
6128+ Whether to check for 'sidelighting', e.g. windows.
6129+ toplit (bool):
6130+ Whether to check for 'toplighting', e.g. skylights.
6131+ baselit (bool):
6132+ Whether to check for 'baselighting', e.g. glazed floors.
6133+
6134+ Returns:
6135+ bool: Whether space is daylit.
6136+ False: If invalid inputs (see logs).
6137+
6138+ """
6139+ mth = "osut.isDaylit"
6140+ cl = openstudio .model .Space
6141+ walls = []
6142+ rufs = []
6143+ floors = []
6144+
6145+ if not isinstance (space , openstudio .model .Space ):
6146+ return oslg .mismatch ("space" , space , cl , mth , CN .DBG , False )
6147+
6148+ try :
6149+ sidelit = bool (sidelit )
6150+ except :
6151+ return oslg .invalid ("sidelit" , mth , 2 , CN .DBG , False )
6152+
6153+ try :
6154+ toplit = bool (toplit )
6155+ except :
6156+ return oslg .invalid ("toplit" , mth , 2 , CN .DBG , False )
6157+
6158+ try :
6159+ baselit = bool (baselit )
6160+ except :
6161+ return oslg .invalid ("baselit" , mth , 2 , CN .DBG , False )
6162+
6163+ if sidelit : walls = facets (space , "Outdoors" , "Wall" )
6164+ if toplit : rufs = facets (space , "Outdoors" , "RoofCeiling" )
6165+ if baselit : floors = facets (space , "Outdoors" , "Floor" )
6166+
6167+ for surface in (walls + rufs + floors ):
6168+ for sub in surface .subSurfaces ():
6169+ # All fenestrated subsurface types are considered, as user can set
6170+ # these explicitly (e.g. skylight in a wall) in OpenStudio.
6171+ if isFenestrated (sub ): return True
6172+
6173+ return False
6174+
6175+
61216176def addSubs (s = None , subs = [], clear = False , bound = False , realign = False , bfr = 0.005 ) -> bool :
61226177 """Adds sub surface(s) (e.g. windows, doors, skylights) to a surface.
61236178
@@ -8700,58 +8755,3 @@ def addSkyLights(spaces=[], opts=dict) -> float:
87008755 addSubs (roof , sub , False , True , True )
87018756
87028757 return rm2
8703-
8704-
8705- def isDaylit (space = None , sidelit = True , toplit = True , baselit = True ) -> bool :
8706- """Validates whether space has outdoor-facing surfaces with fenestration.
8707-
8708- Args:
8709- space (openstudio.model.Space):
8710- An OpenStudio space.
8711- sidelit (bool):
8712- Whether to check for 'sidelighting', e.g. windows.
8713- toplit (bool):
8714- Whether to check for 'toplighting', e.g. skylights.
8715- baselit (bool):
8716- Whether to check for 'baselighting', e.g. glazed floors.
8717-
8718- Returns:
8719- bool: Whether space is daylit.
8720- False: If invalid inputs (see logs).
8721-
8722- """
8723- mth = "osut.isDaylit"
8724- cl = openstudio .model .Space
8725- walls = []
8726- rufs = []
8727- floors = []
8728-
8729- if not isinstance (space , openstudio .model .Space ):
8730- return oslg .mismatch ("space" , space , cl , mth , CN .DBG , False )
8731-
8732- try :
8733- sidelit = bool (sidelit )
8734- except :
8735- return oslg .invalid ("sidelit" , mth , 2 , CN .DBG , False )
8736-
8737- try :
8738- toplit = bool (toplit )
8739- except :
8740- return oslg .invalid ("toplit" , mth , 2 , CN .DBG , False )
8741-
8742- try :
8743- baselit = bool (baselit )
8744- except :
8745- return oslg .invalid ("baselit" , mth , 2 , CN .DBG , False )
8746-
8747- if sidelit : walls = facets (space , "Outdoors" , "Wall" )
8748- if toplit : rufs = facets (space , "Outdoors" , "RoofCeiling" )
8749- if baselit : floors = facets (space , "Outdoors" , "Floor" )
8750-
8751- for surface in (walls + rufs + floors ):
8752- for sub in surface .subSurfaces ():
8753- # All fenestrated subsurface types are considered, as user can set
8754- # these explicitly (e.g. skylight in a wall) in OpenStudio.
8755- if isFenestrated (sub ): return True
8756-
8757- return False
0 commit comments