Skip to content

Instantly share code, notes, and snippets.

@mostaphaRoudsari
Created September 7, 2022 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mostaphaRoudsari/0ac3209425e087911f602a0e91afc3ac to your computer and use it in GitHub Desktop.
Save mostaphaRoudsari/0ac3209425e087911f602a0e91afc3ac to your computer and use it in GitHub Desktop.
Add sensor grids to Honeybee model
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