Embedding 3-D models in the footprints

Hi there,
Since I’ll have to port some projects from one PC to another, the first one with KiCAD under Linux and the second one with KiCAD under Windows, I’m afraid that the all 3-D models will be left on the first PC.
Is it possible to “embed” the 3-D models in the footprints just like this is done in Altium, for example?

If remember correctly altium files are basically an archive. And if you will be sending your project across as a zip file you can use archive_project action plugin, to copy 3D models in the project folder and remap paths in footprints embedded in layout file.

1 Like

It is not possible to embed 3d models in a project (unless you use project local libraries.)

But what is stopping you from setting up the libs on your second PC? Did you use absolute paths in the 3d settings?

If the model is from the vendor, I just put it in the project directory. Then I zip the whole project for transfer

There is a plugin written by @MitjaN that can help. Check out the archive_plugin on his github page here: https://github.com/MitjaNemec/Kicad_action_plugins

One of the several things this plugin does is copy all used library objects (symbols, footprints, and 3D objects) to the project folder and remap the pointers in the schematic and pcb files to the copied locations.

3 Likes

Why it’s not possible? Since the 3-D model (STEP or WRL) is the text file, it can be easily added to the end of each footprint in the kicad_pcb file. Of course I know the file’s size will become enormous but I think it can be done something about that.

What’s the problem with a relative path to the 3d folder?
You can set the 3d path field in every footprint as $(KPRJMOD)/pathtoyour3dlibrary and add the 3d library to the project.

It is not possible because kicad is set up in a way that doesn’t allow embedding the 3d model into the footprint, not that it cannot be implemented if the developers decide to do so. (What I don’t want, but this is only my point of view).

1 Like

The issue in embedding the 3D model inside the board is that you will add the same 3D model in each pcb you are going to create… i.e. if you design 100 boards, you will multiply the size of your 3D model included library hundred times… or even worst if you embed the 3D model inside the footprint…
In that case your model would be multiplied inside the board itself, and then re-multiplied on each project.
Please consider that the 3D library is already quite heavy…

Anyway, if you really need to make your project portable, it would be better to follow the archive_project action plugin suggested before.

1 Like

With 3D models, some of my projects would be almost 100 MB. This becomes a problem emailing the project somewhere and my laptops SSD drive is also getting full.

I do not need answers which tell me why this is not possible - I need solutions similar to the ones used in the other products - Altium etc.
And, of course - when I’m telling “ME”, I mean the needs of many KiCAD users as well, which will benefit from that.
The one easy way would be to have a checkbox saying “embed 3-D models in the project file” - It will be my responsibility if the size is enormous or not.
Or - if we’re going into the database structure support - if you have 100 resistors with the same 3-D model, it can be easily directed to the only one row of the project database.
Yes, I know that may be the right time for that is not come yet, but support for such things must be defined and kept in mind.

Anyways, you can copy the needed files into the project directory and change the paths. If it’s too much work you can use a script. 3d models don’t need to be embedded into footprints to make the project portable/movable. So, what’s the real problem?

Excuse me if it seems I’m a bit picky but just refer to the first statement of my previous comment.
And yes - it’s perfectly easy for me to do the things the way you describe but just try to get out of the box and imagine the users which do not wants to mess with copying the files etc.
Generally speaking this is one of the biggest problems of the FREE software - the SW developers have the wrong impressions that all users share at least the same high level of knowledge :slight_smile:
And please, don’t get me wrong - I’m a strong believer of the open source movement!

OK, I understand. But then we must agree about what is actually needed or wanted. You were speaking about embedding the models into the footprints or files. That’s not what we need or want. We need an easy way to attach the models to the project so that they are copied with the rest of the project and can be used identically on another machine. That can be done now with the mentioned script. You just want an easier, simpler way to do that.

Lets slow down here. The usecase you describe is not directly supported by kicad out of the box. (The official library is just not build that way. It assumes every user you share projects with has the same library setup. In other words it is build around the concept of a central common library.)
Part of the answers above tried to explain the reasoning behind this decision. (It has a lot of benefits. Especially in maintainability and in storage savings)


If you do not agree with how this is handled simply make your own library structure that is build around projects instead of a central library. (KiCad it self fully supports this workflow. There is a reason every project has local library tables.)
For this to work make a folder in every project that contains 3d models. Use the KIPRJMOD path variable to point to the models from within your personal footprints. (this path variable points at the root directory of the project. If you setup everything correctly kicad will take care of adding this path variable to the 3d path.)

Or use a central library as is the standard workflow and rely on scripts to archive your project in a way that makes independent of the readers library setup.


TlDr: Non standard workflows are always harder to work with and require deeper understanding of the software it self. (This is true no matter if you pay for the software or if you get it for free.)

@eelik: I just need a simple solution to exchange the project files with an user which does not know a lot about KiCAD - suppose he had a KiCAD installed in order to look at my files for making its final decision if they are OK for him or not. And one step of taking such decision is to see the 3-D representation of the board.

Yes, that’s it. And I’m just trying to explain that probably there are another approaches at least good as the current one.
And you also should not forget about one of the biggest KiCAD’s advantages - it’s multi-platform availability. Unfortunately the folder’s notations in Windows, Linux and MacOS are totally different.

That is why kicad uses path variables. I have my projects shared across different operating systems with the default setup. Works fine. (even out of the box if everyone uses the same version of kicad with the same version of the library)

I’m sorry if my answer has displeased you, I was only trying to help.
In fact, I really don’t mind what you need or not. My fault.

2 Likes

Guys keep it civil and if possible on topic in here

And thanks to environment variables you can make the full project portable among OSes.
If your need is to let a user have an overview of your design, then the archive_project script is just fitting your needs.

1 Like

@pedro: Unfortunately this is the attitude I stumbled upon on so many Open Source forums.
@Rene_Poschl: Yes, if you have control over all machines. Otherwise you’ll have a countless phone/Viber calls with explanation how to configure this or that etc…