Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cpederkoff committed Jun 26, 2024
1 parent 507d2c6 commit 0f387fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion stltovoxel/polygon_repair.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import math


def find_polylines(segments): # noqa: C901
polylines = []
segment_forward_dict = {}
Expand Down Expand Up @@ -94,7 +95,7 @@ def atan_sum(f1, f2):
# atan2(atan_sum(f1, f2)) == atan2(f1) + atan2(f2)
x1, y1 = f1
x2, y2 = f2
return ( x1*x2 - y1*y2, y1*x2 + x1*y2)
return (x1*x2 - y1*y2, y1*x2 + x1*y2)


def atan_neg(f1):
Expand Down
8 changes: 3 additions & 5 deletions test/test_winding_query.py → test/test_polygon_repair.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import unittest
import math
import numpy as np
import unittest

from stltovoxel import polygon_repair


class TestWindingQuery(unittest.TestCase):
class TestPolygonRepair(unittest.TestCase):
def tuples_almost_equal(self, actual, expected):
for ac_val, exp_val in zip(actual, expected):
self.assertAlmostEqual(ac_val, exp_val, 3, f"{actual} != {expected}")
Expand Down Expand Up @@ -68,7 +67,6 @@ def test_grad_90_norm(self):
expected = polygon_repair.normalize((-1, -1))
self.tuples_almost_equal(actual, expected)


def test_grad_90_norm2(self):
segs = [((0, 0), (1, 0)), ((1, 0), (1, 1)), ((1, 1), (0, 1))]
pos = (0, 0.5)
Expand All @@ -92,7 +90,7 @@ def test_grad_90_norm3(self):
actual = polygon_repair.winding_contour(pos, segs)
expected = polygon_repair.normalize((-1, -1))
self.tuples_almost_equal(actual, expected)


if __name__ == '__main__':
unittest.main()

0 comments on commit 0f387fd

Please sign in to comment.