easyeda 0.0.347 → 0.0.348
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/browser/index.js +9 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +10 -2
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7393,8 +7393,16 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
7393
7393
|
const t = DEFAULT_PCB_THICKNESS_MM / 2;
|
|
7394
7394
|
const attrs = svgNode?.svgData?.attrs ?? {};
|
|
7395
7395
|
const modelHeight = readModelHeightMm(attrs.c_height);
|
|
7396
|
+
const cadModelSize = resolvedCadModelBounds ? {
|
|
7397
|
+
x: resolvedCadModelBounds.max.x - resolvedCadModelBounds.min.x,
|
|
7398
|
+
y: resolvedCadModelBounds.max.y - resolvedCadModelBounds.min.y,
|
|
7399
|
+
z: resolvedCadModelBounds.max.z - resolvedCadModelBounds.min.z
|
|
7400
|
+
} : void 0;
|
|
7401
|
+
const hasValidCadModelSize = cadModelSize !== void 0 && Object.values(cadModelSize).every(
|
|
7402
|
+
(dimension) => Number.isFinite(dimension) && dimension > 0
|
|
7403
|
+
);
|
|
7396
7404
|
if (!cad.size) {
|
|
7397
|
-
cad.size = {
|
|
7405
|
+
cad.size = hasValidCadModelSize ? cadModelSize : {
|
|
7398
7406
|
x: pcb_component2.width,
|
|
7399
7407
|
y: pcb_component2.height,
|
|
7400
7408
|
z: modelHeight
|