summaryrefslogtreecommitdiff
path: root/gerber/utils.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-02-27 15:24:36 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-02-27 15:24:36 +0800
commit29c0d82bf53907030d11df9eb09471b716a0be2e (patch)
treee172ad05e29c9f6a82c862badd0d2242dd567be1 /gerber/utils.py
parent02dbc6a51e2ef417f2bd41d6159ba53cc736535d (diff)
downloadgerbonara-29c0d82bf53907030d11df9eb09471b716a0be2e.tar.gz
gerbonara-29c0d82bf53907030d11df9eb09471b716a0be2e.tar.bz2
gerbonara-29c0d82bf53907030d11df9eb09471b716a0be2e.zip
RS274X backend for rendering. Incompelte still
Diffstat (limited to 'gerber/utils.py')
-rw-r--r--gerber/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gerber/utils.py b/gerber/utils.py
index 1c0af52..16323d6 100644
--- a/gerber/utils.py
+++ b/gerber/utils.py
@@ -288,3 +288,9 @@ def rotate_point(point, angle, center=(0.0, 0.0)):
x = center[0] + (cos(angle) * xdelta) - (sin(angle) * ydelta)
y = center[1] + (sin(angle) * xdelta) - (cos(angle) * ydelta)
return (x, y)
+
+
+def nearly_equal(point1, point2, ndigits = 6):
+ '''Are the points nearly equal'''
+
+ return round(point1[0] - point2[0], ndigits) == 0 and round(point1[1] - point2[1], ndigits) == 0