Sharing 3D models across Mac (or Linux) and Windows machines

I have a custom footprints library that I share across my Mac and Windows machines via an RPi-based home network. There is also a shared STEP files library that contains all the 3D models that I’ve accumulated over time. For my custom footprints, I have set two different file paths to the STEP files for both Mac and Windows under its properties. Mac and Windows have different path naming conventions but they point to the same 3D model. This was done so that while working on either machine, the 3D models would show. However, this does not work. Does pcbnew look for the first path and then move to the next one if it does not find the first? I’m using Kicad v5.1.2.

The correct way too do this is by using path variables. See: Tutorial: How to make a footprint in KiCad 5.1.x (From scratch)? section 3d model assignment)

And also Library management in KiCad version 5

I noticed something similar between Win & Linux, using the path variables.
It seems that in some case KiCAD (I don’t know if it is at eeschema, symbol editor, footprint editor or pcbnew level) use \ instead of / inside the pcbnew format when on Win os.
So when you move your pcbnew file from Win to Unix, KiCAD doesn’t display the models.

This worked once, but it seems on Unix os KiCAD doesn’t ‘understand’ backslash correctly and just drop the 3d model.
You could check it opening the pcbnew file with a text editor and search for \ inside it.

1 Like

Yes Windows use the backslash while Mac and other flavors of Unix use the forward slash. Ergo the use of two paths in the footprint properties for the 3D models. Which is why I wanted to know if pcbnew looks for both paths in a sequential way and accepts the one it finds.

Your workaround is not a good idea!

If you properly use path variables then you do not need to worry about the differences.

Example: In windows set the path variable “MY_3d_models” to point to “C:\Users\MyName\Documents\KiCad\3dModels” On linux you would then set MY_3d_models to point to “~/Documents/KiCad/3dModels”

The footprint would then use ${MY_3d_models}/library.3dshapes/file.wrl (KiCad does convert / to \ if necessary. Otherwise the official libraries would not work!)


For more details read what the stuff i posted above

I did not know this. This is nifty! I’ll take a look at the links you’ve posted. Thanks again.

It depends if you update the library path manually using the sw… if the libraries are untouched, everything is coded with /

If you modify it, on Win you get \ and moving then the pcbnew file to Unix, the \ won’t be converted to /

@Rene_Poschl

That would be a bug. Please report it.

I have to check if this behavior (wrong way to write the path) is still in place, or if it is related to old release of kicad.
Still it is a bad habit to change a behavior and not being back compatible (old board, written with a single \ will be affected by this bug on Unix oses, the path will not be parsed correctly, without any warning message).

The issue does indeed still persist. (If i manually enter the path with \ in ubuntu then it fails to find the model)

I don’t think what you are discussing here is a KiCad bug at all. In windows OS interprets both / and \ as path separators. In Linux only / is valid separator. Solution is simple: never use \ in any cross platform software config unless it’s explicitly required.
To my knowledge KiCad can sometimes convert / to \ on Windows but only for display purposes, it doesn’t store that in any configs or libs, otherwise it would be a huge mess.

1 Like

This is a big limitation of the sw… the user must and should be able to use the OS separator used by the OS, as \ in case of Win …
Then if he/her decide to move the project on Unix os, the issue will come out… An other simple case is i.e. when a project hosted on GH developed on Win will be used on a Unix os.

To my knowledge KiCad can sometimes convert / to \ on Windows but only for display purposes, it doesn’t store that in any configs or libs, otherwise it would be a huge mess.

As I said, for official libs, this is not an issue, because those are built using /
But manually adding some model, a user may manually write a path using the original os separation (\ for win); even KiCAD is adopting the original os sep in some case (I haven’t tested all the options, by pcbnew, pcb fp editor, eeschema editor or eeschema lib editor).

But in general IMO the sw should manage correctly a well formed path, which means using \ on win os, in a Unix environment, if the sw itself is build to work on these OSes.
Note that this issue is relevant only for 3D viewer, as far as I know.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.