easyeda 0.0.346 → 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.
@@ -11236,8 +11236,16 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
11236
11236
  const t = DEFAULT_PCB_THICKNESS_MM / 2;
11237
11237
  const attrs = svgNode?.svgData?.attrs ?? {};
11238
11238
  const modelHeight = readModelHeightMm(attrs.c_height);
11239
+ const cadModelSize = resolvedCadModelBounds ? {
11240
+ x: resolvedCadModelBounds.max.x - resolvedCadModelBounds.min.x,
11241
+ y: resolvedCadModelBounds.max.y - resolvedCadModelBounds.min.y,
11242
+ z: resolvedCadModelBounds.max.z - resolvedCadModelBounds.min.z
11243
+ } : void 0;
11244
+ const hasValidCadModelSize = cadModelSize !== void 0 && Object.values(cadModelSize).every(
11245
+ (dimension) => Number.isFinite(dimension) && dimension > 0
11246
+ );
11239
11247
  if (!cad.size) {
11240
- cad.size = {
11248
+ cad.size = hasValidCadModelSize ? cadModelSize : {
11241
11249
  x: pcb_component2.width,
11242
11250
  y: pcb_component2.height,
11243
11251
  z: modelHeight