@tscircuit/pcb-viewer 1.11.269 → 1.11.270
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 +421 -53
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7262,7 +7262,7 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7262
7262
|
}
|
|
7263
7263
|
case "pcb_smtpad": {
|
|
7264
7264
|
if (element.shape === "rect" || element.shape === "rotated_rect") {
|
|
7265
|
-
const {
|
|
7265
|
+
const { x, y, width, height, layer, rect_border_radius } = element;
|
|
7266
7266
|
const corner_radius = element.corner_radius ?? rect_border_radius ?? 0;
|
|
7267
7267
|
const primitives = [
|
|
7268
7268
|
{
|
|
@@ -7282,26 +7282,146 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7282
7282
|
}
|
|
7283
7283
|
];
|
|
7284
7284
|
if (element.is_covered_with_solder_mask) {
|
|
7285
|
+
const rawMargin = element.soldermask_margin;
|
|
7285
7286
|
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7287
|
+
if (rawMargin === void 0 || rawMargin === null) {
|
|
7288
|
+
const soldermask_margin2 = 0;
|
|
7289
|
+
const openingWidth = Math.max(0.01, width + 2 * soldermask_margin2);
|
|
7290
|
+
const openingHeight = Math.max(0.01, height + 2 * soldermask_margin2);
|
|
7291
|
+
const openingPrimitive = {
|
|
7292
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7293
|
+
pcb_drawing_type: "rect",
|
|
7294
|
+
x,
|
|
7295
|
+
y,
|
|
7296
|
+
w: openingWidth,
|
|
7297
|
+
h: openingHeight,
|
|
7298
|
+
layer: maskLayer,
|
|
7299
|
+
_element: element,
|
|
7300
|
+
_parent_pcb_component,
|
|
7301
|
+
_parent_source_component,
|
|
7302
|
+
_source_port,
|
|
7303
|
+
ccw_rotation: element.ccw_rotation,
|
|
7304
|
+
roundness: corner_radius
|
|
7305
|
+
};
|
|
7306
|
+
if (element.solder_mask_color) {
|
|
7307
|
+
openingPrimitive.color = element.solder_mask_color;
|
|
7308
|
+
}
|
|
7309
|
+
primitives.push(openingPrimitive);
|
|
7310
|
+
const maskCoverageLayer = layer === "bottom" ? "soldermask_bottom" : "soldermask_top";
|
|
7311
|
+
const fullMaskCoverage = {
|
|
7312
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7313
|
+
pcb_drawing_type: "rect",
|
|
7314
|
+
x,
|
|
7315
|
+
y,
|
|
7316
|
+
w: width,
|
|
7317
|
+
h: height,
|
|
7318
|
+
layer: maskCoverageLayer,
|
|
7319
|
+
_element: element,
|
|
7320
|
+
_parent_pcb_component,
|
|
7321
|
+
_parent_source_component,
|
|
7322
|
+
_source_port,
|
|
7323
|
+
ccw_rotation: element.ccw_rotation,
|
|
7324
|
+
roundness: corner_radius
|
|
7325
|
+
};
|
|
7326
|
+
primitives.push(fullMaskCoverage);
|
|
7327
|
+
const cutoutOpening = {
|
|
7328
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7329
|
+
pcb_drawing_type: "rect",
|
|
7330
|
+
x,
|
|
7331
|
+
y,
|
|
7332
|
+
w: openingWidth,
|
|
7333
|
+
h: openingHeight,
|
|
7334
|
+
layer: maskCoverageLayer,
|
|
7335
|
+
_element: element,
|
|
7336
|
+
_parent_pcb_component,
|
|
7337
|
+
_parent_source_component,
|
|
7338
|
+
_source_port,
|
|
7339
|
+
ccw_rotation: element.ccw_rotation,
|
|
7340
|
+
roundness: corner_radius,
|
|
7341
|
+
composite_mode: "destination-out"
|
|
7342
|
+
};
|
|
7343
|
+
primitives.push(cutoutOpening);
|
|
7344
|
+
return primitives;
|
|
7345
|
+
}
|
|
7346
|
+
const soldermask_margin = rawMargin;
|
|
7347
|
+
if (soldermask_margin === 0) {
|
|
7348
|
+
return primitives;
|
|
7349
|
+
}
|
|
7350
|
+
if (soldermask_margin > 0) {
|
|
7351
|
+
const marginRing = {
|
|
7352
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7353
|
+
pcb_drawing_type: "rect",
|
|
7354
|
+
x,
|
|
7355
|
+
y,
|
|
7356
|
+
w: width + 2 * soldermask_margin,
|
|
7357
|
+
h: height + 2 * soldermask_margin,
|
|
7358
|
+
layer: maskLayer,
|
|
7359
|
+
_element: element,
|
|
7360
|
+
_parent_pcb_component,
|
|
7361
|
+
_parent_source_component,
|
|
7362
|
+
_source_port,
|
|
7363
|
+
ccw_rotation: element.ccw_rotation,
|
|
7364
|
+
roundness: corner_radius,
|
|
7365
|
+
color: "rgb(201, 162, 110)"
|
|
7366
|
+
};
|
|
7367
|
+
primitives.push(marginRing);
|
|
7368
|
+
const cutout = {
|
|
7369
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7370
|
+
pcb_drawing_type: "rect",
|
|
7371
|
+
x,
|
|
7372
|
+
y,
|
|
7373
|
+
w: width,
|
|
7374
|
+
h: height,
|
|
7375
|
+
layer: maskLayer,
|
|
7376
|
+
_element: element,
|
|
7377
|
+
_parent_pcb_component,
|
|
7378
|
+
_parent_source_component,
|
|
7379
|
+
_source_port,
|
|
7380
|
+
ccw_rotation: element.ccw_rotation,
|
|
7381
|
+
roundness: corner_radius,
|
|
7382
|
+
composite_mode: "destination-out"
|
|
7383
|
+
};
|
|
7384
|
+
primitives.push(cutout);
|
|
7385
|
+
} else {
|
|
7386
|
+
const openingWidth = Math.max(0.01, width + 2 * soldermask_margin);
|
|
7387
|
+
const openingHeight = Math.max(0.01, height + 2 * soldermask_margin);
|
|
7388
|
+
const innerRingBase = {
|
|
7389
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7390
|
+
pcb_drawing_type: "rect",
|
|
7391
|
+
x,
|
|
7392
|
+
y,
|
|
7393
|
+
w: width,
|
|
7394
|
+
h: height,
|
|
7395
|
+
layer: maskLayer,
|
|
7396
|
+
_element: element,
|
|
7397
|
+
_parent_pcb_component,
|
|
7398
|
+
_parent_source_component,
|
|
7399
|
+
_source_port,
|
|
7400
|
+
ccw_rotation: element.ccw_rotation,
|
|
7401
|
+
roundness: corner_radius
|
|
7402
|
+
};
|
|
7403
|
+
if (element.solder_mask_color) {
|
|
7404
|
+
innerRingBase.color = element.solder_mask_color;
|
|
7405
|
+
}
|
|
7406
|
+
primitives.push(innerRingBase);
|
|
7407
|
+
const innerCutout = {
|
|
7408
|
+
_pcb_drawing_object_id: `rect_${globalPcbDrawingObjectCount++}`,
|
|
7409
|
+
pcb_drawing_type: "rect",
|
|
7410
|
+
x,
|
|
7411
|
+
y,
|
|
7412
|
+
w: openingWidth,
|
|
7413
|
+
h: openingHeight,
|
|
7414
|
+
layer: maskLayer,
|
|
7415
|
+
_element: element,
|
|
7416
|
+
_parent_pcb_component,
|
|
7417
|
+
_parent_source_component,
|
|
7418
|
+
_source_port,
|
|
7419
|
+
ccw_rotation: element.ccw_rotation,
|
|
7420
|
+
roundness: corner_radius,
|
|
7421
|
+
composite_mode: "destination-out"
|
|
7422
|
+
};
|
|
7423
|
+
primitives.push(innerCutout);
|
|
7303
7424
|
}
|
|
7304
|
-
primitives.push(maskPrimitive);
|
|
7305
7425
|
}
|
|
7306
7426
|
return primitives;
|
|
7307
7427
|
} else if (element.shape === "circle") {
|
|
@@ -7321,23 +7441,123 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7321
7441
|
}
|
|
7322
7442
|
];
|
|
7323
7443
|
if (element.is_covered_with_solder_mask) {
|
|
7444
|
+
const rawMargin = element.soldermask_margin;
|
|
7324
7445
|
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7446
|
+
if (rawMargin === void 0 || rawMargin === null) {
|
|
7447
|
+
const soldermask_margin2 = 0;
|
|
7448
|
+
const openingRadius = Math.max(0.01, radius + soldermask_margin2);
|
|
7449
|
+
const openingPrimitive = {
|
|
7450
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7451
|
+
pcb_drawing_type: "circle",
|
|
7452
|
+
x,
|
|
7453
|
+
y,
|
|
7454
|
+
r: openingRadius,
|
|
7455
|
+
layer: maskLayer,
|
|
7456
|
+
_element: element,
|
|
7457
|
+
_parent_pcb_component,
|
|
7458
|
+
_parent_source_component,
|
|
7459
|
+
_source_port
|
|
7460
|
+
};
|
|
7461
|
+
if (element.solder_mask_color) {
|
|
7462
|
+
openingPrimitive.color = element.solder_mask_color;
|
|
7463
|
+
}
|
|
7464
|
+
primitives.push(openingPrimitive);
|
|
7465
|
+
const maskCoverageLayer = layer === "bottom" ? "soldermask_bottom" : "soldermask_top";
|
|
7466
|
+
const fullMaskCoverage = {
|
|
7467
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7468
|
+
pcb_drawing_type: "circle",
|
|
7469
|
+
x,
|
|
7470
|
+
y,
|
|
7471
|
+
r: radius,
|
|
7472
|
+
layer: maskCoverageLayer,
|
|
7473
|
+
_element: element,
|
|
7474
|
+
_parent_pcb_component,
|
|
7475
|
+
_parent_source_component,
|
|
7476
|
+
_source_port
|
|
7477
|
+
};
|
|
7478
|
+
primitives.push(fullMaskCoverage);
|
|
7479
|
+
const cutoutOpening = {
|
|
7480
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7481
|
+
pcb_drawing_type: "circle",
|
|
7482
|
+
x,
|
|
7483
|
+
y,
|
|
7484
|
+
r: openingRadius,
|
|
7485
|
+
layer: maskCoverageLayer,
|
|
7486
|
+
_element: element,
|
|
7487
|
+
_parent_pcb_component,
|
|
7488
|
+
_parent_source_component,
|
|
7489
|
+
_source_port,
|
|
7490
|
+
composite_mode: "destination-out"
|
|
7491
|
+
};
|
|
7492
|
+
primitives.push(cutoutOpening);
|
|
7493
|
+
return primitives;
|
|
7494
|
+
}
|
|
7495
|
+
const soldermask_margin = rawMargin;
|
|
7496
|
+
if (soldermask_margin === 0) {
|
|
7497
|
+
return primitives;
|
|
7498
|
+
}
|
|
7499
|
+
if (soldermask_margin > 0) {
|
|
7500
|
+
const marginRing = {
|
|
7501
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7502
|
+
pcb_drawing_type: "circle",
|
|
7503
|
+
x,
|
|
7504
|
+
y,
|
|
7505
|
+
r: radius + soldermask_margin,
|
|
7506
|
+
layer: maskLayer,
|
|
7507
|
+
_element: element,
|
|
7508
|
+
_parent_pcb_component,
|
|
7509
|
+
_parent_source_component,
|
|
7510
|
+
_source_port,
|
|
7511
|
+
color: "rgb(201, 162, 110)"
|
|
7512
|
+
};
|
|
7513
|
+
primitives.push(marginRing);
|
|
7514
|
+
const cutout = {
|
|
7515
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7516
|
+
pcb_drawing_type: "circle",
|
|
7517
|
+
x,
|
|
7518
|
+
y,
|
|
7519
|
+
r: radius,
|
|
7520
|
+
layer: maskLayer,
|
|
7521
|
+
_element: element,
|
|
7522
|
+
_parent_pcb_component,
|
|
7523
|
+
_parent_source_component,
|
|
7524
|
+
_source_port,
|
|
7525
|
+
composite_mode: "destination-out"
|
|
7526
|
+
};
|
|
7527
|
+
primitives.push(cutout);
|
|
7528
|
+
} else {
|
|
7529
|
+
const openingRadius = Math.max(0.01, radius + soldermask_margin);
|
|
7530
|
+
const innerRingBase = {
|
|
7531
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7532
|
+
pcb_drawing_type: "circle",
|
|
7533
|
+
x,
|
|
7534
|
+
y,
|
|
7535
|
+
r: radius,
|
|
7536
|
+
layer: maskLayer,
|
|
7537
|
+
_element: element,
|
|
7538
|
+
_parent_pcb_component,
|
|
7539
|
+
_parent_source_component,
|
|
7540
|
+
_source_port
|
|
7541
|
+
};
|
|
7542
|
+
if (element.solder_mask_color) {
|
|
7543
|
+
innerRingBase.color = element.solder_mask_color;
|
|
7544
|
+
}
|
|
7545
|
+
primitives.push(innerRingBase);
|
|
7546
|
+
const innerCutout = {
|
|
7547
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7548
|
+
pcb_drawing_type: "circle",
|
|
7549
|
+
x,
|
|
7550
|
+
y,
|
|
7551
|
+
r: openingRadius,
|
|
7552
|
+
layer: maskLayer,
|
|
7553
|
+
_element: element,
|
|
7554
|
+
_parent_pcb_component,
|
|
7555
|
+
_parent_source_component,
|
|
7556
|
+
_source_port,
|
|
7557
|
+
composite_mode: "destination-out"
|
|
7558
|
+
};
|
|
7559
|
+
primitives.push(innerCutout);
|
|
7339
7560
|
}
|
|
7340
|
-
primitives.push(maskPrimitive);
|
|
7341
7561
|
}
|
|
7342
7562
|
return primitives;
|
|
7343
7563
|
} else if (element.shape === "polygon") {
|
|
@@ -7391,25 +7611,139 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7391
7611
|
}
|
|
7392
7612
|
];
|
|
7393
7613
|
if (element.is_covered_with_solder_mask) {
|
|
7614
|
+
const rawMargin = element.soldermask_margin;
|
|
7394
7615
|
const maskLayer = layer === "bottom" ? "soldermask_with_copper_bottom" : "soldermask_with_copper_top";
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7616
|
+
if (rawMargin === void 0 || rawMargin === null) {
|
|
7617
|
+
const soldermask_margin2 = 0;
|
|
7618
|
+
const openingWidth = Math.max(0.01, width + 2 * soldermask_margin2);
|
|
7619
|
+
const openingHeight = Math.max(0.01, height + 2 * soldermask_margin2);
|
|
7620
|
+
const openingPrimitive = {
|
|
7621
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7622
|
+
pcb_drawing_type: "pill",
|
|
7623
|
+
x,
|
|
7624
|
+
y,
|
|
7625
|
+
w: openingWidth,
|
|
7626
|
+
h: openingHeight,
|
|
7627
|
+
layer: maskLayer,
|
|
7628
|
+
_element: element,
|
|
7629
|
+
_parent_pcb_component,
|
|
7630
|
+
_parent_source_component,
|
|
7631
|
+
_source_port,
|
|
7632
|
+
ccw_rotation: element.ccw_rotation
|
|
7633
|
+
};
|
|
7634
|
+
if (element.solder_mask_color) {
|
|
7635
|
+
openingPrimitive.color = element.solder_mask_color;
|
|
7636
|
+
}
|
|
7637
|
+
primitives.push(openingPrimitive);
|
|
7638
|
+
const maskCoverageLayer = layer === "bottom" ? "soldermask_bottom" : "soldermask_top";
|
|
7639
|
+
const fullMaskCoverage = {
|
|
7640
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7641
|
+
pcb_drawing_type: "pill",
|
|
7642
|
+
x,
|
|
7643
|
+
y,
|
|
7644
|
+
w: width,
|
|
7645
|
+
h: height,
|
|
7646
|
+
layer: maskCoverageLayer,
|
|
7647
|
+
_element: element,
|
|
7648
|
+
_parent_pcb_component,
|
|
7649
|
+
_parent_source_component,
|
|
7650
|
+
_source_port,
|
|
7651
|
+
ccw_rotation: element.ccw_rotation
|
|
7652
|
+
};
|
|
7653
|
+
primitives.push(fullMaskCoverage);
|
|
7654
|
+
const cutoutOpening = {
|
|
7655
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7656
|
+
pcb_drawing_type: "pill",
|
|
7657
|
+
x,
|
|
7658
|
+
y,
|
|
7659
|
+
w: openingWidth,
|
|
7660
|
+
h: openingHeight,
|
|
7661
|
+
layer: maskCoverageLayer,
|
|
7662
|
+
_element: element,
|
|
7663
|
+
_parent_pcb_component,
|
|
7664
|
+
_parent_source_component,
|
|
7665
|
+
_source_port,
|
|
7666
|
+
ccw_rotation: element.ccw_rotation,
|
|
7667
|
+
composite_mode: "destination-out"
|
|
7668
|
+
};
|
|
7669
|
+
primitives.push(cutoutOpening);
|
|
7670
|
+
return primitives;
|
|
7671
|
+
}
|
|
7672
|
+
const soldermask_margin = rawMargin;
|
|
7673
|
+
if (soldermask_margin === 0) {
|
|
7674
|
+
return primitives;
|
|
7675
|
+
}
|
|
7676
|
+
if (soldermask_margin > 0) {
|
|
7677
|
+
const marginRing = {
|
|
7678
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7679
|
+
pcb_drawing_type: "pill",
|
|
7680
|
+
x,
|
|
7681
|
+
y,
|
|
7682
|
+
w: width + 2 * soldermask_margin,
|
|
7683
|
+
h: height + 2 * soldermask_margin,
|
|
7684
|
+
layer: maskLayer,
|
|
7685
|
+
_element: element,
|
|
7686
|
+
_parent_pcb_component,
|
|
7687
|
+
_parent_source_component,
|
|
7688
|
+
_source_port,
|
|
7689
|
+
ccw_rotation: element.ccw_rotation,
|
|
7690
|
+
color: "rgb(201, 162, 110)"
|
|
7691
|
+
};
|
|
7692
|
+
primitives.push(marginRing);
|
|
7693
|
+
const cutout = {
|
|
7694
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7695
|
+
pcb_drawing_type: "pill",
|
|
7696
|
+
x,
|
|
7697
|
+
y,
|
|
7698
|
+
w: width,
|
|
7699
|
+
h: height,
|
|
7700
|
+
layer: maskLayer,
|
|
7701
|
+
_element: element,
|
|
7702
|
+
_parent_pcb_component,
|
|
7703
|
+
_parent_source_component,
|
|
7704
|
+
_source_port,
|
|
7705
|
+
ccw_rotation: element.ccw_rotation,
|
|
7706
|
+
composite_mode: "destination-out"
|
|
7707
|
+
};
|
|
7708
|
+
primitives.push(cutout);
|
|
7709
|
+
} else {
|
|
7710
|
+
const openingWidth = Math.max(0.01, width + 2 * soldermask_margin);
|
|
7711
|
+
const openingHeight = Math.max(0.01, height + 2 * soldermask_margin);
|
|
7712
|
+
const innerRingBase = {
|
|
7713
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7714
|
+
pcb_drawing_type: "pill",
|
|
7715
|
+
x,
|
|
7716
|
+
y,
|
|
7717
|
+
w: width,
|
|
7718
|
+
h: height,
|
|
7719
|
+
layer: maskLayer,
|
|
7720
|
+
_element: element,
|
|
7721
|
+
_parent_pcb_component,
|
|
7722
|
+
_parent_source_component,
|
|
7723
|
+
_source_port,
|
|
7724
|
+
ccw_rotation: element.ccw_rotation
|
|
7725
|
+
};
|
|
7726
|
+
if (element.solder_mask_color) {
|
|
7727
|
+
innerRingBase.color = element.solder_mask_color;
|
|
7728
|
+
}
|
|
7729
|
+
primitives.push(innerRingBase);
|
|
7730
|
+
const innerCutout = {
|
|
7731
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7732
|
+
pcb_drawing_type: "pill",
|
|
7733
|
+
x,
|
|
7734
|
+
y,
|
|
7735
|
+
w: openingWidth,
|
|
7736
|
+
h: openingHeight,
|
|
7737
|
+
layer: maskLayer,
|
|
7738
|
+
_element: element,
|
|
7739
|
+
_parent_pcb_component,
|
|
7740
|
+
_parent_source_component,
|
|
7741
|
+
_source_port,
|
|
7742
|
+
ccw_rotation: element.ccw_rotation,
|
|
7743
|
+
composite_mode: "destination-out"
|
|
7744
|
+
};
|
|
7745
|
+
primitives.push(innerCutout);
|
|
7411
7746
|
}
|
|
7412
|
-
primitives.push(maskPrimitive);
|
|
7413
7747
|
}
|
|
7414
7748
|
return primitives;
|
|
7415
7749
|
}
|
|
@@ -8918,6 +9252,7 @@ var Drawer = class {
|
|
|
8918
9252
|
transform;
|
|
8919
9253
|
foregroundLayer = "top";
|
|
8920
9254
|
lastPoint;
|
|
9255
|
+
_tempCompositeMode;
|
|
8921
9256
|
constructor(canvasLayerMap) {
|
|
8922
9257
|
this.canvasLayerMap = canvasLayerMap;
|
|
8923
9258
|
this.ctxLayerMap = Object.fromEntries(
|
|
@@ -9258,6 +9593,9 @@ var Drawer = class {
|
|
|
9258
9593
|
ctx.fillStyle = "rgba(0,0,0,1)";
|
|
9259
9594
|
ctx.strokeStyle = "rgba(0,0,0,1)";
|
|
9260
9595
|
}
|
|
9596
|
+
if (this._tempCompositeMode) {
|
|
9597
|
+
ctx.globalCompositeOperation = this._tempCompositeMode;
|
|
9598
|
+
}
|
|
9261
9599
|
ctx.font = `${scaleOnly(inverse(transform), fontSize)}px sans-serif`;
|
|
9262
9600
|
}
|
|
9263
9601
|
moveTo(x, y) {
|
|
@@ -9547,6 +9885,9 @@ var drawRect = (drawer, rect) => {
|
|
|
9547
9885
|
layer: rect.layer,
|
|
9548
9886
|
size: rect.stroke_width
|
|
9549
9887
|
});
|
|
9888
|
+
if (rect.composite_mode) {
|
|
9889
|
+
drawer._tempCompositeMode = rect.composite_mode;
|
|
9890
|
+
}
|
|
9550
9891
|
drawer.rect({
|
|
9551
9892
|
x: rect.x,
|
|
9552
9893
|
y: rect.y,
|
|
@@ -9559,12 +9900,18 @@ var drawRect = (drawer, rect) => {
|
|
|
9559
9900
|
stroke_width: rect.stroke_width,
|
|
9560
9901
|
roundness: rect.roundness
|
|
9561
9902
|
});
|
|
9903
|
+
if (rect.composite_mode) {
|
|
9904
|
+
drawer._tempCompositeMode = void 0;
|
|
9905
|
+
}
|
|
9562
9906
|
};
|
|
9563
9907
|
var drawRotatedRect = (drawer, rect) => {
|
|
9564
9908
|
drawer.equip({
|
|
9565
9909
|
color: getColor(rect),
|
|
9566
9910
|
layer: rect.layer
|
|
9567
9911
|
});
|
|
9912
|
+
if (rect.composite_mode) {
|
|
9913
|
+
drawer._tempCompositeMode = rect.composite_mode;
|
|
9914
|
+
}
|
|
9568
9915
|
drawer.rotatedRect(
|
|
9569
9916
|
rect.x,
|
|
9570
9917
|
rect.y,
|
|
@@ -9574,20 +9921,35 @@ var drawRotatedRect = (drawer, rect) => {
|
|
|
9574
9921
|
rect.roundness,
|
|
9575
9922
|
rect.mesh_fill
|
|
9576
9923
|
);
|
|
9924
|
+
if (rect.composite_mode) {
|
|
9925
|
+
drawer._tempCompositeMode = void 0;
|
|
9926
|
+
}
|
|
9577
9927
|
};
|
|
9578
9928
|
var drawRotatedPill = (drawer, pill) => {
|
|
9579
9929
|
drawer.equip({
|
|
9580
9930
|
color: getColor(pill),
|
|
9581
9931
|
layer: pill.layer
|
|
9582
9932
|
});
|
|
9933
|
+
if (pill.composite_mode) {
|
|
9934
|
+
drawer._tempCompositeMode = pill.composite_mode;
|
|
9935
|
+
}
|
|
9583
9936
|
drawer.rotatedPill(pill.x, pill.y, pill.w, pill.h, pill.ccw_rotation);
|
|
9937
|
+
if (pill.composite_mode) {
|
|
9938
|
+
drawer._tempCompositeMode = void 0;
|
|
9939
|
+
}
|
|
9584
9940
|
};
|
|
9585
9941
|
var drawCircle = (drawer, circle) => {
|
|
9586
9942
|
drawer.equip({
|
|
9587
9943
|
color: getColor(circle),
|
|
9588
9944
|
layer: circle.layer
|
|
9589
9945
|
});
|
|
9946
|
+
if (circle.composite_mode) {
|
|
9947
|
+
drawer._tempCompositeMode = circle.composite_mode;
|
|
9948
|
+
}
|
|
9590
9949
|
drawer.circle(circle.x, circle.y, circle.r, circle.mesh_fill);
|
|
9950
|
+
if (circle.composite_mode) {
|
|
9951
|
+
drawer._tempCompositeMode = void 0;
|
|
9952
|
+
}
|
|
9591
9953
|
};
|
|
9592
9954
|
var drawOval = (drawer, oval) => {
|
|
9593
9955
|
drawer.equip({
|
|
@@ -9601,7 +9963,13 @@ var drawPill = (drawer, pill) => {
|
|
|
9601
9963
|
color: getColor(pill),
|
|
9602
9964
|
layer: pill.layer
|
|
9603
9965
|
});
|
|
9966
|
+
if (pill.composite_mode) {
|
|
9967
|
+
drawer._tempCompositeMode = pill.composite_mode;
|
|
9968
|
+
}
|
|
9604
9969
|
drawer.pill(pill.x, pill.y, pill.w, pill.h);
|
|
9970
|
+
if (pill.composite_mode) {
|
|
9971
|
+
drawer._tempCompositeMode = void 0;
|
|
9972
|
+
}
|
|
9605
9973
|
};
|
|
9606
9974
|
var drawPolygon = (drawer, polygon) => {
|
|
9607
9975
|
drawer.equip({
|
|
@@ -13261,7 +13629,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
13261
13629
|
// package.json
|
|
13262
13630
|
var package_default = {
|
|
13263
13631
|
name: "@tscircuit/pcb-viewer",
|
|
13264
|
-
version: "1.11.
|
|
13632
|
+
version: "1.11.269",
|
|
13265
13633
|
main: "dist/index.js",
|
|
13266
13634
|
type: "module",
|
|
13267
13635
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -13314,7 +13682,7 @@ var package_default = {
|
|
|
13314
13682
|
"@tscircuit/alphabet": "^0.0.3",
|
|
13315
13683
|
"@tscircuit/math-utils": "^0.0.29",
|
|
13316
13684
|
"@vitejs/plugin-react": "^5.0.2",
|
|
13317
|
-
"circuit-json": "^0.0.
|
|
13685
|
+
"circuit-json": "^0.0.325",
|
|
13318
13686
|
"circuit-to-svg": "^0.0.271",
|
|
13319
13687
|
color: "^4.2.3",
|
|
13320
13688
|
"react-supergrid": "^1.0.10",
|