circuit-json-to-kicad 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2691,7 +2691,7 @@ var ExtractFootprintsStage = class extends ConverterStage {
|
|
|
2691
2691
|
for (const model of models) {
|
|
2692
2692
|
if (model.path) {
|
|
2693
2693
|
const modelFilename = getBasename(model.path);
|
|
2694
|
-
const newPath =
|
|
2694
|
+
const newPath = `../../3dmodels/${fpLibraryName}.3dshapes/${modelFilename}`;
|
|
2695
2695
|
const newModel = new FootprintModel2(newPath);
|
|
2696
2696
|
if (model.offset) newModel.offset = model.offset;
|
|
2697
2697
|
if (model.scale) newModel.scale = model.scale;
|
|
@@ -2870,9 +2870,10 @@ function renameKicadFootprint(params) {
|
|
|
2870
2870
|
footprint.libraryLink = newKicadFootprintName;
|
|
2871
2871
|
for (const model of footprint.models) {
|
|
2872
2872
|
const currentPath = model.path;
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2873
|
+
const usesProjectPath = currentPath.includes("${KIPRJMOD}/") || /3dmodels[\\/]/.test(currentPath);
|
|
2874
|
+
if (usesProjectPath) {
|
|
2875
|
+
const filename = currentPath.split(/[\\/]/).pop() ?? "";
|
|
2876
|
+
model.path = `../../3dmodels/${kicadLibraryName}.3dshapes/${filename}`;
|
|
2876
2877
|
}
|
|
2877
2878
|
}
|
|
2878
2879
|
return {
|