circuit-to-svg 0.0.173 → 0.0.175
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 +102 -13
- package/dist/index.js.map +1 -1
- package/package.json +4 -13
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.174",
|
|
1450
1499
|
description: "Convert Circuit JSON to SVG",
|
|
1451
1500
|
main: "dist/index.js",
|
|
1452
1501
|
files: [
|
|
@@ -1473,29 +1522,20 @@ var package_default = {
|
|
|
1473
1522
|
"@storybook/react": "^8.2.5",
|
|
1474
1523
|
"@storybook/react-vite": "^8.2.5",
|
|
1475
1524
|
"@storybook/test": "^8.2.5",
|
|
1476
|
-
"@tscircuit/core": "0.0.477",
|
|
1477
|
-
"@tscircuit/plop": "^0.0.10",
|
|
1478
1525
|
"@types/bun": "^1.2.8",
|
|
1479
1526
|
biome: "^0.3.3",
|
|
1480
1527
|
"bun-match-svg": "^0.0.12",
|
|
1481
|
-
"circuit-json": "^0.0.218",
|
|
1482
1528
|
esbuild: "^0.20.2",
|
|
1483
1529
|
"performance-now": "^2.1.0",
|
|
1484
1530
|
react: "^18.3.1",
|
|
1485
|
-
"schematic-symbols": "^0.0.153",
|
|
1486
1531
|
storybook: "^8.2.5",
|
|
1532
|
+
tscircuit: "^0.0.571",
|
|
1487
1533
|
tsup: "^8.0.2",
|
|
1488
1534
|
typescript: "^5.4.5",
|
|
1489
|
-
"vite-tsconfig-paths": "^5.0.1"
|
|
1490
|
-
"@tscircuit/checks": "^0.0.44",
|
|
1491
|
-
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
1492
|
-
"@tscircuit/footprinter": "^0.0.204"
|
|
1535
|
+
"vite-tsconfig-paths": "^5.0.1"
|
|
1493
1536
|
},
|
|
1494
1537
|
peerDependencies: {
|
|
1495
|
-
|
|
1496
|
-
"@tscircuit/circuit-json-util": "*",
|
|
1497
|
-
"@tscircuit/footprinter": "*",
|
|
1498
|
-
"schematic-symbols": "*"
|
|
1538
|
+
tscircuit: "*"
|
|
1499
1539
|
},
|
|
1500
1540
|
dependencies: {
|
|
1501
1541
|
"@types/node": "^22.5.5",
|
|
@@ -2385,6 +2425,55 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
|
2385
2425
|
}
|
|
2386
2426
|
];
|
|
2387
2427
|
}
|
|
2428
|
+
if (hole.shape === "rotated_pill_hole_with_rect_pad") {
|
|
2429
|
+
const scaledRectPadWidth = hole.rect_pad_width * Math.abs(transform.a);
|
|
2430
|
+
const scaledRectPadHeight = hole.rect_pad_height * Math.abs(transform.a);
|
|
2431
|
+
const scaledHoleHeight = hole.hole_height * Math.abs(transform.a);
|
|
2432
|
+
const scaledHoleWidth = hole.hole_width * Math.abs(transform.a);
|
|
2433
|
+
const holeRadius = Math.min(scaledHoleHeight, scaledHoleWidth) / 2;
|
|
2434
|
+
return [
|
|
2435
|
+
{
|
|
2436
|
+
name: "g",
|
|
2437
|
+
type: "element",
|
|
2438
|
+
children: [
|
|
2439
|
+
{
|
|
2440
|
+
name: "rect",
|
|
2441
|
+
type: "element",
|
|
2442
|
+
attributes: {
|
|
2443
|
+
class: "assembly-hole-outer-pad",
|
|
2444
|
+
fill: PAD_COLOR,
|
|
2445
|
+
x: (-scaledRectPadWidth / 2).toString(),
|
|
2446
|
+
y: (-scaledRectPadHeight / 2).toString(),
|
|
2447
|
+
width: scaledRectPadWidth.toString(),
|
|
2448
|
+
height: scaledRectPadHeight.toString(),
|
|
2449
|
+
transform: `translate(${x} ${y}) rotate(${-hole.rect_ccw_rotation})`
|
|
2450
|
+
},
|
|
2451
|
+
value: "",
|
|
2452
|
+
children: []
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
name: "rect",
|
|
2456
|
+
type: "element",
|
|
2457
|
+
attributes: {
|
|
2458
|
+
class: "assembly-hole-inner",
|
|
2459
|
+
fill: HOLE_COLOR3,
|
|
2460
|
+
x: (-scaledHoleWidth / 2).toString(),
|
|
2461
|
+
y: (-scaledHoleHeight / 2).toString(),
|
|
2462
|
+
width: scaledHoleWidth.toString(),
|
|
2463
|
+
height: scaledHoleHeight.toString(),
|
|
2464
|
+
rx: holeRadius.toString(),
|
|
2465
|
+
ry: holeRadius.toString(),
|
|
2466
|
+
transform: `translate(${x} ${y}) rotate(${-hole.hole_ccw_rotation})`
|
|
2467
|
+
},
|
|
2468
|
+
value: "",
|
|
2469
|
+
children: []
|
|
2470
|
+
}
|
|
2471
|
+
],
|
|
2472
|
+
value: "",
|
|
2473
|
+
attributes: {}
|
|
2474
|
+
}
|
|
2475
|
+
];
|
|
2476
|
+
}
|
|
2388
2477
|
return [];
|
|
2389
2478
|
}
|
|
2390
2479
|
|