Created
September 7, 2022 19:55
-
-
Save mostaphaRoudsari/0ac3209425e087911f602a0e91afc3ac to your computer and use it in GitHub Desktop.
Add sensor grids to Honeybee model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from honeybee.facetype import Floor | |
from honeybee_radiance.sensorgrid import SensorGrid | |
def add_grids_to_model(model, x_dim=1, y_dim=1, offset=0.8): | |
sensor_grids = [] | |
for room in model.rooms: | |
floors = [face.geometry for face in room.faces if isinstance(face.type, Floor)] | |
grid = SensorGrid.from_face3d( | |
identifier=room.identifier, faces=floors, x_dim=x_dim, y_dim=y_dim, | |
offset=offset, flip=True | |
) | |
sensor_grids.append(grid) | |
model.properties.radiance.sensor_grids = sensor_grids | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment