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/data/merge.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/data/merge.py')
-rwxr-xr-x | test/data/merge.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/test/data/merge.py b/test/data/merge.py deleted file mode 100755 index b3b50d6..0000000 --- a/test/data/merge.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -import os -import gerberex -from gerberex.dxf import DxfFile - -exts = ['GTL', 'GTO', 'GTP', 'GTS', 'GBL', 'GBO', 'GBP', 'GBS', 'TXT'] -boards=[ - ('../../sonopi-digi/pcb/CAMOutputs/sonopi-digi.', 0, 0), - ('../../sonopi-digi/pcb/CAMOutputs/sonopi-digi.', 0, 22.5), - ('../../rcstick-f/pcb/small/CAMOutputs/rcstick-f-small.', 0, 60), - ('../../rcstick-f/pcb/small/CAMOutputs/rcstick-f-small.', 20, 60), - ('../../rcstick-f/pcb/small/CAMOutputs/rcstick-f-small.', 40, 60), - ('../../rcstick-f/pcb/large/CAMOutputs/rcstick-f.', 72.4, 0), - ('../../rcstick-f/pcb/jig/CAMOutputs/rcstick-jig.', 0, 44), - ('../../stm32breakout/pcb/CAMOutputs/stm32breakout.', 78.0, 59.36), - ('../../stm32breakout/pcb/CAMOutputs/stm32breakout.', 100.0, 59.36), -] -outline = 'outline.dxf' -fill = 'fill.dxf' - -outputs = 'outputs/elecrow-panelized' - -os.chdir(os.path.dirname(__file__)) - -for ext in exts: - print('merging %s: ' % ext ,end='', flush=True) - if ext == 'TXT': - ctx = gerberex.DrillComposition() - else: - ctx = gerberex.GerberComposition() - for board in boards: - file = gerberex.read(board[0] + ext) - file.to_metric() - file.offset(board[1], board[2]) - ctx.merge(file) - print('.', end='', flush=True) - if ext != 'TXT': - file = gerberex.read(outline) - ctx.merge(file) - ctx.dump(outputs + '.' + ext) - print(' end', flush=True) - -print('generating GML: ', end='', flush=True) -file = gerberex.read(outline) -file.write(outputs + '.GML') -print('.', end='', flush=True) -file = gerberex.read(fill) -file.to_metric() -file.draw_mode = DxfFile.DM_FILL -file.write(outputs + '-fill.GML') -print('. end', flush=True) |