summaryrefslogtreecommitdiff
path: root/tests/test_dxf.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dxf.py')
-rw-r--r--tests/test_dxf.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_dxf.py b/tests/test_dxf.py
index 3d4d28e..782c8c7 100644
--- a/tests/test_dxf.py
+++ b/tests/test_dxf.py
@@ -19,6 +19,7 @@ class TestExcellon(unittest.TestCase):
cls.OUTPREFIX = 'dxf_'
cls.METRIC_FILE = os.path.join(cls.INDIR, 'ref_dxf_metric.dxf')
cls.INCH_FILE = os.path.join(cls.INDIR, 'ref_dxf_inch.dxf')
+ cls.COMPLEX_FILE = os.path.join(cls.INDIR, 'ref_dxf_complex.dxf')
try:
os.mkdir(cls.OUTDIR)
except FileExistsError:
@@ -127,5 +128,26 @@ class TestExcellon(unittest.TestCase):
dxf.write(outfile)
self._checkResult(outfile)
+ def test_complex_fill(self):
+ outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'complex_fill.gtl')
+ dxf = gerberex.read(self.COMPLEX_FILE)
+ dxf.draw_mode = dxf.DM_FILL
+ dxf.write(outfile)
+ self._checkResult(outfile)
+
+ def test_complex_fill_flip(self):
+ outfile = os.path.join(
+ self.OUTDIR, self.OUTPREFIX + 'complex_fill_flip.gtl')
+ ctx = gerberex.GerberComposition()
+ base = gerberex.rectangle(width=100, height=100, left=0, bottom=0, units='metric')
+ base.draw_mode = base.DM_FILL
+ ctx.merge(base)
+ dxf = gerberex.read(self.COMPLEX_FILE)
+ dxf.negate_polarity()
+ dxf.draw_mode = dxf.DM_FILL
+ ctx.merge(dxf)
+ ctx.dump(outfile)
+ self._checkResult(outfile)
+
if __name__ == '__main__':
unittest.main()