Skip to content

Commit

Permalink
fix(polyface): Ensuring floor of Polyface3D.from_box() points down
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jul 24, 2019
1 parent 9f58472 commit b147d82
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ladybug_geometry/geometry3d/polyface.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,10 @@ def from_box(cls, width, depth, height, base_plane=None):
polyface = cls(_verts, _face_indices, {'edge_indices': _edge_indices,
'edge_types': [1] * 12})
verts = tuple(tuple(_verts[i] for i in face[0]) for face in _face_indices)
top_plane = base_plane.move(_h_vec)
bottom = (Face3D(verts[0], plane=base_plane, enforce_right_hand=False),)
bottom = Face3D(verts[0], plane=base_plane.flip(), enforce_right_hand=False)
middle = tuple(Face3D(v, enforce_right_hand=False) for v in verts[1:5])
top = (Face3D(verts[5], plane=top_plane, enforce_right_hand=False),)
polyface._faces = bottom + middle + top
top = Face3D(verts[5], plane=base_plane.move(_h_vec), enforce_right_hand=False)
polyface._faces = (bottom,) + middle + (top,)
polyface._volume = width * depth * height
return polyface

Expand Down

0 comments on commit b147d82

Please sign in to comment.