MCPcopy Index your code
hub / github.com/cooked/kimotor

github.com/cooked/kimotor @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
75 symbols 125 edges 6 files 15 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

KiMotor

KiMotor is a KiCad EDA plugin that automates the design of parametric PCB motors.

Alt text

Alt text

Requirements

KiMotor requires NumPy for all the math involved in the generation of the layouts.

# Linux - KiCad uses the system Python so, from the console, just run:
pip3 install numpy

# Mac - KiCad ships with its own Python so NumPy must be installed there:
cd /Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9
./pip3 install numpy

Installation

Manual, with Git clone

This is the preferred installation method. Cloning the repo allows you to manually pull in updates later on, as they become available.

Depending on your platform, you have to make sure the plugin is placed in the folder where KiCad expects it to be (see the plugins search paths KiCad documentation):

# Linux (KiCad from Ubuntu PPA)
# TODO
# Linux (KiCad 7 from FlatPak)
cd <HOME>/.var/app/org.kicad.KiCad/data/kicad/7.0/3rdparty/plugins
# Windows
cd C:\Users\<USERNAME>\Documents\KiCad\7.0\3rdparty\plugins
# Mac 
cd <HOME>/Documents/KiCad/7.0/3rdparty/plugins

# then clone the repo
git clone https://github.com/cooked/kimotor.git

Manual, via repo archive

Similar to the previous method but, instead of cloning the repo, download it as a zip archive and unpack it in the proper folder (described above).

Alt text

Automated, via package manager

While a Kimotor version do exist in the official KiCad plugin repository, it has since fallen behind the development and is not recommended. Stick to one ofthe manual installation methods listed above, until next official release.

Troubleshooting

Sometimes it is hard to troubleshoot problems with the plugin. If there is an error preventing the plugin to load at all (no KiMotor icon in the toolbar), like in the case of missing Python packages, it is possible to get a backtrace from the KiCad Scripting Console with the following commands:

import pcbnew
print pcbnew.GetWizardsBackTrace()

If the KiMotor plugin does load, but fails to generate a PCB layout because of a bug, it is still possible to get a popup with the error message, as long as the KiCad Scripting Console was open in the background before running the plugin.

Developers

Code flow


%%{
  init: {
    //'theme': 'forest'
  }
}%%

flowchart TD

  A["Generate"] --> get_parameters

  subgraph get_parameters
    direction LR
    db[(DB \n parameters)]
  end

  subgraph do_coils
    direction TB
    k(ksolver) --> t("coil_tracker")
  end

  get_parameters --> do_coils
  do_coils --> D("do_races")
  D --> E("do_junctions")
  E --> F("do_terminals")

  F --> O{outline?}
    O -->|Y| OU("do_outline")
    O -->|N| S
  OU --> H("do_mounting_holes")
  H --> I("do_thermal_zones")

  I --> S("do_silkscreen")

Core symbols most depended-on inside this repo

vec
called by 4
kimotor_linalg.py
line_points
called by 4
kimotor_linalg.py
tangent
called by 4
kimotor_linalg.py
circle_line_intersect
called by 2
kimotor_linalg.py
coil_tracker
called by 2
kimotor_action.py
line
called by 1
kimotor_linalg.py
circle_arc_mid
called by 1
kimotor_linalg.py
line_line_intersect
called by 1
kimotor_linalg.py

Shape

Method 48
Function 23
Class 4

Languages

Python100%

Modules by API surface

kimotor_action.py36 symbols
kimotor_linalg.py20 symbols
kimotor_gui.py14 symbols
kimotor_solver.py3 symbols
kimotor_persist.py2 symbols

For agents

$ claude mcp add kimotor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact