Add dynamic 3d model generation

Description

At current KiCad's 3d library is approaching the 10GB mark and keeps getting bigger due to need for 3d models for every different size and format of components e.g. through hole resistors with same body size but different lead lengths require multiple 3d models (and a similar story for many other packages)

Steps to reproduce

Look in the 3d model repository and see many models with near identical names but with small changes e.g. https://kicad.github.io/packages3d/Resistor_THT R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal.wrl R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Vertical.wrl

KiCad Version

Application: KiCad
Version: 5.1.6, release build
Libraries:
    wxWidgets 3.0.5
    libcurl/7.72.0 OpenSSL/1.1.1g zlib/1.2.11 zstd/1.4.5 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Linux 5.8.6-1-MANJARO x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.72.0
    OpenCASCADE Technology: 7.4.0
    Curl: 7.70.0
    Compiler: GCC 9.3.0 with C++ ABI 1013
Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=OFF
    KICAD_USE_OCC=ON
    KICAD_SPICE=ON

Feature request

Implement a library for dynamic creation of 3d models based on parameters to decrease size and reusability. Suggestion OpenCSG (the library used by OpenSCAD) which will allow for generation of 3d models on a project by project basis and can be called with parameters using tags inside footprints e.g.

image

(VERY) simple example of function/module based dyanmic SMD resistor creation

image

Edited by KiCad Bot