From 244fcaa5346f4fad819cc2b72857cfb2c472944a Mon Sep 17 00:00:00 2001 From: Hiroshi Murayama Date: Sat, 28 Dec 2019 23:45:33 +0900 Subject: add a function that generate filled gerberdata with representing internal shape by fliping polarity --- tests/test_dxf.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'tests/test_dxf.py') diff --git a/tests/test_dxf.py b/tests/test_dxf.py index 31589da..3d4d28e 100644 --- a/tests/test_dxf.py +++ b/tests/test_dxf.py @@ -19,7 +19,6 @@ 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.MOUSEBITES_FILE = os.path.join(cls.INDIR, 'ref_dxf_mousebites.dxf') try: os.mkdir(cls.OUTDIR) except FileExistsError: @@ -36,6 +35,7 @@ class TestExcellon(unittest.TestCase): outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_line.gtl') dxf = gerberex.read(self.METRIC_FILE) dxf.draw_mode = dxf.DM_LINE + dxf.width = 0.2 dxf.write(outfile) self._checkResult(outfile) @@ -46,23 +46,41 @@ class TestExcellon(unittest.TestCase): dxf.write(outfile) self._checkResult(outfile) + def test_save_fill_simple(self): + outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_fill_simple.gtl') + dxf = gerberex.read(self.METRIC_FILE) + dxf.draw_mode = dxf.DM_FILL + dxf.fill_mode = dxf.FM_SIMPLE + dxf.write(outfile) + self._checkResult(outfile) + def test_save_mousebites(self): outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_mousebites.gtl') - dxf = gerberex.read(self.MOUSEBITES_FILE) + dxf = gerberex.read(self.METRIC_FILE) dxf.draw_mode = dxf.DM_MOUSE_BITES dxf.width = 0.5 - dxf.pitch = 1 + dxf.pitch = 1.4 dxf.write(outfile) self._checkResult(outfile) def test_save_excellon(self): + outfile = os.path.join( + self.OUTDIR, self.OUTPREFIX + 'save_line.txt') + dxf = gerberex.read(self.METRIC_FILE) + dxf.draw_mode = dxf.DM_LINE + dxf.format = (3,3) + dxf.width = 0.2 + dxf.write(outfile, filetype=dxf.FT_EXCELLON) + self._checkResult(outfile) + + def test_save_excellon_mousebites(self): outfile = os.path.join( self.OUTDIR, self.OUTPREFIX + 'save_mousebites.txt') - dxf = gerberex.read(self.MOUSEBITES_FILE) + dxf = gerberex.read(self.METRIC_FILE) dxf.draw_mode = dxf.DM_MOUSE_BITES - dxf.format = (3,3) + dxf.format = (3, 3) dxf.width = 0.5 - dxf.pitch = 1 + dxf.pitch = 1.4 dxf.write(outfile, filetype=dxf.FT_EXCELLON) self._checkResult(outfile) -- cgit