summaryrefslogtreecommitdiff
path: root/test/test.py
diff options
context:
space:
mode:
authoropiopan <opiopan@gmail.com>2019-03-30 11:16:13 +0900
committeropiopan <opiopan@gmail.com>2019-03-30 11:16:13 +0900
commitfcd704e1eef9034e2000f55b2918d7df41379408 (patch)
tree4bc9f8f3f5f8cced53f9f2dfa8f414dfc6466488 /test/test.py
parent7e8f90b3724c62f72cf58ad28c11506212f3b706 (diff)
downloadgerbonara-fcd704e1eef9034e2000f55b2918d7df41379408.tar.gz
gerbonara-fcd704e1eef9034e2000f55b2918d7df41379408.tar.bz2
gerbonara-fcd704e1eef9034e2000f55b2918d7df41379408.zip
add mouse bites generator function
Diffstat (limited to 'test/test.py')
-rwxr-xr-xtest/test.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py
index ced478b..98da22f 100755
--- a/test/test.py
+++ b/test/test.py
@@ -49,6 +49,31 @@ os.chdir(os.path.dirname(__file__))
#merge2()
+ctx = gerberex.DrillComposition()
+base = gerberex.read('data/base.txt')
+dxf = gerberex.read('data/mousebites.dxf')
+dxf.draw_mode = DxfFile.DM_MOUSE_BITES
+dxf.to_metric()
+dxf.width = 0.5
+ctx.merge(base)
+ctx.merge(dxf)
+ctx.dump('outputs/merged.txt')
+
+dxf = gerberex.read('data/mousebite.dxf')
+dxf.zero_suppression = 'leading'
+dxf.write('outputs/a.gtl')
+dxf.draw_mode = DxfFile.DM_MOUSE_BITES
+dxf.width = 0.5
+dxf.write('outputs/b.gml')
+dxf.format = (3,3)
+dxf.write('outputs/b.txt', filetype=DxfFile.FT_EXCELLON)
+top = gerber.load_layer('outputs/a.gtl')
+drill = gerber.load_layer('outputs/b.txt')
+ctx = GerberCairoContext(scale=50)
+ctx.render_layer(top)
+ctx.render_layer(drill)
+ctx.dump('outputs/b.png')
+
file = gerberex.read('data/test.GTL')
file.rotate(45)
file.write('outputs/test_changed.GTL')