diff options
author | opiopan <opiopan@gmail.com> | 2019-03-31 13:30:15 +0900 |
---|---|---|
committer | opiopan <opiopan@gmail.com> | 2019-03-31 13:30:15 +0900 |
commit | 900d992fa3af05f93ac7a4cf717f28598e1a868d (patch) | |
tree | fdd66ac71dcfb6a4d173268f0ead73cdcfd47600 /test/test.py | |
parent | fcd704e1eef9034e2000f55b2918d7df41379408 (diff) | |
download | gerbonara-900d992fa3af05f93ac7a4cf717f28598e1a868d.tar.gz gerbonara-900d992fa3af05f93ac7a4cf717f28598e1a868d.tar.bz2 gerbonara-900d992fa3af05f93ac7a4cf717f28598e1a868d.zip |
auto detection closed paths in the collection of DXF arc object and line object, then fill these closed path
Diffstat (limited to 'test/test.py')
-rwxr-xr-x | test/test.py | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/test/test.py b/test/test.py deleted file mode 100755 index 98da22f..0000000 --- a/test/test.py +++ /dev/null @@ -1,98 +0,0 @@ -import os -import gerberex -from gerberex.dxf import DxfFile -import gerber -from gerber.render.cairo_backend import GerberCairoContext - -def merge(): - ctx = gerberex.GerberComposition() - a = gerberex.read('test.GTL') - a.to_metric() - ctx.merge(a) - - b = gerberex.read('test.GTL') - b.to_metric() - b.offset(0, 25) - ctx.merge(b) - - c = gerberex.read('test2.GTL') - c.to_metric() - c.offset(0, 60) - ctx.merge(c) - - c = gerberex.read('test.GML') - c.to_metric() - ctx.merge(c) - - ctx.dump('test-merged.GTL') - -def merge2(): - ctx = gerberex.DrillComposition() - a = gerberex.read('test.TXT') - a.to_metric() - ctx.merge(a) - - b = gerberex.read('test.TXT') - b.to_metric() - b.offset(0, 25) - ctx.merge(b) - - c = gerberex.read('test2.TXT') - c.to_metric() - c.offset(0, 60) - ctx.merge(c) - - ctx.dump('test-merged.TXT') - - -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') -file = gerberex.read('data/test.TXT') -file.rotate(45) -file.write('outputs/test_changed.TXT') - -file = gerberex.read('data/outline.dxf') -file.to_metric() -w = file.width -file.draw_mode = DxfFile.DM_FILL -file.write('outline.GML') - -copper = gerber.load_layer('test-merged.GTL') -ctx = GerberCairoContext(scale=10) -ctx.render_layer(copper) -outline = gerber.load_layer('test.GML') -outline.cam_source.to_metric() -ctx.render_layer(outline) -drill = gerber.load_layer('test-merged.TXT') -ctx.render_layer(drill) -ctx.dump('test.png') |