summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/panelize/utility.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-07-04 20:56:09 +0200
committerjaseg <git@jaseg.de>2021-07-04 20:56:09 +0200
commitdd8944709c5a48ccb52ba41a2310218770eb1669 (patch)
tree6a98a25f223cd1297462e0bc3a4f6f64c12fc3e5 /gerbonara/gerber/panelize/utility.py
parente38a983c398d5577008926f2cc9c0803b99e8fa9 (diff)
downloadgerbonara-dd8944709c5a48ccb52ba41a2310218770eb1669.tar.gz
gerbonara-dd8944709c5a48ccb52ba41a2310218770eb1669.tar.bz2
gerbonara-dd8944709c5a48ccb52ba41a2310218770eb1669.zip
Refactor panelize/rx274x, refactor bounding_box return value
Diffstat (limited to 'gerbonara/gerber/panelize/utility.py')
-rw-r--r--gerbonara/gerber/panelize/utility.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/gerbonara/gerber/panelize/utility.py b/gerbonara/gerber/panelize/utility.py
index 37de5e8..fc44e79 100644
--- a/gerbonara/gerber/panelize/utility.py
+++ b/gerbonara/gerber/panelize/utility.py
@@ -5,12 +5,13 @@
from math import cos, sin, pi, sqrt
-def rotate(x, y, angle, center):
- x0 = x - center[0]
- y0 = y - center[1]
- angle = angle * pi / 180.0
- return (cos(angle) * x0 - sin(angle) * y0 + center[0],
- sin(angle) * x0 + cos(angle) * y0 + center[1])
+# TODO: replace with ..utils.rotate
+#def rotate(x, y, angle, center):
+# x0 = x - center[0]
+# y0 = y - center[1]
+# angle = angle * pi / 180.0
+# return (cos(angle) * x0 - sin(angle) * y0 + center[0],
+# sin(angle) * x0 + cos(angle) * y0 + center[1])
def is_equal_value(a, b, error_range=0):
return (a - b) * (a - b) <= error_range * error_range
@@ -24,4 +25,4 @@ def normalize_vec2d(vec):
return (vec[0] / length, vec[1] / length)
def dot_vec2d(vec1, vec2):
- return vec1[0] * vec2[0] + vec1[1] * vec2[1] \ No newline at end of file
+ return vec1[0] * vec2[0] + vec1[1] * vec2[1]