circuit-to-svg 0.0.170 → 0.0.171
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 +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1031,7 +1031,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
1031
1031
|
attributes: {
|
|
1032
1032
|
class: "pcb-pad",
|
|
1033
1033
|
fill: layerNameToColor(pad.layer),
|
|
1034
|
-
points,
|
|
1034
|
+
points: points.map((p) => p.join(",")).join(" "),
|
|
1035
1035
|
"data-layer": pad.layer
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
@@ -1446,7 +1446,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
1446
1446
|
var package_default = {
|
|
1447
1447
|
name: "circuit-to-svg",
|
|
1448
1448
|
type: "module",
|
|
1449
|
-
version: "0.0.
|
|
1449
|
+
version: "0.0.170",
|
|
1450
1450
|
description: "Convert Circuit JSON to SVG",
|
|
1451
1451
|
main: "dist/index.js",
|
|
1452
1452
|
files: [
|
|
@@ -1575,6 +1575,15 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
} else if ("x" in circuitJsonElm && "y" in circuitJsonElm) {
|
|
1577
1577
|
updateBounds({ x: circuitJsonElm.x, y: circuitJsonElm.y }, 0, 0);
|
|
1578
|
+
} else if (circuitJsonElm.type === "pcb_smtpad") {
|
|
1579
|
+
const pad = circuitJsonElm;
|
|
1580
|
+
if (pad.shape === "rect" || pad.shape === "rotated_rect" || pad.shape === "pill") {
|
|
1581
|
+
updateBounds({ x: pad.x, y: pad.y }, pad.width, pad.height);
|
|
1582
|
+
} else if (pad.shape === "circle") {
|
|
1583
|
+
updateBounds({ x: pad.x, y: pad.y }, pad.radius * 2, pad.radius * 2);
|
|
1584
|
+
} else if (pad.shape === "polygon") {
|
|
1585
|
+
updateTraceBounds(pad.points);
|
|
1586
|
+
}
|
|
1578
1587
|
} else if ("route" in circuitJsonElm) {
|
|
1579
1588
|
updateTraceBounds(circuitJsonElm.route);
|
|
1580
1589
|
} else if (circuitJsonElm.type === "pcb_silkscreen_text" || circuitJsonElm.type === "pcb_silkscreen_rect" || circuitJsonElm.type === "pcb_silkscreen_circle" || circuitJsonElm.type === "pcb_silkscreen_line") {
|