circuit-to-svg 0.0.233 → 0.0.234
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 +45 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2153,6 +2153,50 @@ function createSvgObjectsFromPcbHole(hole, ctx) {
|
|
|
2153
2153
|
}
|
|
2154
2154
|
];
|
|
2155
2155
|
}
|
|
2156
|
+
if (hole.hole_shape === "pill") {
|
|
2157
|
+
const scaledWidth = hole.hole_width * Math.abs(transform.a);
|
|
2158
|
+
const scaledHeight = hole.hole_height * Math.abs(transform.a);
|
|
2159
|
+
const radiusX = scaledWidth / 2;
|
|
2160
|
+
const straightLength = scaledHeight - scaledWidth;
|
|
2161
|
+
return [
|
|
2162
|
+
{
|
|
2163
|
+
name: "path",
|
|
2164
|
+
type: "element",
|
|
2165
|
+
attributes: {
|
|
2166
|
+
class: "pcb-hole",
|
|
2167
|
+
fill: colorMap2.drill,
|
|
2168
|
+
d: `M${x - radiusX},${y - straightLength / 2} v${straightLength} a${radiusX},${radiusX} 0 0 0 ${scaledWidth},0 v-${straightLength} a${radiusX},${radiusX} 0 0 0 -${scaledWidth},0 z`,
|
|
2169
|
+
"data-type": "pcb_hole",
|
|
2170
|
+
"data-pcb-layer": "drill"
|
|
2171
|
+
},
|
|
2172
|
+
children: [],
|
|
2173
|
+
value: ""
|
|
2174
|
+
}
|
|
2175
|
+
];
|
|
2176
|
+
}
|
|
2177
|
+
if (hole.hole_shape === "rotated_pill") {
|
|
2178
|
+
const scaledWidth = hole.hole_width * Math.abs(transform.a);
|
|
2179
|
+
const scaledHeight = hole.hole_height * Math.abs(transform.a);
|
|
2180
|
+
const radiusX = scaledWidth / 2;
|
|
2181
|
+
const straightLength = scaledHeight - scaledWidth;
|
|
2182
|
+
const rotation = hole.hole_ccw_rotation || 0;
|
|
2183
|
+
return [
|
|
2184
|
+
{
|
|
2185
|
+
name: "path",
|
|
2186
|
+
type: "element",
|
|
2187
|
+
attributes: {
|
|
2188
|
+
class: "pcb-hole",
|
|
2189
|
+
fill: colorMap2.drill,
|
|
2190
|
+
d: `M${-radiusX},${-straightLength / 2} v${straightLength} a${radiusX},${radiusX} 0 0 0 ${scaledWidth},0 v-${straightLength} a${radiusX},${radiusX} 0 0 0 -${scaledWidth},0 z`,
|
|
2191
|
+
transform: `translate(${x} ${y}) rotate(${-rotation})`,
|
|
2192
|
+
"data-type": "pcb_hole",
|
|
2193
|
+
"data-pcb-layer": "drill"
|
|
2194
|
+
},
|
|
2195
|
+
children: [],
|
|
2196
|
+
value: ""
|
|
2197
|
+
}
|
|
2198
|
+
];
|
|
2199
|
+
}
|
|
2156
2200
|
return [];
|
|
2157
2201
|
}
|
|
2158
2202
|
|
|
@@ -2679,7 +2723,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
2679
2723
|
var package_default = {
|
|
2680
2724
|
name: "circuit-to-svg",
|
|
2681
2725
|
type: "module",
|
|
2682
|
-
version: "0.0.
|
|
2726
|
+
version: "0.0.233",
|
|
2683
2727
|
description: "Convert Circuit JSON to SVG",
|
|
2684
2728
|
main: "dist/index.js",
|
|
2685
2729
|
files: [
|