summaryrefslogtreecommitdiff
path: root/examples/panelize.py
diff options
context:
space:
mode:
authorHiroshi Murayama <opiopan@gmail.com>2019-12-28 23:45:33 +0900
committerHiroshi Murayama <opiopan@gmail.com>2019-12-28 23:45:33 +0900
commit244fcaa5346f4fad819cc2b72857cfb2c472944a (patch)
treed849592e18a1afe61fb98f3207dabdaea1f5336e /examples/panelize.py
parentd7a069324222bb8f69adc9b1c815fc9f3f6a29d6 (diff)
downloadgerbonara-244fcaa5346f4fad819cc2b72857cfb2c472944a.tar.gz
gerbonara-244fcaa5346f4fad819cc2b72857cfb2c472944a.tar.bz2
gerbonara-244fcaa5346f4fad819cc2b72857cfb2c472944a.zip
add a function that generate filled gerberdata with representing internal shape by fliping polarity
Diffstat (limited to 'examples/panelize.py')
-rwxr-xr-xexamples/panelize.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/panelize.py b/examples/panelize.py
index 34cc446..20a2cac 100755
--- a/examples/panelize.py
+++ b/examples/panelize.py
@@ -18,7 +18,6 @@ boards=[
]
outline = 'inputs/outline.dxf'
mousebites = 'inputs/mousebites.dxf'
-fill = 'inputs/fill.dxf'
outputs = 'outputs/panelized'
os.chdir(os.path.dirname(__file__))
@@ -62,9 +61,11 @@ file = gerberex.read(outline)
file.write(outputs + '.GML')
putstr('.')
ctx = GerberComposition()
-file = gerberex.read(fill)
-file.to_metric()
+base = gerberex.rectangle(width=100, height=100, left=0, bottom=0, units='metric')
+base.draw_mode = DxfFile.DM_FILL
+ctx.merge(base)
file.draw_mode = DxfFile.DM_FILL
+file.negate_polarity()
ctx.merge(file)
ctx.dump(outputs + '-fill.GML')