Support saving 3D models inside footprints
Description
We should support the (optional) saving of 3D models inside footprint definitions (meaning inside footprint libraries and inside the cached footprints saved in a board file.
Footprints should be able to either reference an internal 3D model or use the existing mechanism to reference an external file. This would provide a migration path for people to switch libraries over to using internal models.
The obvious advantages to doing so are that models will get tied to footprints -- there can be no missing models, or wrong models used because an older board is paired with a newer 3D model library. 3D models have grown to become an important part of the design workflow for many users, as mechanical co-design can be critical when space for a PCB inside a bigger assembly is limited. We should make the use of 3D models more seamless, as the current state of 3D models is kind of hacky compared to symbols and footprints.
Disadvantages are that footprints with embedded models would be larger, of course. The cost of this can be mitigated somewhat through supporting packed footprint libraries (#6917), supporting compression of footprint libraries, and supporting compression of board files (#3929)
KiCad Version
Application: KiCad
Version: (5.99.0-7963-g82e728dbf6), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux 5.4.0-58-generic x86_64, 64 bit, Little endian, wxGTK, ubuntu, x11
Build Info:
Date: Dec 30 2020 21:58:03
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCE: 6.9.1
Curl: 7.68.0
ngspice: 31
Compiler: GCC 9.3.0 with C++ ABI 1013
Build settings:
KICAD_SCRIPTING=OFF
KICAD_SCRIPTING_MODULES=OFF
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=OFF
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=OFF
KICAD_USE_OCE=ON
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE=OFF