@tscircuit/pcb-viewer 1.11.268 → 1.11.269
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.d.ts +2 -0
- package/dist/index.js +273 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ interface State {
|
|
|
20
20
|
is_showing_copper_pours: boolean;
|
|
21
21
|
is_showing_pcb_groups: boolean;
|
|
22
22
|
is_showing_group_anchor_offsets: boolean;
|
|
23
|
+
is_showing_solder_mask: boolean;
|
|
23
24
|
pcb_group_view_mode: "all" | "named_only";
|
|
24
25
|
hovered_error_id: string | null;
|
|
25
26
|
selectLayer: (layer: LayerRef) => void;
|
|
@@ -34,6 +35,7 @@ interface State {
|
|
|
34
35
|
setIsShowingCopperPours: (is_showing: boolean) => void;
|
|
35
36
|
setIsShowingPcbGroups: (is_showing: boolean) => void;
|
|
36
37
|
setIsShowingGroupAnchorOffsets: (is_showing: boolean) => void;
|
|
38
|
+
setIsShowingSolderMask: (is_showing: boolean) => void;
|
|
37
39
|
setPcbGroupViewMode: (mode: "all" | "named_only") => void;
|
|
38
40
|
setHoveredErrorId: (errorId: string | null) => void;
|
|
39
41
|
}
|
package/dist/index.js
CHANGED
|
@@ -6278,7 +6278,8 @@ var STORAGE_KEYS = {
|
|
|
6278
6278
|
IS_SHOWING_PCB_GROUPS: "pcb_viewer_is_showing_pcb_groups",
|
|
6279
6279
|
PCB_GROUP_VIEW_MODE: "pcb_viewer_group_view_mode",
|
|
6280
6280
|
IS_SHOWING_COPPER_POURS: "pcb_viewer_is_showing_copper_pours",
|
|
6281
|
-
IS_SHOWING_GROUP_ANCHOR_OFFSETS: "pcb_viewer_is_showing_group_anchor_offsets"
|
|
6281
|
+
IS_SHOWING_GROUP_ANCHOR_OFFSETS: "pcb_viewer_is_showing_group_anchor_offsets",
|
|
6282
|
+
IS_SHOWING_SOLDER_MASK: "pcb_viewer_is_showing_solder_mask"
|
|
6282
6283
|
};
|
|
6283
6284
|
var getStoredBoolean = (key, defaultValue) => {
|
|
6284
6285
|
if (typeof window === "undefined") return defaultValue;
|
|
@@ -6338,6 +6339,10 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6338
6339
|
STORAGE_KEYS.IS_SHOWING_GROUP_ANCHOR_OFFSETS,
|
|
6339
6340
|
true
|
|
6340
6341
|
),
|
|
6342
|
+
is_showing_solder_mask: getStoredBoolean(
|
|
6343
|
+
STORAGE_KEYS.IS_SHOWING_SOLDER_MASK,
|
|
6344
|
+
false
|
|
6345
|
+
),
|
|
6341
6346
|
pcb_group_view_mode: disablePcbGroups ? "all" : getStoredString(
|
|
6342
6347
|
STORAGE_KEYS.PCB_GROUP_VIEW_MODE,
|
|
6343
6348
|
DEFAULT_PCB_GROUP_VIEW_MODE
|
|
@@ -6375,6 +6380,10 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6375
6380
|
);
|
|
6376
6381
|
set({ is_showing_group_anchor_offsets: is_showing });
|
|
6377
6382
|
},
|
|
6383
|
+
setIsShowingSolderMask: (is_showing) => {
|
|
6384
|
+
setStoredBoolean(STORAGE_KEYS.IS_SHOWING_SOLDER_MASK, is_showing);
|
|
6385
|
+
set({ is_showing_solder_mask: is_showing });
|
|
6386
|
+
},
|
|
6378
6387
|
setPcbGroupViewMode: (mode) => {
|
|
6379
6388
|
if (disablePcbGroups) return;
|
|
6380
6389
|
setStoredString(STORAGE_KEYS.PCB_GROUP_VIEW_MODE, mode);
|
|
@@ -7139,76 +7148,123 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7139
7148
|
}
|
|
7140
7149
|
case "pcb_board": {
|
|
7141
7150
|
const { width, height, center, outline } = element;
|
|
7151
|
+
const primitives = [];
|
|
7152
|
+
const hasSolderMask = allElements.some(
|
|
7153
|
+
(elm) => elm.type === "pcb_smtpad" && elm.is_covered_with_solder_mask === true
|
|
7154
|
+
);
|
|
7155
|
+
if (hasSolderMask) {
|
|
7156
|
+
if (outline && outline.length > 2) {
|
|
7157
|
+
primitives.push({
|
|
7158
|
+
_pcb_drawing_object_id: `polygon_${globalPcbDrawingObjectCount++}`,
|
|
7159
|
+
pcb_drawing_type: "polygon",
|
|
7160
|
+
points: normalizePolygonPoints(outline),
|
|
7161
|
+
layer: "soldermask_top",
|
|
7162
|
+
_element: element
|
|
7163
|
+
});
|
|
7164
|
+
primitives.push({
|
|
7165
|
+
_pcb_drawing_object_id: `polygon_${globalPcbDrawingObjectCount++}`,
|
|
7166
|
+
pcb_drawing_type: "polygon",
|
|
7167
|
+
points: normalizePolygonPoints(outline),
|
|
7168
|
+
layer: "soldermask_bottom",
|
|
7169
|
+
_element: element
|
|
7170
|
+
});
|
|
7171
|
+
} else if (width && height) {
|
|
7172
|
+
primitives.push({
|
|
7173
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7174
|
+
pcb_drawing_type: "rect",
|
|
7175
|
+
x: center.x,
|
|
7176
|
+
y: center.y,
|
|
7177
|
+
w: width,
|
|
7178
|
+
h: height,
|
|
7179
|
+
layer: "soldermask_top",
|
|
7180
|
+
_element: element
|
|
7181
|
+
});
|
|
7182
|
+
primitives.push({
|
|
7183
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7184
|
+
pcb_drawing_type: "rect",
|
|
7185
|
+
x: center.x,
|
|
7186
|
+
y: center.y,
|
|
7187
|
+
w: width,
|
|
7188
|
+
h: height,
|
|
7189
|
+
layer: "soldermask_bottom",
|
|
7190
|
+
_element: element
|
|
7191
|
+
});
|
|
7192
|
+
}
|
|
7193
|
+
}
|
|
7142
7194
|
if (outline && outline.length > 2) {
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7195
|
+
primitives.push(
|
|
7196
|
+
...outline.map((point, index, array) => ({
|
|
7197
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7198
|
+
pcb_drawing_type: "line",
|
|
7199
|
+
x1: point.x,
|
|
7200
|
+
y1: point.y,
|
|
7201
|
+
x2: index === array.length - 1 ? array[0].x : array[index + 1].x,
|
|
7202
|
+
y2: index === array.length - 1 ? array[0].y : array[index + 1].y,
|
|
7203
|
+
width: 1,
|
|
7204
|
+
zoomIndependent: true,
|
|
7205
|
+
layer: "board",
|
|
7206
|
+
_element: element
|
|
7207
|
+
}))
|
|
7208
|
+
);
|
|
7209
|
+
} else {
|
|
7210
|
+
primitives.push(
|
|
7211
|
+
{
|
|
7212
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7213
|
+
pcb_drawing_type: "line",
|
|
7214
|
+
x1: center.x - width / 2,
|
|
7215
|
+
y1: center.y - height / 2,
|
|
7216
|
+
x2: center.x + width / 2,
|
|
7217
|
+
y2: center.y - height / 2,
|
|
7218
|
+
width: 1,
|
|
7219
|
+
zoomIndependent: true,
|
|
7220
|
+
layer: "board",
|
|
7221
|
+
_element: element
|
|
7222
|
+
},
|
|
7223
|
+
{
|
|
7224
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7225
|
+
pcb_drawing_type: "line",
|
|
7226
|
+
x1: center.x - width / 2,
|
|
7227
|
+
y1: center.y + height / 2,
|
|
7228
|
+
x2: center.x + width / 2,
|
|
7229
|
+
y2: center.y + height / 2,
|
|
7230
|
+
width: 1,
|
|
7231
|
+
zoomIndependent: true,
|
|
7232
|
+
layer: "board",
|
|
7233
|
+
_element: element
|
|
7234
|
+
},
|
|
7235
|
+
{
|
|
7236
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7237
|
+
pcb_drawing_type: "line",
|
|
7238
|
+
x1: center.x - width / 2,
|
|
7239
|
+
y1: center.y - height / 2,
|
|
7240
|
+
x2: center.x - width / 2,
|
|
7241
|
+
y2: center.y + height / 2,
|
|
7242
|
+
width: 1,
|
|
7243
|
+
zoomIndependent: true,
|
|
7244
|
+
layer: "board",
|
|
7245
|
+
_element: element
|
|
7246
|
+
},
|
|
7247
|
+
{
|
|
7248
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7249
|
+
pcb_drawing_type: "line",
|
|
7250
|
+
x1: center.x + width / 2,
|
|
7251
|
+
y1: center.y - height / 2,
|
|
7252
|
+
x2: center.x + width / 2,
|
|
7253
|
+
y2: center.y + height / 2,
|
|
7254
|
+
width: 1,
|
|
7255
|
+
zoomIndependent: true,
|
|
7256
|
+
layer: "board",
|
|
7257
|
+
_element: element
|
|
7258
|
+
}
|
|
7259
|
+
);
|
|
7155
7260
|
}
|
|
7156
|
-
return
|
|
7157
|
-
{
|
|
7158
|
-
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7159
|
-
pcb_drawing_type: "line",
|
|
7160
|
-
x1: center.x - width / 2,
|
|
7161
|
-
y1: center.y - height / 2,
|
|
7162
|
-
x2: center.x + width / 2,
|
|
7163
|
-
y2: center.y - height / 2,
|
|
7164
|
-
width: 1,
|
|
7165
|
-
zoomIndependent: true,
|
|
7166
|
-
layer: "board",
|
|
7167
|
-
_element: element
|
|
7168
|
-
},
|
|
7169
|
-
{
|
|
7170
|
-
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7171
|
-
pcb_drawing_type: "line",
|
|
7172
|
-
x1: center.x - width / 2,
|
|
7173
|
-
y1: center.y + height / 2,
|
|
7174
|
-
x2: center.x + width / 2,
|
|
7175
|
-
y2: center.y + height / 2,
|
|
7176
|
-
width: 1,
|
|
7177
|
-
zoomIndependent: true,
|
|
7178
|
-
layer: "board",
|
|
7179
|
-
_element: element
|
|
7180
|
-
},
|
|
7181
|
-
{
|
|
7182
|
-
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7183
|
-
pcb_drawing_type: "line",
|
|
7184
|
-
x1: center.x - width / 2,
|
|
7185
|
-
y1: center.y - height / 2,
|
|
7186
|
-
x2: center.x - width / 2,
|
|
7187
|
-
y2: center.y + height / 2,
|
|
7188
|
-
width: 1,
|
|
7189
|
-
zoomIndependent: true,
|
|
7190
|
-
layer: "board",
|
|
7191
|
-
_element: element
|
|
7192
|
-
},
|
|
7193
|
-
{
|
|
7194
|
-
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7195
|
-
pcb_drawing_type: "line",
|
|
7196
|
-
x1: center.x + width / 2,
|
|
7197
|
-
y1: center.y - height / 2,
|
|
7198
|
-
x2: center.x + width / 2,
|
|
7199
|
-
y2: center.y + height / 2,
|
|
7200
|
-
width: 1,
|
|
7201
|
-
zoomIndependent: true,
|
|
7202
|
-
layer: "board",
|
|
7203
|
-
_element: element
|
|
7204
|
-
}
|
|
7205
|
-
];
|
|
7261
|
+
return primitives;
|
|
7206
7262
|
}
|
|
7207
7263
|
case "pcb_smtpad": {
|
|
7208
7264
|
if (element.shape === "rect" || element.shape === "rotated_rect") {
|
|
7209
7265
|
const { shape, x, y, width, height, layer, rect_border_radius } = element;
|
|
7210
7266
|
const corner_radius = element.corner_radius ?? rect_border_radius ?? 0;
|
|
7211
|
-
|
|
7267
|
+
const primitives = [
|
|
7212
7268
|
{
|
|
7213
7269
|
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7214
7270
|
pcb_drawing_type: "rect",
|
|
@@ -7225,9 +7281,32 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7225
7281
|
roundness: corner_radius
|
|
7226
7282
|
}
|
|
7227
7283
|
];
|
|
7284
|
+
if (element.is_covered_with_solder_mask) {
|
|
7285
|
+
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7286
|
+
const maskPrimitive = {
|
|
7287
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7288
|
+
pcb_drawing_type: "rect",
|
|
7289
|
+
x,
|
|
7290
|
+
y,
|
|
7291
|
+
w: width,
|
|
7292
|
+
h: height,
|
|
7293
|
+
layer: maskLayer,
|
|
7294
|
+
_element: element,
|
|
7295
|
+
_parent_pcb_component,
|
|
7296
|
+
_parent_source_component,
|
|
7297
|
+
_source_port,
|
|
7298
|
+
ccw_rotation: element.ccw_rotation,
|
|
7299
|
+
roundness: corner_radius
|
|
7300
|
+
};
|
|
7301
|
+
if (element.solder_mask_color) {
|
|
7302
|
+
maskPrimitive.color = element.solder_mask_color;
|
|
7303
|
+
}
|
|
7304
|
+
primitives.push(maskPrimitive);
|
|
7305
|
+
}
|
|
7306
|
+
return primitives;
|
|
7228
7307
|
} else if (element.shape === "circle") {
|
|
7229
7308
|
const { x, y, radius, layer } = element;
|
|
7230
|
-
|
|
7309
|
+
const primitives = [
|
|
7231
7310
|
{
|
|
7232
7311
|
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7233
7312
|
pcb_drawing_type: "circle",
|
|
@@ -7241,9 +7320,29 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7241
7320
|
_source_port
|
|
7242
7321
|
}
|
|
7243
7322
|
];
|
|
7323
|
+
if (element.is_covered_with_solder_mask) {
|
|
7324
|
+
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7325
|
+
const maskPrimitive = {
|
|
7326
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7327
|
+
pcb_drawing_type: "circle",
|
|
7328
|
+
x,
|
|
7329
|
+
y,
|
|
7330
|
+
r: radius,
|
|
7331
|
+
layer: maskLayer,
|
|
7332
|
+
_element: element,
|
|
7333
|
+
_parent_pcb_component,
|
|
7334
|
+
_parent_source_component,
|
|
7335
|
+
_source_port
|
|
7336
|
+
};
|
|
7337
|
+
if (element.solder_mask_color) {
|
|
7338
|
+
maskPrimitive.color = element.solder_mask_color;
|
|
7339
|
+
}
|
|
7340
|
+
primitives.push(maskPrimitive);
|
|
7341
|
+
}
|
|
7342
|
+
return primitives;
|
|
7244
7343
|
} else if (element.shape === "polygon") {
|
|
7245
7344
|
const { layer, points } = element;
|
|
7246
|
-
|
|
7345
|
+
const primitives = [
|
|
7247
7346
|
{
|
|
7248
7347
|
_pcb_drawing_object_id: `polygon_${globalPcbDrawingObjectCount++}`,
|
|
7249
7348
|
pcb_drawing_type: "polygon",
|
|
@@ -7255,9 +7354,27 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7255
7354
|
_source_port
|
|
7256
7355
|
}
|
|
7257
7356
|
];
|
|
7357
|
+
if (element.is_covered_with_solder_mask) {
|
|
7358
|
+
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7359
|
+
const maskPrimitive = {
|
|
7360
|
+
_pcb_drawing_object_id: `polygon_${globalPcbDrawingObjectCount++}`,
|
|
7361
|
+
pcb_drawing_type: "polygon",
|
|
7362
|
+
points: normalizePolygonPoints(points),
|
|
7363
|
+
layer: maskLayer,
|
|
7364
|
+
_element: element,
|
|
7365
|
+
_parent_pcb_component,
|
|
7366
|
+
_parent_source_component,
|
|
7367
|
+
_source_port
|
|
7368
|
+
};
|
|
7369
|
+
if (element.solder_mask_color) {
|
|
7370
|
+
maskPrimitive.color = element.solder_mask_color;
|
|
7371
|
+
}
|
|
7372
|
+
primitives.push(maskPrimitive);
|
|
7373
|
+
}
|
|
7374
|
+
return primitives;
|
|
7258
7375
|
} else if (element.shape === "pill" || element.shape === "rotated_pill") {
|
|
7259
7376
|
const { x, y, width, height, layer } = element;
|
|
7260
|
-
|
|
7377
|
+
const primitives = [
|
|
7261
7378
|
{
|
|
7262
7379
|
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7263
7380
|
pcb_drawing_type: "pill",
|
|
@@ -7273,6 +7390,28 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7273
7390
|
ccw_rotation: element.ccw_rotation
|
|
7274
7391
|
}
|
|
7275
7392
|
];
|
|
7393
|
+
if (element.is_covered_with_solder_mask) {
|
|
7394
|
+
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7395
|
+
const maskPrimitive = {
|
|
7396
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7397
|
+
pcb_drawing_type: "pill",
|
|
7398
|
+
x,
|
|
7399
|
+
y,
|
|
7400
|
+
w: width,
|
|
7401
|
+
h: height,
|
|
7402
|
+
layer: maskLayer,
|
|
7403
|
+
_element: element,
|
|
7404
|
+
_parent_pcb_component,
|
|
7405
|
+
_parent_source_component,
|
|
7406
|
+
_source_port,
|
|
7407
|
+
ccw_rotation: element.ccw_rotation
|
|
7408
|
+
};
|
|
7409
|
+
if (element.solder_mask_color) {
|
|
7410
|
+
maskPrimitive.color = element.solder_mask_color;
|
|
7411
|
+
}
|
|
7412
|
+
primitives.push(maskPrimitive);
|
|
7413
|
+
}
|
|
7414
|
+
return primitives;
|
|
7276
7415
|
}
|
|
7277
7416
|
return [];
|
|
7278
7417
|
}
|
|
@@ -8543,6 +8682,14 @@ var colors_default = {
|
|
|
8543
8682
|
plated_hole: "rgb(26, 196, 210)",
|
|
8544
8683
|
ratsnest: "rgba(245, 255, 213, 0.702)",
|
|
8545
8684
|
select_overlay: "rgb(4, 255, 67)",
|
|
8685
|
+
soldermaskWithCopper: {
|
|
8686
|
+
top: "rgb(18, 82, 50)",
|
|
8687
|
+
bottom: "rgb(77, 127, 196)"
|
|
8688
|
+
},
|
|
8689
|
+
soldermask: {
|
|
8690
|
+
top: "rgb(12, 55, 33)",
|
|
8691
|
+
bottom: "rgb(12, 55, 33)"
|
|
8692
|
+
},
|
|
8546
8693
|
through_via: "rgb(236, 236, 236)",
|
|
8547
8694
|
user_1: "rgb(194, 194, 194)",
|
|
8548
8695
|
user_2: "rgb(89, 148, 220)",
|
|
@@ -8739,6 +8886,10 @@ var LAYER_NAME_TO_COLOR = {
|
|
|
8739
8886
|
bottom_silkscreen: colors_default.board.b_silks,
|
|
8740
8887
|
top_fabrication: colors_default.board.f_fab,
|
|
8741
8888
|
bottom_fabrication: colors_default.board.b_fab,
|
|
8889
|
+
soldermask_top: colors_default.board.soldermask.top,
|
|
8890
|
+
soldermask_bottom: colors_default.board.soldermask.bottom,
|
|
8891
|
+
soldermask_with_copper_top: colors_default.board.soldermaskWithCopper.top,
|
|
8892
|
+
soldermask_with_copper_bottom: colors_default.board.soldermaskWithCopper.bottom,
|
|
8742
8893
|
notes: colors_default.board.user_2,
|
|
8743
8894
|
...colors_default.board
|
|
8744
8895
|
};
|
|
@@ -8750,9 +8901,13 @@ var DEFAULT_DRAW_ORDER = [
|
|
|
8750
8901
|
"inner2",
|
|
8751
8902
|
"inner1",
|
|
8752
8903
|
"bottom",
|
|
8904
|
+
"soldermask_bottom",
|
|
8753
8905
|
"bottom_silkscreen",
|
|
8754
8906
|
"top",
|
|
8907
|
+
"soldermask_top",
|
|
8755
8908
|
"top_silkscreen",
|
|
8909
|
+
"soldermask_with_copper_bottom",
|
|
8910
|
+
"soldermask_with_copper_top",
|
|
8756
8911
|
"board"
|
|
8757
8912
|
];
|
|
8758
8913
|
var Drawer = class {
|
|
@@ -9044,23 +9199,27 @@ var Drawer = class {
|
|
|
9044
9199
|
*/
|
|
9045
9200
|
orderAndFadeLayers() {
|
|
9046
9201
|
const { canvasLayerMap, foregroundLayer } = this;
|
|
9202
|
+
const associatedSilkscreen = foregroundLayer === "top" ? "top_silkscreen" : foregroundLayer === "bottom" ? "bottom_silkscreen" : void 0;
|
|
9203
|
+
const maskWithCopperLayerForForeground = foregroundLayer === "top" ? "soldermask_with_copper_top" : foregroundLayer === "bottom" ? "soldermask_with_copper_bottom" : void 0;
|
|
9047
9204
|
const opaqueLayers = /* @__PURE__ */ new Set([
|
|
9048
9205
|
foregroundLayer,
|
|
9049
9206
|
"drill",
|
|
9050
9207
|
"other",
|
|
9051
9208
|
"board",
|
|
9052
|
-
|
|
9209
|
+
...associatedSilkscreen ? [associatedSilkscreen] : [],
|
|
9210
|
+
...maskWithCopperLayerForForeground ? [maskWithCopperLayerForForeground] : []
|
|
9053
9211
|
]);
|
|
9054
|
-
const associatedSilkscreen = foregroundLayer === "top" ? "top_silkscreen" : foregroundLayer === "bottom" ? "bottom_silkscreen" : void 0;
|
|
9055
9212
|
const layersToShiftToTop = [
|
|
9056
9213
|
foregroundLayer,
|
|
9057
|
-
...associatedSilkscreen ? [associatedSilkscreen] : []
|
|
9214
|
+
...associatedSilkscreen ? [associatedSilkscreen] : [],
|
|
9215
|
+
...maskWithCopperLayerForForeground ? [maskWithCopperLayerForForeground] : []
|
|
9058
9216
|
];
|
|
9059
9217
|
const order = [
|
|
9060
9218
|
...DEFAULT_DRAW_ORDER.filter(
|
|
9061
9219
|
(l) => !layersToShiftToTop.includes(l)
|
|
9062
9220
|
),
|
|
9063
9221
|
foregroundLayer,
|
|
9222
|
+
...maskWithCopperLayerForForeground ? [maskWithCopperLayerForForeground] : [],
|
|
9064
9223
|
"drill",
|
|
9065
9224
|
...associatedSilkscreen ? [associatedSilkscreen] : []
|
|
9066
9225
|
];
|
|
@@ -9497,7 +9656,11 @@ var orderedLayers = [
|
|
|
9497
9656
|
"board",
|
|
9498
9657
|
"bottom_silkscreen",
|
|
9499
9658
|
"bottom",
|
|
9659
|
+
"soldermask_bottom",
|
|
9500
9660
|
"top",
|
|
9661
|
+
"soldermask_top",
|
|
9662
|
+
"soldermask_with_copper_bottom",
|
|
9663
|
+
"soldermask_with_copper_top",
|
|
9501
9664
|
"top_silkscreen",
|
|
9502
9665
|
"inner1",
|
|
9503
9666
|
"inner2",
|
|
@@ -9518,16 +9681,28 @@ var CanvasPrimitiveRenderer = ({
|
|
|
9518
9681
|
}) => {
|
|
9519
9682
|
const canvasRefs = useRef2({});
|
|
9520
9683
|
const selectedLayer = useGlobalStore((s) => s.selected_layer);
|
|
9684
|
+
const isShowingSolderMask = useGlobalStore((s) => s.is_showing_solder_mask);
|
|
9521
9685
|
useEffect4(() => {
|
|
9522
9686
|
if (!canvasRefs.current) return;
|
|
9523
9687
|
if (Object.keys(canvasRefs.current).length === 0) return;
|
|
9524
|
-
const
|
|
9688
|
+
const filteredCanvasRefs = Object.fromEntries(
|
|
9689
|
+
Object.entries(canvasRefs.current).filter(([layer, canvas]) => {
|
|
9690
|
+
if (!canvas) return false;
|
|
9691
|
+
if (!isShowingSolderMask && layer.includes("soldermask")) {
|
|
9692
|
+
return false;
|
|
9693
|
+
}
|
|
9694
|
+
return true;
|
|
9695
|
+
})
|
|
9696
|
+
);
|
|
9697
|
+
if (Object.keys(filteredCanvasRefs).length === 0) return;
|
|
9698
|
+
const drawer = new Drawer(filteredCanvasRefs);
|
|
9525
9699
|
if (transform) drawer.transform = transform;
|
|
9526
9700
|
drawer.clear();
|
|
9527
9701
|
drawer.foregroundLayer = selectedLayer;
|
|
9528
|
-
|
|
9702
|
+
const filteredPrimitives = isShowingSolderMask ? primitives : primitives.filter((p) => !p.layer?.includes("soldermask"));
|
|
9703
|
+
drawPrimitives(drawer, filteredPrimitives);
|
|
9529
9704
|
drawer.orderAndFadeLayers();
|
|
9530
|
-
}, [primitives, transform, selectedLayer]);
|
|
9705
|
+
}, [primitives, transform, selectedLayer, isShowingSolderMask]);
|
|
9531
9706
|
return /* @__PURE__ */ jsxs(
|
|
9532
9707
|
"div",
|
|
9533
9708
|
{
|
|
@@ -9551,13 +9726,22 @@ var CanvasPrimitiveRenderer = ({
|
|
|
9551
9726
|
stringifyCoord: (x, y, z) => `${toMMSI(x, z)}, ${toMMSI(y, z)}`
|
|
9552
9727
|
}
|
|
9553
9728
|
),
|
|
9554
|
-
orderedLayers.
|
|
9729
|
+
orderedLayers.filter((layer) => {
|
|
9730
|
+
if (!isShowingSolderMask) {
|
|
9731
|
+
return !layer.includes("soldermask");
|
|
9732
|
+
}
|
|
9733
|
+
return true;
|
|
9734
|
+
}).map((l) => l.replace(/-/g, "")).map((layer, i) => /* @__PURE__ */ jsx3(
|
|
9555
9735
|
"canvas",
|
|
9556
9736
|
{
|
|
9557
9737
|
className: `pcb-layer-${layer}`,
|
|
9558
9738
|
ref: (el) => {
|
|
9559
9739
|
canvasRefs.current ??= {};
|
|
9560
|
-
|
|
9740
|
+
if (el) {
|
|
9741
|
+
canvasRefs.current[layer] = el;
|
|
9742
|
+
} else {
|
|
9743
|
+
delete canvasRefs.current[layer];
|
|
9744
|
+
}
|
|
9561
9745
|
},
|
|
9562
9746
|
style: {
|
|
9563
9747
|
position: "absolute",
|
|
@@ -13077,7 +13261,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
13077
13261
|
// package.json
|
|
13078
13262
|
var package_default = {
|
|
13079
13263
|
name: "@tscircuit/pcb-viewer",
|
|
13080
|
-
version: "1.11.
|
|
13264
|
+
version: "1.11.268",
|
|
13081
13265
|
main: "dist/index.js",
|
|
13082
13266
|
type: "module",
|
|
13083
13267
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -13345,6 +13529,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13345
13529
|
setIsShowingCopperPours,
|
|
13346
13530
|
setIsShowingPcbGroups,
|
|
13347
13531
|
setIsShowingGroupAnchorOffsets,
|
|
13532
|
+
setIsShowingSolderMask,
|
|
13348
13533
|
setPcbGroupViewMode,
|
|
13349
13534
|
setHoveredErrorId
|
|
13350
13535
|
} = useGlobalStore((s) => ({
|
|
@@ -13364,6 +13549,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13364
13549
|
is_showing_copper_pours: s.is_showing_copper_pours,
|
|
13365
13550
|
is_showing_pcb_groups: s.is_showing_pcb_groups,
|
|
13366
13551
|
is_showing_group_anchor_offsets: s.is_showing_group_anchor_offsets,
|
|
13552
|
+
is_showing_solder_mask: s.is_showing_solder_mask,
|
|
13367
13553
|
pcb_group_view_mode: s.pcb_group_view_mode
|
|
13368
13554
|
},
|
|
13369
13555
|
setEditMode: s.setEditMode,
|
|
@@ -13374,6 +13560,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13374
13560
|
setIsShowingCopperPours: s.setIsShowingCopperPours,
|
|
13375
13561
|
setIsShowingPcbGroups: s.setIsShowingPcbGroups,
|
|
13376
13562
|
setIsShowingGroupAnchorOffsets: s.setIsShowingGroupAnchorOffsets,
|
|
13563
|
+
setIsShowingSolderMask: s.setIsShowingSolderMask,
|
|
13377
13564
|
setPcbGroupViewMode: s.setPcbGroupViewMode,
|
|
13378
13565
|
setHoveredErrorId: s.setHoveredErrorId
|
|
13379
13566
|
}));
|
|
@@ -13863,6 +14050,16 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13863
14050
|
}
|
|
13864
14051
|
}
|
|
13865
14052
|
),
|
|
14053
|
+
/* @__PURE__ */ jsx16(
|
|
14054
|
+
CheckboxMenuItem,
|
|
14055
|
+
{
|
|
14056
|
+
label: "Show Solder Mask",
|
|
14057
|
+
checked: viewSettings.is_showing_solder_mask,
|
|
14058
|
+
onClick: () => {
|
|
14059
|
+
setIsShowingSolderMask(!viewSettings.is_showing_solder_mask);
|
|
14060
|
+
}
|
|
14061
|
+
}
|
|
14062
|
+
),
|
|
13866
14063
|
/* @__PURE__ */ jsx16(
|
|
13867
14064
|
CheckboxMenuItem,
|
|
13868
14065
|
{
|