circuit-json-to-gerber 0.0.78 → 0.0.79
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/{chunk-O4SBQLXH.js → chunk-UPPCW5VE.js} +303 -16
- package/dist/chunk-UPPCW5VE.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-O4SBQLXH.js.map +0 -1
|
@@ -1576,6 +1576,33 @@ var getApertureConfigFromPcbCopperText = (elm) => {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
throw new Error(`Provide font_size for: ${elm}`);
|
|
1578
1578
|
};
|
|
1579
|
+
var getApertureConfigFromPcbFabricationNoteText = (elm) => {
|
|
1580
|
+
if ("font_size" in elm) {
|
|
1581
|
+
return {
|
|
1582
|
+
standard_template_code: "C",
|
|
1583
|
+
diameter: elm.font_size / 8
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
throw new Error(`Provide font_size for: ${elm}`);
|
|
1587
|
+
};
|
|
1588
|
+
var getApertureConfigFromPcbFabricationNotePath = (elm) => {
|
|
1589
|
+
if (!("stroke_width" in elm) || typeof elm.stroke_width !== "number") {
|
|
1590
|
+
return {
|
|
1591
|
+
standard_template_code: "C",
|
|
1592
|
+
diameter: 0.1
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
return {
|
|
1596
|
+
standard_template_code: "C",
|
|
1597
|
+
diameter: elm.stroke_width
|
|
1598
|
+
};
|
|
1599
|
+
};
|
|
1600
|
+
var getApertureConfigFromPcbFabricationNoteDimension = (elm) => {
|
|
1601
|
+
return {
|
|
1602
|
+
standard_template_code: "C",
|
|
1603
|
+
diameter: Math.max(0.05, elm.font_size / 10)
|
|
1604
|
+
};
|
|
1605
|
+
};
|
|
1579
1606
|
var getApertureConfigFromPcbSolderPaste = (elm) => {
|
|
1580
1607
|
if (elm.shape === "rect") {
|
|
1581
1608
|
return {
|
|
@@ -1778,6 +1805,7 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
1778
1805
|
const configHashMap = /* @__PURE__ */ new Set();
|
|
1779
1806
|
const isSoldermaskLayer = glayer_name.endsWith("_Mask");
|
|
1780
1807
|
const isCopperLayer = glayer_name.endsWith("_Cu");
|
|
1808
|
+
const isFabricationLayer = glayer_name.endsWith("_Fab");
|
|
1781
1809
|
const addConfigIfNew = (config) => {
|
|
1782
1810
|
const hash = stableStringify(config);
|
|
1783
1811
|
if (!configHashMap.has(hash)) {
|
|
@@ -1787,6 +1815,7 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
1787
1815
|
};
|
|
1788
1816
|
for (const elm of circuitJson) {
|
|
1789
1817
|
if (elm.type === "pcb_smtpad") {
|
|
1818
|
+
if (isFabricationLayer) continue;
|
|
1790
1819
|
if (elm.layer === layer && elm.shape !== "polygon") {
|
|
1791
1820
|
if (isSoldermaskLayer) {
|
|
1792
1821
|
addConfigIfNew(getApertureConfigFromPcbSmtpadSoldermask(elm));
|
|
@@ -1795,6 +1824,7 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
1795
1824
|
}
|
|
1796
1825
|
}
|
|
1797
1826
|
} else if (elm.type === "pcb_solder_paste") {
|
|
1827
|
+
if (isFabricationLayer) continue;
|
|
1798
1828
|
if (elm.layer === layer) {
|
|
1799
1829
|
addConfigIfNew(getApertureConfigFromPcbSolderPaste(elm));
|
|
1800
1830
|
if (elm.shape === "pill") {
|
|
@@ -1808,6 +1838,7 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
1808
1838
|
}
|
|
1809
1839
|
}
|
|
1810
1840
|
} else if (elm.type === "pcb_plated_hole") {
|
|
1841
|
+
if (isFabricationLayer) continue;
|
|
1811
1842
|
if (elm.layers.includes(layer)) {
|
|
1812
1843
|
if (elm.shape === "hole_with_polygon_pad") {
|
|
1813
1844
|
continue;
|
|
@@ -1835,18 +1866,39 @@ function getAllApertureTemplateConfigsForLayer({
|
|
|
1835
1866
|
} else
|
|
1836
1867
|
console.warn("NOT IMPLEMENTED: drawing gerber for non circle holes");
|
|
1837
1868
|
} else if (elm.type === "pcb_via") {
|
|
1869
|
+
if (isFabricationLayer) continue;
|
|
1838
1870
|
addConfigIfNew(getApertureConfigFromOuterDiameter(elm));
|
|
1839
1871
|
} else if (elm.type === "pcb_trace") {
|
|
1872
|
+
if (isFabricationLayer) continue;
|
|
1840
1873
|
for (const point of elm.route) {
|
|
1841
1874
|
if (point.route_type === "via" && typeof point.outer_diameter === "number" && (point.from_layer === layer || point.to_layer === layer)) {
|
|
1842
1875
|
addConfigIfNew(getApertureConfigFromOuterDiameter(point));
|
|
1843
1876
|
}
|
|
1844
1877
|
}
|
|
1845
|
-
} else if (elm.type === "pcb_silkscreen_path")
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1878
|
+
} else if (elm.type === "pcb_silkscreen_path") {
|
|
1879
|
+
if (!isFabricationLayer)
|
|
1880
|
+
addConfigIfNew(getApertureConfigFromPcbSilkscreenPath(elm));
|
|
1881
|
+
} else if (elm.type === "pcb_silkscreen_text") {
|
|
1882
|
+
if (!isFabricationLayer)
|
|
1883
|
+
addConfigIfNew(getApertureConfigFromPcbSilkscreenText(elm));
|
|
1884
|
+
} else if (elm.type === "pcb_fabrication_note_text") {
|
|
1885
|
+
if (isFabricationLayer && elm.layer === layer)
|
|
1886
|
+
addConfigIfNew(getApertureConfigFromPcbFabricationNoteText(elm));
|
|
1887
|
+
} else if (elm.type === "pcb_fabrication_note_path") {
|
|
1888
|
+
if (isFabricationLayer && elm.layer === layer)
|
|
1889
|
+
addConfigIfNew(getApertureConfigFromPcbFabricationNotePath(elm));
|
|
1890
|
+
} else if (elm.type === "pcb_fabrication_note_rect") {
|
|
1891
|
+
if (isFabricationLayer && elm.layer === layer) {
|
|
1892
|
+
if (elm.has_stroke !== false)
|
|
1893
|
+
addConfigIfNew(getApertureConfigFromPcbFabricationNotePath(elm));
|
|
1894
|
+
if (elm.is_filled === true) addConfigIfNew(REGION_APERTURE_CONFIG);
|
|
1895
|
+
}
|
|
1896
|
+
} else if (elm.type === "pcb_fabrication_note_dimension") {
|
|
1897
|
+
if (isFabricationLayer && elm.layer === layer) {
|
|
1898
|
+
addConfigIfNew(getApertureConfigFromPcbFabricationNoteDimension(elm));
|
|
1899
|
+
addConfigIfNew(getApertureConfigFromPcbFabricationNoteText(elm));
|
|
1900
|
+
}
|
|
1901
|
+
} else if (elm.type === "pcb_copper_text") {
|
|
1850
1902
|
if (elm.layer === layer)
|
|
1851
1903
|
addConfigIfNew(getApertureConfigFromPcbCopperText(elm));
|
|
1852
1904
|
}
|
|
@@ -1901,7 +1953,7 @@ var findApertureNumber = (glayer, search_params) => {
|
|
|
1901
1953
|
// package.json
|
|
1902
1954
|
var package_default = {
|
|
1903
1955
|
name: "circuit-json-to-gerber",
|
|
1904
|
-
version: "0.0.
|
|
1956
|
+
version: "0.0.78",
|
|
1905
1957
|
main: "dist/index.js",
|
|
1906
1958
|
type: "module",
|
|
1907
1959
|
scripts: {
|
|
@@ -1956,6 +2008,8 @@ var layerAndTypeToFileFunction = {
|
|
|
1956
2008
|
"bottom-soldermask": "Soldermask,Bot",
|
|
1957
2009
|
"top-silkscreen": "Legend,Top",
|
|
1958
2010
|
"bottom-silkscreen": "Legend,Bot",
|
|
2011
|
+
"top-fabrication": "Other,Fab,Top",
|
|
2012
|
+
"bottom-fabrication": "Other,Fab,Bot",
|
|
1959
2013
|
"top-paste": "Paste,Top",
|
|
1960
2014
|
"bottom-paste": "Paste,Bot",
|
|
1961
2015
|
edgecut: "Profile,NP"
|
|
@@ -2018,6 +2072,7 @@ var layerRefToGerberPrefix = {
|
|
|
2018
2072
|
var layerTypeToGerberSuffix = {
|
|
2019
2073
|
copper: "Cu",
|
|
2020
2074
|
silkscreen: "SilkScreen",
|
|
2075
|
+
fabrication: "Fab",
|
|
2021
2076
|
soldermask: "Mask",
|
|
2022
2077
|
mask: "Mask",
|
|
2023
2078
|
paste: "Paste"
|
|
@@ -2115,6 +2170,176 @@ import {
|
|
|
2115
2170
|
rotate,
|
|
2116
2171
|
translate
|
|
2117
2172
|
} from "transformation-matrix";
|
|
2173
|
+
|
|
2174
|
+
// src/gerber/convert-soup-to-gerber-commands/fabricationLayerRefs.ts
|
|
2175
|
+
var outerLayerRefs = ["top", "bottom"];
|
|
2176
|
+
var isOuterLayerRef = (layerRef) => layerRef === "top" || layerRef === "bottom";
|
|
2177
|
+
var isFabricationElementOnLayer = (element, layerRef) => (element.type === "pcb_fabrication_note_text" || element.type === "pcb_fabrication_note_path" || element.type === "pcb_fabrication_note_rect" || element.type === "pcb_fabrication_note_dimension") && element.layer === layerRef;
|
|
2178
|
+
var getFabricationLayerRefs = (circuitJson) => outerLayerRefs.filter(
|
|
2179
|
+
(layerRef) => circuitJson.some(
|
|
2180
|
+
(element) => isFabricationElementOnLayer(element, layerRef)
|
|
2181
|
+
)
|
|
2182
|
+
);
|
|
2183
|
+
|
|
2184
|
+
// src/gerber/convert-soup-to-gerber-commands/getFabRectPoints.ts
|
|
2185
|
+
var getFabRectPoints = (element) => {
|
|
2186
|
+
const halfWidth = element.width / 2;
|
|
2187
|
+
const halfHeight = element.height / 2;
|
|
2188
|
+
const { x, y } = element.center;
|
|
2189
|
+
return [
|
|
2190
|
+
{ x: x - halfWidth, y: y - halfHeight },
|
|
2191
|
+
{ x: x + halfWidth, y: y - halfHeight },
|
|
2192
|
+
{ x: x + halfWidth, y: y + halfHeight },
|
|
2193
|
+
{ x: x - halfWidth, y: y + halfHeight }
|
|
2194
|
+
];
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
// src/gerber/convert-soup-to-gerber-commands/renderOpenPath.ts
|
|
2198
|
+
var renderOpenPath = ({
|
|
2199
|
+
element,
|
|
2200
|
+
glayer,
|
|
2201
|
+
apertureConfig,
|
|
2202
|
+
route,
|
|
2203
|
+
mapY
|
|
2204
|
+
}) => {
|
|
2205
|
+
if (route.length === 0) return;
|
|
2206
|
+
const gerber = gerberBuilder().add("select_aperture", {
|
|
2207
|
+
aperture_number: findApertureNumber(glayer, apertureConfig)
|
|
2208
|
+
});
|
|
2209
|
+
gerber.add("move_operation", {
|
|
2210
|
+
x: route[0].x,
|
|
2211
|
+
y: mapY(route[0].y)
|
|
2212
|
+
});
|
|
2213
|
+
const isDashed = element.is_stroke_dashed === true;
|
|
2214
|
+
if (!isDashed) {
|
|
2215
|
+
for (let i = 1; i < route.length; i++) {
|
|
2216
|
+
gerber.add("plot_operation", {
|
|
2217
|
+
x: route[i].x,
|
|
2218
|
+
y: mapY(route[i].y)
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
glayer.push(...gerber.build());
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
const dashLength = Math.max(0.2, (element.stroke_width ?? 0.1) * 4);
|
|
2225
|
+
const gapLength = dashLength;
|
|
2226
|
+
for (const [start, end] of pairs(route)) {
|
|
2227
|
+
const dx = end.x - start.x;
|
|
2228
|
+
const dy = end.y - start.y;
|
|
2229
|
+
const length = Math.hypot(dx, dy);
|
|
2230
|
+
if (length <= 1e-9) continue;
|
|
2231
|
+
const ux = dx / length;
|
|
2232
|
+
const uy = dy / length;
|
|
2233
|
+
let distance = 0;
|
|
2234
|
+
while (distance < length) {
|
|
2235
|
+
const dashEndDistance = Math.min(distance + dashLength, length);
|
|
2236
|
+
const dashStart = {
|
|
2237
|
+
x: start.x + ux * distance,
|
|
2238
|
+
y: start.y + uy * distance
|
|
2239
|
+
};
|
|
2240
|
+
const dashEnd = {
|
|
2241
|
+
x: start.x + ux * dashEndDistance,
|
|
2242
|
+
y: start.y + uy * dashEndDistance
|
|
2243
|
+
};
|
|
2244
|
+
gerber.add("move_operation", {
|
|
2245
|
+
x: dashStart.x,
|
|
2246
|
+
y: mapY(dashStart.y)
|
|
2247
|
+
});
|
|
2248
|
+
gerber.add("plot_operation", {
|
|
2249
|
+
x: dashEnd.x,
|
|
2250
|
+
y: mapY(dashEnd.y)
|
|
2251
|
+
});
|
|
2252
|
+
distance += dashLength + gapLength;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
glayer.push(...gerber.build());
|
|
2256
|
+
};
|
|
2257
|
+
|
|
2258
|
+
// src/gerber/convert-soup-to-gerber-commands/renderFabricationDimension.ts
|
|
2259
|
+
var renderFabricationDimension = ({
|
|
2260
|
+
element,
|
|
2261
|
+
glayer,
|
|
2262
|
+
mapY,
|
|
2263
|
+
renderText
|
|
2264
|
+
}) => {
|
|
2265
|
+
const from = element.from;
|
|
2266
|
+
const to = element.to;
|
|
2267
|
+
const dx = to.x - from.x;
|
|
2268
|
+
const dy = to.y - from.y;
|
|
2269
|
+
const length = Math.hypot(dx, dy);
|
|
2270
|
+
if (length <= 1e-9) return;
|
|
2271
|
+
const offsetDistance = element.offset_distance ?? element.offset ?? 0;
|
|
2272
|
+
const defaultOffsetDirection = { x: -dy / length, y: dx / length };
|
|
2273
|
+
const offsetDirection = element.offset_direction ?? defaultOffsetDirection;
|
|
2274
|
+
const offsetMagnitude = Math.hypot(offsetDirection.x, offsetDirection.y) || 1;
|
|
2275
|
+
const offsetVector = {
|
|
2276
|
+
x: offsetDirection.x / offsetMagnitude * offsetDistance,
|
|
2277
|
+
y: offsetDirection.y / offsetMagnitude * offsetDistance
|
|
2278
|
+
};
|
|
2279
|
+
const dimStart = { x: from.x + offsetVector.x, y: from.y + offsetVector.y };
|
|
2280
|
+
const dimEnd = { x: to.x + offsetVector.x, y: to.y + offsetVector.y };
|
|
2281
|
+
const arrowSize = element.arrow_size ?? 1;
|
|
2282
|
+
const ux = dx / length;
|
|
2283
|
+
const uy = dy / length;
|
|
2284
|
+
const px = -uy;
|
|
2285
|
+
const py = ux;
|
|
2286
|
+
const arrowHalfWidth = arrowSize * 0.35;
|
|
2287
|
+
const lineConfig = getApertureConfigFromPcbFabricationNoteDimension(element);
|
|
2288
|
+
renderOpenPath({
|
|
2289
|
+
element,
|
|
2290
|
+
glayer,
|
|
2291
|
+
apertureConfig: lineConfig,
|
|
2292
|
+
route: [from, dimStart, dimEnd, to],
|
|
2293
|
+
mapY
|
|
2294
|
+
});
|
|
2295
|
+
renderOpenPath({
|
|
2296
|
+
element,
|
|
2297
|
+
glayer,
|
|
2298
|
+
apertureConfig: lineConfig,
|
|
2299
|
+
route: [
|
|
2300
|
+
{
|
|
2301
|
+
x: dimStart.x + ux * arrowSize + px * arrowHalfWidth,
|
|
2302
|
+
y: dimStart.y + uy * arrowSize + py * arrowHalfWidth
|
|
2303
|
+
},
|
|
2304
|
+
dimStart,
|
|
2305
|
+
{
|
|
2306
|
+
x: dimStart.x + ux * arrowSize - px * arrowHalfWidth,
|
|
2307
|
+
y: dimStart.y + uy * arrowSize - py * arrowHalfWidth
|
|
2308
|
+
}
|
|
2309
|
+
],
|
|
2310
|
+
mapY
|
|
2311
|
+
});
|
|
2312
|
+
renderOpenPath({
|
|
2313
|
+
element,
|
|
2314
|
+
glayer,
|
|
2315
|
+
apertureConfig: lineConfig,
|
|
2316
|
+
route: [
|
|
2317
|
+
{
|
|
2318
|
+
x: dimEnd.x - ux * arrowSize + px * arrowHalfWidth,
|
|
2319
|
+
y: dimEnd.y - uy * arrowSize + py * arrowHalfWidth
|
|
2320
|
+
},
|
|
2321
|
+
dimEnd,
|
|
2322
|
+
{
|
|
2323
|
+
x: dimEnd.x - ux * arrowSize - px * arrowHalfWidth,
|
|
2324
|
+
y: dimEnd.y - uy * arrowSize - py * arrowHalfWidth
|
|
2325
|
+
}
|
|
2326
|
+
],
|
|
2327
|
+
mapY
|
|
2328
|
+
});
|
|
2329
|
+
if (element.text) {
|
|
2330
|
+
renderText({
|
|
2331
|
+
...element,
|
|
2332
|
+
anchor_position: {
|
|
2333
|
+
x: (dimStart.x + dimEnd.x) / 2,
|
|
2334
|
+
y: (dimStart.y + dimEnd.y) / 2
|
|
2335
|
+
},
|
|
2336
|
+
anchor_alignment: "center",
|
|
2337
|
+
ccw_rotation: element.text_ccw_rotation ?? Math.atan2(dy, dx) * 180 / Math.PI
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
};
|
|
2341
|
+
|
|
2342
|
+
// src/gerber/convert-soup-to-gerber-commands/index.ts
|
|
2118
2343
|
var getLayerCount2 = (circuitJson) => {
|
|
2119
2344
|
const board = circuitJson.find((element) => element.type === "pcb_board");
|
|
2120
2345
|
const numLayers = board?.num_layers ?? 2;
|
|
@@ -2133,7 +2358,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2133
2358
|
const layerCount = getLayerCount2(circuitJson);
|
|
2134
2359
|
const innerLayerRefs = getInnerLayerRefs(layerCount);
|
|
2135
2360
|
const copperLayerRefs = ["top", ...innerLayerRefs, "bottom"];
|
|
2136
|
-
const
|
|
2361
|
+
const fabricationLayerRefs = getFabricationLayerRefs(circuitJson);
|
|
2137
2362
|
const glayers = {
|
|
2138
2363
|
F_Cu: getCommandHeaders({
|
|
2139
2364
|
layer: "top",
|
|
@@ -2180,9 +2405,18 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2180
2405
|
total_layer_count: layerCount
|
|
2181
2406
|
});
|
|
2182
2407
|
}
|
|
2408
|
+
for (const layerRef of fabricationLayerRefs) {
|
|
2409
|
+
glayers[getGerberLayerName(layerRef, "fabrication")] = getCommandHeaders({
|
|
2410
|
+
layer: layerRef,
|
|
2411
|
+
layer_type: "fabrication"
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2183
2414
|
const copperGerberLayerNames = copperLayerRefs.map(
|
|
2184
2415
|
(layerRef) => getGerberLayerName(layerRef, "copper")
|
|
2185
2416
|
);
|
|
2417
|
+
const fabricationGerberLayerNames = fabricationLayerRefs.map(
|
|
2418
|
+
(layerRef) => getGerberLayerName(layerRef, "fabrication")
|
|
2419
|
+
);
|
|
2186
2420
|
const outerGerberLayerNames = outerLayerRefs.flatMap((layerRef) => [
|
|
2187
2421
|
getGerberLayerName(layerRef, "soldermask"),
|
|
2188
2422
|
getGerberLayerName(layerRef, "paste"),
|
|
@@ -2191,6 +2425,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2191
2425
|
for (const glayer_name of [
|
|
2192
2426
|
"F_Cu",
|
|
2193
2427
|
...copperGerberLayerNames.filter((name) => name !== "F_Cu"),
|
|
2428
|
+
...fabricationGerberLayerNames,
|
|
2194
2429
|
...outerGerberLayerNames
|
|
2195
2430
|
]) {
|
|
2196
2431
|
const glayer = glayers[glayer_name];
|
|
@@ -2675,7 +2910,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2675
2910
|
);
|
|
2676
2911
|
}
|
|
2677
2912
|
}
|
|
2678
|
-
} else if (element.type === "pcb_silkscreen_path" &&
|
|
2913
|
+
} else if (element.type === "pcb_silkscreen_path" && isOuterLayerRef(layer)) {
|
|
2679
2914
|
if (element.layer === layer) {
|
|
2680
2915
|
const glayer = glayers[getGerberLayerName(layer, "silkscreen")];
|
|
2681
2916
|
const apertureConfig = getApertureConfigFromPcbSilkscreenPath(element);
|
|
@@ -2696,13 +2931,65 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2696
2931
|
}
|
|
2697
2932
|
glayer.push(...gerber.build());
|
|
2698
2933
|
}
|
|
2699
|
-
} else if (element.type === "pcb_silkscreen_text" &&
|
|
2934
|
+
} else if (element.type === "pcb_silkscreen_text" && isOuterLayerRef(layer)) {
|
|
2700
2935
|
renderVectorText(
|
|
2701
2936
|
element,
|
|
2702
2937
|
layer,
|
|
2703
2938
|
"silkscreen",
|
|
2704
2939
|
getApertureConfigFromPcbSilkscreenText
|
|
2705
2940
|
);
|
|
2941
|
+
} else if (element.type === "pcb_fabrication_note_path" && isOuterLayerRef(layer)) {
|
|
2942
|
+
if (element.layer === layer) {
|
|
2943
|
+
renderOpenPath({
|
|
2944
|
+
element,
|
|
2945
|
+
glayer: glayers[getGerberLayerName(layer, "fabrication")],
|
|
2946
|
+
apertureConfig: getApertureConfigFromPcbFabricationNotePath(element),
|
|
2947
|
+
route: element.route,
|
|
2948
|
+
mapY: mfy
|
|
2949
|
+
});
|
|
2950
|
+
}
|
|
2951
|
+
} else if (element.type === "pcb_fabrication_note_rect" && isOuterLayerRef(layer)) {
|
|
2952
|
+
if (element.layer === layer) {
|
|
2953
|
+
const glayer = glayers[getGerberLayerName(layer, "fabrication")];
|
|
2954
|
+
const points = getFabRectPoints(element);
|
|
2955
|
+
if (element.is_filled === true) {
|
|
2956
|
+
addClosedRegionFromPoints({
|
|
2957
|
+
target: glayer,
|
|
2958
|
+
apertureSource: glayer,
|
|
2959
|
+
points
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
if (element.has_stroke !== false) {
|
|
2963
|
+
renderOpenPath({
|
|
2964
|
+
element,
|
|
2965
|
+
glayer,
|
|
2966
|
+
apertureConfig: getApertureConfigFromPcbFabricationNotePath(element),
|
|
2967
|
+
route: [...points, points[0]],
|
|
2968
|
+
mapY: mfy
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
} else if (element.type === "pcb_fabrication_note_dimension" && isOuterLayerRef(layer)) {
|
|
2973
|
+
if (element.layer === layer) {
|
|
2974
|
+
renderFabricationDimension({
|
|
2975
|
+
element,
|
|
2976
|
+
glayer: glayers[getGerberLayerName(layer, "fabrication")],
|
|
2977
|
+
mapY: mfy,
|
|
2978
|
+
renderText: (textElement) => renderVectorText(
|
|
2979
|
+
textElement,
|
|
2980
|
+
layer,
|
|
2981
|
+
"fabrication",
|
|
2982
|
+
getApertureConfigFromPcbFabricationNoteText
|
|
2983
|
+
)
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
2986
|
+
} else if (element.type === "pcb_fabrication_note_text" && isOuterLayerRef(layer)) {
|
|
2987
|
+
renderVectorText(
|
|
2988
|
+
element,
|
|
2989
|
+
layer,
|
|
2990
|
+
"fabrication",
|
|
2991
|
+
getApertureConfigFromPcbFabricationNoteText
|
|
2992
|
+
);
|
|
2706
2993
|
} else if (element.type === "pcb_copper_text" && layer !== "edgecut") {
|
|
2707
2994
|
renderVectorText(
|
|
2708
2995
|
element,
|
|
@@ -2711,7 +2998,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2711
2998
|
getApertureConfigFromPcbCopperText
|
|
2712
2999
|
);
|
|
2713
3000
|
} else if (element.type === "pcb_smtpad" && element.shape !== "polygon") {
|
|
2714
|
-
if (element.layer === layer &&
|
|
3001
|
+
if (element.layer === layer && isOuterLayerRef(layer)) {
|
|
2715
3002
|
if (element.shape === "pill" || element.shape === "rotated_pill") {
|
|
2716
3003
|
const soldermaskMargin = typeof element.soldermask_margin === "number" ? element.soldermask_margin : 0;
|
|
2717
3004
|
const rotation2 = element.shape === "rotated_pill" && typeof element.ccw_rotation === "number" ? element.ccw_rotation : 0;
|
|
@@ -2761,7 +3048,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2761
3048
|
}
|
|
2762
3049
|
}
|
|
2763
3050
|
} else if (element.type === "pcb_smtpad" && element.shape === "polygon") {
|
|
2764
|
-
if (element.layer === layer &&
|
|
3051
|
+
if (element.layer === layer && isOuterLayerRef(layer)) {
|
|
2765
3052
|
const layers_to_add_to = [
|
|
2766
3053
|
glayers[getGerberLayerName(layer, "copper")]
|
|
2767
3054
|
];
|
|
@@ -2781,7 +3068,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2781
3068
|
}
|
|
2782
3069
|
}
|
|
2783
3070
|
} else if (element.type === "pcb_solder_paste") {
|
|
2784
|
-
if (element.layer === layer &&
|
|
3071
|
+
if (element.layer === layer && isOuterLayerRef(layer)) {
|
|
2785
3072
|
const glayer = glayers[getGerberLayerName(layer, "paste")];
|
|
2786
3073
|
let rotation = 0;
|
|
2787
3074
|
if ("ccw_rotation" in element && typeof element.ccw_rotation === "number") {
|
|
@@ -2823,7 +3110,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2823
3110
|
const layersToAddTo = [
|
|
2824
3111
|
glayers[getGerberLayerName(layer, "copper")]
|
|
2825
3112
|
];
|
|
2826
|
-
if (
|
|
3113
|
+
if (isOuterLayerRef(layer) && element.is_covered_with_solder_mask !== true) {
|
|
2827
3114
|
layersToAddTo.push(glayers[getGerberLayerName(layer, "soldermask")]);
|
|
2828
3115
|
}
|
|
2829
3116
|
for (const glayer of layersToAddTo) {
|
|
@@ -2966,7 +3253,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2966
3253
|
}
|
|
2967
3254
|
}
|
|
2968
3255
|
} else if (element.type === "pcb_hole") {
|
|
2969
|
-
if (
|
|
3256
|
+
if (isOuterLayerRef(layer) && element.is_covered_with_solder_mask !== true) {
|
|
2970
3257
|
for (const glayer of [
|
|
2971
3258
|
glayers[getGerberLayerName(layer, "soldermask")]
|
|
2972
3259
|
]) {
|
|
@@ -2991,7 +3278,7 @@ var convertSoupToGerberCommands = (circuitJson, opts = {}) => {
|
|
|
2991
3278
|
const layersToAddTo = [
|
|
2992
3279
|
glayers[getGerberLayerName(layer, "copper")]
|
|
2993
3280
|
];
|
|
2994
|
-
if (element.is_tented === false &&
|
|
3281
|
+
if (element.is_tented === false && isOuterLayerRef(layer)) {
|
|
2995
3282
|
layersToAddTo.push(glayers[getGerberLayerName(layer, "soldermask")]);
|
|
2996
3283
|
}
|
|
2997
3284
|
for (const glayer of layersToAddTo) {
|
|
@@ -3234,4 +3521,4 @@ export {
|
|
|
3234
3521
|
stringifyGerberCommands,
|
|
3235
3522
|
convertSoupToGerberCommands
|
|
3236
3523
|
};
|
|
3237
|
-
//# sourceMappingURL=chunk-
|
|
3524
|
+
//# sourceMappingURL=chunk-UPPCW5VE.js.map
|