Skip to content

Commit

Permalink
fix(face): Add core geometry properties to assist with DOE-2 translation
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Apr 19, 2024
1 parent 87156cb commit 20f5de4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ladybug_geometry/geometry3d/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,14 @@ def azimuth(self):

@property
def altitude(self):
"""Get the altitude of the Face3D (between Pi/2 and -Pi/2)."""
"""Get the altitude of the Face3D. Between Pi/2 (up) and -Pi/2 (down)."""
return self.plane.altitude

@property
def tilt(self):
"""Get the tilt of the Face3D. Between 0 (up) and Pi (down)."""
return self.plane.tilt

@property
def is_clockwise(self):
"""Boolean for whether the face vertices and boundary are in clockwise order.
Expand Down
12 changes: 10 additions & 2 deletions ladybug_geometry/geometry3d/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def y(self):

@property
def azimuth(self):
"""Get the azimuth of the plane (between 0 and 2 * Pi).
"""Get the azimuth of the plane.
This is always between 0, indicating the positive Y-axis, and moving clockwise
up to 2 * Pi, which indicates a return to the positive Y-axis.
This will be zero if the plane is perfectly horizontal.
"""
Expand All @@ -153,11 +156,16 @@ def azimuth(self):

@property
def altitude(self):
"""Get the altitude of the plane (between Pi/2 and -Pi/2)."""
"""Get the altitude of the plane. Between Pi/2 (up) and -Pi/2 (down)."""
if self._altitude is None:
self._altitude = self.n.angle(Vector3D(0, 0, -1)) - math.pi / 2
return self._altitude

@property
def tilt(self):
"""Get the tilt of the plane. Between 0 (up) and Pi (down)."""
return abs(self.altitude - (math.pi / 2))

@property
def min(self):
"""Returns the Plane origin."""
Expand Down

0 comments on commit 20f5de4

Please sign in to comment.