Questions about Python access for automatic placement

53 views
Skip to first unread message

Vesa Solonen

unread,
Mar 7, 2025, 10:35:31 AMMar 7
to KiCad Developers
Hi All,

I am playing about an idea how to do some automatic placing and would
like to experiment a bit. To that I would need some advice regarding
Python access to PCB structures and DRC. E.g. is the following available
or not at the moment.

1. Courtyard overlap, the best would be somewhat continuous value
regarding how much overlap there is, but just boolean would do to start
with.

2. Rubberband length, overall and per component (planning to start with
overall)

3. Access to component locations in somewhat structured way, x, y and
orientation for all but locked ones.

4. Way to push changes and update the view.


Jon Evans

unread,
Mar 7, 2025, 11:14:22 AMMar 7
to dev...@kicad.org
Hi Vesa,

It is not currently possible to run DRC or find out collision information via Python, sorry.
You can access and modify footprint locations, but you can't check if one footprint collides with another.

-Jon

--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion visit https://groups.google.com/a/kicad.org/d/msgid/devlist/33de102e-c2a8-4d4b-afcd-42718cc91ebb%40aalto.fi.

Vesa Solonen

unread,
Mar 11, 2025, 1:06:30 PMMar 11
to dev...@kicad.org
Hi Jon,

Thanks for the answer. Then I have to leave this approach for a while.
Is there anyone working on the current autoplacer or is there something
planned? My intention was to test how differential evolution optimizer
from SciPy would work for this.

The usage case would be making "bundles" of footprint for preliminary
grouping before manual layout. I use the same for routing e.g. do a
preliminary layout and look for the bottlenecks from thin track
autorouter results, then do the final manually. Works pretty well for
dense discrete smd boads, where the main goal is to do everything in one
layer without vias.

-Vesa
Reply all
Reply to author
Forward
0 new messages