Creating Footprint or Structure on Paste Layer in Python


I have been trying to create a customized paste layer by using the Python interface inside KiCad 6. The plan is to create some little structures on the paste layer as I would need the thin metal structures of the stencil in order hold an air filter. So not the normal application of a stencil :slight_smile:

As far as I got, I cannot just “draw” lines on that F.Paste Layer in the PCB editor as I can do on the copper layers. Here the following works:

t = pcbnew.TRACK(pcb)

and so forth. I also tried to reassign those tracks later to the F.Paste Layer, but that also does not seem to be the way its supposed to work.

Is there something comparable that I can do on the Paste Layer? In the footprint editor I did not see a possibility to run scripts.

Does anybody know a similar project and could provide hints or links? That’d be great.

… or is it just not possible?

Don’t know if I will be helpful (I don’t know Python and don’t think of using it in KiCad).
I think you can create the structures you need as footprints and than you can probably use Python to place lot of them at PCB.
The other thought… - may be instead of creating PCB you can just create gerber file.

if you’re making a stencil for this only and not for a board, you can draw your structures on any layer you like, and then plot that layer to gerber and use that gerber file to have a stencil made.

If you need custom shapes on the paste layer in a footprint, you can import a bitmap (using the image conversion tool in kicad’s main application) onto the mask layer, then change its layer to the paste layer in the footprint editor.