172 lines
5.3 KiB
Markdown
172 lines
5.3 KiB
Markdown
# Layers
|
|
|
|
An image maniplulation program-style logical-layer panel for KiCad 10. Adds a overlay-style panel (in the spirit of Paint DOT net) into named logical layers.
|
|
You can add or subtract your selection to and from the layer, or to and from the board. You can hide and unhide each layers cleanly. You can rename/colour/lock/annotate, sort and organize the layers, a layer can have childen.
|
|
|
|
There are also boolean operations (merge/subtract/intersect) between layers (logical)
|
|
snap to grid, and more to come. Operations are all composed together as one commit and can easily be undone with Edit->Undo or equivalent.
|
|
|
|
Rendering of in-panel board previews is powered by [Siphon](https://git.else-if.org/jess/Siphon),
|
|
a pure-Rust KiCad-board-to-vectors crate. You would not technically need KiCad installed to produce the vectors, it is a completely isolated utility which makes no calls at all to kicad-cli.
|
|
|
|
## Install
|
|
|
|
Every platform installs into KiCad 10's *10.0/plugin* directory. I'm 90% sure that's where they are supposed to go.
|
|
|
|
Close KiCad completely prior to running the install script or KiCad might crash, and you might lose work. Close KiCad completely when you update the plugin too. Turns out there's a lot of differences between python and Rust plugins, though maybe the better distiction is IPC plugins in general. I am yet to make a python IPC plugin though, so I can't say for certain.
|
|
|
|
### macOS
|
|
|
|
Requires Xcode Command-Line Tools, Rust (`rustup`), and `rsvg-convert` (optional; only used
|
|
to regenerate icons from `resources/Layers.svg`).
|
|
|
|
```sh
|
|
git clone https://git.else-if.org/jess/Layers
|
|
cd Layers
|
|
./scripts/install.sh
|
|
```
|
|
|
|
Installs to `~/Documents/KiCad/10.0/plugins/com.jesshunter.layers/`.
|
|
|
|
### Windows (10 / 11, ARM64 or x86_64)
|
|
|
|
Grrr. It works. I'm still too tickled to talk about it. It did some real spiteful shit to me. I refused to install visual studio on my VM, and it never forgave me for that.
|
|
|
|
#### 1. Install MSYS2
|
|
|
|
Download and run the installer from <https://www.msys2.org>. Accept the defaults
|
|
(`C:\msys64`). When it finishes, launch the **MSYS2** shell it drops on your Start menu.
|
|
|
|
#### 2. Install the toolchain for your CPU
|
|
|
|
In the MSYS2 shell:
|
|
|
|
```sh
|
|
# ARM64 (Snapdragon X, Surface Pro 11, etc.)
|
|
pacman -Syu
|
|
pacman -S --needed \
|
|
mingw-w64-clang-aarch64-toolchain \
|
|
mingw-w64-clang-aarch64-cmake \
|
|
mingw-w64-clang-aarch64-ninja \
|
|
mingw-w64-clang-aarch64-librsvg \
|
|
git
|
|
|
|
# x86_64 (Intel / AMD)
|
|
pacman -Syu
|
|
pacman -S --needed \
|
|
mingw-w64-ucrt-x86_64-toolchain \
|
|
mingw-w64-ucrt-x86_64-cmake \
|
|
mingw-w64-ucrt-x86_64-ninja \
|
|
mingw-w64-ucrt-x86_64-librsvg \
|
|
git
|
|
```
|
|
|
|
(You can close + reopen the shell after the first `pacman -Syu` if it asks you to.)
|
|
|
|
#### 3. Install Rust + the GNU target
|
|
|
|
In **PowerShell** (not MSYS2):
|
|
|
|
```powershell
|
|
# Install rustup
|
|
winget install --id Rustlang.Rustup
|
|
# or: irm https://win.rustup.rs/x86_64 | iex
|
|
|
|
# After rustup finishes, add the matching GNU target:
|
|
# ARM64:
|
|
rustup target add aarch64-pc-windows-gnullvm
|
|
# x86_64:
|
|
rustup target add x86_64-pc-windows-gnu
|
|
```
|
|
|
|
#### 4. Add MinGW to your user PATH
|
|
|
|
Rust's GNU target calls out to the MinGW linker, so that directory needs to be on
|
|
PATH. Run this **once** in PowerShell (elevated shell not required):
|
|
|
|
```powershell
|
|
# ARM64
|
|
[Environment]::SetEnvironmentVariable(
|
|
"Path",
|
|
[Environment]::GetEnvironmentVariable("Path", "User") + ";C:\msys64\clangarm64\bin",
|
|
"User"
|
|
)
|
|
|
|
# x86_64
|
|
[Environment]::SetEnvironmentVariable(
|
|
"Path",
|
|
[Environment]::GetEnvironmentVariable("Path", "User") + ";C:\msys64\ucrt64\bin",
|
|
"User"
|
|
)
|
|
```
|
|
|
|
Close and reopen every PowerShell / cmd window after this so they pick up the change.
|
|
|
|
#### 5. Build + install
|
|
|
|
```bat
|
|
git clone https://git.else-if.org/jess/Layers
|
|
cd Layers
|
|
install.bat
|
|
```
|
|
|
|
Installs to `%USERPROFILE%\Documents\KiCad\10.0\plugins\com.jesshunter.layers\`
|
|
(or the OneDrive-redirected equivalent).
|
|
|
|
|
|
### Linux — Debian / Ubuntu / Pop!_OS (apt)
|
|
|
|
```sh
|
|
sudo apt update
|
|
sudo apt install -y \
|
|
build-essential pkg-config curl git \
|
|
libgtk-3-dev libxkbcommon-dev libwayland-dev \
|
|
libvulkan-dev mesa-vulkan-drivers \
|
|
librsvg2-bin
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
source "$HOME/.cargo/env"
|
|
|
|
git clone https://git.else-if.org/jess/Layers
|
|
cd Layers
|
|
./scripts/install-linux.sh
|
|
```
|
|
|
|
Installs to `~/.local/share/kicad/10.0/plugins/com.jesshunter.layers/`.
|
|
|
|
### Linux — Arch / Manjaro (pacman)
|
|
|
|
```sh
|
|
sudo pacman -Syu --needed \
|
|
base-devel pkgconf curl git \
|
|
gtk3 libxkbcommon wayland \
|
|
vulkan-icd-loader vulkan-headers \
|
|
librsvg
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
source "$HOME/.cargo/env"
|
|
|
|
git clone https://git.else-if.org/jess/Layers
|
|
cd Layers
|
|
./scripts/install-linux.sh
|
|
```
|
|
|
|
Installs to `~/.local/share/kicad/10.0/plugins/com.jesshunter.layers/`.
|
|
|
|
## Configuration
|
|
|
|
`resources/colors.toml` in the installed plugin directory controls every UI colour and the
|
|
window-fade alphas. Edit to taste and restart the plugin to pick up the change.
|
|
|
|
The plugin writes settings and state to:
|
|
|
|
| Platform | Path |
|
|
|---|---|
|
|
| macOS | `~/Library/Application Support/com.jesshunter.layers/` |
|
|
| Linux | `$XDG_DATA_HOME/com.jesshunter.layers/` (typically `~/.local/share/com.jesshunter.layers/`) |
|
|
| Windows | `%APPDATA%\com.jesshunter.layers\` |
|
|
|
|
## Licence
|
|
|
|
Unlicensed — see `LICENCE`.
|
|
|
|
Written by [pszsh](https://else-if.org).
|