TousstNicolas / JLC2KiCad_lib

JLC2KICAD_lib is a python script that generate a component library (schematic, footprint and 3D model ) for KiCad from the JLCPCB/easyEDA library.
MIT License
228 stars 42 forks source link

More path options #55

Closed Ing-Dom closed 10 months ago

Ing-Dom commented 10 months ago

give the user the possibility to overcome some hard-coded limitations reagrding the library structure, e.g. the "symbol" and the packages3d directory by adding the (optional) arguments -symbol_lib_dir and -model_dir. The default is exactly the known behaviour. Also, the usage of MODEL_BASE_VARIABLE was enhanced: when providing a string that stars with "$", the string is used as-is. That also enables the user to use additional directories, like "$(MY_LIB_DIR)/mylib.3dshapes/model.step"

TousstNicolas commented 10 months ago

Thanks for this awesome PR!

I completely agree on the MODEL_BASE_VARIABLE changes.

As for the -symbol_lib_dir and -model_dir, it might be more intuitive to remove the "/" from the argument and include it when formatting the path names. For example, i.e. use it as -symbol_lib_dir my_symbol_dir and then use it as filename = f"{output_dir}/{symbol_path}/" + library_name + ".kicad_sym". Otherwise, it might lead to confusing errors when forgetting to include the "/."