Huh, I might want to use that plugin for a side project I've been neglecting. I wanted to make a PCB and I have a program that generates the PCB traces I want as SVG (it's complicated, definitely not something to draw by hand), but I hadn't found a good way to import it into KiCad as a copper layer. I was using SVG because the PCB aligns with some laser cut plywood parts, and SVG is a good format for the laser cutter. I wanted to use the same program to generate the wood parts and (part of) the PCB layout.
(There seemed to be a route where you can export as DXF from Inscape and import that into KiCad, but if I remember correctly there wasn't an obvious way to import it as a copper layer. Maybe the situation has been improved since I last tried.)
Writing out the KiCad files in a native format was an option. KiCad files are human-readable, so it probably wouldn't be too hard to figure out how to just generate the data programmatically, I just got distracted by other projects and never got back to the project. My data is just thousands of little line segments, nothing fancy.
It looks like your script uses some KiCad libraries. My generator program is written in Haskell, so unless someone has written a binding there's probably no easy way to just use the KiCad API. But human readable text doesn't look hard to generate.
It seems like the sort of problem I was trying to solve is kind of similar to yours. (The geometry is different. I wasn't making coil-shaped traces, instead my thing was to take a voronoi diagram and for each cell print a set of interdigitized fingers inside the cell. These are for pressure sensors under a strangely-configured keyboard. But the general problem of "I can write a program to draw lines but I need it to be a PCB" is more-or-less the same.)
Yea the library I am using noted that people are always trying to write Kicad format parsers from scratch but each time they’ll run in to small issues, so it is meant to be a go-to library for this kind of thing. It’s Python though. I don’t know if there is any way for Haskell to utilize Python libraries.
Good to know. I haven't worked on this in a couple years, so I think it was with an earlier version than that. Nice to see that KiCad is steadily improving.
(There seemed to be a route where you can export as DXF from Inscape and import that into KiCad, but if I remember correctly there wasn't an obvious way to import it as a copper layer. Maybe the situation has been improved since I last tried.)