From b732c00f7ca3db6d306581a839e1ef109a9a0fdb Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 22 Mar 2024 12:55:49 -0300 Subject: [PATCH] [Panelize][Added] Support for all new options - upto 1.5.1 - Including current git status --- CHANGELOG.md | 4 + docs/samples/generic_plot.kibot.yaml | 87 ++++++++++-- docs/source/Changelog.rst | 60 ++++---- .../source/configuration/outputs/panelize.rst | 60 +++++++- docs/source/dependencies.rst | 2 +- kibot/optionable.py | 5 +- kibot/out_panelize.py | 130 +++++++++++++++--- src/kibot-check | 5 +- 8 files changed, 290 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69f82ae3..4602e8d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.6.5] - Unreleased +### Added +- KiCad 8 support +- Panelize: support for all new options (upto 1.5.1) + ### Changed - KiRi: continue even on corrupted schematics (#583) - Variants: avoid W045 on nameless pads. Assuming they are on purpose and not diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 13dfcbe0..b4a61887 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -1797,14 +1797,21 @@ outputs: # [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with # copper clearance: 0.5 + # [number|string] Diameter of hexagons + diameter: 7 + # `edge_clearance` is an alias for `edgeclearance` + # [number|string] Specifies clearance between the fill and panel perimeter + edgeclearance: 0.5 # [string|list(string)] List of layers to fill. Can be a comma-separated string. # Using *all* means all external copper layers layers: 'F.Cu,B.Cu' # [number|string] The orientation of the hatched strokes orientation: 45 - # [number|string] The space between the hatched strokes + # [number|string] The space between the hatched strokes or hexagons spacing: 1 - # [string='none'] [none,solid,hatched] How to fill non-board areas of the panel with copper + # [number=15] Remove fragments smaller than threshold. Expressed as a percentage + threshold: 15 + # [string='none'] [none,solid,hatched,hex] How to fill non-board areas of the panel with copper type: 'none' # [number|string] The width of the hatched strokes width: 1 @@ -1822,8 +1829,14 @@ outputs: cutcurves: false # [number|string] Drill size used for the *mousebites* drill: 0.5 + # `end_prolongation` is an alias for `endprolongation` + # [number|string] Prolongation on the end of V-CUT without text + endprolongation: 3 # [string='Cmts.User'] Specify the layer to render V-cuts on. Also used for the *layer* type layer: 'Cmts.User' + # `line_width` is an alias for `linewidth` + # [number|string] Line width to plot cuts with + linewidth: 0.3 # [number|string] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, # negative puts the cuts into the tabs offset: 0 @@ -1832,6 +1845,20 @@ outputs: prolong: 0 # [number|string] The spacing of the holes used for the *mousebites* spacing: 0.8 + # [string='V-CUT'] Text template for the V-CUT + template: 'V-CUT' + # `text_offset` is an alias for `textoffset` + # `text_prolongation` is an alias for `textprolongation` + # `text_size` is an alias for `textsize` + # `text_thickness` is an alias for `textthickness` + # [number|string] Text offset from the V-CUT + textoffset: 3 + # [number|string] Prolongation of the text size of V-CUT + textprolongation: 3 + # [number|string] Text size for vcuts + textsize: 2 + # [number|string] Text thickness for width + textthickness: 0.3 # [string='none'] [none,mousebites,vcuts,layer,plugin] Layer: When KiKit reports it cannot perform cuts, you can render the cuts # into a layer with this option to understand what's going on. Shouldn't be used for the final design type: 'none' @@ -1862,6 +1889,8 @@ outputs: hoffset: 0 # [number|string] Diameter of the solder mask opening opening: 1 + # [boolean=false] Include the fiducials in the paste layer (therefore they appear on the stencil) + paste: false # [string='none'] [none,3fid,4fid,plugin] Add none, 3 or 4 fiducials to the (rail/frame of) the panel type: 'none' # [number|string] Vertical offset from panel edges @@ -1870,8 +1899,15 @@ outputs: framing: # [string=''] Argument to pass to the plugin. Used for *plugin* arg: '' - # [number|string] Specify the size of chamfer frame corners + # [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + # and `chamferheight` to create a non 45 degrees chamfer chamfer: 0 + # `chamfer_height` is an alias for `chamferheight` + # `chamfer_width` is an alias for `chamferwidth` + # [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer + chamferheight: 0 + # [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer + chamferwidth: 0 # [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin* code: '' # [string='both'] [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. @@ -1881,6 +1917,12 @@ outputs: fillet: 0 # [number|string] Specify the horizontal space between PCB and the frame/rail hspace: 2 + # `max_total_height` is an alias for `maxtotalheight` + # `max_total_width` is an alias for `maxtotalwidth` + # [number|string] Maximal height of the panel + maxtotalheight: 10000 + # [number|string] Maximal width of the panel + maxtotalwidth: 10000 # `min_total_height` is an alias for `mintotalheight` # `min_total_width` is an alias for `mintotalwidth` # [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. @@ -1922,12 +1964,18 @@ outputs: code: '' # [number=1] Specify the number of columns of boards in the grid pattern cols: 1 + # `h_back_bone` is an alias for `hbackbone` + # `h_bone_cut` is an alias for `hbonecut` + # `h_bone_first` is an alias for `hbonefirst` + # `h_bone_skip` is an alias for `hboneskip` # [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the # spacing of the boards hbackbone: 0 # [boolean=true] If there are both backbones specified, specifies if there should be a horizontal cut where the backbones # cross hbonecut: true + # [number=0] Specify first horizontal backbone to render + hbonefirst: 0 # [number=0] Skip every n horizontal backbones. I.e., 1 means place only every other backbone hboneskip: 0 # [number|string] Specify the horizontal gap between the boards @@ -1947,12 +1995,18 @@ outputs: space: null # [string='grid'] [grid,plugin] In the plugin type only `code` and `arg` are relevant type: 'grid' + # `v_back_bone` is an alias for `vbackbone` + # `v_bone_cut` is an alias for `vbonecut` + # `v_bone_first` is an alias for `vbonefirst` + # `v_bone_skip` is an alias for `vboneskip` # [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the # spacing of the boards vbackbone: 0 # [boolean=true] If there are both backbones specified, specifies if there should be a vertical cut where the backbones # cross vbonecut: true + # [number=0] Specify first vertical backbone to render + vbonefirst: 0 # [number=0] Skip every n vertical backbones. I.e., 1 means place only every other backbone vboneskip: 0 # [number|string] Specify the vertical gap between the boards @@ -1962,18 +2016,18 @@ outputs: name: '' # [dict] Sets page size on the resulting panel and position the panel in the page page: - # [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br + # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br # (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline - anchor: 'tl' + anchor: 'mt' # [number|string] Height for the `custom` paper size height: 210 # `page_size` is an alias for `type` # `pos_x` is an alias for `posx` # `pos_y` is an alias for `posy` - # [number|string] The X position of the panel on the page - posx: 15 - # [number|string] The Y position of the panel on the page - posy: 15 + # [number|string] The X position of the panel on the page. Can be expressed as a page size percentage + posx: '50%' + # [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage + posy: 20 # `size` is an alias for `type` # [string='inherit'] [inherit,custom,A0,A1,A2,A3,A4,A5,A,B,C,D,E,USLetter,USLegal,USLedger,A0-portrait,A1-portrait,A2-portrait, # A3-portrait,A4-portrait,A5-portrait,A-portrait,B-portrait,C-portrait,D-portrait,E-portrait, @@ -1988,10 +2042,17 @@ outputs: copperfill: false # [boolean=false] Draw dimensions with the panel size. dimensions: false + # `edge_width` is an alias for `edgewidth` + # [number|string] Specify line width for the Edge.Cuts of the panel + edgewidth: 0.1 # `mill_radius` is an alias for `millradius` + # `mill_radius_outer` is an alias for `millradiusouter` # [number|string] Simulate the milling operation (add fillets to the internal corners). # Specify mill radius (usually 1 mm). 0 radius disables the functionality millradius: 0 + # [number|string] Like `millradius`, but modifies only board outer counter. + # No internal features of the board are affected + millradiusouter: 0 # [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Specify if the auxiliary origin an grid origin should be placed. # Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). # Empty string does not changes the origin @@ -2053,6 +2114,11 @@ outputs: # [number|string] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. # Used for *fixed* mindistance: 0 + # `patch_corners` is an alias for `patchcorners` + # [boolean=true] The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to + # add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to + # apply the patches + patchcorners: true # [number|string] The maximum spacing of the tabs. Used for *spacing* spacing: 10 # `tab_footprints` is an alias for `tabfootprints` @@ -2228,6 +2294,9 @@ outputs: paste: false # [number|string] Diameter of the holes size: 1.152 + # `solder_mask_margin` is an alias for `soldermaskmargin` + # [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB + soldermaskmargin: 0 # [string='none'] [none,3hole,4hole,plugin] Add none, 3 or 4 holes to the (rail/frame of) the panel type: 'none' # [number|string] Vertical offset from panel edges diff --git a/docs/source/Changelog.rst b/docs/source/Changelog.rst index 636741a1..671ef12b 100644 --- a/docs/source/Changelog.rst +++ b/docs/source/Changelog.rst @@ -16,6 +16,12 @@ Versioning `__. [1.6.5] - Unreleased -------------------- +Added +~~~~~ + +- KiCad 8 support +- Panelize: support for all new options (upto 1.5.1) + Changed ~~~~~~~ @@ -48,6 +54,8 @@ Fixed [1.6.4] - 2024-02-02 -------------------- +.. _added-1: + Added ~~~~~ @@ -327,7 +335,7 @@ Fixed [1.6.3] - 2023-06-26 -------------------- -.. _added-1: +.. _added-2: Added ~~~~~ @@ -497,7 +505,7 @@ Fixed [1.6.2] - 2023-04-24 -------------------- -.. _added-2: +.. _added-3: Added ~~~~~ @@ -615,7 +623,7 @@ Changed: [1.6.1] - 2023-03-16 -------------------- -.. _added-3: +.. _added-4: Added ~~~~~ @@ -664,7 +672,7 @@ Fixed [1.6.0] - 2023-02-06 -------------------- -.. _added-4: +.. _added-5: Added ~~~~~ @@ -795,7 +803,7 @@ Fixed [1.5.0] - 2022-12-16 -------------------- -.. _added-5: +.. _added-6: Added ~~~~~ @@ -909,7 +917,7 @@ Fixed [1.4.0] - 2022-10-12 -------------------- -.. _added-6: +.. _added-7: Added ~~~~~ @@ -1027,7 +1035,7 @@ Changed [1.3.0] - 2022-09-08 -------------------- -.. _added-7: +.. _added-8: Added ~~~~~ @@ -1127,7 +1135,7 @@ Changed [1.2.0] - 2022-06-15 -------------------- -.. _added-8: +.. _added-9: Added ~~~~~ @@ -1186,7 +1194,7 @@ Changed [1.1.0] - 2022-05-24 -------------------- -.. _added-9: +.. _added-10: Added ~~~~~ @@ -1217,7 +1225,7 @@ Fixed [1.0.0] - 2022-05-10 -------------------- -.. _added-10: +.. _added-11: Added ~~~~~ @@ -1395,7 +1403,7 @@ Fixed [0.11.0] - 2021-04-25 --------------------- -.. _added-11: +.. _added-12: Added ~~~~~ @@ -1451,7 +1459,7 @@ Fixed [0.10.1] - 2021-02-22 --------------------- -.. _added-12: +.. _added-13: Added ~~~~~ @@ -1500,7 +1508,7 @@ Fixed [0.10.0] - 2021-02-12 --------------------- -.. _added-13: +.. _added-14: Added ~~~~~ @@ -1563,7 +1571,7 @@ Fixed [0.9.0] - 2021-01-04 -------------------- -.. _added-14: +.. _added-15: Added ~~~~~ @@ -1601,7 +1609,7 @@ Fixed [0.8.1] - 2020-12-09 -------------------- -.. _added-15: +.. _added-16: Added ~~~~~ @@ -1622,7 +1630,7 @@ Fixed [0.8.0] - 2020-11-06 -------------------- -.. _added-16: +.. _added-17: Added ~~~~~ @@ -1653,7 +1661,7 @@ Fixed [0.7.0] - 2020-09-11 -------------------- -.. _added-17: +.. _added-18: Added ~~~~~ @@ -1717,7 +1725,7 @@ Fixed [0.6.1] - 2020-08-20 -------------------- -.. _added-18: +.. _added-19: Added ~~~~~ @@ -1744,7 +1752,7 @@ Fixed [0.6.0] - 2020-08-18 -------------------- -.. _added-19: +.. _added-20: Added ~~~~~ @@ -1812,7 +1820,7 @@ Changed - Now we test the PCB and/or SCH only when we are doing something that needs them. -.. _added-20: +.. _added-21: Added ~~~~~ @@ -1881,7 +1889,7 @@ Fixed [0.4.0] - 2020-06-17 -------------------- -.. _added-21: +.. _added-22: Added ~~~~~ @@ -1894,7 +1902,7 @@ Added [0.3.0] - 2020-06-14 -------------------- -.. _added-22: +.. _added-23: Added ~~~~~ @@ -1923,7 +1931,7 @@ Fixed [0.2.5] - 2020-06-11 -------------------- -.. _added-23: +.. _added-24: Added ~~~~~ @@ -1964,7 +1972,7 @@ Fixed [0.2.3] - 2020-04-23 -------------------- -.. _added-24: +.. _added-25: Added ~~~~~ @@ -2002,7 +2010,7 @@ Fixed [0.2.0] - 2020-03-28 -------------------- -.. _added-25: +.. _added-26: Added ~~~~~ @@ -2032,7 +2040,7 @@ Fixed [0.1.1] - 2020-03-13 -------------------- -.. _added-26: +.. _added-27: Added ~~~~~ diff --git a/docs/source/configuration/outputs/panelize.rst b/docs/source/configuration/outputs/panelize.rst index 863da06c..e2d03d32 100644 --- a/docs/source/configuration/outputs/panelize.rst +++ b/docs/source/configuration/outputs/panelize.rst @@ -52,12 +52,25 @@ Parameters: - ``cutcurves`` :index:`: ` [boolean=false] Specify if curves should be approximated by straight cuts (e.g., for cutting tabs on circular boards). Used for *vcuts*. - ``drill`` :index:`: ` [number|string] Drill size used for the *mousebites*. + - *end_prolongation* :index:`: ` Alias for endprolongation. + - ``endprolongation`` :index:`: ` [number|string] Prolongation on the end of V-CUT without text. - ``layer`` :index:`: ` [string='Cmts.User'] Specify the layer to render V-cuts on. Also used for the *layer* type. + - *line_width* :index:`: ` Alias for linewidth. + - ``linewidth`` :index:`: ` [number|string] Line width to plot cuts with. - ``offset`` :index:`: ` [number|string] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, negative puts the cuts into the tabs. - ``prolong`` :index:`: ` [number|string] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets caused by milling). Used for *mousebites* and *layer*. - ``spacing`` :index:`: ` [number|string] The spacing of the holes used for the *mousebites*. + - ``template`` :index:`: ` [string='V-CUT'] Text template for the V-CUT. + - *text_offset* :index:`: ` Alias for textoffset. + - *text_prolongation* :index:`: ` Alias for textprolongation. + - *text_size* :index:`: ` Alias for textsize. + - *text_thickness* :index:`: ` Alias for textthickness. + - ``textoffset`` :index:`: ` [number|string] Text offset from the V-CUT. + - ``textprolongation`` :index:`: ` [number|string] Prolongation of the text size of V-CUT. + - ``textsize`` :index:`: ` [number|string] Text size for vcuts. + - ``textthickness`` :index:`: ` [number|string] Text thickness for width. - **fiducials** :index:`: ` [dict] Used to add fiducial marks to the (rail/frame of) the panel. @@ -68,6 +81,7 @@ Parameters: - ``coppersize`` :index:`: ` [number|string] Diameter of the copper spot. - ``hoffset`` :index:`: ` [number|string] Horizontal offset from panel edges. - ``opening`` :index:`: ` [number|string] Diameter of the solder mask opening. + - ``paste`` :index:`: ` [boolean=false] Include the fiducials in the paste layer (therefore they appear on the stencil). - ``voffset`` :index:`: ` [number|string] Vertical offset from panel edges. - **framing** :index:`: ` [dict] Specify the frame around the boards. @@ -81,12 +95,21 @@ Parameters: the boards have just a milled slot around their perimeter. Plugin: Uses an external python function, only `code` and `arg` are relevant. - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - ``chamfer`` :index:`: ` [number|string] Specify the size of chamfer frame corners. + - ``chamfer`` :index:`: ` [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + and `chamferheight` to create a non 45 degrees chamfer. + - *chamfer_height* :index:`: ` Alias for chamferheight. + - *chamfer_width* :index:`: ` Alias for chamferwidth. + - ``chamferheight`` :index:`: ` [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer. + - ``chamferwidth`` :index:`: ` [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer. - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - ``cuts`` :index:`: ` [string='both'] [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. Used for *frame*. - ``fillet`` :index:`: ` [number|string] Specify radius of fillet frame corners. - ``hspace`` :index:`: ` [number|string] Specify the horizontal space between PCB and the frame/rail. + - *max_total_height* :index:`: ` Alias for maxtotalheight. + - *max_total_width* :index:`: ` Alias for maxtotalwidth. + - ``maxtotalheight`` :index:`: ` [number|string] Maximal height of the panel. + - ``maxtotalwidth`` :index:`: ` [number|string] Maximal width of the panel. - *min_total_height* :index:`: ` Alias for mintotalheight. - *min_total_width* :index:`: ` Alias for mintotalwidth. - ``mintotalheight`` :index:`: ` [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. @@ -114,10 +137,15 @@ Parameters: - *bake_text* :index:`: ` Alias for baketext. - ``baketext`` :index:`: ` [boolean=true] A flag that indicates if text variables should be substituted or not. - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. + - *h_back_bone* :index:`: ` Alias for hbackbone. + - *h_bone_cut* :index:`: ` Alias for hbonecut. + - *h_bone_first* :index:`: ` Alias for hbonefirst. + - *h_bone_skip* :index:`: ` Alias for hboneskip. - ``hbackbone`` :index:`: ` [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the spacing of the boards. - ``hbonecut`` :index:`: ` [boolean=true] If there are both backbones specified, specifies if there should be a horizontal cut where the backbones cross. + - ``hbonefirst`` :index:`: ` [number=0] Specify first horizontal backbone to render. - ``hboneskip`` :index:`: ` [number=0] Skip every n horizontal backbones. I.e., 1 means place only every other backbone. - ``hspace`` :index:`: ` [number|string] Specify the horizontal gap between the boards. - *rename_net* :index:`: ` Alias for renamenet. @@ -128,10 +156,15 @@ Parameters: - ``rotation`` :index:`: ` [number|string] Rotate the boards before placing them in the panel. - ``space`` :index:`: ` [number|string] Specify the gap between the boards, overwrites `hspace` and `vspace`. - ``type`` :index:`: ` [string='grid'] [grid,plugin] In the plugin type only `code` and `arg` are relevant. + - *v_back_bone* :index:`: ` Alias for vbackbone. + - *v_bone_cut* :index:`: ` Alias for vbonecut. + - *v_bone_first* :index:`: ` Alias for vbonefirst. + - *v_bone_skip* :index:`: ` Alias for vboneskip. - ``vbackbone`` :index:`: ` [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the spacing of the boards. - ``vbonecut`` :index:`: ` [boolean=true] If there are both backbones specified, specifies if there should be a vertical cut where the backbones cross. + - ``vbonefirst`` :index:`: ` [number=0] Specify first vertical backbone to render. - ``vboneskip`` :index:`: ` [number=0] Skip every n vertical backbones. I.e., 1 means place only every other backbone. - ``vspace`` :index:`: ` [number|string] Specify the vertical gap between the boards. @@ -145,13 +178,13 @@ Parameters: A3-portrait,A4-portrait,A5-portrait,A-portrait,B-portrait,C-portrait,D-portrait,E-portrait, USLetter-portrait,USLegal-portrait,USLedger-portrait] Paper size. The default `inherit` option inherits paper size from the source board. This feature is not supported on KiCAD 5. - - ``anchor`` :index:`: ` [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br + - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline. - ``height`` :index:`: ` [number|string] Height for the `custom` paper size. - *pos_x* :index:`: ` Alias for posx. - *pos_y* :index:`: ` Alias for posy. - - ``posx`` :index:`: ` [number|string] The X position of the panel on the page. - - ``posy`` :index:`: ` [number|string] The Y position of the panel on the page. + - ``posx`` :index:`: ` [number|string] The X position of the panel on the page. Can be expressed as a page size percentage. + - ``posy`` :index:`: ` [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage. - ``width`` :index:`: ` [number|string] Width for the `custom` paper size. - **tabs** :index:`: ` [dict] Style of the tabs used to join the PCB copies. @@ -173,6 +206,10 @@ Parameters: - *min_distance* :index:`: ` Alias for mindistance. - ``mindistance`` :index:`: ` [number|string] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. Used for *fixed*. + - *patch_corners* :index:`: ` Alias for patchcorners. + - ``patchcorners`` :index:`: ` [boolean=true] The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to + add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to + apply the patches. - ``spacing`` :index:`: ` [number|string] The maximum spacing of the tabs. Used for *spacing*. - *tab_footprints* :index:`: ` Alias for tabfootprints. - ``tabfootprints`` :index:`: ` [string='kikit:Tab'] The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma. @@ -191,19 +228,25 @@ Parameters: - ``hoffset`` :index:`: ` [number|string] Horizontal offset from panel edges. - ``paste`` :index:`: ` [boolean=false] If True, the holes are included in the paste layer (therefore they appear on the stencil). - ``size`` :index:`: ` [number|string] Diameter of the holes. + - *solder_mask_margin* :index:`: ` Alias for soldermaskmargin. + - ``soldermaskmargin`` :index:`: ` [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB. - ``voffset`` :index:`: ` [number|string] Vertical offset from panel edges. - ``copperfill`` :index:`: ` [dict] Fill non-board areas of the panel with copper. - Valid keys: - - **type** :index:`: ` [string='none'] [none,solid,hatched] How to fill non-board areas of the panel with copper. + - **type** :index:`: ` [string='none'] [none,solid,hatched,hex] How to fill non-board areas of the panel with copper. - ``clearance`` :index:`: ` [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with copper. + - ``diameter`` :index:`: ` [number|string] Diameter of hexagons. + - *edge_clearance* :index:`: ` Alias for edgeclearance. + - ``edgeclearance`` :index:`: ` [number|string] Specifies clearance between the fill and panel perimeter. - ``layers`` :index:`: ` [string|list(string)] List of layers to fill. Can be a comma-separated string. Using *all* means all external copper layers. - ``orientation`` :index:`: ` [number|string] The orientation of the hatched strokes. - - ``spacing`` :index:`: ` [number|string] The space between the hatched strokes. + - ``spacing`` :index:`: ` [number|string] The space between the hatched strokes or hexagons. + - ``threshold`` :index:`: ` [number=15] Remove fragments smaller than threshold. Expressed as a percentage. - ``width`` :index:`: ` [number|string] The width of the hatched strokes. - ``debug`` :index:`: ` [dict] Debug options. @@ -227,9 +270,14 @@ Parameters: - ``copperfill`` :index:`: ` [boolean=false] Fill tabs and frame with copper (e.g., to save etchant or to increase rigidity of flex-PCB panels). - ``dimensions`` :index:`: ` [boolean=false] Draw dimensions with the panel size.. + - *edge_width* :index:`: ` Alias for edgewidth. + - ``edgewidth`` :index:`: ` [number|string] Specify line width for the Edge.Cuts of the panel. - *mill_radius* :index:`: ` Alias for millradius. + - *mill_radius_outer* :index:`: ` Alias for millradiusouter. - ``millradius`` :index:`: ` [number|string] Simulate the milling operation (add fillets to the internal corners). Specify mill radius (usually 1 mm). 0 radius disables the functionality. + - ``millradiusouter`` :index:`: ` [number|string] Like `millradius`, but modifies only board outer counter. + No internal features of the board are affected. - ``origin`` :index:`: ` [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Specify if the auxiliary origin an grid origin should be placed. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). Empty string does not changes the origin. diff --git a/docs/source/dependencies.rst b/docs/source/dependencies.rst index 9123f947..d6288462 100644 --- a/docs/source/dependencies.rst +++ b/docs/source/dependencies.rst @@ -22,7 +22,7 @@ - Compare schematics for `kiri` (v2.2.0) - Print the page frame in GUI mode for `pcb_print` (v1.6.7) -`KiKit `__ :index:`: ` v1.3.0.4 |image11| |Auto-download| +`KiKit `__ :index:`: ` v1.5.1 |image11| |Auto-download| - Mandatory for: `panelize`, `stencil_3d`, `stencil_for_jig` - Optional to separate multiboard projects for general use diff --git a/kibot/optionable.py b/kibot/optionable.py index ddd8cb4f..6bff1677 100644 --- a/kibot/optionable.py +++ b/kibot/optionable.py @@ -570,9 +570,10 @@ def expand_filename(self, dir, name, id, ext, make_safe=True): class PanelOptions(BaseOptions): """ A class for options that uses KiKit's units """ _num_regex = re.compile(r'([\d\.]+)(mm|cm|dm|m|mil|inch|in)') + _per_regex = re.compile(r'([\d\.]+)%') _ang_regex = re.compile(r'([\d\.]+)(deg|°|rad)') - def add_units(self, ops, def_units=None, convert=False): + def add_units(self, ops, def_units=None, convert=False, percent=False): if def_units is None: def_units = self._parent._parent.units for op in ops: @@ -587,6 +588,8 @@ def add_units(self, ops, def_units=None, convert=False): if convert: setattr(self, _op, int(val*GS.kikit_units_to_kicad[def_units])) else: + if percent and PanelOptions._per_regex.match(val): + continue m = PanelOptions._num_regex.match(val) if m is None: raise KiPlotConfigurationError('Malformed value `{}: {}` must be a number and units'.format(op, val)) diff --git a/kibot/out_panelize.py b/kibot/out_panelize.py index 0efbce43..71e7e997 100644 --- a/kibot/out_panelize.py +++ b/kibot/out_panelize.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de Tecnología Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de Tecnología Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: - from: KiKit role: mandatory + version: 1.5.1 """ import collections from copy import deepcopy @@ -61,15 +62,15 @@ def __init__(self): """ {type} """ self.size = None """ {type} """ - self.anchor = 'tl' + self.anchor = 'mt' """ [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline """ - self.posx = 15 - """ [number|string] The X position of the panel on the page """ + self.posx = '50%' + """ [number|string] The X position of the panel on the page. Can be expressed as a page size percentage """ self.pos_x = None """ {posx} """ - self.posy = 15 - """ [number|string] The Y position of the panel on the page """ + self.posy = 20 + """ [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage """ self.pos_y = None """ {posy} """ self.width = 297 @@ -80,7 +81,8 @@ def __init__(self): def config(self, parent): super().config(parent) - self.add_units(('posx', 'posy', 'width', 'height')) + self.add_units(('posx', 'posy'), percent=True) + self.add_units(('width', 'height')) class PanelizeLayout(PanelOptionsWithPlugin): @@ -122,19 +124,39 @@ def __init__(self): self.vbackbone = 0 """ [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the spacing of the boards """ + self.v_back_bone = None + """ {vbackbone} """ self.hbackbone = 0 """ [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the spacing of the boards """ + self.h_back_bone = None + """ {hbackbone} """ self.vboneskip = 0 """ Skip every n vertical backbones. I.e., 1 means place only every other backbone """ + self.v_bone_skip = None + """ {vboneskip} """ self.hboneskip = 0 """ Skip every n horizontal backbones. I.e., 1 means place only every other backbone """ + self.h_bone_skip = None + """ {hboneskip} """ self.vbonecut = True """ If there are both backbones specified, specifies if there should be a vertical cut where the backbones cross """ + self.v_bone_cut = None + """ {vbonecut} """ self.hbonecut = True """ If there are both backbones specified, specifies if there should be a horizontal cut where the backbones cross """ + self.h_bone_cut = None + """ {hbonecut} """ + self.vbonefirst = 0 + """ Specify first vertical backbone to render """ + self.v_bone_first = None + """ {vbonefirst} """ + self.hbonefirst = 0 + """ Specify first horizontal backbone to render """ + self.h_bone_first = None + """ {hbonefirst} """ super().__init__() def config(self, parent): @@ -176,6 +198,12 @@ def __init__(self): self.cutout = 1 """ [number|string] When your design features open pockets on the side, this parameter specifies extra cutout depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full* """ + self.patchcorners = True + """ The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to + add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to + apply the patches """ + self.patch_corners = None + """ {patchcorners} """ self.tabfootprints = 'kikit:Tab' """ The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma """ self.tab_footprints = None @@ -212,13 +240,40 @@ def __init__(self): Used for *vcuts* """ self.cut_curves = None """ {cutcurves} """ + self.linewidth = 0.3 + """ [number|string] Line width to plot cuts with """ + self.line_width = None + """ {linewidth} """ + self.textthickness = 0.3 + """ [number|string] Text thickness for width """ + self.text_thickness = None + """ {textthickness} """ + self.textsize = 2 + """ [number|string] Text size for vcuts """ + self.text_size = None + """ {textsize} """ + self.endprolongation = 3 + """ [number|string] Prolongation on the end of V-CUT without text """ + self.end_prolongation = None + """ {endprolongation} """ + self.textprolongation = 3 + """ [number|string] Prolongation of the text size of V-CUT """ + self.text_prolongation = None + """ {textprolongation} """ + self.textoffset = 3 + """ [number|string] Text offset from the V-CUT """ + self.text_offset = None + """ {textoffset} """ + self.template = 'V-CUT' + """ Text template for the V-CUT """ self.layer = 'Cmts.User' """ Specify the layer to render V-cuts on. Also used for the *layer* type """ super().__init__() def config(self, parent): super().config(parent) - self.add_units(('drill', 'spacing', 'offset', 'prolong', 'clearance')) + self.add_units(('drill', 'spacing', 'offset', 'prolong', 'clearance', 'linewidth', 'textthickness', 'textsize', + 'endprolongation', 'textprolongation', 'textoffset')) res = Layer.solve(self.layer) if len(res) > 1: raise KiPlotConfigurationError('Must select only one layer for the V-cuts ({})'.format(self.layer)) @@ -245,7 +300,16 @@ def __init__(self): self.fillet = 0 """ [number|string] Specify radius of fillet frame corners """ self.chamfer = 0 - """ [number|string] Specify the size of chamfer frame corners """ + """ [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + and `chamferheight` to create a non 45 degrees chamfer """ + self.chamferwidth = 0 + """ [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer """ + self.chamfer_width = None + """ {chamferwidth} """ + self.chamferheight = 0 + """ [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer """ + self.chamfer_height = None + """ {chamferheight} """ self.mintotalheight = 0 """ [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. Useful for services that require minimal panel size """ @@ -256,6 +320,14 @@ def __init__(self): Useful for services that require minimal panel size """ self.min_total_width = None """ {mintotalwidth} """ + self.maxtotalheight = 10000 + """ [number|string] Maximal height of the panel """ + self.max_total_height = None + """ {maxtotalheight} """ + self.maxtotalwidth = 10000 + """ [number|string] Maximal width of the panel """ + self.max_total_width = None + """ {maxtotalwidth} """ self.cuts = 'both' """ [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. Used for *frame* """ @@ -270,7 +342,7 @@ def config(self, parent): if self.space: self.hspace = self.vspace = self.space self.add_units(('hspace', 'vspace', 'space', 'width', 'fillet', 'chamfer', 'mintotalwidth', 'mintotalheight', - 'slotwidth')) + 'slotwidth', 'chamferwidth', 'chamferheight')) class PanelizeTooling(PanelOptionsWithPlugin): @@ -286,11 +358,15 @@ def __init__(self): """ [number|string] Diameter of the holes """ self.paste = False """ If True, the holes are included in the paste layer (therefore they appear on the stencil) """ + self.soldermaskmargin = 0 + """ [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB """ + self.solder_mask_margin = None + """ {soldermaskmargin} """ super().__init__() def config(self, parent): super().config(parent) - self.add_units(('hoffset', 'voffset', 'size')) + self.add_units(('hoffset', 'voffset', 'size', 'soldermaskmargin')) class PanelizeFiducials(PanelOptions): @@ -308,6 +384,8 @@ def __init__(self): """ {coppersize} """ self.opening = 1 """ [number|string] Diameter of the solder mask opening """ + self.paste = False + """ Include the fiducials in the paste layer (therefore they appear on the stencil) """ super().__init__() def config(self, parent): @@ -369,25 +447,34 @@ class PanelizeCopperfill(PanelOptions): def __init__(self): with document: self.type = 'none' - """ *[none,solid,hatched] How to fill non-board areas of the panel with copper """ + """ *[none,solid,hatched,hex] How to fill non-board areas of the panel with copper """ self.clearance = 0.5 """ [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with copper """ + self.edgeclearance = 0.5 + """ [number|string] Specifies clearance between the fill and panel perimeter """ + self.edge_clearance = None + """ {edgeclearance} """ self.layers = 'F.Cu,B.Cu' """ [string|list(string)] List of layers to fill. Can be a comma-separated string. Using *all* means all external copper layers """ self.width = 1 """ [number|string] The width of the hatched strokes """ self.spacing = 1 - """ [number|string] The space between the hatched strokes """ + """ [number|string] The space between the hatched strokes or hexagons """ self.orientation = 45 """ [number|string] The orientation of the hatched strokes """ + self.diameter = 7 + """ [number|string] Diameter of hexagons """ + self.threshold = 15 + """ Remove fragments smaller than threshold. Expressed as a percentage """ super().__init__() def config(self, parent): super().config(parent) - self.add_units(('width', 'spacing', 'clearance')) + self.add_units(('width', 'spacing', 'clearance', 'edgeclearance', 'diameter')) self.add_angle(('orientation', )) + self.threshold = str(self.threshold)+'%' if not isinstance(self.layers, str) or self.layers != 'all': if isinstance(self.layers, str): self.layers = self.layers.split(',') @@ -407,6 +494,11 @@ def __init__(self): Specify mill radius (usually 1 mm). 0 radius disables the functionality """ self.mill_radius = None """ {millradius} """ + self.millradiusouter = 0 + """ [number|string] Like `millradius`, but modifies only board outer counter. + No internal features of the board are affected """ + self.mill_radius_outer = None + """ {millradiusouter} """ self.reconstructarcs = False """ The panelization process works on top of a polygonal representation of the board. This options allows to reconstruct the arcs in the design before saving the panel """ @@ -434,11 +526,15 @@ def __init__(self): Empty string does not changes the origin """ self.dimensions = False """ Draw dimensions with the panel size. """ + self.edgewidth = 0.1 + """ [number|string] Specify line width for the Edge.Cuts of the panel """ + self.edge_width = None + """ {edgewidth} """ super().__init__() def config(self, parent): super().config(parent) - self.add_units(('millradius',)) + self.add_units(('millradius', 'edgewidth', 'millradiusouter')) class PanelizeDebug(PanelOptions): diff --git a/src/kibot-check b/src/kibot-check index 776943df..f5a7c8f7 100755 --- a/src/kibot-check +++ b/src/kibot-check @@ -761,9 +761,8 @@ deps = '{\ "output": "panelize",\ "version": [\ 1,\ - 3,\ - 0,\ - 4\ + 5,\ + 1\ ]\ },\ {\