I have a sometihng.pretty library which contains some very specific footprints. I am placing each component.step right next to component.kicad_mod, inside something.pretty.
Is this a good practice? Why? (To me it looks like it is, because every time something.pretty is shared, 3D models are shipped also there at no extra effort.)
To insert the 3D model I simply open “Footprint Properties"→"3D models” and in the box for the path I type in the name component.step. The 3D model shows up fine. However, when I close “Footprint Properties” by clicking “ok” and then hit “Alt+3” to open the 3D view of the footprint, the 3D model is not there.
Problem 2 looks like an issue with the path being relative and not absolute. Is there something like ${PATH_TO_THIS_FILE} so I can do ${PATH_TO_THIS_FILE}../component.step ? (similar to Python’s Path(__file__))
Despite problem 2, in the PCB 3D view the model shows up, so it seems not as a big issue.
Every user clones this repo to his /her local machine.
It relies on these path variables configured in the project manager [^2] :
Var
Path
KICAD_USER_3DMOD
C:\kicadlib\3dmodels
KICAD_USER_LIB
C:\kicadlib
KICAD_USER_TEMPLATE_DIR
C:\kicadlib\template
When using local libraries I also create a folder 3dmodels in the project directory.
Kicad is pretty smart when you select a file: It often will replace the absolute path with some path variable instead wich will make projects more portable, I guess.
For the 3D elements in one of my projects the path in the FP-manager for the 3D is altered to: ${KIPRJMOD}/3dmodels/<my-3D-ModelFile>
When 3D models are not available I create them with FreeCad and also store the *.FCStd-file in the 3dmodels folder. For converting them to *.STEP and *.WRL I use the KiCad StepUp Plugin from FreeCad. This will generate them in the same folder. Which comes in handy. I also do a Fusion of the parts (housing, terminals, …) prior to exporting and change the default name “Fusion” to whatetever part I want to create. The *.FCStd gets the same name. So after export it looks like this:
This works fine for me, so far.
[^1]: I use the template folder for storing personal drawing frame(s). The expansion of this path variable is currently giving me some trouble using the iBOM package from CLI.
[^2]:Tables in KiCad (like in the project manager) accept Ctrl-C, `Ctrl-V`` for moving data in and out
According to my understanding OP, his 3D model is in global library and not project specific library so why it would be replicated in each board?
I copied the footprint libraries (directories) structure under separate 3D folder and have my 3D models there. I use absolute address to point to 3D model.
I use only my own libraries and if I use 3D model from KiCad library I copy it also into my 3D libraries and in footprints use them instead of models in KiCad library.
@OP: This is not the standard way of organizing kicad footprints/3D-models, but it’s also a designed workflow. The possibility to add the 3D-model not from a central 3D-repositor but as file inside the footprint folder (with relative path) was added in kicad version v6 or v7. I recommed this workflow (3D-model file with relative path inside footprint library) partly (because I use it partly for my libraries myself). Some pro/con arguments from my side:
"+"archiving and distributing projects: 3D can’t be forgotten (forgetten?) - the 3D file is always included
“+” installing kicad on computers: no messing around with 3D path variables
“+” searching for the 3D-file is easy - always alongside the footprint file
“-” a 3D-file can only be used for all footprints in one library - you can’t share the 3D-model between different libraries (harddisk space savings - see maui)
all “copy/paste” operations for footprints between libraries don’t work with this relative 3D-files and with such a copy you will loose the 3D-model (must be copied with your file system manager manually later).
“-” organizing the 3D-models is harder - because they are naturally distributed between many different library folders (only important if you have many footprint libraries)
The title “Is it a good practice to store 3D models inside .pretty footprint library” is related to store the 3D model inside the pretty fp lib.
If I understud correctly the query, this is adding the 3D model inside the pretty fp (copying all the 3D step model inside).
Because the fp is embedded inside each pcb file, this will increase the archive duplicating the 3d data on each board file.
@maui : I don’t think the OP writes about that option (embed the 3D file inside the FP file). This feature is new and only available in the v8.99 nighlies.
I think he just saves the 3D model inside the footprint library folder, alongside the *.kicad_mod footprint file. So the 3D-parameter gets a relative path instead of a a absolute global path. This is possible for global as well as for project libraries.