diff --git a/CHANGELOG.md b/CHANGELOG.md index 34f1d450..52c2169f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Better debug information when a BoM fails to be generated. - Support for compressed YAML files. + ### Changed - Allowed operations that doesn't involve a PCB now can run if the PCB file is missing or corrupted. +- The 'check_zone_fills' option is now independent of 'run_drc' + ### Fixed - Error codes that overlapped. diff --git a/Makefile b/Makefile index 6bee753c..e5939b2f 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ #!/usr/bin/make PY_COV=python3-coverage +REFDIR=tests/reference/ +REFILL=tests/board_samples/zone-refill.kicad_pcb CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))) USER_ID=$(shell id -u) GROUP_ID=$(shell id -g) - deb: fakeroot dpkg-buildpackage -uc -b @@ -43,4 +44,11 @@ test_docker_local: deb_clean: fakeroot debian/rules clean -.PHONY: deb deb_clean lint test test_local +gen_ref: + # Reference outputs, must be manually inspected if regenerated + cp -a $(REFILL).refill $(REFILL) + src/kiplot -c tests/yaml_samples/pdf_zone-refill.kiplot.yaml -b tests/board_samples/zone-refill.kicad_pcb -d $(REFDIR) + src/kiplot -c tests/yaml_samples/print_pcb_zone-refill.kiplot.yaml -b tests/board_samples/zone-refill.kicad_pcb -d $(REFDIR) + cp -a $(REFILL).ok $(REFILL) + +.PHONY: deb deb_clean lint test test_local gen_ref diff --git a/README.md b/README.md index 5920285b..90f68c6e 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,9 @@ This section is used to specify tasks that will executed before generating any o - `run_erc` To run the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. - `run_drc` To run the DRC (Distance Rules Check). To ensure we have a valid PCB. - `update_xml` To update the XML version of the BoM (Bill of Materials). To ensure our generated BoM is up to date. +- `check_zone_fills` Zones are filled before doing any operation involving PCB layers. -The `run_drc` command has the following options: -- `check_zone_fills` Every time we run the DRC the zones are filled again. This option saves the PCB to disk updating the zones. +The `run_drc` command has the following option: - `ignore_unconnected` Ignores the unconnected nets. Useful if you didn't finish the routing. Here is an example of a *preflight* section: @@ -169,7 +169,6 @@ outputs: plot_footprint_values: true force_plot_invisible_refs_vals: false tent_vias: true - check_zone_fills: true line_width: 0.15 # gerber options @@ -199,7 +198,6 @@ Most options are the same you'll find in the KiCad dialogs. - `plot_footprint_values` include the footprint values - `force_plot_invisible_refs_vals` include references and values even when they are marked as invisible - `tent_vias` cover the vias -- `check_zone_fills` currently without effect Note that each layer is generated in a separated file. diff --git a/kiplot/kiplot.py b/kiplot/kiplot.py index 9298df76..4056884f 100644 --- a/kiplot/kiplot.py +++ b/kiplot/kiplot.py @@ -134,6 +134,8 @@ class Plotter(object): def _load_board(self, brd_file): try: board = pcbnew.LoadBoard(brd_file) + if self.cfg.check_zone_fills: + pcbnew.ZONE_FILLER(board).Fill(board.Zones()) except OSError as e: logger.error('Error loading PCB file. Currupted?') logger.error(e) @@ -165,6 +167,9 @@ class Plotter(object): elif skip == 'run_erc': self.cfg.run_erc = False logger.debug('Skipping run_erc') + elif skip == 'check_zone_fills': + self.cfg.check_zone_fills = False + logger.debug('Skipping run_erc') else: logger.error('Unknown action to skip: '+skip) exit(misc.EXIT_BAD_ARGS) @@ -179,8 +184,7 @@ class Plotter(object): if self.cfg.update_xml: self._update_xml(brd_file) if self.cfg.run_drc: - self._run_drc(brd_file, self.cfg.ignore_unconnected, - self.cfg.check_zone_fills, filter_file) + self._run_drc(brd_file, self.cfg.ignore_unconnected, filter_file) def _run_erc(self, brd_file, filter_file): sch_file = check_eeschema_do(brd_file) @@ -216,7 +220,7 @@ class Plotter(object): logger.error('Failed to update the BoM, error %d', ret) exit(misc.BOM_ERROR) - def _run_drc(self, brd_file, ignore_unconnected, check_zone_fills, filter_file): + def _run_drc(self, brd_file, ignore_unconnected, filter_file): check_script(misc.CMD_PCBNEW_RUN_DRC, misc.URL_PCBNEW_RUN_DRC, '1.4.0') cmd = [misc.CMD_PCBNEW_RUN_DRC, 'run_drc'] if filter_file: @@ -228,8 +232,6 @@ class Plotter(object): cmd.insert(1, '-r') if ignore_unconnected: cmd.insert(1, '-i') - if check_zone_fills: - cmd.insert(1, '-s') logger.info('- Running the DRC') logger.debug('Executing: '+str(cmd)) ret = call(cmd) @@ -602,7 +604,7 @@ class Plotter(object): def _do_pcb_print(self, board, output_dir, output, brd_file): check_script(misc.CMD_PCBNEW_PRINT_LAYERS, - misc.URL_PCBNEW_PRINT_LAYERS, '1.3.1') + misc.URL_PCBNEW_PRINT_LAYERS, '1.4.1') to = output.options.type_options # Verify the inner layers layer_cnt = board.GetCopperLayerCount() @@ -615,8 +617,10 @@ class Plotter(object): "Inner layer {} is not valid for this board" .format(layer.layer)) cmd = [misc.CMD_PCBNEW_PRINT_LAYERS, 'export', - '--output_name', to.output_name, - brd_file, output_dir] + '--output_name', to.output_name] + if self.cfg.check_zone_fills: + cmd.append('-f') + cmd.extend([brd_file, output_dir]) if level_debug(): cmd.insert(1, '-vv') cmd.insert(1, '-r') diff --git a/tests/board_samples/zone-refill.kicad_pcb b/tests/board_samples/zone-refill.kicad_pcb new file mode 100644 index 00000000..2cba7e7d --- /dev/null +++ b/tests/board_samples/zone-refill.kicad_pcb @@ -0,0 +1,339 @@ +(kicad_pcb (version 20171130) (host pcbnew 5.1.5+dfsg1-2~bpo10+1) + + (general + (thickness 1.6) + (drawings 5) + (tracks 10) + (zones 0) + (modules 4) + (nets 4) + ) + + (page A4) + (layers + (0 F.Cu signal) + (31 B.Cu signal) + (32 B.Adhes user) + (33 F.Adhes user) + (34 B.Paste user) + (35 F.Paste user) + (36 B.SilkS user) + (37 F.SilkS user) + (38 B.Mask user) + (39 F.Mask user) + (40 Dwgs.User user) + (41 Cmts.User user) + (42 Eco1.User user) + (43 Eco2.User user) + (44 Edge.Cuts user) + (45 Margin user) + (46 B.CrtYd user) + (47 F.CrtYd user) + (48 B.Fab user) + (49 F.Fab user) + ) + + (setup + (last_trace_width 0.25) + (trace_clearance 0.2) + (zone_clearance 0.508) + (zone_45_only no) + (trace_min 0.2) + (via_size 0.8) + (via_drill 0.4) + (via_min_size 0.4) + (via_min_drill 0.3) + (uvia_size 0.3) + (uvia_drill 0.1) + (uvias_allowed no) + (uvia_min_size 0.2) + (uvia_min_drill 0.1) + (edge_width 0.05) + (segment_width 0.2) + (pcb_text_width 0.3) + (pcb_text_size 1.5 1.5) + (mod_edge_width 0.12) + (mod_text_size 1 1) + (mod_text_width 0.15) + (pad_size 1.524 1.524) + (pad_drill 0.762) + (pad_to_mask_clearance 0.051) + (solder_mask_min_width 0.25) + (aux_axis_origin 0 0) + (visible_elements FFFFFF7F) + (pcbplotparams + (layerselection 0x010fc_ffffffff) + (usegerberextensions false) + (usegerberattributes false) + (usegerberadvancedattributes false) + (creategerberjobfile false) + (excludeedgelayer true) + (linewidth 0.100000) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (padsonsilk false) + (subtractmaskfromsilk false) + (outputformat 1) + (mirror false) + (drillshape 1) + (scaleselection 1) + (outputdirectory "")) + ) + + (net 0 "") + (net 1 GND) + (net 2 "Net-(C1-Pad1)") + (net 3 "Net-(J1-Pad1)") + + (net_class Default "Esta es la clase de red por defecto." + (clearance 0.2) + (trace_width 0.25) + (via_dia 0.8) + (via_drill 0.4) + (uvia_dia 0.3) + (uvia_drill 0.1) + (add_net GND) + (add_net "Net-(C1-Pad1)") + (add_net "Net-(J1-Pad1)") + ) + + (module Resistor_SMD:R_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC712) + (at 161.9375 74 180) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags resistor) + (path /5EBAD9A3) + (attr smd) + (fp_text reference R1 (at 0 1.65) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value R (at 0 -1.65) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 3 "Net-(J1-Pad1)")) + (pad 1 smd roundrect (at -0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC57B) + (at 167 77.54 180) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC9BE) + (fp_text reference J2 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4 4.87) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 "Net-(C1-Pad1)")) + (pad 1 thru_hole rect (at 0 0 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC6B7) + (at 157.82 74.85) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC114) + (fp_text reference J1 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4.82 5.15) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 3 "Net-(J1-Pad1)")) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Capacitor_SMD:C_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC54F) + (at 163 77.0625 270) + (descr "Capacitor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags capacitor) + (path /5EBAE412) + (attr smd) + (fp_text reference C1 (at 0 1.65 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value C (at 0 -1.65 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0 270) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_line (start 170 80) (end 169 80) (layer Edge.Cuts) (width 0.05) (tstamp 5EBAC92C)) + (gr_line (start 170 72) (end 170 80) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 72) (end 170 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 80) (end 155 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 169 80) (end 155 80) (layer Edge.Cuts) (width 0.05)) + + (segment (start 162.39 77.39) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 157.82 77.39) (end 162.39 77.39) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 163.46 77.54) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 77.54) (end 163.46 77.54) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 75) (end 164 75) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 76) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 74) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 159.7 74) (end 161 74) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 157.82 74.85) (end 158.92 74.85) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 158.92 74.85) (end 159.7 74) (width 0.25) (layer B.Cu) (net 3)) + + (zone (net 1) (net_name GND) (layer B.Cu) (tstamp 5EBAC970) (hatch edge 0.508) + (connect_pads (clearance 0.508)) + (min_thickness 0.254) + (fill yes (arc_segments 32) (thermal_gap 0.508) (thermal_bridge_width 0.508)) + (polygon + (pts + (xy 170 80) (xy 155 80) (xy 155 72) (xy 170 72) + ) + ) + (filled_polygon + (pts + (xy 169.340001 79.34) (xy 155.66 79.34) (xy 155.66 77.74689) (xy 156.378524 77.74689) (xy 156.423175 77.894099) + (xy 156.548359 78.15692) (xy 156.722412 78.390269) (xy 156.938645 78.585178) (xy 157.188748 78.734157) (xy 157.463109 78.831481) + (xy 157.693 78.710814) (xy 157.693 77.517) (xy 157.947 77.517) (xy 157.947 78.710814) (xy 158.176891 78.831481) + (xy 158.451252 78.734157) (xy 158.701355 78.585178) (xy 158.917588 78.390269) (xy 158.917788 78.39) (xy 165.511928 78.39) + (xy 165.524188 78.514482) (xy 165.560498 78.63418) (xy 165.619463 78.744494) (xy 165.698815 78.841185) (xy 165.795506 78.920537) + (xy 165.90582 78.979502) (xy 166.025518 79.015812) (xy 166.15 79.028072) (xy 166.71425 79.025) (xy 166.873 78.86625) + (xy 166.873 77.667) (xy 167.127 77.667) (xy 167.127 78.86625) (xy 167.28575 79.025) (xy 167.85 79.028072) + (xy 167.974482 79.015812) (xy 168.09418 78.979502) (xy 168.204494 78.920537) (xy 168.301185 78.841185) (xy 168.380537 78.744494) + (xy 168.439502 78.63418) (xy 168.475812 78.514482) (xy 168.488072 78.39) (xy 168.485 77.82575) (xy 168.32625 77.667) + (xy 167.127 77.667) (xy 166.873 77.667) (xy 165.67375 77.667) (xy 165.515 77.82575) (xy 165.511928 78.39) + (xy 158.917788 78.39) (xy 159.091641 78.15692) (xy 159.216825 77.894099) (xy 159.261476 77.74689) (xy 159.140155 77.517) + (xy 157.947 77.517) (xy 157.693 77.517) (xy 156.499845 77.517) (xy 156.378524 77.74689) (xy 155.66 77.74689) + (xy 155.66 74) (xy 156.331928 74) (xy 156.331928 75.7) (xy 156.344188 75.824482) (xy 156.380498 75.94418) + (xy 156.439463 76.054494) (xy 156.518815 76.151185) (xy 156.615506 76.230537) (xy 156.72582 76.289502) (xy 156.806466 76.313966) + (xy 156.722412 76.389731) (xy 156.548359 76.62308) (xy 156.423175 76.885901) (xy 156.378524 77.03311) (xy 156.499845 77.263) + (xy 157.693 77.263) (xy 157.693 77.243) (xy 157.947 77.243) (xy 157.947 77.263) (xy 159.140155 77.263) + (xy 159.261476 77.03311) (xy 159.216825 76.885901) (xy 159.091641 76.62308) (xy 158.917588 76.389731) (xy 158.833534 76.313966) + (xy 158.91418 76.289502) (xy 159.024494 76.230537) (xy 159.121185 76.151185) (xy 159.200537 76.054494) (xy 159.259502 75.94418) + (xy 159.295812 75.824482) (xy 159.308072 75.7) (xy 159.308072 75.592847) (xy 160.012857 75.560218) (xy 160.065361 75.560874) + (xy 160.124226 75.549928) (xy 160.183465 75.541311) (xy 160.197692 75.536266) (xy 160.212544 75.533504) (xy 160.268139 75.511284) + (xy 160.324563 75.491275) (xy 160.337542 75.483545) (xy 160.351559 75.477943) (xy 160.401746 75.445309) (xy 160.453187 75.414673) + (xy 160.492188 75.379524) (xy 161.50392 74.570139) (xy 161.584237 74.491803) (xy 161.668957 74.368374) (xy 161.727969 74.230789) + (xy 161.759006 74.084334) (xy 161.760058 74) (xy 162.236324 74) (xy 162.250998 74.148985) (xy 162.294454 74.292246) + (xy 162.365026 74.424276) (xy 162.436201 74.511002) (xy 162.925199 75) (xy 162.436201 75.488998) (xy 162.365026 75.575724) + (xy 162.294454 75.707754) (xy 162.250998 75.851015) (xy 162.236324 76) (xy 162.250998 76.148985) (xy 162.294454 76.292246) + (xy 162.365026 76.424276) (xy 162.459999 76.540001) (xy 162.575724 76.634974) (xy 162.707754 76.705546) (xy 162.851015 76.749002) + (xy 163 76.763676) (xy 163.148985 76.749002) (xy 163.292246 76.705546) (xy 163.424276 76.634974) (xy 163.511002 76.563799) + (xy 164.314802 75.76) (xy 165.721822 75.76) (xy 165.846525 75.946632) (xy 165.97838 76.078487) (xy 165.90582 76.100498) + (xy 165.795506 76.159463) (xy 165.698815 76.238815) (xy 165.619463 76.335506) (xy 165.560498 76.44582) (xy 165.524188 76.565518) + (xy 165.511928 76.69) (xy 165.515 77.25425) (xy 165.67375 77.413) (xy 166.873 77.413) (xy 166.873 77.393) + (xy 167.127 77.393) (xy 167.127 77.413) (xy 168.32625 77.413) (xy 168.485 77.25425) (xy 168.488072 76.69) + (xy 168.475812 76.565518) (xy 168.439502 76.44582) (xy 168.380537 76.335506) (xy 168.301185 76.238815) (xy 168.204494 76.159463) + (xy 168.09418 76.100498) (xy 168.02162 76.078487) (xy 168.153475 75.946632) (xy 168.31599 75.703411) (xy 168.427932 75.433158) + (xy 168.485 75.14626) (xy 168.485 74.85374) (xy 168.427932 74.566842) (xy 168.31599 74.296589) (xy 168.153475 74.053368) + (xy 167.946632 73.846525) (xy 167.703411 73.68401) (xy 167.433158 73.572068) (xy 167.14626 73.515) (xy 166.85374 73.515) + (xy 166.566842 73.572068) (xy 166.296589 73.68401) (xy 166.053368 73.846525) (xy 165.846525 74.053368) (xy 165.721822 74.24) + (xy 164.314802 74.24) (xy 163.511002 73.436201) (xy 163.424276 73.365026) (xy 163.292246 73.294454) (xy 163.148985 73.250998) + (xy 163 73.236324) (xy 162.851015 73.250998) (xy 162.707754 73.294454) (xy 162.575724 73.365026) (xy 162.459999 73.459999) + (xy 162.365026 73.575724) (xy 162.294454 73.707754) (xy 162.250998 73.851015) (xy 162.236324 74) (xy 161.760058 74) + (xy 161.760874 73.934639) (xy 161.733504 73.787456) (xy 161.677944 73.64844) (xy 161.596331 73.522935) (xy 161.491802 73.415763) + (xy 161.368373 73.331043) (xy 161.230788 73.272031) (xy 161.084334 73.240995) (xy 160.934638 73.239126) (xy 160.787455 73.266496) + (xy 160.64844 73.322057) (xy 160.554384 73.383218) (xy 159.718111 74.052237) (xy 159.308072 74.07122) (xy 159.308072 74) + (xy 159.295812 73.875518) (xy 159.259502 73.75582) (xy 159.200537 73.645506) (xy 159.121185 73.548815) (xy 159.024494 73.469463) + (xy 158.91418 73.410498) (xy 158.794482 73.374188) (xy 158.67 73.361928) (xy 156.97 73.361928) (xy 156.845518 73.374188) + (xy 156.72582 73.410498) (xy 156.615506 73.469463) (xy 156.518815 73.548815) (xy 156.439463 73.645506) (xy 156.380498 73.75582) + (xy 156.344188 73.875518) (xy 156.331928 74) (xy 155.66 74) (xy 155.66 72.66) (xy 169.34 72.66) + ) + ) + ) +) diff --git a/tests/board_samples/zone-refill.kicad_pcb.ok b/tests/board_samples/zone-refill.kicad_pcb.ok new file mode 100644 index 00000000..2cba7e7d --- /dev/null +++ b/tests/board_samples/zone-refill.kicad_pcb.ok @@ -0,0 +1,339 @@ +(kicad_pcb (version 20171130) (host pcbnew 5.1.5+dfsg1-2~bpo10+1) + + (general + (thickness 1.6) + (drawings 5) + (tracks 10) + (zones 0) + (modules 4) + (nets 4) + ) + + (page A4) + (layers + (0 F.Cu signal) + (31 B.Cu signal) + (32 B.Adhes user) + (33 F.Adhes user) + (34 B.Paste user) + (35 F.Paste user) + (36 B.SilkS user) + (37 F.SilkS user) + (38 B.Mask user) + (39 F.Mask user) + (40 Dwgs.User user) + (41 Cmts.User user) + (42 Eco1.User user) + (43 Eco2.User user) + (44 Edge.Cuts user) + (45 Margin user) + (46 B.CrtYd user) + (47 F.CrtYd user) + (48 B.Fab user) + (49 F.Fab user) + ) + + (setup + (last_trace_width 0.25) + (trace_clearance 0.2) + (zone_clearance 0.508) + (zone_45_only no) + (trace_min 0.2) + (via_size 0.8) + (via_drill 0.4) + (via_min_size 0.4) + (via_min_drill 0.3) + (uvia_size 0.3) + (uvia_drill 0.1) + (uvias_allowed no) + (uvia_min_size 0.2) + (uvia_min_drill 0.1) + (edge_width 0.05) + (segment_width 0.2) + (pcb_text_width 0.3) + (pcb_text_size 1.5 1.5) + (mod_edge_width 0.12) + (mod_text_size 1 1) + (mod_text_width 0.15) + (pad_size 1.524 1.524) + (pad_drill 0.762) + (pad_to_mask_clearance 0.051) + (solder_mask_min_width 0.25) + (aux_axis_origin 0 0) + (visible_elements FFFFFF7F) + (pcbplotparams + (layerselection 0x010fc_ffffffff) + (usegerberextensions false) + (usegerberattributes false) + (usegerberadvancedattributes false) + (creategerberjobfile false) + (excludeedgelayer true) + (linewidth 0.100000) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (padsonsilk false) + (subtractmaskfromsilk false) + (outputformat 1) + (mirror false) + (drillshape 1) + (scaleselection 1) + (outputdirectory "")) + ) + + (net 0 "") + (net 1 GND) + (net 2 "Net-(C1-Pad1)") + (net 3 "Net-(J1-Pad1)") + + (net_class Default "Esta es la clase de red por defecto." + (clearance 0.2) + (trace_width 0.25) + (via_dia 0.8) + (via_drill 0.4) + (uvia_dia 0.3) + (uvia_drill 0.1) + (add_net GND) + (add_net "Net-(C1-Pad1)") + (add_net "Net-(J1-Pad1)") + ) + + (module Resistor_SMD:R_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC712) + (at 161.9375 74 180) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags resistor) + (path /5EBAD9A3) + (attr smd) + (fp_text reference R1 (at 0 1.65) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value R (at 0 -1.65) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 3 "Net-(J1-Pad1)")) + (pad 1 smd roundrect (at -0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC57B) + (at 167 77.54 180) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC9BE) + (fp_text reference J2 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4 4.87) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 "Net-(C1-Pad1)")) + (pad 1 thru_hole rect (at 0 0 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC6B7) + (at 157.82 74.85) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC114) + (fp_text reference J1 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4.82 5.15) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 3 "Net-(J1-Pad1)")) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Capacitor_SMD:C_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC54F) + (at 163 77.0625 270) + (descr "Capacitor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags capacitor) + (path /5EBAE412) + (attr smd) + (fp_text reference C1 (at 0 1.65 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value C (at 0 -1.65 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0 270) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_line (start 170 80) (end 169 80) (layer Edge.Cuts) (width 0.05) (tstamp 5EBAC92C)) + (gr_line (start 170 72) (end 170 80) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 72) (end 170 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 80) (end 155 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 169 80) (end 155 80) (layer Edge.Cuts) (width 0.05)) + + (segment (start 162.39 77.39) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 157.82 77.39) (end 162.39 77.39) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 163.46 77.54) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 77.54) (end 163.46 77.54) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 75) (end 164 75) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 76) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 74) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 159.7 74) (end 161 74) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 157.82 74.85) (end 158.92 74.85) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 158.92 74.85) (end 159.7 74) (width 0.25) (layer B.Cu) (net 3)) + + (zone (net 1) (net_name GND) (layer B.Cu) (tstamp 5EBAC970) (hatch edge 0.508) + (connect_pads (clearance 0.508)) + (min_thickness 0.254) + (fill yes (arc_segments 32) (thermal_gap 0.508) (thermal_bridge_width 0.508)) + (polygon + (pts + (xy 170 80) (xy 155 80) (xy 155 72) (xy 170 72) + ) + ) + (filled_polygon + (pts + (xy 169.340001 79.34) (xy 155.66 79.34) (xy 155.66 77.74689) (xy 156.378524 77.74689) (xy 156.423175 77.894099) + (xy 156.548359 78.15692) (xy 156.722412 78.390269) (xy 156.938645 78.585178) (xy 157.188748 78.734157) (xy 157.463109 78.831481) + (xy 157.693 78.710814) (xy 157.693 77.517) (xy 157.947 77.517) (xy 157.947 78.710814) (xy 158.176891 78.831481) + (xy 158.451252 78.734157) (xy 158.701355 78.585178) (xy 158.917588 78.390269) (xy 158.917788 78.39) (xy 165.511928 78.39) + (xy 165.524188 78.514482) (xy 165.560498 78.63418) (xy 165.619463 78.744494) (xy 165.698815 78.841185) (xy 165.795506 78.920537) + (xy 165.90582 78.979502) (xy 166.025518 79.015812) (xy 166.15 79.028072) (xy 166.71425 79.025) (xy 166.873 78.86625) + (xy 166.873 77.667) (xy 167.127 77.667) (xy 167.127 78.86625) (xy 167.28575 79.025) (xy 167.85 79.028072) + (xy 167.974482 79.015812) (xy 168.09418 78.979502) (xy 168.204494 78.920537) (xy 168.301185 78.841185) (xy 168.380537 78.744494) + (xy 168.439502 78.63418) (xy 168.475812 78.514482) (xy 168.488072 78.39) (xy 168.485 77.82575) (xy 168.32625 77.667) + (xy 167.127 77.667) (xy 166.873 77.667) (xy 165.67375 77.667) (xy 165.515 77.82575) (xy 165.511928 78.39) + (xy 158.917788 78.39) (xy 159.091641 78.15692) (xy 159.216825 77.894099) (xy 159.261476 77.74689) (xy 159.140155 77.517) + (xy 157.947 77.517) (xy 157.693 77.517) (xy 156.499845 77.517) (xy 156.378524 77.74689) (xy 155.66 77.74689) + (xy 155.66 74) (xy 156.331928 74) (xy 156.331928 75.7) (xy 156.344188 75.824482) (xy 156.380498 75.94418) + (xy 156.439463 76.054494) (xy 156.518815 76.151185) (xy 156.615506 76.230537) (xy 156.72582 76.289502) (xy 156.806466 76.313966) + (xy 156.722412 76.389731) (xy 156.548359 76.62308) (xy 156.423175 76.885901) (xy 156.378524 77.03311) (xy 156.499845 77.263) + (xy 157.693 77.263) (xy 157.693 77.243) (xy 157.947 77.243) (xy 157.947 77.263) (xy 159.140155 77.263) + (xy 159.261476 77.03311) (xy 159.216825 76.885901) (xy 159.091641 76.62308) (xy 158.917588 76.389731) (xy 158.833534 76.313966) + (xy 158.91418 76.289502) (xy 159.024494 76.230537) (xy 159.121185 76.151185) (xy 159.200537 76.054494) (xy 159.259502 75.94418) + (xy 159.295812 75.824482) (xy 159.308072 75.7) (xy 159.308072 75.592847) (xy 160.012857 75.560218) (xy 160.065361 75.560874) + (xy 160.124226 75.549928) (xy 160.183465 75.541311) (xy 160.197692 75.536266) (xy 160.212544 75.533504) (xy 160.268139 75.511284) + (xy 160.324563 75.491275) (xy 160.337542 75.483545) (xy 160.351559 75.477943) (xy 160.401746 75.445309) (xy 160.453187 75.414673) + (xy 160.492188 75.379524) (xy 161.50392 74.570139) (xy 161.584237 74.491803) (xy 161.668957 74.368374) (xy 161.727969 74.230789) + (xy 161.759006 74.084334) (xy 161.760058 74) (xy 162.236324 74) (xy 162.250998 74.148985) (xy 162.294454 74.292246) + (xy 162.365026 74.424276) (xy 162.436201 74.511002) (xy 162.925199 75) (xy 162.436201 75.488998) (xy 162.365026 75.575724) + (xy 162.294454 75.707754) (xy 162.250998 75.851015) (xy 162.236324 76) (xy 162.250998 76.148985) (xy 162.294454 76.292246) + (xy 162.365026 76.424276) (xy 162.459999 76.540001) (xy 162.575724 76.634974) (xy 162.707754 76.705546) (xy 162.851015 76.749002) + (xy 163 76.763676) (xy 163.148985 76.749002) (xy 163.292246 76.705546) (xy 163.424276 76.634974) (xy 163.511002 76.563799) + (xy 164.314802 75.76) (xy 165.721822 75.76) (xy 165.846525 75.946632) (xy 165.97838 76.078487) (xy 165.90582 76.100498) + (xy 165.795506 76.159463) (xy 165.698815 76.238815) (xy 165.619463 76.335506) (xy 165.560498 76.44582) (xy 165.524188 76.565518) + (xy 165.511928 76.69) (xy 165.515 77.25425) (xy 165.67375 77.413) (xy 166.873 77.413) (xy 166.873 77.393) + (xy 167.127 77.393) (xy 167.127 77.413) (xy 168.32625 77.413) (xy 168.485 77.25425) (xy 168.488072 76.69) + (xy 168.475812 76.565518) (xy 168.439502 76.44582) (xy 168.380537 76.335506) (xy 168.301185 76.238815) (xy 168.204494 76.159463) + (xy 168.09418 76.100498) (xy 168.02162 76.078487) (xy 168.153475 75.946632) (xy 168.31599 75.703411) (xy 168.427932 75.433158) + (xy 168.485 75.14626) (xy 168.485 74.85374) (xy 168.427932 74.566842) (xy 168.31599 74.296589) (xy 168.153475 74.053368) + (xy 167.946632 73.846525) (xy 167.703411 73.68401) (xy 167.433158 73.572068) (xy 167.14626 73.515) (xy 166.85374 73.515) + (xy 166.566842 73.572068) (xy 166.296589 73.68401) (xy 166.053368 73.846525) (xy 165.846525 74.053368) (xy 165.721822 74.24) + (xy 164.314802 74.24) (xy 163.511002 73.436201) (xy 163.424276 73.365026) (xy 163.292246 73.294454) (xy 163.148985 73.250998) + (xy 163 73.236324) (xy 162.851015 73.250998) (xy 162.707754 73.294454) (xy 162.575724 73.365026) (xy 162.459999 73.459999) + (xy 162.365026 73.575724) (xy 162.294454 73.707754) (xy 162.250998 73.851015) (xy 162.236324 74) (xy 161.760058 74) + (xy 161.760874 73.934639) (xy 161.733504 73.787456) (xy 161.677944 73.64844) (xy 161.596331 73.522935) (xy 161.491802 73.415763) + (xy 161.368373 73.331043) (xy 161.230788 73.272031) (xy 161.084334 73.240995) (xy 160.934638 73.239126) (xy 160.787455 73.266496) + (xy 160.64844 73.322057) (xy 160.554384 73.383218) (xy 159.718111 74.052237) (xy 159.308072 74.07122) (xy 159.308072 74) + (xy 159.295812 73.875518) (xy 159.259502 73.75582) (xy 159.200537 73.645506) (xy 159.121185 73.548815) (xy 159.024494 73.469463) + (xy 158.91418 73.410498) (xy 158.794482 73.374188) (xy 158.67 73.361928) (xy 156.97 73.361928) (xy 156.845518 73.374188) + (xy 156.72582 73.410498) (xy 156.615506 73.469463) (xy 156.518815 73.548815) (xy 156.439463 73.645506) (xy 156.380498 73.75582) + (xy 156.344188 73.875518) (xy 156.331928 74) (xy 155.66 74) (xy 155.66 72.66) (xy 169.34 72.66) + ) + ) + ) +) diff --git a/tests/board_samples/zone-refill.kicad_pcb.refill b/tests/board_samples/zone-refill.kicad_pcb.refill new file mode 100644 index 00000000..9f8cd6e4 --- /dev/null +++ b/tests/board_samples/zone-refill.kicad_pcb.refill @@ -0,0 +1,352 @@ +(kicad_pcb (version 20171130) (host pcbnew 5.1.5+dfsg1-2~bpo10+1) + + (general + (thickness 1.6) + (drawings 5) + (tracks 10) + (zones 0) + (modules 4) + (nets 4) + ) + + (page A4) + (layers + (0 F.Cu signal) + (31 B.Cu signal) + (32 B.Adhes user) + (33 F.Adhes user) + (34 B.Paste user) + (35 F.Paste user) + (36 B.SilkS user) + (37 F.SilkS user) + (38 B.Mask user) + (39 F.Mask user) + (40 Dwgs.User user) + (41 Cmts.User user) + (42 Eco1.User user) + (43 Eco2.User user) + (44 Edge.Cuts user) + (45 Margin user) + (46 B.CrtYd user) + (47 F.CrtYd user) + (48 B.Fab user) + (49 F.Fab user) + ) + + (setup + (last_trace_width 0.25) + (trace_clearance 0.2) + (zone_clearance 0.508) + (zone_45_only no) + (trace_min 0.2) + (via_size 0.8) + (via_drill 0.4) + (via_min_size 0.4) + (via_min_drill 0.3) + (uvia_size 0.3) + (uvia_drill 0.1) + (uvias_allowed no) + (uvia_min_size 0.2) + (uvia_min_drill 0.1) + (edge_width 0.05) + (segment_width 0.2) + (pcb_text_width 0.3) + (pcb_text_size 1.5 1.5) + (mod_edge_width 0.12) + (mod_text_size 1 1) + (mod_text_width 0.15) + (pad_size 1.524 1.524) + (pad_drill 0.762) + (pad_to_mask_clearance 0.051) + (solder_mask_min_width 0.25) + (aux_axis_origin 0 0) + (visible_elements FFFFFF7F) + (pcbplotparams + (layerselection 0x010fc_ffffffff) + (usegerberextensions false) + (usegerberattributes false) + (usegerberadvancedattributes false) + (creategerberjobfile false) + (excludeedgelayer true) + (linewidth 0.100000) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (padsonsilk false) + (subtractmaskfromsilk false) + (outputformat 1) + (mirror false) + (drillshape 1) + (scaleselection 1) + (outputdirectory "")) + ) + + (net 0 "") + (net 1 GND) + (net 2 "Net-(C1-Pad1)") + (net 3 "Net-(J1-Pad1)") + + (net_class Default "Esta es la clase de red por defecto." + (clearance 0.2) + (trace_width 0.25) + (via_dia 0.8) + (via_drill 0.4) + (uvia_dia 0.3) + (uvia_drill 0.1) + (add_net GND) + (add_net "Net-(C1-Pad1)") + (add_net "Net-(J1-Pad1)") + ) + + (module Resistor_SMD:R_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC712) + (at 161.9375 74 180) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags resistor) + (path /5EBAD9A3) + (attr smd) + (fp_text reference R1 (at 0 1.65) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value R (at 0 -1.65) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 3 "Net-(J1-Pad1)")) + (pad 1 smd roundrect (at -0.9375 0 180) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC57B) + (at 167 77.54 180) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC9BE) + (fp_text reference J2 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4 4.87) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 "Net-(C1-Pad1)")) + (pad 1 thru_hole rect (at 0 0 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5EBAC6B7) + (at 157.82 74.85) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /5EBAC114) + (fp_text reference J1 (at 0 -2.33) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Conn_01x02_Male (at -4.82 5.15) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0 1.27 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 GND)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 3 "Net-(J1-Pad1)")) + (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Capacitor_SMD:C_0805_2012Metric (layer B.Cu) (tedit 5B36C52B) (tstamp 5EBAC54F) + (at 163 77.0625 270) + (descr "Capacitor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags capacitor) + (path /5EBAE412) + (attr smd) + (fp_text reference C1 (at 0 1.65 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value C (at 0 -1.65 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 0 270) (layer B.Fab) + (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) + ) + (fp_line (start 1.68 -0.95) (end -1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.68 0.95) (end 1.68 -0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 0.95) (end 1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.68 -0.95) (end -1.68 0.95) (layer B.CrtYd) (width 0.05)) + (fp_line (start -0.258578 -0.71) (end 0.258578 -0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.258578 0.71) (end 0.258578 0.71) (layer B.SilkS) (width 0.12)) + (fp_line (start 1 -0.6) (end -1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start 1 0.6) (end 1 -0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 0.6) (end 1 0.6) (layer B.Fab) (width 0.1)) + (fp_line (start -1 -0.6) (end -1 0.6) (layer B.Fab) (width 0.1)) + (pad 2 smd roundrect (at 0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.9375 0 270) (size 0.975 1.4) (layers B.Cu B.Paste B.Mask) (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)")) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0805_2012Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_line (start 170 80) (end 169 80) (layer Edge.Cuts) (width 0.05) (tstamp 5EBAC92C)) + (gr_line (start 170 72) (end 170 80) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 72) (end 170 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 155 80) (end 155 72) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 169 80) (end 155 80) (layer Edge.Cuts) (width 0.05)) + + (segment (start 162.39 77.39) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 157.82 77.39) (end 162.39 77.39) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 163.46 77.54) (end 163 78) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 77.54) (end 163.46 77.54) (width 0.25) (layer B.Cu) (net 1)) + (segment (start 167 75) (end 164 75) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 76) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 164 75) (end 163 74) (width 0.25) (layer B.Cu) (net 2)) + (segment (start 159.7 74) (end 161 74) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 157.82 74.85) (end 158.92 74.85) (width 0.25) (layer B.Cu) (net 3)) + (segment (start 158.92 74.85) (end 159.7 74) (width 0.25) (layer B.Cu) (net 3)) + + (zone (net 1) (net_name GND) (layer B.Cu) (tstamp 5EBAC970) (hatch edge 0.508) + (connect_pads (clearance 0.508)) + (min_thickness 0.254) + (fill yes (arc_segments 32) (thermal_gap 0.508) (thermal_bridge_width 0.508)) + (polygon + (pts + (xy 170 80) (xy 155 80) (xy 155 72) (xy 170 72) + ) + ) + (filled_polygon + (pts + (xy 169.340001 79.34) (xy 155.66 79.34) (xy 155.66 77.74689) (xy 156.378524 77.74689) (xy 156.423175 77.894099) + (xy 156.548359 78.15692) (xy 156.722412 78.390269) (xy 156.938645 78.585178) (xy 157.188748 78.734157) (xy 157.463109 78.831481) + (xy 157.693 78.710814) (xy 157.693 77.517) (xy 157.947 77.517) (xy 157.947 78.710814) (xy 158.176891 78.831481) + (xy 158.451252 78.734157) (xy 158.701355 78.585178) (xy 158.809719 78.4875) (xy 161.661928 78.4875) (xy 161.674188 78.611982) + (xy 161.710498 78.73168) (xy 161.769463 78.841994) (xy 161.848815 78.938685) (xy 161.945506 79.018037) (xy 162.05582 79.077002) + (xy 162.175518 79.113312) (xy 162.3 79.125572) (xy 162.71425 79.1225) (xy 162.873 78.96375) (xy 162.873 78.127) + (xy 163.127 78.127) (xy 163.127 78.96375) (xy 163.28575 79.1225) (xy 163.7 79.125572) (xy 163.824482 79.113312) + (xy 163.94418 79.077002) (xy 164.054494 79.018037) (xy 164.151185 78.938685) (xy 164.230537 78.841994) (xy 164.289502 78.73168) + (xy 164.325812 78.611982) (xy 164.338072 78.4875) (xy 164.336588 78.39) (xy 165.511928 78.39) (xy 165.524188 78.514482) + (xy 165.560498 78.63418) (xy 165.619463 78.744494) (xy 165.698815 78.841185) (xy 165.795506 78.920537) (xy 165.90582 78.979502) + (xy 166.025518 79.015812) (xy 166.15 79.028072) (xy 166.71425 79.025) (xy 166.873 78.86625) (xy 166.873 77.667) + (xy 167.127 77.667) (xy 167.127 78.86625) (xy 167.28575 79.025) (xy 167.85 79.028072) (xy 167.974482 79.015812) + (xy 168.09418 78.979502) (xy 168.204494 78.920537) (xy 168.301185 78.841185) (xy 168.380537 78.744494) (xy 168.439502 78.63418) + (xy 168.475812 78.514482) (xy 168.488072 78.39) (xy 168.485 77.82575) (xy 168.32625 77.667) (xy 167.127 77.667) + (xy 166.873 77.667) (xy 165.67375 77.667) (xy 165.515 77.82575) (xy 165.511928 78.39) (xy 164.336588 78.39) + (xy 164.335 78.28575) (xy 164.17625 78.127) (xy 163.127 78.127) (xy 162.873 78.127) (xy 161.82375 78.127) + (xy 161.665 78.28575) (xy 161.661928 78.4875) (xy 158.809719 78.4875) (xy 158.917588 78.390269) (xy 159.091641 78.15692) + (xy 159.216825 77.894099) (xy 159.261476 77.74689) (xy 159.140155 77.517) (xy 157.947 77.517) (xy 157.693 77.517) + (xy 156.499845 77.517) (xy 156.378524 77.74689) (xy 155.66 77.74689) (xy 155.66 74) (xy 156.331928 74) + (xy 156.331928 75.7) (xy 156.344188 75.824482) (xy 156.380498 75.94418) (xy 156.439463 76.054494) (xy 156.518815 76.151185) + (xy 156.615506 76.230537) (xy 156.72582 76.289502) (xy 156.806466 76.313966) (xy 156.722412 76.389731) (xy 156.548359 76.62308) + (xy 156.423175 76.885901) (xy 156.378524 77.03311) (xy 156.499845 77.263) (xy 157.693 77.263) (xy 157.693 77.243) + (xy 157.947 77.243) (xy 157.947 77.263) (xy 159.140155 77.263) (xy 159.261476 77.03311) (xy 159.216825 76.885901) + (xy 159.091641 76.62308) (xy 158.917588 76.389731) (xy 158.833534 76.313966) (xy 158.91418 76.289502) (xy 159.024494 76.230537) + (xy 159.121185 76.151185) (xy 159.200537 76.054494) (xy 159.259502 75.94418) (xy 159.295812 75.824482) (xy 159.308072 75.7) + (xy 159.308072 75.504326) (xy 159.344276 75.484974) (xy 159.356983 75.474546) (xy 159.371129 75.466185) (xy 159.41474 75.427146) + (xy 159.460001 75.390001) (xy 159.494163 75.348374) (xy 159.964226 74.836127) (xy 160.023042 74.946164) (xy 160.132708 75.079792) + (xy 160.266336 75.189458) (xy 160.418791 75.270947) (xy 160.584215 75.321128) (xy 160.75625 75.338072) (xy 161.24375 75.338072) + (xy 161.415785 75.321128) (xy 161.581209 75.270947) (xy 161.733664 75.189458) (xy 161.867292 75.079792) (xy 161.9375 74.994244) + (xy 162.007708 75.079792) (xy 162.076264 75.136054) (xy 162.053836 75.148042) (xy 161.920208 75.257708) (xy 161.810542 75.391336) + (xy 161.729053 75.543791) (xy 161.678872 75.709215) (xy 161.661928 75.88125) (xy 161.661928 76.36875) (xy 161.678872 76.540785) + (xy 161.729053 76.706209) (xy 161.810542 76.858664) (xy 161.920208 76.992292) (xy 161.926564 76.997508) (xy 161.848815 77.061315) + (xy 161.769463 77.158006) (xy 161.710498 77.26832) (xy 161.674188 77.388018) (xy 161.661928 77.5125) (xy 161.665 77.71425) + (xy 161.82375 77.873) (xy 162.873 77.873) (xy 162.873 77.853) (xy 163.127 77.853) (xy 163.127 77.873) + (xy 164.17625 77.873) (xy 164.335 77.71425) (xy 164.338072 77.5125) (xy 164.325812 77.388018) (xy 164.289502 77.26832) + (xy 164.230537 77.158006) (xy 164.151185 77.061315) (xy 164.073436 76.997508) (xy 164.079792 76.992292) (xy 164.189458 76.858664) + (xy 164.270947 76.706209) (xy 164.321128 76.540785) (xy 164.338072 76.36875) (xy 164.338072 75.88125) (xy 164.32613 75.76) + (xy 165.721822 75.76) (xy 165.846525 75.946632) (xy 165.97838 76.078487) (xy 165.90582 76.100498) (xy 165.795506 76.159463) + (xy 165.698815 76.238815) (xy 165.619463 76.335506) (xy 165.560498 76.44582) (xy 165.524188 76.565518) (xy 165.511928 76.69) + (xy 165.515 77.25425) (xy 165.67375 77.413) (xy 166.873 77.413) (xy 166.873 77.393) (xy 167.127 77.393) + (xy 167.127 77.413) (xy 168.32625 77.413) (xy 168.485 77.25425) (xy 168.488072 76.69) (xy 168.475812 76.565518) + (xy 168.439502 76.44582) (xy 168.380537 76.335506) (xy 168.301185 76.238815) (xy 168.204494 76.159463) (xy 168.09418 76.100498) + (xy 168.02162 76.078487) (xy 168.153475 75.946632) (xy 168.31599 75.703411) (xy 168.427932 75.433158) (xy 168.485 75.14626) + (xy 168.485 74.85374) (xy 168.427932 74.566842) (xy 168.31599 74.296589) (xy 168.153475 74.053368) (xy 167.946632 73.846525) + (xy 167.703411 73.68401) (xy 167.433158 73.572068) (xy 167.14626 73.515) (xy 166.85374 73.515) (xy 166.566842 73.572068) + (xy 166.296589 73.68401) (xy 166.053368 73.846525) (xy 165.846525 74.053368) (xy 165.721822 74.24) (xy 164.314802 74.24) + (xy 164.000572 73.925771) (xy 164.000572 73.54375) (xy 163.983628 73.371715) (xy 163.933447 73.206291) (xy 163.851958 73.053836) + (xy 163.742292 72.920208) (xy 163.608664 72.810542) (xy 163.456209 72.729053) (xy 163.290785 72.678872) (xy 163.11875 72.661928) + (xy 162.63125 72.661928) (xy 162.459215 72.678872) (xy 162.293791 72.729053) (xy 162.141336 72.810542) (xy 162.007708 72.920208) + (xy 161.9375 73.005756) (xy 161.867292 72.920208) (xy 161.733664 72.810542) (xy 161.581209 72.729053) (xy 161.415785 72.678872) + (xy 161.24375 72.661928) (xy 160.75625 72.661928) (xy 160.584215 72.678872) (xy 160.418791 72.729053) (xy 160.266336 72.810542) + (xy 160.132708 72.920208) (xy 160.023042 73.053836) (xy 159.941553 73.206291) (xy 159.931327 73.24) (xy 159.720983 73.24) + (xy 159.667234 73.237027) (xy 159.609291 73.245257) (xy 159.551014 73.250997) (xy 159.535281 73.255769) (xy 159.519014 73.25808) + (xy 159.463788 73.277456) (xy 159.407753 73.294454) (xy 159.393257 73.302202) (xy 159.37775 73.307643) (xy 159.32735 73.337431) + (xy 159.275724 73.365026) (xy 159.26302 73.375452) (xy 159.24887 73.383815) (xy 159.205248 73.422864) (xy 159.159999 73.459999) + (xy 159.125845 73.501616) (xy 159.099137 73.530721) (xy 159.024494 73.469463) (xy 158.91418 73.410498) (xy 158.794482 73.374188) + (xy 158.67 73.361928) (xy 156.97 73.361928) (xy 156.845518 73.374188) (xy 156.72582 73.410498) (xy 156.615506 73.469463) + (xy 156.518815 73.548815) (xy 156.439463 73.645506) (xy 156.380498 73.75582) (xy 156.344188 73.875518) (xy 156.331928 74) + (xy 155.66 74) (xy 155.66 72.66) (xy 169.34 72.66) + ) + ) + ) +) diff --git a/tests/reference/PCB_Bot.pdf b/tests/reference/PCB_Bot.pdf new file mode 100644 index 00000000..cee23767 Binary files /dev/null and b/tests/reference/PCB_Bot.pdf differ diff --git a/tests/reference/zone-refill-B_Cu.pdf b/tests/reference/zone-refill-B_Cu.pdf new file mode 100644 index 00000000..919e9b47 Binary files /dev/null and b/tests/reference/zone-refill-B_Cu.pdf differ diff --git a/tests/test_plot/test_pdf.py b/tests/test_plot/test_pdf.py index 0597d1da..37d65400 100644 --- a/tests/test_plot/test_pdf.py +++ b/tests/test_plot/test_pdf.py @@ -29,3 +29,13 @@ def test_pdf(): ctx.dont_expect_out_file(ctx.get_gerber_job_filename()) ctx.clean_up() + + +def test_pdf_refill(): + prj = 'zone-refill' + ctx = context.TestContext('Plot_PDF_Refill', prj, 'pdf_zone-refill', '') + ctx.run() + + b_cu = ctx.get_gerber_filename('B_Cu', '.pdf') + ctx.expect_out_file(b_cu) + ctx.compare_image(b_cu) diff --git a/tests/test_plot/test_print_pcb.py b/tests/test_plot/test_print_pcb.py index ae0e94b9..b4086305 100644 --- a/tests/test_plot/test_print_pcb.py +++ b/tests/test_plot/test_print_pcb.py @@ -19,6 +19,7 @@ from utils import context PDF_DIR = 'Layers' PDF_FILE = 'PCB_Top.pdf' +PDF_FILE_B = 'PCB_Bot.pdf' def test_print_pcb(): @@ -28,3 +29,12 @@ def test_print_pcb(): # Check all outputs are there ctx.expect_out_file(os.path.join(PDF_DIR, PDF_FILE)) ctx.clean_up() + + +def test_print_pcb_refill(): + prj = 'zone-refill' + ctx = context.TestContext('PrPCB_Refill', prj, 'print_pcb_zone-refill', '') + ctx.run() + + ctx.expect_out_file(PDF_FILE_B) + ctx.compare_image(PDF_FILE_B) diff --git a/tests/utils/context.py b/tests/utils/context.py index f2a1ced8..ff6ebfa7 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -11,7 +11,8 @@ from pty import openpty COVERAGE_SCRIPT = 'python3-coverage' KICAD_PCB_EXT = '.kicad_pcb' KICAD_SCH_EXT = '.sch' -REF_DIR = 'N/A' +REF_DIR = 'tests/reference' + MODE_SCH = 1 MODE_PCB = 0 @@ -57,7 +58,7 @@ class TestContext(object): def _get_yaml_name(self, name, yaml_compressed): self.yaml_file = os.path.abspath(os.path.join(self._get_yaml_dir(), name+'.kiplot.yaml')) if yaml_compressed: - self.yaml_file += '.gz' + self.yaml_file += '.gz' logging.info('YAML file: '+self.yaml_file) assert os.path.isfile(self.yaml_file) diff --git a/tests/yaml_samples/pdf_zone-refill.kiplot.yaml b/tests/yaml_samples/pdf_zone-refill.kiplot.yaml new file mode 100644 index 00000000..c1ca79a8 --- /dev/null +++ b/tests/yaml_samples/pdf_zone-refill.kiplot.yaml @@ -0,0 +1,31 @@ +kiplot: + version: 1 + +preflight: + check_zone_fills: true + +outputs: + - name: PDF + comment: "PDF files" + type: pdf + dir: . + options: + exclude_edge_layer: false + exclude_pads_from_silkscreen: false + use_aux_axis_as_origin: false + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + check_zone_fills: true + + # PDF options + drill_marks: small + mirror_plot: false + negative_plot: false + line_width: 0.01 + layers: + - layer: B.Cu + suffix: B_Cu + diff --git a/tests/yaml_samples/print_pcb_zone-refill.kiplot.yaml b/tests/yaml_samples/print_pcb_zone-refill.kiplot.yaml new file mode 100644 index 00000000..71b4e681 --- /dev/null +++ b/tests/yaml_samples/print_pcb_zone-refill.kiplot.yaml @@ -0,0 +1,17 @@ +# Example KiPlot config file +kiplot: + version: 1 + +preflight: + check_zone_fills: true + +outputs: + - name: 'print_front' + comment: "Print B.Cu (filling zones)" + type: pdf_pcb_print + dir: . + options: + output_name: PCB_Bot.pdf + layers: + - layer: B.Cu +