From ca23fbd9534ab3cba3fd7b032816766c1150ebf9 Mon Sep 17 00:00:00 2001 From: Hiroshi Murayama Date: Mon, 30 Dec 2019 17:51:48 +0900 Subject: fix bugs that fail judgement of path's containment --- tests/test_dxf.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/test_dxf.py') 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() -- cgit