Skip to content

Commit

Permalink
fix(room): Implement better solution for vertex size mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Nov 28, 2023
1 parent 7ed5a40 commit 087d699
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
12 changes: 6 additions & 6 deletions honeybee/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ class Model(_Base):
not contain any spaces or special characters.
rooms: A list of Room objects in the model.
orphaned_faces: A list of the Face objects in the model that lack
a parent Room. Note that orphaned Faces are not acceptable for
Models that are to be exported for energy simulation.
a parent Room. Note that orphaned Faces are translated to sun-blocking
shade objects in energy simulation.
orphaned_shades: A list of the Shade objects in the model that lack
a parent.
orphaned_apertures: A list of the Aperture objects in the model that lack
a parent Face. Note that orphaned Apertures are not acceptable for
Models that are to be exported for energy simulation.
a parent Face. Note that orphaned Apertures are translated to sun-blocking
shade objects in energy simulation.
orphaned_doors: A list of the Door objects in the model that lack
a parent Face. Note that orphaned Doors are not acceptable for
Models that are to be exported for energy simulation.
a parent Face. Note that orphaned Doors are translated to sun-blocking
shade objects in energy simulation.
shade_meshes: A list of the ShadeMesh objects in the model.
units: Text for the units system in which the model geometry
exists. Default: 'Meters'. Choose from the following:
Expand Down
18 changes: 2 additions & 16 deletions honeybee/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,22 +1154,8 @@ def clean_envelope(self, adjacency_dict, tolerance=0.01):
if isinstance(face.boundary_condition, Surface):
try:
adj_face = adjacency_dict[face.identifier]
if len(new_geo) > len(adj_face.geometry):
# gradually increase tolerance until vertices match
tol_incr, iter_c = tolerance / 10, 50
test_tol = tolerance + tol_incr
while iter_c > 0 and len(new_geo) > len(adj_face.geometry):
new_geo = face.geometry.remove_colinear_vertices(test_tol)
test_tol += tol_incr
iter_c -= 1
elif len(new_geo) < len(adj_face.geometry):
# gradually decrease tolerance until vertices match
tol_incr, iter_c = tolerance / 100, 50
test_tol = tolerance - tol_incr
while iter_c > 0 and len(new_geo) < len(adj_face.geometry):
new_geo = face.geometry.remove_colinear_vertices(test_tol)
test_tol -= tol_incr
iter_c -= 1
if len(new_geo) != len(adj_face.geometry):
new_geo = adj_face.geometry.flip()
except KeyError: # the adjacent object has not been found yet
pass
adj_dict[face.boundary_condition.boundary_condition_object] = face
Expand Down

0 comments on commit 087d699

Please sign in to comment.