Need advice for managing own library repo / project repo

Hi people,

I’ve just built the 4.0.0 release and I’m starting to re-learn Kicad, last try was this summer. Biggest discomfort is to get my head around library management, anyway…

I want to organize my projects and libraries with git. I would really like to get some input from you guys.

  1. I want my own library repo where I keep my own parts and vetted parts from other libraries. How should I sync these parts local to a project?

1b) and how should I sync my repo with the external repos?

  1. My next project I know I want to do several respins of the PCB from a common starting point (after placing and deciding board dimensions with a script)
    Is it okay to use use git branches in a similar way as I would do in SW. Aka working withing the same project, but on different branches?
  1. I want my own library repo where I keep my own parts and vetted parts
    from other libraries.

It will depend on your own work flow, But for my company I have a dedicated git repo library that has my approved symbols, footprint and 3D models.
Every part that I use has a dedicated symbol, footprint and 3D model.

How should I sync these parts local to a project?

All I have to do is make sure that I add the symbol and footprint directory to my project configuration path and override kicad 3D model path.

  1. My next project I know I want to do several respins of the PCB from a
    common starting point (after placing and deciding board dimensions with
    a script)
    Is it okay to use use git branches in a similar way as I
    would do in SW. Aka working withing the same project, but on different
    branches?

Should be fine. Kicad files are all human readable and so lend themselves perfectly to file visioning tool such as git. You should be able to create branches and as long as you generate the Gerber files on every commit then you should be able to you this script tool to visually see the diff between branches/commit.

-Ron

Thank you very much Ron, that confirms my thoughts.

I’m spending some time now to setup the environment/workflow properly so I can work efficiently, and using that diff script is on my list. I didnt really think of generating gerbers pr commit, but that is actually crucial if I want to use that script. Thanks.

Hi again.

Okay so last time I figured that the solution which gave me most control was to have my symbols, footprints and 3d models in subfolders in the project and link them relative.
Now I will extend it with having them as a git submodule in a separate repo. I think that will work fine.

But I have doubts with how to link in general symbols (and footprints), like power symbols and passive components, which I’m happy with using the default one from KiCads. I got confused because the regular symbols and components was still showing up in Kicad up after deleting them from the search path, but I figured they were cached in a project_cached.lib file.
My goal is to have my project totaly self-contained, independent of system settings, kicad installation and other library installations.

  1. In my own library I have only “special” parts. How should I link in regular kicad symbols and footprints? It would have be neat if I could use KiCads GitHub library as a submodule also, so I could the project commits to a certain commit tag in the library.
    https://github.com/KiCad/kicad-library
    Is this possible?

  2. I also a bit confused how to link to the 3dmodels, I think I’m still getting tricked because there are duplicates in the default system path.
    2a) How can I link to specific relative 3d model path for the project? Using the KISYS3DMOD environment variable? Should I overwrite it pr project by having a script for setting the environment variable? Can I link to several 3dmodel paths?

I think I want something like this:

A) git submodule “my-library”
projectfolder/my-library/mysymbols.lib
projectfolder/my-library/myfootprints/.kicad_mod
projectfolder/my-library/my3dmodels/
.step , *.wrl, … etc

B) general kicad-library as submodule, and selected the actual used symbols and footprints in library manager and fp-lib-table:
projectfolder/kicad-library/power.lib
projectfolder/kicad-library/modules/
projectfolder/kicad-library/modules/3dpackages

Hi again,

Just wondered if someone are using the official kicad-library as a git submodule pr project? If so any pitfalls or concerns?

I’m trying to figure this out too. I have a bunch of projects in my guthub repo (https://github.com/bobc/bobc_hardware) which work fine in 4022, with relative links to my own libraries in the repo. I want to move out the common libs, to a new repo, and move the projects to v4.

I think your scheme will work for symbols and footprints. Symbols still use a search path (which is likely to change in future), and footprints can be relative to $(KIPRJMOD). 3d models are a problem, there is only a choice between an absolute path and path relative to $(KISYS3DMOD) only, which is inconvenient. It means all 3D models must be stored under a single place, wherever that is. To use my models, users would have to copy files into that folder.

Cirilo is trying to improve the 3D side, but is meeting resistance. I hope he is successful, because the current config makes sharing projects quite awkward, and is a step backwards from previous versions.

Apart from that, duplicating libraries in each project can eat up disk space (and bandwidth) - you may not be worried about that. My complete set of libraries including 3d models has grown to over 400MB, which is a bit too big to have multiple copies of for my taste.

@bobc @pthor
for 3D models it is possible to add manually the var ${KIPRJMOD}/
to each path of the 3D models
e.g.

(model ${KIPRJMOD}/shapes/cap_0603.wrl  

than your path will point to your project path plus added path
(the fastest way to add this var is by editing the file with a text editor)

If you download my kicad StepUp demo project you will get a fully self contained project (pcbnew only) with 3D models in STEP, VRML
that can be moved around without any prob :smile:

and moreover you can have a look to the way to export kicad board and parts to mechanical world :smile:

and here MOD-MPU9150 to MCAD you can download also a copy of the Olimex MOD-MPU9150 git project done in kicad, converted to fully 3D models portable and ready to be exported to MCAD (kicad StepUp exporter included)

Maurice

Thanks for your comments Bob,

I found out (again) that the kicad-library footprints are in dedicated repos, which made the hiearchy a bit more complicated and added to the setup time of the project, but i think I got it set up good enought to actually start learning KiCad and designing now.

The 3d models are still confusing/a mess, but the default kicad models magically shows up due to KISYS3DMOD, and my own shows up when edit (each!) footprint with a relative path.

My project looks like this now:

./mylibrary/ (submodule)
./mylibrary/mysymbols.lib
./mylibrary/myfootprints/
./mylibrary/my3dmodels/

./kicad-library/ (submodule)
./kicad-library/library/*.lib

./kicad-footprints/Housings_DFN_QFN.pretty (submodule)
./kicad-footprints/.pretty (submodules)

I don’t want to have my 3d models in each project, as I said that is 400MB data. I want the model path to be relative to the location of the footprint… like how it used to be.

Really, there needs to be a better way to link up symbols, footprints and 3d models into a single object. Dare I say “database” :slight_smile:

Thanks Maurice!

Yeah, it was actually the StepUp demo and that 3d repo that got me motivated here, the plan is to able to easily generate mechanical files for two stacked PCBs to be used in Fusion 360. I have tested StepUp briefly with one board and it worked quite nice. Great work btw! :smiley:
I still need to go through the process of creating own 3d models…and to manage them :smile:

One question:
I didnt really get to what file you were adding:

(model ${KIPRJMOD}/shapes/cap_0603.wrl

I will look into the StepUp demo and see how it is organized there

To answer myself, that model entry is in the .kicad_pcb file, which got added when I changed the 3d model in the footprint edit dialog in pcbnew.

I wonder though, is it a way to link a 3dmodel to a footprint? Or do I have to do it for each instance?

I guess the default kicad footprints links to 3dmodels by name, relative to KISYS3DMOD

@pthor
sorry I just put the text part of the .kicad_pcb file, related to the footprint 3d model
to change this path with pcbnew, you can use the pcbnew GUI as in the picture

moreover there you can add e.g.
${KI_PORT_PRJ_3DMOD}/shapes/cap_0603.wrl
and assign your environment var to the path you need

Maurice

have a look here


a lot of models are coming :smile:

the link between footprint and 3d model can be included in the footprint library part model (.kicad_mod), and there you can also include $var

Thanks again, a lot of useful tips I will look into!