Skip to content

Commit f94cb19

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7d0d5bc + 2e25a3d commit f94cb19

32 files changed

+5102
-199
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ body:
77
options:
88
- label: I have read [FAQ](https://yaqwsx.github.io/KiKit/latest/faq/)
99
required: true
10-
- label: I use KiKit at least version 1.4.0 (older version are not supported)
10+
- label: I have searched existing issues (including closed ones)
11+
required: true
12+
- label: I use KiKit at least version 1.5.0 (older version are not supported)
1113
required: true
1214
- type: input
1315
attributes:
@@ -37,7 +39,8 @@ body:
3739
If you run into KiKit crashing, please rerun the command with `--debug
3840
'trace: true'` (when using the panelize command) or with `--debug` (when
3941
using any other command) and include the output in the error log. Please,
40-
enclose the log into a code block.
42+
enclose the log into a code block. Not including the log might
43+
significantly increase time for handling the issue.
4144
4245
If applicable, add screenshots to explain your problem. Note that if file
4346
type is not supported by GitHub, you can put them in a ZIP archive.
@@ -48,8 +51,9 @@ body:
4851
label: Steps to Reproduce
4952
description: >
5053
Please specify the steps to reproduce the issue. Do not forget to include
51-
the KiKit command and also, please include any input boards you use. If
52-
the boards are confidential, please reach out to me via e-mail to discuss
53-
details.
54+
the KiKit command and also, please include any input boards you use. Not
55+
including files for reproduction might significantly increase time for
56+
handling the issue. If the boards are confidential, you can send them to
57+
e-mail@honzamrazek.cz with subject "KiKit issue files for #123".
5458
validations:
5559
required: true

.github/workflows/test-kikit.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
13-
kicad-version: [v7, v7-testing, v8-testing, nightly]
13+
kicad-version: [v7, v7-testing, v8, v8-testing]
1414
steps:
1515
- uses: actions/checkout@v4
1616
- uses: ./.github/actions/setup-kicad
@@ -64,28 +64,28 @@ jobs:
6464
suffix: ""
6565
platform: linux/amd64
6666
repo: ubuntu
67-
kicad_version: "6.0"
67+
kicad_version: "7.0"
6868
additional_packages: ""
6969
additional_python_packages: ""
7070
- name: "m1"
7171
suffix: -m1
7272
platform: linux/arm64/v8
7373
repo: arm64v8/ubuntu
74-
kicad_version: "6.0"
74+
kicad_version: "7.0"
7575
additional_packages: gcc-aarch64-linux-gnu libgeos-dev
7676
additional_python_packages: python3-dev
77-
- name: "x64 v7"
78-
suffix: "-v7"
77+
- name: "x64 v8"
78+
suffix: "-v8"
7979
platform: linux/amd64
8080
repo: ubuntu
81-
kicad_version: "7.0"
81+
kicad_version: "8.0"
8282
additional_packages: ""
8383
additional_python_packages: ""
84-
- name: "m1 v7"
85-
suffix: -m1-v7
84+
- name: "m1 v8"
85+
suffix: -m1-v8
8686
platform: linux/arm64/v8
8787
repo: arm64v8/ubuntu
88-
kicad_version: "7.0"
88+
kicad_version: "8.0"
8989
additional_packages: gcc-aarch64-linux-gnu libgeos-dev
9090
additional_python_packages: python3-dev
9191
steps:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG REPO=ubuntu
22
FROM $REPO:22.04 AS base
33

4-
ARG KICAD_VERSION="6.0"
4+
ARG KICAD_VERSION="8.0"
55
ARG ADDITIONAL_PACKAGES
66
ARG ADDITIONAL_PYTHON_PACKAGES
77

@@ -14,7 +14,7 @@ RUN apt-get update && \
1414

1515
RUN add-apt-repository --yes ppa:kicad/kicad-$KICAD_VERSION-releases
1616

17-
# Setup ENV variables for KiCAD 7
17+
# Setup ENV variables for KiCAD 7 & 8
1818
# See https://gitlab.com/kicad/packaging/kicad-ubuntu-builder/kicad-daily-package/-/issues/43
1919
ENV PYTHONPATH=/usr/lib/kicad/lib/python3/dist-packages:${PYTHONPATH} \
2020
LD_LIBRARY_PATH=/usr/lib/kicad/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PCM_LIB_RESOURCES := $(shell find pcm/kikit-lib -type f -print) \
88
$(shell find kikit/resources/kikit.kicad_sym -type f -print) \
99
$(shell find kikit/resources/kikit.pretty -type f -print)
1010

11-
.PHONY: doc clean package release test test-system test-unit
11+
.PHONY: doc clean package release test test-system test-unit docker-release
1212

1313
all:
1414
# doc package test pcm
@@ -108,5 +108,10 @@ pcm-lib: $(PCM_LIB_RESOURCES)
108108
-s versions.-1.download_url=\"TBA\" \
109109
build/pcm-kikit-lib-metadata.json build/pcm-kikit-lib-metadata.json
110110

111+
docker-release:
112+
docker build -t yaqwsx/kikit:$(shell git describe --tags --always)-KiCAD8 --build-arg="KICAD_VERSION=8.0" .
113+
docker build -t yaqwsx/kikit:latest --build-arg="KICAD_VERSION=8.0" .
114+
docker build -t yaqwsx/kikit:$(shell git describe --tags --always)-KiCAD7 --build-arg="KICAD_VERSION=7.0" .
115+
111116
clean:
112117
rm -rf dist build

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ manufacturing data and board presentation pages.
7575

7676
## How To Use It?
7777

78-
Read the [CLI documentation](https://yaqwsx.github.io/KiKit/latest/panelization/cli/) and the [panelize
79-
documentation](doc/panelization.md). Also don't miss the
80-
[examples](https://yaqwsx.github.io/KiKit/examples/panelization/examples/). There is also a quick not on how to use
81-
[panelization action plugin](https://yaqwsx.github.io/KiKit/latest/panelization/gui/). If you are interested in
82-
generating solder paste stencils, see [Stencil documentation](https://yaqwsx.github.io/KiKit/latest/stencil/)
78+
Start with reading the [panelization
79+
documentation](https://yaqwsx.github.io/KiKit/latest/panelization/intro/). This
80+
page will you guide through CLI, GUI and scripting usage. Also don't miss the
81+
[examples](https://yaqwsx.github.io/KiKit/examples/panelization/examples/).
82+
There is also a quick not on how to use [panelization action
83+
plugin](https://yaqwsx.github.io/KiKit/latest/panelization/gui/). If you are
84+
interested in generating solder paste stencils, see [Stencil
85+
documentation](https://yaqwsx.github.io/KiKit/latest/stencil/)
8386

8487
## Acknowledgements
8588

docs/installation/docker.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ down and run that for you instead:
5151
docker run -v $(pwd):/kikit yaqwsx/kikit:nightly --version
5252
```
5353

54+
We provide the following containers:
55+
56+
- **latests**: The latest stable version of KiKit with the newest stable KiCAD.
57+
- **vX.Y.Z-KiCADvA**: A container with particular version of KiKit backed by
58+
given version of KiCAD.
59+
- **nightly**, **nightly-m1**: Daily build of KiKit from the upstream version
60+
with the newest KiCAD. The m1 flavour supports mac M1.
61+
62+
A full list is available on
63+
[Dockerhub](https://hub.docker.com/r/yaqwsx/kikit/tags).
64+
5465
## Mac M1 containers
5566

5667
There are also nightly containers of Mac M1 available with tag `nightly-m1`.

docs/panelization/cli.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ Use mousebites to
339339
- `offset` - specify the offset, positive offset puts the cuts into the board,
340340
negative puts the cuts into the tabs
341341
- `layer` - specify the layer to render V-cuts on.
342+
- `linewidth` - specify linewidth
343+
- `endprolongation` - prolongation of the cut line from the board line on the
344+
side without text.
345+
- `textprolongation` - the same as above, just on the text side
346+
- `textoffset` - offset of the text from the cut line
347+
- `template` - a string template for text to render. Can contain variables
348+
listed below, e.g., `V-CUT {pos_mm}`.
349+
- `pos_mm`, `pos_inch` – position of the V-cut from the panel origin
350+
- `pos_inv_mm`, `pos_inv_inch` – inverted position of the V-cut from the panel origin
342351

343352
#### Layer
344353

@@ -349,6 +358,7 @@ design.
349358
- `layer` - specify the layer to render the cuts on.
350359
- `prolong` - distance for tangential prolongation of the cuts. It has the same
351360
meaning as mousebites.
361+
- `linewidth` - width of line to render
352362

353363
#### Plugin
354364

@@ -591,5 +601,7 @@ Finishing touches to the panel.
591601
be one of `tl`, `tr`, `bl`, `br` (corners), `mt`, `mb`, `ml`, `mr` (middle of
592602
sides), `c` (center). Empty string does not changes the origin.
593603
- `dimensions` - `true` or `false`. Draw dimensions with the panel size.
604+
- `edgewidth` ­– width of the line for panel edges (that is the lines in the
605+
`Edge.Cuts` layer).
594606

595607

kikit/actionPlugins/panelize.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pcbnewTransition import pcbnew, isV8
55
from kikit.panelize_ui_impl import loadPresetChain, obtainPreset, mergePresets
66
from kikit import panelize_ui
7-
from kikit.panelize import appendItem
7+
from kikit.panelize import NonFatalErrors, appendItem
88
from kikit.common import PKG_BASE
99
from .common import initDialog, destroyDialog
1010
import kikit.panelize_ui_sections
@@ -57,9 +57,8 @@ def transplateBoard(source, target):
5757
for x in items:
5858
target.Remove(x)
5959

60-
targetNetinfo = target.GetNetInfo()
61-
if not isV8():
62-
targetNetinfo.RemoveUnusedNets()
60+
for x in list(target.GetNetInfo().NetsByNetcode().values()):
61+
target.Remove(x)
6362

6463
for x in source.GetDrawings():
6564
appendItem(target, x)
@@ -69,9 +68,9 @@ def transplateBoard(source, target):
6968
appendItem(target, x)
7069
for x in source.Zones():
7170
appendItem(target, x)
72-
if not isV8():
73-
for n in [n for _, n in source.GetNetInfo().NetsByNetcode().items()]:
74-
targetNetinfo.AppendNet(n)
71+
72+
for n in [n for _, n in source.GetNetInfo().NetsByNetcode().items()]:
73+
target.Add(n)
7574

7675
d = target.GetDesignSettings()
7776
d.CloneFrom(source.GetDesignSettings())
@@ -421,7 +420,7 @@ def OnPanelize(self, event):
421420
thread.join(timeout=1)
422421
if not thread.is_alive():
423422
break
424-
if thread.exception:
423+
if thread.exception and not isinstance(thread.exception, NonFatalErrors):
425424
raise thread.exception
426425
# KiCAD 6 does something strange here, so we will load
427426
# an empty file if we read it directly, but we can always make
@@ -437,6 +436,8 @@ def OnPanelize(self, event):
437436
panel = pcbnew.LoadBoard(copyPanelName)
438437
transplateBoard(panel, self.board)
439438
self.dirty = True
439+
if thread.exception:
440+
raise thread.exception
440441
except Exception as e:
441442
dlg = wx.MessageDialog(
442443
None, f"Cannot perform:\n\n{e}", "Error", wx.OK)

kikit/common.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,18 @@ def isLinestringCyclic(line):
260260
c = line.coords
261261
return c[0] == c[-1] or isinstance(line, LinearRing)
262262

263+
def constructArrow(origin, direction, distance: float, tipSize: float) -> shapely.LineString:
264+
origin = np.array(origin)
265+
direction = np.array(direction)
266+
267+
endpoint = origin + direction * distance
268+
269+
tipEndpoint1 = endpoint + tipSize / 2 * (-direction - np.array([-direction[1], direction[0]]))
270+
tipEndpoint2 = endpoint + tipSize / 2 * (-direction + np.array([-direction[1], direction[0]]))
271+
272+
arrow = shapely.LineString([origin, endpoint, tipEndpoint1, tipEndpoint2, endpoint])
273+
return arrow
274+
263275
def fromOpt(object, default):
264276
"""
265277
Given an object, return it if not None. Otherwise return default

kikit/drc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class DrcExclusion:
6262

6363
def eqRepr(self) -> Tuple[str, Union[Tuple[str, str], str]]:
6464
if len(self.objects) == 1:
65-
return (self.type, self.objects[0])
65+
objRepr = str(self.objects[0].m_Uuid.AsString()) if isinstance(self.objects[0], pcbnew.BOARD_ITEM) else self.objects[0]
66+
return (self.type, objRepr)
6667
if len(self.objects) == 2 or self.type in ["starved_thermal"]:
6768
return (self.type, tuple(str(x.m_Uuid.AsString()) for x in self.objects))
6869
raise RuntimeError("Unsupported exclusion object count")

kikit/panel_features/copperFill.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def apply(self, panel: Any) -> None:
3636
geoms = [zoneArea] if isinstance(zoneArea, Polygon) else zoneArea.geoms
3737

3838
for g in geoms:
39+
if len(g.exterior.coords) == 0:
40+
# Skip empty geometries
41+
continue
3942
zoneContainer = pcbnew.ZONE(panel.board)
4043
self._adjustZoneParameters(zoneContainer)
4144
zoneContainer.Outline().AddOutline(linestringToKicad(g.exterior))

0 commit comments

Comments
 (0)