Skip to content

Commit

Permalink
fix(face3d): Fix incorrect spelling of the word contour
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed May 29, 2021
1 parent 46fcf11 commit fb52f5c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
18 changes: 9 additions & 9 deletions ladybug_geometry/geometry3d/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def mesh_grid(self, x_dim, y_dim=None, offset=None, flip=False,

return grid_mesh3d

def countour_by_number(self, contour_count, direction_vector, flip_side, tolerance):
def contour_by_number(self, contour_count, direction_vector, flip_side, tolerance):
"""Generate a list of LineSegment3D objects contouring the face.
Args:
Expand Down Expand Up @@ -982,8 +982,8 @@ def countour_by_number(self, contour_count, direction_vector, flip_side, toleran
contours = [l_seg for l_seg in contours if l_seg.length >= tolerance]
return contours

def countour_by_distance_between(self, distance, direction_vector, flip_side,
tolerance):
def contour_by_distance_between(self, distance, direction_vector, flip_side,
tolerance):
"""Generate a list of LineSegment3D objects contouring the face.
Args:
Expand Down Expand Up @@ -1030,8 +1030,8 @@ def countour_by_distance_between(self, distance, direction_vector, flip_side,
contours = [l_seg for l_seg in contours if l_seg.length >= tolerance]
return contours

def countour_fins_by_number(self, fin_count, depth, offset, angle,
contour_vector, flip_side, tolerance):
def contour_fins_by_number(self, fin_count, depth, offset, angle,
contour_vector, flip_side, tolerance):
"""Generate a list of Fac3D objects over this face (like louvers or fins).
Args:
Expand All @@ -1055,12 +1055,12 @@ def countour_fins_by_number(self, fin_count, depth, offset, angle,
than the tolerance.
"""
extru_vec = self._get_fin_extrusion_vector(depth, angle, contour_vector)
contours = self.countour_by_number(
contours = self.contour_by_number(
fin_count, contour_vector, flip_side, tolerance)
return self._get_extrusion_fins(contours, extru_vec, offset)

def countour_fins_by_distance_between(self, distance, depth, offset, angle,
contour_vector, flip_side, tolerance):
def contour_fins_by_distance_between(self, distance, depth, offset, angle,
contour_vector, flip_side, tolerance):
"""Generate a list of Fac3D objects over this face (like louvers or fins).
Args:
Expand All @@ -1084,7 +1084,7 @@ def countour_fins_by_distance_between(self, distance, depth, offset, angle,
than the tolerance.
"""
extru_vec = self._get_fin_extrusion_vector(depth, angle, contour_vector)
contours = self.countour_by_distance_between(
contours = self.contour_by_distance_between(
distance, contour_vector, flip_side, tolerance)
return self._get_extrusion_fins(contours, extru_vec, offset)

Expand Down
48 changes: 24 additions & 24 deletions tests/face3d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,94 +1019,94 @@ def test_mesh_grid():
assert mesh_3.max.z == pytest.approx(-1, rel=1e-2)


def test_countour_by_number():
"""Test the countour_by_number method."""
def test_contour_by_number():
"""Test the contour_by_number method."""
pts_1 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(2, 0, 0)]
pts_2 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(4, 0, 0)]
plane = Plane(Vector3D(0, 1, 0))
face_1 = Face3D(pts_1, plane)
face_2 = Face3D(pts_2, plane)

contours = face_1.countour_by_number(4, Vector2D(0, 1), False, 0.01)
contours = face_1.contour_by_number(4, Vector2D(0, 1), False, 0.01)
assert len(contours) == 4
assert contours[0].p2.z == pytest.approx(2, rel=1e-3)
assert contours[-1].p2.z == pytest.approx(0.5, rel=1e-3)

contours = face_1.countour_by_number(4, Vector2D(1), False, 0.01)
contours = face_1.contour_by_number(4, Vector2D(1), False, 0.01)
assert len(contours) == 4
assert contours[-1].p2.x == pytest.approx(1.5, rel=1e-3)

contours = face_1.countour_by_number(4, Vector2D(1), True, 0.01)
contours = face_1.contour_by_number(4, Vector2D(1), True, 0.01)
assert len(contours) == 4
assert contours[-1].p2.x == pytest.approx(0.5, rel=1e-3)

contours = face_2.countour_by_number(4, Vector2D(0, 1), False, 0.01)
contours = face_2.contour_by_number(4, Vector2D(0, 1), False, 0.01)
assert len(contours) == 4
contours = face_2.countour_by_number(8, Vector2D(1), False, 0.01)
contours = face_2.contour_by_number(8, Vector2D(1), False, 0.01)
assert len(contours) == 8


def test_countour_by_distance_between():
"""Test the countour_by_distance_between method."""
def test_contour_by_distance_between():
"""Test the contour_by_distance_between method."""
pts_1 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(2, 0, 0)]
pts_2 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(4, 0, 0)]
plane = Plane(Vector3D(0, 1, 0))
face_1 = Face3D(pts_1, plane)
face_2 = Face3D(pts_2, plane)

