circuit-to-svg 0.0.275 → 0.0.276
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 +59 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1671,6 +1671,64 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
];
|
|
1673
1673
|
}
|
|
1674
|
+
if (hole.shape === "oval") {
|
|
1675
|
+
const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
|
|
1676
|
+
const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
|
|
1677
|
+
const scaledHoleWidth = hole.hole_width * Math.abs(transform.a);
|
|
1678
|
+
const scaledHoleHeight = hole.hole_height * Math.abs(transform.a);
|
|
1679
|
+
const rotation = hole.ccw_rotation || 0;
|
|
1680
|
+
const transformStr = rotation ? `translate(${x} ${y}) rotate(${-rotation})` : `translate(${x} ${y})`;
|
|
1681
|
+
const children = [
|
|
1682
|
+
// Outer oval shape
|
|
1683
|
+
{
|
|
1684
|
+
name: "ellipse",
|
|
1685
|
+
type: "element",
|
|
1686
|
+
attributes: {
|
|
1687
|
+
class: "pcb-hole-outer",
|
|
1688
|
+
fill: colorMap2.copper.top,
|
|
1689
|
+
cx: "0",
|
|
1690
|
+
cy: "0",
|
|
1691
|
+
rx: (scaledOuterWidth / 2).toString(),
|
|
1692
|
+
ry: (scaledOuterHeight / 2).toString(),
|
|
1693
|
+
transform: transformStr,
|
|
1694
|
+
"data-type": "pcb_plated_hole",
|
|
1695
|
+
"data-pcb-layer": copperLayer
|
|
1696
|
+
},
|
|
1697
|
+
value: "",
|
|
1698
|
+
children: []
|
|
1699
|
+
},
|
|
1700
|
+
// Inner oval shape
|
|
1701
|
+
{
|
|
1702
|
+
name: "ellipse",
|
|
1703
|
+
type: "element",
|
|
1704
|
+
attributes: {
|
|
1705
|
+
class: "pcb-hole-inner",
|
|
1706
|
+
fill: colorMap2.drill,
|
|
1707
|
+
cx: "0",
|
|
1708
|
+
cy: "0",
|
|
1709
|
+
rx: (scaledHoleWidth / 2).toString(),
|
|
1710
|
+
ry: (scaledHoleHeight / 2).toString(),
|
|
1711
|
+
transform: transformStr,
|
|
1712
|
+
"data-type": "pcb_plated_hole_drill",
|
|
1713
|
+
"data-pcb-layer": "drill"
|
|
1714
|
+
},
|
|
1715
|
+
value: "",
|
|
1716
|
+
children: []
|
|
1717
|
+
}
|
|
1718
|
+
];
|
|
1719
|
+
return [
|
|
1720
|
+
{
|
|
1721
|
+
name: "g",
|
|
1722
|
+
type: "element",
|
|
1723
|
+
attributes: {
|
|
1724
|
+
"data-type": "pcb_plated_hole",
|
|
1725
|
+
"data-pcb-layer": "through"
|
|
1726
|
+
},
|
|
1727
|
+
children,
|
|
1728
|
+
value: ""
|
|
1729
|
+
}
|
|
1730
|
+
];
|
|
1731
|
+
}
|
|
1674
1732
|
if (hole.shape === "circle") {
|
|
1675
1733
|
const scaledOuterWidth = hole.outer_diameter * Math.abs(transform.a);
|
|
1676
1734
|
const scaledOuterHeight = hole.outer_diameter * Math.abs(transform.a);
|
|
@@ -4292,7 +4350,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
4292
4350
|
var package_default = {
|
|
4293
4351
|
name: "circuit-to-svg",
|
|
4294
4352
|
type: "module",
|
|
4295
|
-
version: "0.0.
|
|
4353
|
+
version: "0.0.275",
|
|
4296
4354
|
description: "Convert Circuit JSON to SVG",
|
|
4297
4355
|
main: "dist/index.js",
|
|
4298
4356
|
files: [
|