39 lines
1.7 KiB
Markdown
39 lines
1.7 KiB
Markdown
# KiCad Layout Replicator
|
|
|
|
A KiCad PCB editor plugin that replicates component placement across hierarchical sheet instances.
|
|
|
|
## Concept
|
|
|
|
When a schematic uses multiple instances of the same hierarchical sheet (e.g. four identical amplifier channels), you can place and arrange one instance manually, then use this plugin to copy that exact layout to the other instances — preserving relative positions and rotations.
|
|
|
|
## How it works
|
|
|
|
1. Pick a **source sheet** (the fully placed reference layout) and a **target sheet**
|
|
2. Pick a **reference component** from the source sheet — this acts as the anchor point
|
|
3. The corresponding component in the target sheet defines where the copy should land and at what orientation
|
|
4. All other components in the target sheet are placed using a rigid body transform: rotated around the source reference position, then translated to the target reference position
|
|
|
|
The reference component in the target sheet must already be placed — it defines the destination and orientation of the replicated layout.
|
|
|
|
## Installation
|
|
|
|
Symlink the plugin directory into your KiCad scripting plugins folder:
|
|
|
|
```bash
|
|
./local-deploy.sh
|
|
```
|
|
|
|
Or manually:
|
|
|
|
```bash
|
|
ln -sf "$(realpath plugins/layout_replicator)" ~/.local/share/kicad/9.0/scripting/plugins/layout_replicator
|
|
```
|
|
|
|
Then in the PCB editor: **Tools → External Plugins → Refresh Plugins**
|
|
|
|
The plugin appears as **Layout Replicator** under **Tools → External Plugins**.
|
|
|
|
## Component matching
|
|
|
|
Components are matched across sheet instances using the symbol UUID from the hierarchical path — the last segment of `GetPath()`. This is identical for equivalent components across all instances of the same sheet, regardless of their assigned reference designators.
|