contours = face_1.countour_by_distance_between(0.5, Vector2D(0, 1), False, 0.01)
contours = face_1.contour_by_distance_between(0.5, Vector2D(0, 1), False, 0.01)
assert len(contours) == 4
assert contours[0].p2.z == pytest.approx(2, rel=1e-3)
assert contours[-1].p2.z == pytest.approx(0.5, rel=1e-3)

contours = face_1.countour_by_distance_between(0.5, Vector2D(1), False, 0.01)
contours = face_1.contour_by_distance_between(0.5, Vector2D(1), False, 0.01)
assert len(contours) == 4
assert contours[-1].p2.x == pytest.approx(1.5, rel=1e-3)

contours = face_1.countour_by_distance_between(0.5, Vector2D(1), True, 0.01)
contours = face_1.contour_by_distance_between(0.5, Vector2D(1), True, 0.01)
assert len(contours) == 4
assert contours[-1].p2.x == pytest.approx(0.5, rel=1e-3)

contours = face_2.countour_by_distance_between(0.5, Vector2D(0, 1), False, 0.01)
contours = face_2.contour_by_distance_between(0.5, Vector2D(0, 1), False, 0.01)
assert len(contours) == 4
contours = face_2.countour_by_distance_between(0.5, Vector2D(1), False, 0.01)
contours = face_2.contour_by_distance_between(0.5, Vector2D(1), False, 0.01)
assert len(contours) == 8


def test_countour_fins_by_number():
"""Test the countour_fins_by_number method."""
def test_contour_fins_by_number():
"""Test the contour_fins_by_number method."""
pts_1 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(2, 0, 0)]
plane = Plane(Vector3D(0, 1, 0))
face_1 = Face3D(pts_1, plane)

fins = face_1.countour_fins_by_number(4, 0.5, 0.5, 0, Vector2D(0, 1), False, 0.01)
fins = face_1.contour_fins_by_number(4, 0.5, 0.5, 0, Vector2D(0, 1), False, 0.01)
assert len(fins) == 4

fins = face_1.countour_fins_by_number(4, 0.5, 0.5, 0, Vector2D(1), False, 0.01)
fins = face_1.contour_fins_by_number(4, 0.5, 0.5, 0, Vector2D(1), False, 0.01)
assert len(fins) == 4

fins = face_1.countour_fins_by_number(
fins = face_1.contour_fins_by_number(
4, 0.5, 0.5, math.pi/4, Vector2D(0, 1), False, 0.01)
assert len(fins) == 4


def test_countour_fins_by_distance_between():
"""Test the countour_fins_by_distance_between method."""
def test_contour_fins_by_distance_between():
"""Test the contour_fins_by_distance_between method."""
pts_1 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(2, 0, 0)]
pts_2 = [Point3D(0, 0, 0), Point3D(0, 0, 2), Point3D(2, 0, 2), Point3D(4, 0, 0)]
plane = Plane(Vector3D(0, 1, 0))
face_1 = Face3D(pts_1, plane)
face_2 = Face3D(pts_2, plane)

fins = face_1.countour_fins_by_distance_between(
fins = face_1.contour_fins_by_distance_between(
0.5, 0.5, 0.5, 0, Vector2D(0, 1), False, 0.01)
assert len(fins) == 4

fins = face_1.countour_fins_by_distance_between(
fins = face_1.contour_fins_by_distance_between(
0.25, 0.5, 0.5,0, Vector2D(1), False, 0.01)
assert len(fins) == 8

fins = face_2.countour_fins_by_distance_between(
fins = face_2.contour_fins_by_distance_between(
0.5, 0.5, 0.5, 0, Vector2D(1), False, 0.01)
assert len(fins) == 8

Expand Down

0 comments on commit fb52f5c

Please sign in to comment.