From cb47cf3042dca4c15db9460213fb3f623719e4b1 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 8 Mar 2022 15:55:34 -0300 Subject: [PATCH] New output to export PCB in GENCAD format. Closes #159 --- CHANGELOG.md | 6 +- Makefile | 2 +- README.md | 25 ++ docs/README.in | 1 + docs/samples/generic_plot.kibot.yaml | 20 ++ kibot/misc.py | 2 + kibot/out_gencad.py | 73 +++++ tests/board_samples/kicad_5/gencad.kicad_pcb | 319 +++++++++++++++++++ tests/board_samples/kicad_6/gencad.kicad_pcb | 300 +++++++++++++++++ tests/reference/5_1_6/gencad-gencad.cad | 262 +++++++++++++++ tests/reference/5_1_7/gencad-gencad.cad | 1 + tests/reference/6_0_2/gencad-gencad.cad | 263 +++++++++++++++ tests/test_plot/test_misc.py | 16 + tests/yaml_samples/gencad_1.kibot.yaml | 12 + 14 files changed, 1299 insertions(+), 3 deletions(-) create mode 100644 kibot/out_gencad.py create mode 100644 tests/board_samples/kicad_5/gencad.kicad_pcb create mode 100644 tests/board_samples/kicad_6/gencad.kicad_pcb create mode 100644 tests/reference/5_1_6/gencad-gencad.cad create mode 120000 tests/reference/5_1_7/gencad-gencad.cad create mode 100644 tests/reference/6_0_2/gencad-gencad.cad create mode 100644 tests/yaml_samples/gencad_1.kibot.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4881f870..7d1174db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,8 +68,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added global options to define the PCB details (`pcb_material`, `solder_mask_color`, `silk_screen_color` and `pcb_finish`) - Report generation (for design house) (#93) -- New output to print PCB layers in SVG format. -- New output to join PDFs. (#156) +- New outputs: + - Print PCB layers in SVG format. + - Join PDFs. (#156) + - Export PCB in GENCAD format. (#159) ### Changed - Internal BoM: now components with different Tolerance, Voltage, Current diff --git a/Makefile b/Makefile index 302e4e7b..8e08b5ca 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ test_docker_local_1: # Run in the same directory to make the __pycache__ valid # Also change the owner of the files to the current user (we run as root like in GitHub) docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" setsoft/kicad_auto_test:latest \ - /bin/bash -c "flake8 . --count --statistics ; python3-coverage run -a src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k 'test_annotate_pcb_' --test_dir output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/" + /bin/bash -c "flake8 . --count --statistics ; python3-coverage run -a src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k 'test_gencad' --test_dir output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/board_samples/ tests/.config/kiplot/plugins/__pycache__/ tests/test_plot/fake_pcbnew/__pycache__/ tests/.config/kibot/plugins/__pycache__/ .coverage htmlcov/" $(PY_COV) report x-www-browser htmlcov/index.html diff --git a/README.md b/README.md index 5f60cacb..205b9cce 100644 --- a/README.md +++ b/README.md @@ -639,6 +639,7 @@ The available values for *type* are: - `render_3d` PCB render, from the KiCad's 3D Viewer (broken in KiCad 6.0.0) - Others: - `boardview` creates a file useful to repair the board, but without disclosing the full layout. + - `gencad` exports the PCB in GENCAD format. - `compress` creates an archive containing generated data. - `download_datasheets` downloads the datasheets for all the components. - `pcbdraw` nice images of the PCB in customized colors. @@ -1090,6 +1091,30 @@ Next time you need this list just use an alias, like this: - `output_id`: [string=''] Text to use for the %I expansion content. To differentiate variations of this output. - `run_by_default`: [boolean=true] When enabled this output will be created when no specific outputs are requested. +* GenCAD + * Type: `gencad` + * Description: Exports the PCB in GENCAD format. + This format is interpreted by some CADCAM software and helps certain + manufacturers + * Valid keys: + - `comment`: [string=''] A comment for documentation purposes. + - `dir`: [string='./'] Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. + - `disable_run_by_default`: [string|boolean] Use it to disable the `run_by_default` status of other output. + Useful when this output extends another and you don't want to generate the original. + Use the boolean true value to disable the output you are extending. + - `extends`: [string=''] Copy the `options` section from the indicated output. + - `name`: [string=''] Used to identify this particular output definition. + - `options`: [dict] Options for the `gencad` output. + * Valid keys: + - `aux_origin`: [boolean=false] Use auxiliary axis as origin. + - `flip_bottom_padstacks`: [boolean=false] Flip bottom footprint padstacks. + - `no_reuse_shapes`: [boolean=false] Generate a new shape for each footprint instance (Do not reuse shapes). + - `output`: [string='%f-%i%I%v.%x'] Filename for the output (%i=gencad, %x=cad). Affected by global options. + - `save_origin`: [boolean=false] Save the origin coordinates in the file. + - `unique_pin_names`: [boolean=false] Generate unique pin names. + - `output_id`: [string=''] Text to use for the %I expansion content. To differentiate variations of this output. + - `run_by_default`: [boolean=true] When enabled this output will be created when no specific outputs are requested. + * Gerber drill format * Type: `gerb_drill` * Description: This is the information for the drilling machine in gerber format. diff --git a/docs/README.in b/docs/README.in index 32f35424..2091baf6 100644 --- a/docs/README.in +++ b/docs/README.in @@ -448,6 +448,7 @@ The available values for *type* are: - `render_3d` PCB render, from the KiCad's 3D Viewer (broken in KiCad 6.0.0) - Others: - `boardview` creates a file useful to repair the board, but without disclosing the full layout. + - `gencad` exports the PCB in GENCAD format. - `compress` creates an archive containing generated data. - `download_datasheets` downloads the datasheets for all the components. - `pcbdraw` nice images of the PCB in customized colors. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 177ff7be..a32e4d39 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -460,6 +460,26 @@ outputs: use_aux_axis_as_origin: false # [string='DECIMAL_FORMAT'] [DECIMAL_FORMAT,SUPPRESS_LEADING,SUPPRESS_TRAILING,KEEP_ZEROS] How to handle the zeros zeros_format: 'DECIMAL_FORMAT' + # GenCAD: + # This format is interpreted by some CADCAM software and helps certain + # manufacturers + - name: 'gencad_example' + comment: 'Exports the PCB in GENCAD format.' + type: 'gencad' + dir: 'Example/gencad_dir' + options: + # [boolean=false] Use auxiliary axis as origin + aux_origin: false + # [boolean=false] Flip bottom footprint padstacks + flip_bottom_padstacks: false + # [boolean=false] Generate a new shape for each footprint instance (Do not reuse shapes) + no_reuse_shapes: false + # [string='%f-%i%I%v.%x'] Filename for the output (%i=gencad, %x=cad). Affected by global options + output: '%f-%i%I%v.%x' + # [boolean=false] Save the origin coordinates in the file + save_origin: false + # [boolean=false] Generate unique pin names + unique_pin_names: false # Gerber drill format: # You can create a map file for documentation purposes. # This output is what you get from the 'File/Fabrication output/Drill Files' menu in pcbnew. diff --git a/kibot/misc.py b/kibot/misc.py index 0e4722ab..d0b32f8f 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -71,6 +71,8 @@ CMD_PCBNEW_PRINT_LAYERS = CMD_PCBNEW_RUN_DRC URL_PCBNEW_PRINT_LAYERS = URL_EESCHEMA_DO CMD_PCBNEW_3D = CMD_PCBNEW_RUN_DRC URL_PCBNEW_3D = URL_EESCHEMA_DO +CMD_PCBNEW_GENCAD = CMD_PCBNEW_RUN_DRC +URL_PCBNEW_GENCAD = URL_EESCHEMA_DO CMD_KIBOM = 'KiBOM_CLI.py' URL_KIBOM = 'https://github.com/INTI-CMNB/KiBoM' CMD_IBOM = 'generate_interactive_bom.py' diff --git a/kibot/out_gencad.py b/kibot/out_gencad.py new file mode 100644 index 00000000..062f8804 --- /dev/null +++ b/kibot/out_gencad.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2022 Salvador E. Tropea +# Copyright (c) 2022 Instituto Nacional de TecnologĂ­a Industrial +# License: GPL-3.0 +# Project: KiBot (formerly KiPlot) +import os +from .gs import GS +from .optionable import BaseOptions +from .misc import CMD_PCBNEW_GENCAD, URL_PCBNEW_GENCAD, FAILED_EXECUTE +from .kiplot import check_script, exec_with_retry, add_extra_options +from .macros import macros, document, output_class # noqa: F401 +from . import log + +logger = log.get_logger() + + +class GenCADOptions(BaseOptions): + def __init__(self): + with document: + self.output = GS.def_global_output + """ Filename for the output (%i=gencad, %x=cad) """ + self.flip_bottom_padstacks = False + """ Flip bottom footprint padstacks """ + self.unique_pin_names = False + """ Generate unique pin names """ + self.no_reuse_shapes = False + """ Generate a new shape for each footprint instance (Do not reuse shapes) """ + self.aux_origin = False + """ Use auxiliary axis as origin """ + self.save_origin = False + """ Save the origin coordinates in the file """ + super().__init__() + self._expand_id = 'gencad' + self._expand_ext = 'cad' + + def run(self, name): + check_script(CMD_PCBNEW_GENCAD, URL_PCBNEW_GENCAD, '1.6.5') + # Output file name + cmd = [CMD_PCBNEW_GENCAD, 'export_gencad', '--output_name', os.path.basename(name)] + if self.flip_bottom_padstacks: + cmd.append('--flip_bottom_padstacks') + if self.unique_pin_names: + cmd.append('--unique_pin_names') + if self.no_reuse_shapes: + cmd.append('--no_reuse_shapes') + if self.aux_origin: + cmd.append('--aux_origin') + if self.save_origin: + cmd.append('--save_origin') + cmd.extend([GS.pcb_file, os.path.dirname(name)]) + cmd, video_remove = add_extra_options(cmd) + # Execute it + ret = exec_with_retry(cmd) + if ret: + logger.error(CMD_PCBNEW_GENCAD+' returned %d', ret) + exit(FAILED_EXECUTE) + if video_remove: + video_name = os.path.join(self.expand_filename_pcb(GS.out_dir), 'pcbnew_export_gencad_screencast.ogv') + if os.path.isfile(video_name): + os.remove(video_name) + + +@output_class +class GenCAD(BaseOutput): # noqa: F821 + """ GenCAD + Exports the PCB in GENCAD format. + This format is interpreted by some CADCAM software and helps certain + manufacturers """ + def __init__(self): + super().__init__() + with document: + self.options = GenCADOptions + """ [dict] Options for the `gencad` output """ diff --git a/tests/board_samples/kicad_5/gencad.kicad_pcb b/tests/board_samples/kicad_5/gencad.kicad_pcb new file mode 100644 index 00000000..96e158d6 --- /dev/null +++ b/tests/board_samples/kicad_5/gencad.kicad_pcb @@ -0,0 +1,319 @@ +(kicad_pcb (version 20171130) (host pcbnew 5.1.6+dfsg1-1) + + (general + (thickness 1.6) + (drawings 6) + (tracks 44) + (zones 0) + (modules 4) + (nets 4) + ) + + (page A4) + (layers + (0 F.Cu signal) + (1 GND.Cu signal) + (2 Signal1.Cu signal) + (3 Signal2.Cu signal) + (4 Power.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 /Power/VCC) + (net 2 GND) + (net 3 "Net-(C2-Pad1)") + + (net_class Default "This is the default net class." + (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 /Power/VCC) + (add_net GND) + (add_net "Net-(C2-Pad1)") + ) + + (module Capacitor_SMD:C_0402_1005Metric (layer F.Cu) (tedit 5B301BBE) (tstamp 5CA72801) + (at 164.775001 80.505001 90) + (descr "Capacitor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags capacitor) + (path /5CA71704/5CA745A6) + (attr smd) + (fp_text reference C1 (at 0 -1.17 90) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value C (at 0 1.17 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_text user %R (at 0 0 90) (layer F.Fab) + (effects (font (size 0.25 0.25) (thickness 0.04))) + ) + (pad 1 smd roundrect (at -0.485 0 90) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 /Power/VCC)) + (pad 2 smd roundrect (at 0.485 0 90) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 GND)) + (model ${KIPRJMOD}/3D/C_0402_1005Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Capacitor_SMD:C_0402_1005Metric (layer F.Cu) (tedit 5B301BBE) (tstamp 5CA72810) + (at 170.18 80.020001 90) + (descr "Capacitor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags capacitor) + (path /5CA75BC1/5CA76352) + (attr smd) + (fp_text reference C2 (at 0 -1.17 90) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value C (at 0 1.17 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_text user %R (at 0 0 90) (layer F.Fab) + (effects (font (size 0.25 0.25) (thickness 0.04))) + ) + (pad 2 smd roundrect (at 0.485 0 90) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 GND)) + (pad 1 smd roundrect (at -0.485 0 90) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 3 "Net-(C2-Pad1)")) + (model ${KIPRJMOD}/3D/C_0402_1005Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Connector_JST:JST_JWPF_B02B-JWPF-SK-R_1x02_P2.00mm_Vertical (layer F.Cu) (tedit 5B772B89) (tstamp 5CA7282D) + (at 154.94 80.01) + (descr "JST JWPF series connector, B02B-JWPF-SK-R (http://www.jst-mfg.com/product/pdf/eng/eJWPF1.pdf), generated with kicad-footprint-generator") + (tags "connector JST JWPF side entry") + (path /5CA71704/5CA714F2) + (fp_text reference P1 (at -1.35 -3.7) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value CONN_01X02 (at -1.35 5.7) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0 -1.15) (end -0.375 -1.9) (layer F.Fab) (width 0.1)) + (fp_line (start 0.375 -1.9) (end 0 -1.15) (layer F.Fab) (width 0.1)) + (fp_line (start -0.375 -1.9) (end 0.375 -1.9) (layer F.Fab) (width 0.1)) + (fp_line (start -5.75 -2.85) (end -4.25 -2.85) (layer F.SilkS) (width 0.12)) + (fp_line (start -5.75 -1.35) (end -5.75 -2.85) (layer F.SilkS) (width 0.12)) + (fp_line (start 2.81 -1.61) (end 2.81 3.61) (layer F.SilkS) (width 0.12)) + (fp_line (start -5.51 4.61) (end 1.81 4.61) (layer F.SilkS) (width 0.12)) + (fp_line (start -5.51 -2.61) (end -5.51 4.61) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.81 -2.61) (end -5.51 -2.61) (layer F.SilkS) (width 0.12)) + (fp_line (start 2.7 -1.5) (end 2.7 3.5) (layer F.Fab) (width 0.1)) + (fp_line (start -5.4 4.5) (end 1.7 4.5) (layer F.Fab) (width 0.1)) + (fp_line (start -5.4 -2.5) (end -5.4 4.5) (layer F.Fab) (width 0.1)) + (fp_line (start 1.7 -2.5) (end -5.4 -2.5) (layer F.Fab) (width 0.1)) + (fp_line (start 3.2 -3) (end -5.9 -3) (layer F.CrtYd) (width 0.05)) + (fp_line (start 3.2 5) (end 3.2 -3) (layer F.CrtYd) (width 0.05)) + (fp_line (start -5.9 5) (end 3.2 5) (layer F.CrtYd) (width 0.05)) + (fp_line (start -5.9 -3) (end -5.9 5) (layer F.CrtYd) (width 0.05)) + (fp_arc (start 1.7 -1.5) (end 1.7 -2.5) (angle 90) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.7 3.5) (end 2.7 3.5) (angle 90) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.81 -1.61) (end 1.81 -2.61) (angle 90) (layer F.SilkS) (width 0.12)) + (fp_arc (start 1.81 3.61) (end 2.81 3.61) (angle 90) (layer F.SilkS) (width 0.12)) + (fp_text user %R (at -4.7 1 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (pad 1 thru_hole roundrect (at 0 0) (size 2 1.3) (drill 1) (layers *.Cu *.Mask) (roundrect_rratio 0.192308) + (net 2 GND)) + (pad 2 thru_hole oval (at 0 2) (size 2 1.3) (drill 1) (layers *.Cu *.Mask) + (net 1 /Power/VCC)) + (pad "" np_thru_hole circle (at -1.5 4.05) (size 1.15 1.15) (drill 1.15) (layers *.Cu *.Mask)) + (model ${KIPRJMOD}/3D/B02B-JWPF-SK-R.step + (offset (xyz -3.2 -4.5 -8)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 -90)) + ) + ) + + (module Resistor_SMD:R_0402_1005Metric (layer F.Cu) (tedit 5B301BBD) (tstamp 5CA7283C) + (at 167.64 83.82) + (descr "Resistor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags resistor) + (path /5CA75BC1/5CA75C86) + (attr smd) + (fp_text reference R1 (at 0 -1.17) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value R (at 0 1.17) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer F.CrtYd) (width 0.05)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer F.Fab) (width 0.1)) + (fp_text user %R (at 0 0) (layer F.Fab) + (effects (font (size 0.25 0.25) (thickness 0.04))) + ) + (pad 1 smd roundrect (at -0.485 0) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 /Power/VCC)) + (pad 2 smd roundrect (at 0.485 0) (size 0.59 0.64) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 3 "Net-(C2-Pad1)")) + (model ${KIPRJMOD}/3D/R_0402_1005Metric.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_text "Text in Cmts.User" (at 149 93) (layer Cmts.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (gr_text "Text in Dwgs.User" (at 149 68) (layer Dwgs.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (gr_line (start 187.96 69.85) (end 142.24 69.85) (layer Edge.Cuts) (width 0.12)) + (gr_line (start 187.96 91.44) (end 187.96 69.85) (layer Edge.Cuts) (width 0.12)) + (gr_line (start 142.24 91.44) (end 187.96 91.44) (layer Edge.Cuts) (width 0.12)) + (gr_line (start 142.24 69.85) (end 142.24 91.44) (layer Edge.Cuts) (width 0.12)) + + (segment (start 160 73) (end 180 73) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 180 73) (end 180 88) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 180 88) (end 160 88) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 161 87) (end 179 87) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 179 87) (end 179 74) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 161 74) (end 179 74) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 179 74) (end 160.995 74) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 160.995 74) (end 161 74.005) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 180 88) (end 160.009 88) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 160.009 88) (end 160 87.991) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 167.155 83.37) (end 165.1 81.315) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 167.155 83.82) (end 167.155 83.37) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 165.1 81.315) (end 164.775001 80.990001) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 164.775001 80.990001) (end 157.769999 80.990001) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 156.75 82.01) (end 154.94 82.01) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 157.769999 80.990001) (end 156.75 82.01) (width 0.25) (layer F.Cu) (net 1)) + (segment (start 159.9226 82.01) (end 160 82.0874) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 154.94 82.01) (end 159.9226 82.01) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 160 82.0874) (end 160 73) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 160 88) (end 160 82.0874) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 180 88) (end 180 73.0152) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 179.9848 73) (end 160 73) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 180 73.0152) (end 179.9848 73) (width 0.25) (layer Signal1.Cu) (net 1)) + (segment (start 160.9786 82.01) (end 161 82.0314) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 154.94 82.01) (end 160.9786 82.01) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 161 82.0314) (end 161 87) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 161 74) (end 161 82.0314) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 161 87) (end 178.9888 87) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 179 86.9888) (end 179 74) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 178.9888 87) (end 179 86.9888) (width 0.25) (layer Power.Cu) (net 1)) + (segment (start 164.765 80.01) (end 164.775001 80.020001) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 154.94 80.01) (end 164.765 80.01) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 165.260001 79.535001) (end 170.18 79.535001) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 164.775001 80.020001) (end 165.260001 79.535001) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 154.9708 79.9792) (end 154.94 80.01) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 160 79.9792) (end 154.9708 79.9792) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 160 87.991) (end 160 79.9792) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 160 79.9792) (end 160 73) (width 0.25) (layer GND.Cu) (net 2)) + (segment (start 160.9852 80.01) (end 161 80.0248) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 154.94 80.01) (end 160.9852 80.01) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 161 80.0248) (end 161 87) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 161 74.005) (end 161 80.0248) (width 0.25) (layer Signal2.Cu) (net 2)) + (segment (start 170.18 81.765) (end 168.125 83.82) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 170.18 80.505001) (end 170.18 81.765) (width 0.25) (layer F.Cu) (net 3)) + +) diff --git a/tests/board_samples/kicad_6/gencad.kicad_pcb b/tests/board_samples/kicad_6/gencad.kicad_pcb new file mode 100644 index 00000000..16abb40f --- /dev/null +++ b/tests/board_samples/kicad_6/gencad.kicad_pcb @@ -0,0 +1,300 @@ +(kicad_pcb (version 20211014) (generator pcbnew) + + (general + (thickness 1.6) + ) + + (paper "A4") + (layers + (0 "F.Cu" signal) + (1 "In1.Cu" signal "GND.Cu") + (2 "In2.Cu" signal "Signal1.Cu") + (3 "In3.Cu" signal "Signal2.Cu") + (4 "In4.Cu" signal "Power.Cu") + (31 "B.Cu" signal) + (32 "B.Adhes" user "B.Adhesive") + (33 "F.Adhes" user "F.Adhesive") + (34 "B.Paste" user) + (35 "F.Paste" user) + (36 "B.SilkS" user "B.Silkscreen") + (37 "F.SilkS" user "F.Silkscreen") + (38 "B.Mask" user) + (39 "F.Mask" user) + (40 "Dwgs.User" user "User.Drawings") + (41 "Cmts.User" user "User.Comments") + (42 "Eco1.User" user "User.Eco1") + (43 "Eco2.User" user "User.Eco2") + (44 "Edge.Cuts" user) + (45 "Margin" user) + (46 "B.CrtYd" user "B.Courtyard") + (47 "F.CrtYd" user "F.Courtyard") + (48 "B.Fab" user) + (49 "F.Fab" user) + ) + + (setup + (pad_to_mask_clearance 0) + (pcbplotparams + (layerselection 0x00010fc_ffffffff) + (disableapertmacros false) + (usegerberextensions false) + (usegerberattributes false) + (usegerberadvancedattributes false) + (creategerberjobfile false) + (svguseinch false) + (svgprecision 6) + (excludeedgelayer true) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (dxfpolygonmode true) + (dxfimperialunits true) + (dxfusepcbnewfont true) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (sketchpadsonfab false) + (subtractmaskfromsilk false) + (outputformat 1) + (mirror false) + (drillshape 1) + (scaleselection 1) + (outputdirectory "") + ) + ) + + (net 0 "") + (net 1 "/Power/VCC") + (net 2 "GND") + (net 3 "Net-(C2-Pad1)") + + (footprint "Capacitor_SMD:C_0402_1005Metric" (layer "F.Cu") + (tedit 5B301BBE) (tstamp 00000000-0000-0000-0000-00005ca72801) + (at 164.775001 80.505001 90) + (descr "Capacitor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags "capacitor") + (path "/00000000-0000-0000-0000-00005ca71704/00000000-0000-0000-0000-00005ca745a6") + (attr smd) + (fp_text reference "C1" (at 0 -1.17 90) (layer "F.SilkS") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 9a23b22f-3d9b-4951-aca2-1dd2d0be96b0) + ) + (fp_text value "C" (at 0 1.17 90) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp c9740a16-60df-417c-b8aa-6e246ef5377c) + ) + (fp_text user "${REFERENCE}" (at 0 0 90) (layer "F.Fab") + (effects (font (size 0.25 0.25) (thickness 0.04))) + (tstamp f028daf9-04ea-48a3-b9bc-9fa512382e75) + ) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp 1be44349-9ddf-433e-8bf3-5a664ab30d7a)) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp c2a759fb-6634-422d-a827-5c66f0a574d3)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp c84ccc44-72d9-492b-ac06-49803b12528e)) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp dd4e2556-ea45-40ee-a0d2-d93fc24a120b)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 395a5b6d-e42e-4126-b363-590a3a0a70ff)) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp 639b9d2c-61cd-4a70-8baf-501716ff183d)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp ba8dd5eb-d5d0-4903-8450-0db58011357d)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp e71c1f04-99a9-4bd7-887d-05aa3966e68b)) + (pad "1" smd roundrect locked (at -0.485 0 90) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 1 "/Power/VCC") (tstamp ba243994-ae89-440a-a76c-71226388e015)) + (pad "2" smd roundrect locked (at 0.485 0 90) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 2 "GND") (tstamp e8d5cc32-c7e5-4a70-b97a-4338c5309ced)) + (model "${KIPRJMOD}/3D/C_0402_1005Metric.wrl" + (offset (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (footprint "Capacitor_SMD:C_0402_1005Metric" (layer "F.Cu") + (tedit 5B301BBE) (tstamp 00000000-0000-0000-0000-00005ca72810) + (at 170.18 80.020001 90) + (descr "Capacitor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags "capacitor") + (path "/00000000-0000-0000-0000-00005ca75bc1/00000000-0000-0000-0000-00005ca76352") + (attr smd) + (fp_text reference "C2" (at 0 -1.17 90) (layer "F.SilkS") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 4b0ea34d-5553-49d4-9ac6-f48fba4fe3bc) + ) + (fp_text value "C" (at 0 1.17 90) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 5fa2cd46-6664-42e4-a296-a39cc550683c) + ) + (fp_text user "${REFERENCE}" (at 0 0 90) (layer "F.Fab") + (effects (font (size 0.25 0.25) (thickness 0.04))) + (tstamp 36fea843-7950-4cc8-aac2-59b2ab23c8ab) + ) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp 14420231-66cc-402f-99e7-5c8b6fd43c5b)) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp 3ce06a93-2b01-4698-890f-27cb0fe67071)) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp 82f10354-af3f-4d57-86e0-ddb67a99af44)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp a927c407-0c19-4da0-9a0b-4ccd1a5c1e97)) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp 2dd27e21-4b72-41c7-87a0-b01e27eff833)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 4db15ae6-e71c-47ec-adf5-f44b8d8c3074)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 65d95687-ee87-4c26-bcdc-ce2bdb869303)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp f52a043a-6aa7-4174-9331-66b5ef3bef47)) + (pad "1" smd roundrect locked (at -0.485 0 90) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 3 "Net-(C2-Pad1)") (tstamp cd01f9b6-04c6-4727-b30b-c86b8a198260)) + (pad "2" smd roundrect locked (at 0.485 0 90) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 2 "GND") (tstamp f458f5ad-1900-437c-af8b-79b4b9fc1534)) + (model "${KIPRJMOD}/3D/C_0402_1005Metric.wrl" + (offset (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (footprint "Connector_JST:JST_JWPF_B02B-JWPF-SK-R_1x02_P2.00mm_Vertical" (layer "F.Cu") + (tedit 5F775CC9) (tstamp 00000000-0000-0000-0000-00005ca7282d) + (at 154.94 80.01) + (descr "JST JWPF series connector, B02B-JWPF-SK-R (http://www.jst-mfg.com/product/pdf/eng/eJWPF1.pdf), generated with kicad-footprint-generator") + (tags "connector JST JWPF side entry") + (path "/00000000-0000-0000-0000-00005ca71704/00000000-0000-0000-0000-00005ca714f2") + (attr through_hole) + (fp_text reference "P1" (at -1.35 -3.7) (layer "F.SilkS") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 01e65c7c-ade6-4c5d-9a10-2ae32822c795) + ) + (fp_text value "CONN_01X02" (at -1.35 5.7) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 391fc8ae-4836-4ea4-8f58-37150a7e3966) + ) + (fp_text user "${REFERENCE}" (at -4.7 1 90) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp f1db09b7-cef3-4b59-9928-d4b649d3ba36) + ) + (fp_line (start 1.81 -2.61) (end -5.51 -2.61) (layer "F.SilkS") (width 0.12) (tstamp 33221914-6b6a-4232-be2b-076ef481847d)) + (fp_line (start -5.75 -2.85) (end -4.25 -2.85) (layer "F.SilkS") (width 0.12) (tstamp 4002613e-3ff9-444a-b4f6-8e8fecb97c70)) + (fp_line (start -5.51 4.61) (end -2.05 4.61) (layer "F.SilkS") (width 0.12) (tstamp 4b3c1322-fa44-46c5-94bf-f2e5e1d343be)) + (fp_line (start -5.75 -1.35) (end -5.75 -2.85) (layer "F.SilkS") (width 0.12) (tstamp 8a5b244d-a586-4fce-a4af-81ba527962ea)) + (fp_line (start -5.51 -2.61) (end -5.51 4.61) (layer "F.SilkS") (width 0.12) (tstamp ab1b5e79-b044-45c2-9af4-f06625a6e6f3)) + (fp_line (start 2.81 -1.61) (end 2.81 3.61) (layer "F.SilkS") (width 0.12) (tstamp f49325c4-99e7-4ce3-8934-848a13a8ba71)) + (fp_line (start -0.93 4.611771) (end 1.791822 4.611771) (layer "F.SilkS") (width 0.12) (tstamp f75d9b3d-6d27-4f5c-9072-8045fa5c9abc)) + (fp_arc (start 2.81 3.61) (mid 2.517107 4.317107) (end 1.81 4.61) (layer "F.SilkS") (width 0.12) (tstamp 054ef1d4-61fe-406b-9c06-403783d044cd)) + (fp_arc (start 1.81 -2.61) (mid 2.517107 -2.317107) (end 2.81 -1.61) (layer "F.SilkS") (width 0.12) (tstamp 1302ec87-2c9b-4084-bad8-ff491c491404)) + (fp_line (start 3.2 -3) (end -5.9 -3) (layer "F.CrtYd") (width 0.05) (tstamp 233d639f-ccf6-46d5-938a-2fa7af01802d)) + (fp_line (start 3.2 5) (end 3.2 -3) (layer "F.CrtYd") (width 0.05) (tstamp 2f025c58-117a-4c69-bd75-10928cf38fdd)) + (fp_line (start -5.9 5) (end 3.2 5) (layer "F.CrtYd") (width 0.05) (tstamp 33735995-1cb8-4e72-bcd6-2956b5ce2cfd)) + (fp_line (start -5.9 -3) (end -5.9 5) (layer "F.CrtYd") (width 0.05) (tstamp 4b1e41ea-3346-41da-a638-75ed32630d0e)) + (fp_line (start -5.4 -2.5) (end -5.4 4.5) (layer "F.Fab") (width 0.1) (tstamp 36a818c4-d265-4e25-9ac8-8e7b3b394da9)) + (fp_line (start 1.7 -2.5) (end -5.4 -2.5) (layer "F.Fab") (width 0.1) (tstamp 630eeaf5-efd9-4a15-b3e6-cf60ca6ed4dc)) + (fp_line (start 0 -1.15) (end -0.375 -1.9) (layer "F.Fab") (width 0.1) (tstamp 841f0f2a-5b8e-4ed2-8eba-7a6abce7f90a)) + (fp_line (start -5.4 4.5) (end 1.7 4.5) (layer "F.Fab") (width 0.1) (tstamp 98a8fbb4-9925-4005-84de-a3d0abfc24c0)) + (fp_line (start 2.7 -1.5) (end 2.7 3.5) (layer "F.Fab") (width 0.1) (tstamp 9df24d71-5bb7-4764-9c01-13d3e158b1fc)) + (fp_line (start -0.375 -1.9) (end 0.375 -1.9) (layer "F.Fab") (width 0.1) (tstamp aaa5a52c-b22b-4732-be68-0bf327f783eb)) + (fp_line (start 0.375 -1.9) (end 0 -1.15) (layer "F.Fab") (width 0.1) (tstamp d85b4c38-7d8c-45a9-b086-fdf1e889231f)) + (fp_arc (start 1.7 -2.5) (mid 2.407107 -2.207107) (end 2.7 -1.5) (layer "F.Fab") (width 0.1) (tstamp 482087fc-b33d-4c8b-a35b-a2bf5616df9f)) + (fp_arc (start 2.7 3.5) (mid 2.407107 4.207107) (end 1.7 4.5) (layer "F.Fab") (width 0.1) (tstamp e5349c41-425d-4ed8-94d5-5f4b6b7429dc)) + (pad "" np_thru_hole circle locked (at -1.5 4.05) (size 1.15 1.15) (drill 1.15) (layers *.Cu *.Mask) (tstamp 202871af-da07-4017-9e30-f448f216e668)) + (pad "1" thru_hole roundrect locked (at 0 0) (size 2 1.3) (drill 1) (layers *.Cu *.Mask) (roundrect_rratio 0.192308) + (net 2 "GND") (tstamp 219a773e-ac2b-4e53-b0e9-f8b9b58e259e)) + (pad "2" thru_hole oval locked (at 0 2) (size 2 1.3) (drill 1) (layers *.Cu *.Mask) + (net 1 "/Power/VCC") (tstamp 7280d213-04c2-4a0c-9ec5-efe27ae8a927)) + (model "${KIPRJMOD}/3D/B02B-JWPF-SK-R.step" + (offset (xyz -3.2 -4.5 -8)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 -90)) + ) + ) + + (footprint "Resistor_SMD:R_0402_1005Metric" (layer "F.Cu") + (tedit 5B301BBD) (tstamp 00000000-0000-0000-0000-00005ca7283c) + (at 167.64 83.82) + (descr "Resistor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: http://www.tortai-tech.com/upload/download/2011102023233369053.pdf), generated with kicad-footprint-generator") + (tags "resistor") + (path "/00000000-0000-0000-0000-00005ca75bc1/00000000-0000-0000-0000-00005ca75c86") + (attr smd) + (fp_text reference "R1" (at 0 -1.17) (layer "F.SilkS") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 1712ddb2-8498-47c4-9102-89884d6009b3) + ) + (fp_text value "R" (at 0 1.17) (layer "F.Fab") + (effects (font (size 1 1) (thickness 0.15))) + (tstamp 8b21f92e-4d94-4dfc-b965-48a43195b342) + ) + (fp_text user "${REFERENCE}" (at 0 0) (layer "F.Fab") + (effects (font (size 0.25 0.25) (thickness 0.04))) + (tstamp 96f07353-86e5-4ce6-9992-8b40505a18e9) + ) + (fp_line (start 0.93 -0.47) (end 0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp 378f6628-66ef-4189-bee0-1583cf727555)) + (fp_line (start -0.93 0.47) (end -0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp 8ca06879-b527-4155-8fd0-0bd34aaa2e69)) + (fp_line (start -0.93 -0.47) (end 0.93 -0.47) (layer "F.CrtYd") (width 0.05) (tstamp 964739da-c909-4d70-8d52-f7979b81719f)) + (fp_line (start 0.93 0.47) (end -0.93 0.47) (layer "F.CrtYd") (width 0.05) (tstamp e9c91c55-58c3-4890-b728-b3a8876ac20e)) + (fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 4e06a9d5-f2a3-488b-9aa4-b42ed45336fb)) + (fp_line (start -0.5 -0.25) (end 0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp 585d956e-0a20-4895-9a63-4b8126e791ed)) + (fp_line (start -0.5 0.25) (end -0.5 -0.25) (layer "F.Fab") (width 0.1) (tstamp 82e7535a-f542-4fb6-a13f-a9d090fb1bf1)) + (fp_line (start 0.5 0.25) (end -0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp dbb42a80-ad9f-4c04-bbd1-c8c2ec36815a)) + (pad "1" smd roundrect locked (at -0.485 0) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 1 "/Power/VCC") (tstamp 7fdddde3-d41d-4e09-82ef-432774318262)) + (pad "2" smd roundrect locked (at 0.485 0) (size 0.59 0.64) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) + (net 3 "Net-(C2-Pad1)") (tstamp b46b1255-5aa3-4ecd-9309-4fdf26cca450)) + (model "${KIPRJMOD}/3D/R_0402_1005Metric.wrl" + (offset (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_line (start 187.96 69.85) (end 142.24 69.85) (layer "Edge.Cuts") (width 0.12) (tstamp 1d2200bd-ccd1-4031-9372-30a2928d183b)) + (gr_line (start 142.24 69.85) (end 142.24 91.44) (layer "Edge.Cuts") (width 0.12) (tstamp 900362e5-bd4f-4871-ae2d-6d8132a1ca60)) + (gr_line (start 187.96 91.44) (end 187.96 69.85) (layer "Edge.Cuts") (width 0.12) (tstamp a9359475-73be-4eab-ac48-7e0e4951c28f)) + (gr_line (start 142.24 91.44) (end 187.96 91.44) (layer "Edge.Cuts") (width 0.12) (tstamp ff645443-f882-436f-b50c-99274595dcc9)) + (gr_text "Text in Dwgs.User" (at 149 68) (layer "Dwgs.User") (tstamp 06c75a95-88f3-4a33-93f5-bda2b8f9e5cf) + (effects (font (size 1 1) (thickness 0.15))) + ) + (gr_text "Text in Cmts.User" (at 149 93) (layer "Cmts.User") (tstamp baeb1cc7-796b-470c-8b9f-d52896d68c36) + (effects (font (size 1 1) (thickness 0.15))) + ) + + (segment (start 167.155 83.82) (end 167.155 83.37) (width 0.25) (layer "F.Cu") (net 1) (tstamp 29d0a5ec-066e-4464-8da7-249a00673e24)) + (segment (start 156.75 82.01) (end 154.94 82.01) (width 0.25) (layer "F.Cu") (net 1) (tstamp 34a33052-9a56-46d8-8637-1964c8330030)) + (segment (start 165.1 81.315) (end 164.775001 80.990001) (width 0.25) (layer "F.Cu") (net 1) (tstamp 498be5a9-bdc2-4274-8172-a93fdb364124)) + (segment (start 164.775001 80.990001) (end 157.769999 80.990001) (width 0.25) (layer "F.Cu") (net 1) (tstamp 6975de1c-9010-4420-a896-22710b4d6ef0)) + (segment (start 157.769999 80.990001) (end 156.75 82.01) (width 0.25) (layer "F.Cu") (net 1) (tstamp 6c066fdf-faaf-41c7-bab0-5b14822540cb)) + (segment (start 167.155 83.37) (end 165.1 81.315) (width 0.25) (layer "F.Cu") (net 1) (tstamp e104162b-e5b4-40f5-b86c-d39aab33df13)) + (segment (start 180 88) (end 160 88) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 23344ac0-1ddf-46e9-b447-8c6227dca955)) + (segment (start 179.9848 73) (end 160 73) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 24b6a054-076f-448b-91ac-f51d97df8fed)) + (segment (start 180 73.0152) (end 179.9848 73) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 2981c240-a937-427f-a0ab-64e0a2f1588d)) + (segment (start 160 88) (end 160 82.0874) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 50fc8d73-518c-4f35-bc0a-2b3a8a184b49)) + (segment (start 180 88) (end 180 73.0152) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 81d4b9c2-3cde-4eb1-8172-3f3a9a34934d)) + (segment (start 160 82.0874) (end 160 73) (width 0.25) (layer "In2.Cu") (net 1) (tstamp 9b1592b5-e765-4fe0-a5a6-9084dc74250c)) + (segment (start 159.9226 82.01) (end 160 82.0874) (width 0.25) (layer "In2.Cu") (net 1) (tstamp aa340853-4ab1-4202-b02d-17cd5e5a3bef)) + (segment (start 154.94 82.01) (end 159.9226 82.01) (width 0.25) (layer "In2.Cu") (net 1) (tstamp fe7d60bf-b7af-4d9a-b88e-1d392c069550)) + (segment (start 161 82.0314) (end 161 87) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 0f3459d4-80af-4d53-8f06-354f472de373)) + (segment (start 154.94 82.01) (end 160.9786 82.01) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 0f854b51-f5eb-43a2-9983-482f4c5a7802)) + (segment (start 179 86.9888) (end 179 74) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 361005b8-d729-4068-baa1-41be76d6fceb)) + (segment (start 161 74) (end 179 74) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 68f23baf-b8be-4e59-8ca4-94515a71f54a)) + (segment (start 161 87) (end 178.9888 87) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 6a90896e-6cb4-4ead-ad53-ea652bf5c7f2)) + (segment (start 178.9888 87) (end 179 86.9888) (width 0.25) (layer "In4.Cu") (net 1) (tstamp 798d3fb6-ab93-46a7-87f5-d1865cd63482)) + (segment (start 160.9786 82.01) (end 161 82.0314) (width 0.25) (layer "In4.Cu") (net 1) (tstamp b7d9f079-9f5b-4865-8c43-f23205213a68)) + (segment (start 161 74) (end 161 82.0314) (width 0.25) (layer "In4.Cu") (net 1) (tstamp c804858e-3c36-46db-93c4-b7315315c9b1)) + (segment (start 165.260001 79.535001) (end 170.18 79.535001) (width 0.25) (layer "F.Cu") (net 2) (tstamp 3d2ad86c-23b9-404e-9734-01910c44d8ce)) + (segment (start 164.765 80.01) (end 164.775001 80.020001) (width 0.25) (layer "F.Cu") (net 2) (tstamp 6332b0ee-5cdf-4697-b55a-e0f0dd77f8ce)) + (segment (start 154.94 80.01) (end 164.765 80.01) (width 0.25) (layer "F.Cu") (net 2) (tstamp 90419f32-393b-42b6-928e-f75e84540618)) + (segment (start 164.775001 80.020001) (end 165.260001 79.535001) (width 0.25) (layer "F.Cu") (net 2) (tstamp edef7a5b-c8fb-451e-ad80-b0b4c119bcef)) + (segment (start 180 73) (end 180 88) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 2d592a53-27a0-4c92-b11f-17804b171e0e)) + (segment (start 160 73) (end 180 73) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 4650ef86-7064-4722-a2e5-1163cd2ce8d2)) + (segment (start 180 88) (end 160.009 88) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 4b817320-b5aa-47c7-8f94-de74f4d43b0a)) + (segment (start 160.009 88) (end 160 87.991) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 7ab5aece-3cbe-4e3f-84e2-c1eb62cb86cf)) + (segment (start 154.9708 79.9792) (end 154.94 80.01) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 88b04270-effd-4e84-a65e-71c5936c05d1)) + (segment (start 160 79.9792) (end 154.9708 79.9792) (width 0.25) (layer "In1.Cu") (net 2) (tstamp 8b3046a6-0c28-496a-b2b2-123190bddeb9)) + (segment (start 160 79.9792) (end 160 73) (width 0.25) (layer "In1.Cu") (net 2) (tstamp c8f4e9bb-ff9f-431c-92cd-eaf196680015)) + (segment (start 160 87.991) (end 160 79.9792) (width 0.25) (layer "In1.Cu") (net 2) (tstamp d60a9fb2-0cad-4a39-859a-38192742cbc2)) + (segment (start 179 87) (end 179 74) (width 0.25) (layer "In3.Cu") (net 2) (tstamp 4178ccf8-1a1e-4296-9efe-ecdd9ef8535e)) + (segment (start 154.94 80.01) (end 160.9852 80.01) (width 0.25) (layer "In3.Cu") (net 2) (tstamp 592184ad-f729-4aeb-9516-a77f8cac5a72)) + (segment (start 160.995 74) (end 161 74.005) (width 0.25) (layer "In3.Cu") (net 2) (tstamp 5f497fc8-0612-4128-8d96-db8122821f83)) + (segment (start 161 87) (end 179 87) (width 0.25) (layer "In3.Cu") (net 2) (tstamp 695b14e7-56b6-4e96-843f-fd5673817085)) + (segment (start 160.9852 80.01) (end 161 80.0248) (width 0.25) (layer "In3.Cu") (net 2) (tstamp c7c422c0-8e1d-45d4-b657-cb36b003ff9c)) + (segment (start 179 74) (end 160.995 74) (width 0.25) (layer "In3.Cu") (net 2) (tstamp d4d8d124-9840-4ebd-9db3-31e917d49a67)) + (segment (start 161 80.0248) (end 161 87) (width 0.25) (layer "In3.Cu") (net 2) (tstamp d6c4e1b2-3197-4428-9416-faa0359685dd)) + (segment (start 161 74.005) (end 161 80.0248) (width 0.25) (layer "In3.Cu") (net 2) (tstamp e11cb8ea-55a2-4d51-b55a-159154c676ad)) + (segment (start 170.18 80.505001) (end 170.18 81.765) (width 0.25) (layer "F.Cu") (net 3) (tstamp 39584a4d-665b-4b75-bca9-5cd27f67aa54)) + (segment (start 170.18 81.765) (end 168.125 83.82) (width 0.25) (layer "F.Cu") (net 3) (tstamp d51b1e5a-2978-4dda-9173-3696dbd8f279)) + +) diff --git a/tests/reference/5_1_6/gencad-gencad.cad b/tests/reference/5_1_6/gencad-gencad.cad new file mode 100644 index 00000000..e7cffa13 --- /dev/null +++ b/tests/reference/5_1_6/gencad-gencad.cad @@ -0,0 +1,262 @@ +$HEADER +GENCAD 1.4 +USER "" +DRAWING "" +REVISION " " +UNITS INCH +ORIGIN 0 0 +INTERTRACK 0 +$ENDHEADER + +$BOARD +LINE 7.4 -2.75 5.6 -2.75 +LINE 7.4 -3.6 7.4 -2.75 +LINE 5.6 -3.6 7.4 -3.6 +LINE 5.6 -2.75 5.6 -3.6 +$ENDBOARD + +$PADS +PAD P1 ROUND 0.0452756 +CIRCLE 0 0 0.0226378 +PAD P2 POLYGON 0.0393701 +ARC -0.0393701 0 -0.0137795 -0.0255906 -0.0137795 0 +LINE -0.0137795 -0.0255906 0.0137795 -0.0255906 +ARC 0.0137795 -0.0255906 0.0393701 0 0.0137795 0 +ARC 0.0393701 0 0.0137795 0.0255906 0.0137795 0 +LINE -0.0137795 0.0255906 0.0137795 0.0255906 +ARC -0.0137795 0.0255906 -0.0393701 0 -0.0137795 0 +PAD P3 POLYGON 0 +ARC -0.0116142 -0.00679134 -0.00580709 -0.0125984 -0.00580709 -0.00679134 +LINE -0.00580709 -0.0125984 0.00580709 -0.0125984 +ARC 0.00580709 -0.0125984 0.0116142 -0.00679134 0.00580709 -0.00679134 +LINE 0.0116142 0.00679134 0.0116142 -0.00679134 +ARC 0.0116142 0.00679134 0.00580709 0.0125984 0.00580709 0.00679134 +LINE -0.00580709 0.0125984 0.00580709 0.0125984 +ARC -0.00580709 0.0125984 -0.0116142 0.00679134 -0.00580709 0.00679134 +LINE -0.0116142 -0.00679134 -0.0116142 0.00679134 +PAD P4 POLYGON 0.0393701 +ARC -0.0393701 -0.015748 -0.0295276 -0.0255906 -0.0295276 -0.015748 +LINE -0.0295276 -0.0255906 0.0295276 -0.0255906 +ARC 0.0295276 -0.0255906 0.0393701 -0.015748 0.0295276 -0.015748 +LINE 0.0393701 0.015748 0.0393701 -0.015748 +ARC 0.0393701 0.015748 0.0295276 0.0255906 0.0295276 0.015748 +LINE -0.0295276 0.0255906 0.0295276 0.0255906 +ARC -0.0295276 0.0255906 -0.0393701 0.015748 -0.0295276 0.015748 +LINE -0.0393701 -0.015748 -0.0393701 0.015748 + +$ENDPADS + +$PADSTACKS +PADSTACK PAD1 0.0452756 +PAD P1 BOTTOM 0 0 +PAD P1 INNER1 0 0 +PAD P1 INNER2 0 0 +PAD P1 INNER3 0 0 +PAD P1 INNER4 0 0 +PAD P1 TOP 0 0 +PADSTACK PAD1F 0.0452756 +PAD P1 TOP 0 0 +PAD P1 INNER13 0 0 +PAD P1 INNER12 0 0 +PAD P1 INNER11 0 0 +PAD P1 INNER10 0 0 +PAD P1 BOTTOM 0 0 +PAD P1 SOLDERMASK_BOTTOM 0 0 +PAD P1 SOLDERMASK_TOP 0 0 +PADSTACK PAD2 0.0393701 +PAD P2 BOTTOM 0 0 +PAD P2 INNER1 0 0 +PAD P2 INNER2 0 0 +PAD P2 INNER3 0 0 +PAD P2 INNER4 0 0 +PAD P2 TOP 0 0 +PADSTACK PAD2F 0.0393701 +PAD P2 TOP 0 0 +PAD P2 INNER13 0 0 +PAD P2 INNER12 0 0 +PAD P2 INNER11 0 0 +PAD P2 INNER10 0 0 +PAD P2 BOTTOM 0 0 +PAD P2 SOLDERMASK_BOTTOM 0 0 +PAD P2 SOLDERMASK_TOP 0 0 +PADSTACK PAD3 0 +PAD P3 TOP 0 0 +PADSTACK PAD3F 0 +PAD P3 TOP 0 0 +PAD P3 SOLDERPASTE_TOP 0 0 +PAD P3 SOLDERMASK_TOP 0 0 +PADSTACK PAD4 0.0393701 +PAD P4 BOTTOM 0 0 +PAD P4 INNER1 0 0 +PAD P4 INNER2 0 0 +PAD P4 INNER3 0 0 +PAD P4 INNER4 0 0 +PAD P4 TOP 0 0 +PADSTACK PAD4F 0.0393701 +PAD P4 TOP 0 0 +PAD P4 INNER13 0 0 +PAD P4 INNER12 0 0 +PAD P4 INNER11 0 0 +PAD P4 INNER10 0 0 +PAD P4 BOTTOM 0 0 +PAD P4 SOLDERMASK_BOTTOM 0 0 +PAD P4 SOLDERMASK_TOP 0 0 +$ENDPADSTACKS + +$ARTWORKS +$ENDARTWORKS + +$SHAPES + +SHAPE "C1" +INSERT SMD +PIN "1" PAD3 -0.0190945 0 TOP 0 0 +PIN "2" PAD3 0.0190945 0 TOP 0 0 + +SHAPE "C2" +INSERT SMD +PIN "2" PAD3 0.0190945 0 TOP 0 0 +PIN "1" PAD3 -0.0190945 0 TOP 0 0 + +SHAPE "P1" +INSERT TH +LINE 0.0712598 0.102756 -0.216929 0.102756 +LINE -0.216929 0.102756 -0.216929 -0.181496 +LINE -0.216929 -0.181496 0.0712598 -0.181496 +LINE 0.11063 0.0633858 0.11063 -0.142126 +LINE -0.226378 0.0531496 -0.226378 0.112205 +LINE -0.226378 0.112205 -0.167323 0.112205 +ARC 0.0712598 0.102756 0.11063 0.0633858 0.0712598 0.0633858 +ARC 0.11063 -0.142126 0.0712598 -0.181496 0.0712598 -0.142126 +PIN "1" PAD4 0 0 TOP 0 0 +PIN "2" PAD2 0 -0.0787402 TOP 0 0 +PIN "none" PAD1 -0.0590551 -0.159449 TOP 0 0 + +SHAPE "R1" +INSERT SMD +PIN "1" PAD3 -0.0190945 0 TOP 0 0 +PIN "2" PAD3 0.0190945 0 TOP 0 0 +$ENDSHAPES + +$COMPONENTS + +COMPONENT "C1" +DEVICE "DEV_C1" +PLACE 6.4872 -3.16949 +LAYER TOP +ROTATION 90 +SHAPE "C1" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "C1" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "C" 0 0 0.0393701 0.0393701 +SHEET "RefDes: C1, Value: C" + +COMPONENT "C2" +DEVICE "DEV_C2" +PLACE 6.7 -3.15039 +LAYER TOP +ROTATION 90 +SHAPE "C2" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "C2" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "C" 0 0 0.0393701 0.0393701 +SHEET "RefDes: C2, Value: C" + +COMPONENT "P1" +DEVICE "DEV_P1" +PLACE 6.1 -3.15 +LAYER TOP +ROTATION 0 +SHAPE "P1" 0 0 +TEXT -0.0531496 0.145669 0.0393701 0 0 SILKSCREEN_TOP "P1" 0 0 0.0787402 0.0393701 +TEXT -0.0531496 -0.224409 0.0393701 0 0 SILKSCREEN_TOP "CONN_01X02" 0 0 0.393701 0.0393701 +SHEET "RefDes: P1, Value: CONN_01X02" + +COMPONENT "R1" +DEVICE "DEV_R1" +PLACE 6.6 -3.3 +LAYER TOP +ROTATION 0 +SHAPE "R1" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "R1" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "R" 0 0 0.0393701 0.0393701 +SHEET "RefDes: R1, Value: R" +$ENDCOMPONENTS + +$DEVICES +$ENDDEVICES + +$SIGNALS +SIGNAL "/Power/VCC" +NODE "C1" "1" +NODE "P1" "2" +NODE "R1" "1" +SIGNAL "GND" +NODE "C1" "2" +NODE "C2" "2" +NODE "P1" "1" +SIGNAL "Net-(C2-Pad1)" +NODE "C2" "1" +NODE "R1" "2" +$ENDSIGNALS + +$TRACKS +TRACK TRACK250000 0.00984252 +$ENDTRACKS + +$ROUTES +ROUTE "/Power/VCC" +TRACK TRACK250000 +LAYER TOP +LINE 6.58091 -3.28228 6.5 -3.20138 +LINE 6.58091 -3.3 6.58091 -3.28228 +LINE 6.5 -3.20138 6.4872 -3.18858 +LINE 6.4872 -3.18858 6.21142 -3.18858 +LINE 6.17126 -3.22874 6.1 -3.22874 +LINE 6.21142 -3.18858 6.17126 -3.22874 +LAYER INNER3 +LINE 7.08661 -3.46457 6.29921 -3.46457 +LINE 6.29617 -3.22874 6.29921 -3.23179 +LINE 6.1 -3.22874 6.29617 -3.22874 +LINE 6.29921 -3.23179 6.29921 -2.87402 +LINE 6.29921 -3.46457 6.29921 -3.23179 +LINE 7.08661 -3.46457 7.08661 -2.87461 +LINE 7.08602 -2.87402 6.29921 -2.87402 +LINE 7.08661 -2.87461 7.08602 -2.87402 +LAYER INNER1 +LINE 6.33858 -2.91339 7.04724 -2.91339 +LINE 6.33774 -3.22874 6.33858 -3.22958 +LINE 6.1 -3.22874 6.33774 -3.22874 +LINE 6.33858 -3.22958 6.33858 -3.4252 +LINE 6.33858 -2.91339 6.33858 -3.22958 +LINE 6.33858 -3.4252 7.0468 -3.4252 +LINE 7.04724 -3.42476 7.04724 -2.91339 +LINE 7.0468 -3.4252 7.04724 -3.42476 +ROUTE "GND" +LAYER TOP +LINE 6.48681 -3.15 6.4872 -3.15039 +LINE 6.1 -3.15 6.48681 -3.15 +LINE 6.5063 -3.1313 6.7 -3.1313 +LINE 6.4872 -3.15039 6.5063 -3.1313 +LAYER INNER4 +LINE 6.29921 -2.87402 7.08661 -2.87402 +LINE 7.08661 -2.87402 7.08661 -3.46457 +LINE 7.08661 -3.46457 6.29957 -3.46457 +LINE 6.29957 -3.46457 6.29921 -3.46421 +LINE 6.10121 -3.14879 6.1 -3.15 +LINE 6.29921 -3.14879 6.10121 -3.14879 +LINE 6.29921 -3.46421 6.29921 -3.14879 +LINE 6.29921 -3.14879 6.29921 -2.87402 +LAYER INNER2 +LINE 6.33858 -3.4252 7.04724 -3.4252 +LINE 7.04724 -3.4252 7.04724 -2.91339 +LINE 7.04724 -2.91339 6.33839 -2.91339 +LINE 6.33839 -2.91339 6.33858 -2.91358 +LINE 6.338 -3.15 6.33858 -3.15058 +LINE 6.1 -3.15 6.338 -3.15 +LINE 6.33858 -3.15058 6.33858 -3.4252 +LINE 6.33858 -2.91358 6.33858 -3.15058 +ROUTE "Net-(C2-Pad1)" +LAYER TOP +LINE 6.7 -3.21909 6.61909 -3.3 +LINE 6.7 -3.16949 6.7 -3.21909 +$ENDROUTES + diff --git a/tests/reference/5_1_7/gencad-gencad.cad b/tests/reference/5_1_7/gencad-gencad.cad new file mode 120000 index 00000000..0e2542bf --- /dev/null +++ b/tests/reference/5_1_7/gencad-gencad.cad @@ -0,0 +1 @@ +../5_1_6/gencad-gencad.cad \ No newline at end of file diff --git a/tests/reference/6_0_2/gencad-gencad.cad b/tests/reference/6_0_2/gencad-gencad.cad new file mode 100644 index 00000000..e45a95c2 --- /dev/null +++ b/tests/reference/6_0_2/gencad-gencad.cad @@ -0,0 +1,263 @@ +$HEADER +GENCAD 1.4 +USER "" +DRAWING "" +REVISION " " +UNITS INCH +ORIGIN 0 0 +INTERTRACK 0 +$ENDHEADER + +$BOARD +LINE 7.4 -2.75 5.6 -2.75 +LINE 5.6 -2.75 5.6 -3.6 +LINE 7.4 -3.6 7.4 -2.75 +LINE 5.6 -3.6 7.4 -3.6 +$ENDBOARD + +$PADS +PAD P1 ROUND 0.0452756 +CIRCLE 0 0 0.0226378 +PAD P2 POLYGON 0.0393701 +ARC -0.0393701 0 -0.0137795 -0.0255906 -0.0137795 0 +LINE -0.0137795 -0.0255906 0.0137795 -0.0255906 +ARC 0.0137795 -0.0255906 0.0393701 0 0.0137795 0 +ARC 0.0393701 0 0.0137795 0.0255906 0.0137795 0 +LINE -0.0137795 0.0255906 0.0137795 0.0255906 +ARC -0.0137795 0.0255906 -0.0393701 0 -0.0137795 0 +PAD P3 POLYGON 0.0393701 +ARC -0.0393701 -0.015748 -0.0295276 -0.0255906 -0.0295276 -0.015748 +LINE -0.0295276 -0.0255906 0.0295276 -0.0255906 +ARC 0.0295276 -0.0255906 0.0393701 -0.015748 0.0295276 -0.015748 +LINE 0.0393701 0.015748 0.0393701 -0.015748 +ARC 0.0393701 0.015748 0.0295276 0.0255906 0.0295276 0.015748 +LINE -0.0295276 0.0255906 0.0295276 0.0255906 +ARC -0.0295276 0.0255906 -0.0393701 0.015748 -0.0295276 0.015748 +LINE -0.0393701 -0.015748 -0.0393701 0.015748 +PAD P4 POLYGON 0 +ARC -0.0116142 -0.00679134 -0.00580709 -0.0125984 -0.00580709 -0.00679134 +LINE -0.00580709 -0.0125984 0.00580709 -0.0125984 +ARC 0.00580709 -0.0125984 0.0116142 -0.00679134 0.00580709 -0.00679134 +LINE 0.0116142 0.00679134 0.0116142 -0.00679134 +ARC 0.0116142 0.00679134 0.00580709 0.0125984 0.00580709 0.00679134 +LINE -0.00580709 0.0125984 0.00580709 0.0125984 +ARC -0.00580709 0.0125984 -0.0116142 0.00679134 -0.00580709 0.00679134 +LINE -0.0116142 -0.00679134 -0.0116142 0.00679134 + +$ENDPADS + +$PADSTACKS +PADSTACK PAD1 0.0452756 +PAD P1 BOTTOM 0 0 +PAD P1 INNER1 0 0 +PAD P1 INNER2 0 0 +PAD P1 INNER3 0 0 +PAD P1 INNER4 0 0 +PAD P1 TOP 0 0 +PADSTACK PAD1F 0.0452756 +PAD P1 TOP 0 0 +PAD P1 INNER13 0 0 +PAD P1 INNER12 0 0 +PAD P1 INNER11 0 0 +PAD P1 INNER10 0 0 +PAD P1 BOTTOM 0 0 +PAD P1 SOLDERMASK_BOTTOM 0 0 +PAD P1 SOLDERMASK_TOP 0 0 +PADSTACK PAD2 0.0393701 +PAD P2 BOTTOM 0 0 +PAD P2 INNER1 0 0 +PAD P2 INNER2 0 0 +PAD P2 INNER3 0 0 +PAD P2 INNER4 0 0 +PAD P2 TOP 0 0 +PADSTACK PAD2F 0.0393701 +PAD P2 TOP 0 0 +PAD P2 INNER13 0 0 +PAD P2 INNER12 0 0 +PAD P2 INNER11 0 0 +PAD P2 INNER10 0 0 +PAD P2 BOTTOM 0 0 +PAD P2 SOLDERMASK_BOTTOM 0 0 +PAD P2 SOLDERMASK_TOP 0 0 +PADSTACK PAD3 0.0393701 +PAD P3 BOTTOM 0 0 +PAD P3 INNER1 0 0 +PAD P3 INNER2 0 0 +PAD P3 INNER3 0 0 +PAD P3 INNER4 0 0 +PAD P3 TOP 0 0 +PADSTACK PAD3F 0.0393701 +PAD P3 TOP 0 0 +PAD P3 INNER13 0 0 +PAD P3 INNER12 0 0 +PAD P3 INNER11 0 0 +PAD P3 INNER10 0 0 +PAD P3 BOTTOM 0 0 +PAD P3 SOLDERMASK_BOTTOM 0 0 +PAD P3 SOLDERMASK_TOP 0 0 +PADSTACK PAD4 0 +PAD P4 TOP 0 0 +PADSTACK PAD4F 0 +PAD P4 TOP 0 0 +PAD P4 SOLDERPASTE_TOP 0 0 +PAD P4 SOLDERMASK_TOP 0 0 +$ENDPADSTACKS + +$ARTWORKS +$ENDARTWORKS + +$SHAPES + +SHAPE "C1" +INSERT SMD +PIN "1" PAD4 -0.0190945 0 TOP 0 0 +PIN "2" PAD4 0.0190945 0 TOP 0 0 + +SHAPE "C2" +INSERT SMD +PIN "1" PAD4 -0.0190945 0 TOP 0 0 +PIN "2" PAD4 0.0190945 0 TOP 0 0 + +SHAPE "P1" +INSERT TH +LINE 0.0712598 0.102756 -0.216929 0.102756 +LINE -0.226378 0.112205 -0.167323 0.112205 +LINE -0.216929 -0.181496 -0.0807087 -0.181496 +LINE -0.226378 0.0531496 -0.226378 0.112205 +LINE -0.216929 0.102756 -0.216929 -0.181496 +LINE 0.11063 0.0633858 0.11063 -0.142126 +LINE -0.0366142 -0.181566 0.0705442 -0.181566 +ARC 0.0712598 -0.181496 0.11063 -0.142126 0.0712599 -0.142126 +ARC 0.11063 0.0633858 0.0712598 0.102756 0.0712599 0.0633859 +PIN "none" PAD1 -0.0590551 -0.159449 TOP 0 0 +PIN "1" PAD3 0 0 TOP 0 0 +PIN "2" PAD2 0 -0.0787402 TOP 0 0 + +SHAPE "R1" +INSERT SMD +PIN "1" PAD4 -0.0190945 0 TOP 0 0 +PIN "2" PAD4 0.0190945 0 TOP 0 0 +$ENDSHAPES + +$COMPONENTS + +COMPONENT "C1" +DEVICE "DEV_C1" +PLACE 6.4872 -3.16949 +LAYER TOP +ROTATION 90 +SHAPE "C1" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "C1" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "C" 0 0 0.0393701 0.0393701 +SHEET "RefDes: C1, Value: C" + +COMPONENT "C2" +DEVICE "DEV_C2" +PLACE 6.7 -3.15039 +LAYER TOP +ROTATION 90 +SHAPE "C2" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "C2" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "C" 0 0 0.0393701 0.0393701 +SHEET "RefDes: C2, Value: C" + +COMPONENT "P1" +DEVICE "DEV_P1" +PLACE 6.1 -3.15 +LAYER TOP +ROTATION 0 +SHAPE "P1" 0 0 +TEXT -0.0531496 0.145669 0.0393701 0 0 SILKSCREEN_TOP "P1" 0 0 0.0787402 0.0393701 +TEXT -0.0531496 -0.224409 0.0393701 0 0 SILKSCREEN_TOP "CONN_01X02" 0 0 0.393701 0.0393701 +SHEET "RefDes: P1, Value: CONN_01X02" + +COMPONENT "R1" +DEVICE "DEV_R1" +PLACE 6.6 -3.3 +LAYER TOP +ROTATION 0 +SHAPE "R1" 0 0 +TEXT 0 0.046063 0.0393701 0 0 SILKSCREEN_TOP "R1" 0 0 0.0787402 0.0393701 +TEXT 0 -0.046063 0.0393701 0 0 SILKSCREEN_TOP "R" 0 0 0.0393701 0.0393701 +SHEET "RefDes: R1, Value: R" +$ENDCOMPONENTS + +$DEVICES +$ENDDEVICES + +$SIGNALS +SIGNAL "/Power/VCC" +NODE "C1" "1" +NODE "P1" "2" +NODE "R1" "1" +SIGNAL "GND" +NODE "C1" "2" +NODE "C2" "2" +NODE "P1" "1" +SIGNAL "Net-(C2-Pad1)" +NODE "C2" "1" +NODE "R1" "2" +$ENDSIGNALS + +$TRACKS +TRACK TRACK250000 0.00984252 +$ENDTRACKS + +$ROUTES +ROUTE "/Power/VCC" +TRACK TRACK250000 +LAYER TOP +LINE 6.17126 -3.22874 6.1 -3.22874 +LINE 6.5 -3.20138 6.4872 -3.18858 +LINE 6.4872 -3.18858 6.21142 -3.18858 +LINE 6.21142 -3.18858 6.17126 -3.22874 +LINE 6.58091 -3.28228 6.5 -3.20138 +LINE 6.58091 -3.3 6.58091 -3.28228 +LAYER INNER3 +LINE 6.29617 -3.22874 6.29921 -3.23179 +LINE 6.1 -3.22874 6.29617 -3.22874 +LINE 6.29921 -3.23179 6.29921 -2.87402 +LINE 7.08661 -3.46457 7.08661 -2.87461 +LINE 6.29921 -3.46457 6.29921 -3.23179 +LINE 7.08661 -2.87461 7.08602 -2.87402 +LINE 7.08602 -2.87402 6.29921 -2.87402 +LINE 7.08661 -3.46457 6.29921 -3.46457 +LAYER INNER1 +LINE 6.33858 -3.22958 6.33858 -3.4252 +LINE 6.1 -3.22874 6.33774 -3.22874 +LINE 7.04724 -3.42476 7.04724 -2.91339 +LINE 6.33858 -2.91339 7.04724 -2.91339 +LINE 6.33858 -3.4252 7.0468 -3.4252 +LINE 7.0468 -3.4252 7.04724 -3.42476 +LINE 6.33774 -3.22874 6.33858 -3.22958 +LINE 6.33858 -2.91339 6.33858 -3.22958 +ROUTE "GND" +LAYER TOP +LINE 6.5063 -3.1313 6.7 -3.1313 +LINE 6.4872 -3.15039 6.5063 -3.1313 +LINE 6.48681 -3.15 6.4872 -3.15039 +LINE 6.1 -3.15 6.48681 -3.15 +LAYER INNER4 +LINE 7.08661 -2.87402 7.08661 -3.46457 +LINE 6.29921 -2.87402 7.08661 -2.87402 +LINE 7.08661 -3.46457 6.29957 -3.46457 +LINE 6.29957 -3.46457 6.29921 -3.46421 +LINE 6.10121 -3.14879 6.1 -3.15 +LINE 6.29921 -3.14879 6.10121 -3.14879 +LINE 6.29921 -3.14879 6.29921 -2.87402 +LINE 6.29921 -3.46421 6.29921 -3.14879 +LAYER INNER2 +LINE 7.04724 -3.4252 7.04724 -2.91339 +LINE 6.33858 -2.91358 6.33858 -3.15058 +LINE 6.33858 -3.15058 6.33858 -3.4252 +LINE 7.04724 -2.91339 6.33839 -2.91339 +LINE 6.338 -3.15 6.33858 -3.15058 +LINE 6.33858 -3.4252 7.04724 -3.4252 +LINE 6.33839 -2.91339 6.33858 -2.91358 +LINE 6.1 -3.15 6.338 -3.15 +ROUTE "Net-(C2-Pad1)" +LAYER TOP +LINE 6.7 -3.16949 6.7 -3.21909 +LINE 6.7 -3.21909 6.61909 -3.3 +$ENDROUTES + diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 60a7da14..9c11c353 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -1115,3 +1115,19 @@ def test_annotate_pcb_tbrl_big_grid(test_dir): def test_annotate_pcb_tbrl_small_grid(test_dir): check_anno_pcb(test_dir, 'tbrl_small_grid', {'C1': '1u', 'C2': '2u', 'R1': '2', 'R2': '1', 'C3': '3u', 'C4': '4u', 'R3': '3', 'R4': '4'}) + + +def test_gencad_1(test_dir): + prj = 'gencad' + ctx = context.TestContext(test_dir, 'test_gencad_1', prj, 'gencad_1', '') + ctx.run() + o = prj+'-gencad.cad' + ctx.expect_out_file(o) + file = ctx.get_out_path(o) + with open(file, 'rt') as f: + text = f.read() + text = re.sub(r'(USER|DRAWING) "(.*)"', r'\1 ""', text) + with open(file, 'wt') as f: + f.write(text) + ctx.compare_txt(o) + ctx.clean_up() diff --git a/tests/yaml_samples/gencad_1.kibot.yaml b/tests/yaml_samples/gencad_1.kibot.yaml new file mode 100644 index 00000000..037ca182 --- /dev/null +++ b/tests/yaml_samples/gencad_1.kibot.yaml @@ -0,0 +1,12 @@ +# Example KiBot config file +kibot: + version: 1 + +outputs: + - name: 'GENCAD export Test' + comment: "Example of GENCAD export" + type: gencad + options: + flip_bottom_padstacks: true + no_reuse_shapes: true + save_origin: true