circuit-to-svg 0.0.173 → 0.0.174
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 +100 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -518,6 +518,55 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
518
518
|
}
|
|
519
519
|
];
|
|
520
520
|
}
|
|
521
|
+
if (hole.shape === "rotated_pill_hole_with_rect_pad") {
|
|
522
|
+
const scaledRectPadWidth = hole.rect_pad_width * Math.abs(transform.a);
|
|
523
|
+
const scaledRectPadHeight = hole.rect_pad_height * Math.abs(transform.a);
|
|
524
|
+
const scaledHoleHeight = hole.hole_height * Math.abs(transform.a);
|
|
525
|
+
const scaledHoleWidth = hole.hole_width * Math.abs(transform.a);
|
|
526
|
+
const holeRadius = Math.min(scaledHoleHeight, scaledHoleWidth) / 2;
|
|
527
|
+
return [
|
|
528
|
+
{
|
|
529
|
+
name: "g",
|
|
530
|
+
type: "element",
|
|
531
|
+
children: [
|
|
532
|
+
{
|
|
533
|
+
name: "rect",
|
|
534
|
+
type: "element",
|
|
535
|
+
attributes: {
|
|
536
|
+
class: "pcb-hole-outer-pad",
|
|
537
|
+
fill: colorMap2.copper.top,
|
|
538
|
+
x: (-scaledRectPadWidth / 2).toString(),
|
|
539
|
+
y: (-scaledRectPadHeight / 2).toString(),
|
|
540
|
+
width: scaledRectPadWidth.toString(),
|
|
541
|
+
height: scaledRectPadHeight.toString(),
|
|
542
|
+
transform: `translate(${x} ${y}) rotate(${-hole.rect_ccw_rotation})`
|
|
543
|
+
},
|
|
544
|
+
value: "",
|
|
545
|
+
children: []
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: "rect",
|
|
549
|
+
type: "element",
|
|
550
|
+
attributes: {
|
|
551
|
+
class: "pcb-hole-inner",
|
|
552
|
+
fill: colorMap2.drill,
|
|
553
|
+
x: (-scaledHoleWidth / 2).toString(),
|
|
554
|
+
y: (-scaledHoleHeight / 2).toString(),
|
|
555
|
+
width: scaledHoleWidth.toString(),
|
|
556
|
+
height: scaledHoleHeight.toString(),
|
|
557
|
+
rx: holeRadius.toString(),
|
|
558
|
+
ry: holeRadius.toString(),
|
|
559
|
+
transform: `translate(${x} ${y}) rotate(${-hole.hole_ccw_rotation})`
|
|
560
|
+
},
|
|
561
|
+
value: "",
|
|
562
|
+
children: []
|
|
563
|
+
}
|
|
564
|
+
],
|
|
565
|
+
value: "",
|
|
566
|
+
attributes: {}
|
|
567
|
+
}
|
|
568
|
+
];
|
|
569
|
+
}
|
|
521
570
|
return [];
|
|
522
571
|
}
|
|
523
572
|
|
|
@@ -1446,7 +1495,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
1446
1495
|
var package_default = {
|
|
1447
1496
|
name: "circuit-to-svg",
|
|
1448
1497
|
type: "module",
|
|
1449
|
-
version: "0.0.
|
|
1498
|
+
version: "0.0.173",
|
|
1450
1499
|
description: "Convert Circuit JSON to SVG",
|
|
1451
1500
|
main: "dist/index.js",
|
|
1452
1501
|
files: [
|
|
@@ -1478,7 +1527,7 @@ var package_default = {
|
|
|
1478
1527
|
"@types/bun": "^1.2.8",
|
|
1479
1528
|
biome: "^0.3.3",
|
|
1480
1529
|
"bun-match-svg": "^0.0.12",
|
|
1481
|
-
"circuit-json": "^0.0.
|
|
1530
|
+
"circuit-json": "^0.0.223",
|
|
1482
1531
|
esbuild: "^0.20.2",
|
|
1483
1532
|
"performance-now": "^2.1.0",
|
|
1484
1533
|
react: "^18.3.1",
|
|
@@ -2385,6 +2434,55 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
|
2385
2434
|
}
|
|
2386
2435
|
];
|
|
2387
2436
|
}
|
|
2437
|
+
if (hole.shape === "rotated_pill_hole_with_rect_pad") {
|
|
2438
|
+
const scaledRectPadWidth = hole.rect_pad_width * Math.abs(transform.a);
|
|
2439
|
+
const scaledRectPadHeight = hole.rect_pad_height * Math.abs(transform.a);
|
|
2440
|
+
const scaledHoleHeight = hole.hole_height * Math.abs(transform.a);
|
|
2441
|
+
const scaledHoleWidth = hole.hole_width * Math.abs(transform.a);
|
|
2442
|
+
const holeRadius = Math.min(scaledHoleHeight, scaledHoleWidth) / 2;
|
|
2443
|
+
return [
|
|
2444
|
+
{
|
|
2445
|
+
name: "g",
|
|
2446
|
+
type: "element",
|
|
2447
|
+
children: [
|
|
2448
|
+
{
|
|
2449
|
+
name: "rect",
|
|
2450
|
+
type: "element",
|
|
2451
|
+
attributes: {
|
|
2452
|
+
class: "assembly-hole-outer-pad",
|
|
2453
|
+
fill: PAD_COLOR,
|
|
2454
|
+
x: (-scaledRectPadWidth / 2).toString(),
|
|
2455
|
+
y: (-scaledRectPadHeight / 2).toString(),
|
|
2456
|
+
width: scaledRectPadWidth.toString(),
|
|
2457
|
+
height: scaledRectPadHeight.toString(),
|
|
2458
|
+
transform: `translate(${x} ${y}) rotate(${-hole.rect_ccw_rotation})`
|
|
2459
|
+
},
|
|
2460
|
+
value: "",
|
|
2461
|
+
children: []
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
name: "rect",
|
|
2465
|
+
type: "element",
|
|
2466
|
+
attributes: {
|
|
2467
|
+
class: "assembly-hole-inner",
|
|
2468
|
+
fill: HOLE_COLOR3,
|
|
2469
|
+
x: (-scaledHoleWidth / 2).toString(),
|
|
2470
|
+
y: (-scaledHoleHeight / 2).toString(),
|
|
2471
|
+
width: scaledHoleWidth.toString(),
|
|
2472
|
+
height: scaledHoleHeight.toString(),
|
|
2473
|
+
rx: holeRadius.toString(),
|
|
2474
|
+
ry: holeRadius.toString(),
|
|
2475
|
+
transform: `translate(${x} ${y}) rotate(${-hole.hole_ccw_rotation})`
|
|
2476
|
+
},
|
|
2477
|
+
value: "",
|
|
2478
|
+
children: []
|
|
2479
|
+
}
|
|
2480
|
+
],
|
|
2481
|
+
value: "",
|
|
2482
|
+
attributes: {}
|
|
2483
|
+
}
|
|
2484
|
+
];
|
|
2485
|
+
}
|
|
2388
2486
|
return [];
|
|
2389
2487
|
}
|
|
2390
2488
|
|