circuit-to-svg 0.0.110 → 0.0.111

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 CHANGED
@@ -288,6 +288,51 @@ function createSvgObjectsFromPcbPlatedHole(hole, transform) {
288
288
  }
289
289
  ];
290
290
  }
291
+ if (hole.shape === "circular_hole_with_rect_pad") {
292
+ const scaledHoleDiameter = hole.hole_diameter * Math.abs(transform.a);
293
+ const scaledRectPadWidth = hole.rect_pad_width * Math.abs(transform.a);
294
+ const scaledRectPadHeight = hole.rect_pad_height * Math.abs(transform.a);
295
+ const holeRadius = scaledHoleDiameter / 2;
296
+ return [
297
+ {
298
+ name: "g",
299
+ type: "element",
300
+ children: [
301
+ // Rectangular pad (outer shape)
302
+ {
303
+ name: "rect",
304
+ type: "element",
305
+ attributes: {
306
+ class: "pcb-hole-outer-pad",
307
+ fill: "rgb(200, 52, 52)",
308
+ x: (x - scaledRectPadWidth / 2).toString(),
309
+ y: (y - scaledRectPadHeight / 2).toString(),
310
+ width: scaledRectPadWidth.toString(),
311
+ height: scaledRectPadHeight.toString()
312
+ },
313
+ value: "",
314
+ children: []
315
+ },
316
+ // Circular hole inside the rectangle
317
+ {
318
+ name: "circle",
319
+ type: "element",
320
+ attributes: {
321
+ class: "pcb-hole-inner",
322
+ fill: "rgb(255, 38, 226)",
323
+ cx: x.toString(),
324
+ cy: y.toString(),
325
+ r: holeRadius.toString()
326
+ },
327
+ value: "",
328
+ children: []
329
+ }
330
+ ],
331
+ value: "",
332
+ attributes: {}
333
+ }
334
+ ];
335
+ }
291
336
  return [];
292
337
  }
293
338