Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 26, 2023
1 parent b5195c3 commit cc4a161
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/test_bezier_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_extraction(self):
knot_vectors=[[0, 0, 0, 0, 1, 1, 2, 3, 4, 4, 4, 4]],
degrees=[3],
control_points=c.np.random.rand(8, 2),
weights=c.np.random.rand(8,1),
weights=c.np.random.rand(8, 1),
)

# Extract Beziers
Expand Down Expand Up @@ -75,11 +75,9 @@ def test_extraction_matrice_bspline_2D(self):
for m, b in zip(n_matrices, beziers_n):
# Test matrices m against spline ctps
self.assertTrue(
c.np.allclose(b.control_points,
m @ bspline.control_points)
c.np.allclose(b.control_points, m @ bspline.control_points)
)


def test_extraction_matrice_nurbs_2D(self):
"""Create matrices to extract splines"""

Expand All @@ -93,16 +91,14 @@ def test_extraction_matrice_nurbs_2D(self):
beziers_n = nurbs.extract_bezier_patches()
for m, b in zip(n_matrices, beziers_n):
# Test matrices m against spline ctps
self.assertTrue(c.np.allclose(b.weights, m @ nurbs.weights))
self.assertTrue(
c.np.allclose(b.weights,
m @ nurbs.weights)
)
self.assertTrue(
c.np.allclose(b.control_points,
(m @ (nurbs.control_points*nurbs.weights)) / b.weights)
c.np.allclose(
b.control_points,
(m @ (nurbs.control_points * nurbs.weights)) / b.weights,
)
)



if __name__ == "__main__":
c.unittest.main()

0 comments on commit cc4a161

Please sign in to comment.