Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ This command will save:
- the footprint in `~/libs/my_lib.pretty/` folder for footprint libraries. The folder will be created if it doesn't exist.
- the 3d models in `~/libs/my_lib.3dshapes/` folder for 3d models. The folder will be created if it doesn't exist.

When you want to share your lib over different computers, it is a good idea to store the 3d model's path in the footprint file with a KiCAD path variable.

```bash
easyeda2kicad --full --lcsc_id=C2040 --output ~/libs/my_lib --3D-path-var EASYEDALIB_3D
```

You can use the option `--overwrite` to update a component symbol/footprint that is already in a Kicad library (generated by easyeda2kicad)

```bash
Expand Down
10 changes: 10 additions & 0 deletions easyeda2kicad/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def get_parser() -> argparse.ArgumentParser:
type=str,
)

parser.add_argument(
"--3D-path-var",
required=False,
metavar="EASYEDALIB_3DPATH",
help="subsitute the 3d-models's path in the footprint by this value",
type=str,
)

parser.add_argument(
"--overwrite",
required=False,
Expand Down Expand Up @@ -322,6 +330,8 @@ def main(argv: List[str] = sys.argv[1:]) -> int:
model_3d_path = "${EASYEDA2KICAD}/easyeda2kicad.3dshapes"
if arguments["project_relative"]:
model_3d_path = "${KIPRJMOD}" + model_3d_path
if arguments["3D_path_var"]:
model_3d_path = f'$\u007b{arguments["3D_path_var"]}\u007d'

ki_footprint.export(
footprint_full_path=f"{footprint_path}/{footprint_filename}",
Expand Down