summaryrefslogtreecommitdiff
path: root/tests/test_dxf.py
diff options
context:
space:
mode:
authorHiroshi Murayama <opiopan@gmail.com>2019-12-30 17:51:48 +0900
committerHiroshi Murayama <opiopan@gmail.com>2019-12-30 17:51:48 +0900
commitca23fbd9534ab3cba3fd7b032816766c1150ebf9 (patch)
treed35d276fcae9a86d5a7dbe2e06a45b3ae10afe93 /tests/test_dxf.py
parent244fcaa5346f4fad819cc2b72857cfb2c472944a (diff)
downloadgerbonara-ca23fbd9534ab3cba3fd7b032816766c1150ebf9.tar.gz
gerbonara-ca23fbd9534ab3cba3fd7b032816766c1150ebf9.tar.bz2
gerbonara-ca23fbd9534ab3cba3fd7b032816766c1150ebf9.zip
fix bugs that fail judgement of path's containment
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()