circuit-json-to-lbrn 0.0.15 → 0.0.16

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  // lib/index.ts
2
- import { LightBurnProject, CutSetting, ShapePath as ShapePath15 } from "lbrnts";
2
+ import { LightBurnProject, CutSetting, ShapePath as ShapePath16 } from "lbrnts";
3
3
  import { cju as cju2 } from "@tscircuit/circuit-json-util";
4
4
 
5
5
  // lib/element-handlers/addPlatedHole/addCirclePlatedHole.ts
@@ -602,9 +602,9 @@ import { ShapePath as ShapePath6 } from "lbrnts";
602
602
  // lib/helpers/polygonShape.ts
603
603
  var createPolygonPathFromOutline = (outline, offsetX, offsetY) => {
604
604
  const verts = [];
605
- for (const point5 of outline) {
606
- const x = (point5.x ?? 0) + offsetX;
607
- const y = (point5.y ?? 0) + offsetY;
605
+ for (const point6 of outline) {
606
+ const x = (point6.x ?? 0) + offsetX;
607
+ const y = (point6.y ?? 0) + offsetY;
608
608
  verts.push({ x, y });
609
609
  }
610
610
  if (verts.length === 0) {
@@ -1207,7 +1207,7 @@ var addPcbTrace = (trace, ctx) => {
1207
1207
  return;
1208
1208
  }
1209
1209
  const { route } = trace;
1210
- const traceWidth = route.find((point5) => point5.route_type === "wire")?.width ?? 0.15;
1210
+ const traceWidth = route.find((point6) => point6.route_type === "wire")?.width ?? 0.15;
1211
1211
  const polygons = [];
1212
1212
  for (const routePoint of route) {
1213
1213
  const circle = new Flatten2.Circle(
@@ -1341,14 +1341,14 @@ var calculateCircuitBounds = (circuitJson) => {
1341
1341
  }
1342
1342
  }
1343
1343
  for (const trace of db.pcb_trace.list()) {
1344
- const isWidthPoint = (point5) => "width" in point5 && typeof point5.width === "number";
1344
+ const isWidthPoint = (point6) => "width" in point6 && typeof point6.width === "number";
1345
1345
  const halfWidth = trace.route_thickness_mode === "interpolated" ? 0 : (trace.route.find(isWidthPoint)?.width ?? 0) / 2;
1346
- for (const point5 of trace.route) {
1347
- const pointWidth = trace.route_thickness_mode === "interpolated" ? isWidthPoint(point5) ? point5.width / 2 : 0 : halfWidth;
1348
- minX = Math.min(minX, point5.x - pointWidth);
1349
- minY = Math.min(minY, point5.y - pointWidth);
1350
- maxX = Math.max(maxX, point5.x + pointWidth);
1351
- maxY = Math.max(maxY, point5.y + pointWidth);
1346
+ for (const point6 of trace.route) {
1347
+ const pointWidth = trace.route_thickness_mode === "interpolated" ? isWidthPoint(point6) ? point6.width / 2 : 0 : halfWidth;
1348
+ minX = Math.min(minX, point6.x - pointWidth);
1349
+ minY = Math.min(minY, point6.y - pointWidth);
1350
+ maxX = Math.max(maxX, point6.x + pointWidth);
1351
+ maxY = Math.max(maxY, point6.y + pointWidth);
1352
1352
  }
1353
1353
  }
1354
1354
  for (const hole of db.pcb_plated_hole.list()) {
@@ -1372,6 +1372,70 @@ var calculateOriginFromBounds = (bounds, margin) => {
1372
1372
  return { x: originX, y: originY };
1373
1373
  };
1374
1374
 
1375
+ // lib/element-handlers/addPcbVia/index.ts
1376
+ import { ShapePath as ShapePath15 } from "lbrnts";
1377
+ import { Circle as Circle3, point as point5 } from "@flatten-js/core";
1378
+ var addPcbVia = (via, ctx) => {
1379
+ const {
1380
+ db,
1381
+ project,
1382
+ copperCutSetting,
1383
+ soldermaskCutSetting,
1384
+ throughBoardCutSetting,
1385
+ origin,
1386
+ includeCopper,
1387
+ includeSoldermask,
1388
+ connMap,
1389
+ soldermaskMargin
1390
+ } = ctx;
1391
+ const centerX = via.x + origin.x;
1392
+ const centerY = via.y + origin.y;
1393
+ if (via.outer_diameter > 0 && includeCopper) {
1394
+ const viaPort = db.pcb_port.list().find((port) => port.x === via.x && port.y === via.y);
1395
+ const netId = viaPort ? connMap.getNetConnectedToId(viaPort.pcb_port_id) : void 0;
1396
+ const outerRadius = via.outer_diameter / 2;
1397
+ const circle = new Circle3(point5(centerX, centerY), outerRadius);
1398
+ const polygon = circleToPolygon(circle);
1399
+ if (netId) {
1400
+ ctx.netGeoms.get(netId)?.push(polygon);
1401
+ } else {
1402
+ const outer = createCirclePath(centerX, centerY, outerRadius);
1403
+ project.children.push(
1404
+ new ShapePath15({
1405
+ cutIndex: copperCutSetting.index,
1406
+ verts: outer.verts,
1407
+ prims: outer.prims,
1408
+ isClosed: true
1409
+ })
1410
+ );
1411
+ }
1412
+ }
1413
+ if (via.outer_diameter > 0 && includeSoldermask) {
1414
+ const smRadius = via.outer_diameter / 2 + soldermaskMargin;
1415
+ const outer = createCirclePath(centerX, centerY, smRadius);
1416
+ project.children.push(
1417
+ new ShapePath15({
1418
+ cutIndex: soldermaskCutSetting.index,
1419
+ verts: outer.verts,
1420
+ prims: outer.prims,
1421
+ isClosed: true
1422
+ })
1423
+ );
1424
+ }
1425
+ if (via.hole_diameter > 0) {
1426
+ const innerRadius = via.hole_diameter / 2;
1427
+ const inner = createCirclePath(centerX, centerY, innerRadius);
1428
+ project.children.push(
1429
+ new ShapePath15({
1430
+ cutIndex: throughBoardCutSetting.index,
1431
+ verts: inner.verts,
1432
+ prims: inner.prims,
1433
+ isClosed: true
1434
+ })
1435
+ );
1436
+ }
1437
+ };
1438
+
1375
1439
  // lib/index.ts
1376
1440
  var convertCircuitJsonToLbrn = (circuitJson, options = {}) => {
1377
1441
  const db = cju2(circuitJson);
@@ -1443,6 +1507,9 @@ var convertCircuitJsonToLbrn = (circuitJson, options = {}) => {
1443
1507
  for (const board of db.pcb_board.list()) {
1444
1508
  addPcbBoard(board, ctx);
1445
1509
  }
1510
+ for (const via of db.pcb_via.list()) {
1511
+ addPcbVia(via, ctx);
1512
+ }
1446
1513
  if (ctx.includeCopper) {
1447
1514
  for (const net of Object.keys(connMap.netMap)) {
1448
1515
  const netGeoms = ctx.netGeoms.get(net);
@@ -1463,7 +1530,7 @@ var convertCircuitJsonToLbrn = (circuitJson, options = {}) => {
1463
1530
  for (const island of union.splitToIslands()) {
1464
1531
  const { verts, prims } = polygonToShapePathData(island);
1465
1532
  project.children.push(
1466
- new ShapePath15({
1533
+ new ShapePath16({
1467
1534
  cutIndex: copperCutSetting.index,
1468
1535
  verts,
1469
1536
  prims,
@@ -0,0 +1,84 @@
1
+ import type { PcbVia } from "circuit-json"
2
+ import type { ConvertContext } from "../../ConvertContext"
3
+ import { ShapePath } from "lbrnts"
4
+ import { createCirclePath } from "../../helpers/circleShape"
5
+ import { Circle, point } from "@flatten-js/core"
6
+ import { circleToPolygon } from "../addPcbTrace/circle-to-polygon"
7
+
8
+ export const addPcbVia = (via: PcbVia, ctx: ConvertContext): void => {
9
+ const {
10
+ db,
11
+ project,
12
+ copperCutSetting,
13
+ soldermaskCutSetting,
14
+ throughBoardCutSetting,
15
+ origin,
16
+ includeCopper,
17
+ includeSoldermask,
18
+ connMap,
19
+ soldermaskMargin,
20
+ } = ctx
21
+ const centerX = via.x + origin.x
22
+ const centerY = via.y + origin.y
23
+
24
+ // Add outer circle (copper annulus) if drawing copper - add to netGeoms for merging
25
+ if (via.outer_diameter > 0 && includeCopper) {
26
+ // Find the pcb_port associated with this via (vias don't have pcb_port_id property)
27
+ // We need to find a port at the same location as the via
28
+ const viaPort = db.pcb_port
29
+ .list()
30
+ .find((port) => port.x === via.x && port.y === via.y)
31
+
32
+ const netId = viaPort
33
+ ? connMap.getNetConnectedToId(viaPort.pcb_port_id)
34
+ : undefined
35
+
36
+ const outerRadius = via.outer_diameter / 2
37
+ const circle = new Circle(point(centerX, centerY), outerRadius)
38
+ const polygon = circleToPolygon(circle)
39
+
40
+ if (netId) {
41
+ // Add to netGeoms to be merged with other elements on the same net
42
+ ctx.netGeoms.get(netId)?.push(polygon)
43
+ } else {
44
+ // No net connection - draw directly
45
+ const outer = createCirclePath(centerX, centerY, outerRadius)
46
+ project.children.push(
47
+ new ShapePath({
48
+ cutIndex: copperCutSetting.index,
49
+ verts: outer.verts,
50
+ prims: outer.prims,
51
+ isClosed: true,
52
+ }),
53
+ )
54
+ }
55
+ }
56
+
57
+ // Add soldermask opening if drawing soldermask
58
+ if (via.outer_diameter > 0 && includeSoldermask) {
59
+ const smRadius = via.outer_diameter / 2 + soldermaskMargin
60
+ const outer = createCirclePath(centerX, centerY, smRadius)
61
+ project.children.push(
62
+ new ShapePath({
63
+ cutIndex: soldermaskCutSetting.index,
64
+ verts: outer.verts,
65
+ prims: outer.prims,
66
+ isClosed: true,
67
+ }),
68
+ )
69
+ }
70
+
71
+ // Add inner circle (hole) - always cut through the board regardless of mode
72
+ if (via.hole_diameter > 0) {
73
+ const innerRadius = via.hole_diameter / 2
74
+ const inner = createCirclePath(centerX, centerY, innerRadius)
75
+ project.children.push(
76
+ new ShapePath({
77
+ cutIndex: throughBoardCutSetting.index,
78
+ verts: inner.verts,
79
+ prims: inner.prims,
80
+ isClosed: true,
81
+ }),
82
+ )
83
+ }
84
+ }
package/lib/index.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  calculateCircuitBounds,
14
14
  calculateOriginFromBounds,
15
15
  } from "./calculateBounds"
16
+ import { addPcbVia } from "./element-handlers/addPcbVia"
16
17
  // import { writeDebugSvg } from "./writeDebugSvg"
17
18
 
18
19
  export const convertCircuitJsonToLbrn = (
@@ -104,6 +105,10 @@ export const convertCircuitJsonToLbrn = (
104
105
  addPcbBoard(board, ctx)
105
106
  }
106
107
 
108
+ for (const via of db.pcb_via.list()) {
109
+ addPcbVia(via, ctx)
110
+ }
111
+
107
112
  // Draw each individual shape geometry as a ShapePath
108
113
  // FOR DEBUGGING!!!
109
114
  // for (const net of Object.keys(connMap.netMap)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "circuit-json-to-lbrn",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "bun run site/index.html",
@@ -0,0 +1,8 @@
1
+ <svg width="800" height="1400" viewBox="0 0 800 1400" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(0, 0)">
3
+ <style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="150" y="50" width="500" height="500" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 150 550 L 650 550 L 650 50 L 150 50 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="5" data-type="pcb_board" data-pcb-layer="board"/><g data-type="pcb_via" data-pcb-layer="through"><circle class="pcb-hole-outer" fill="rgb(200, 52, 52)" cx="300" cy="200" r="37.5" data-type="pcb_via" data-pcb-layer="top"/><circle class="pcb-hole-inner" fill="#FF26E2" cx="300" cy="200" r="20" data-type="pcb_via" data-pcb-layer="drill"/></g><g data-type="pcb_via" data-pcb-layer="through"><circle class="pcb-hole-outer" fill="rgb(200, 52, 52)" cx="500" cy="400" r="50" data-type="pcb_via" data-pcb-layer="top"/><circle class="pcb-hole-inner" fill="#FF26E2" cx="500" cy="400" r="25" data-type="pcb_via" data-pcb-layer="drill"/></g>
4
+ </g>
5
+ <g transform="translate(0, 600) scale(26.666666666666668, 26.666666666666668) translate(14.9, 14.9)">
6
+ <rect x="-14.9" y="-14.9" width="30" height="30" fill="white"/><g transform="matrix(1 0 0 -1 0 0.1999999999999993)"><g transform="matrix(1,0,0,1,0,0)"><path d="M -1.15 2.1 L -1.1536114549958523 2.1735128552471705 L -1.164411039697577 2.2463177415120965 L -1.1822947482008432 2.317713507940847 L -1.207090350616535 2.3870125742738173 L -1.2385590517387337 2.453547552619498 L -1.276397790773091 2.5166776747647015 L -1.3202421599779472 2.575794963122734 L -1.3696699141100892 2.6303300858899106 L -1.4242050368772659 2.6797578400220528 L -1.483322325235298 2.723602209226909 L -1.5464524473805015 2.7614409482612663 L -1.6129874257261825 2.792909649383465 L -1.6822864920591531 2.8177052517991568 L -1.7536822584879037 2.835588960302423 L -1.8264871447528293 2.8463885450041477 L -1.9 2.85 L -1.9735128552471704 2.8463885450041477 L -2.046317741512096 2.835588960302423 L -2.1177135079408465 2.8177052517991568 L -2.187012574273817 2.792909649383465 L -2.2535475526194984 2.7614409482612663 L -2.3166776747647013 2.723602209226909 L -2.375794963122734 2.679757840022053 L -2.4303300858899104 2.630330085889911 L -2.4797578400220526 2.575794963122734 L -2.523602209226909 2.5166776747647015 L -2.561440948261266 2.4535475526194985 L -2.592909649383465 2.3870125742738173 L -2.6177052517991566 2.317713507940847 L -2.6355889603024227 2.2463177415120965 L -2.6463885450041476 2.1735128552471705 L -2.65 2.1 L -2.6463885450041476 2.0264871447528296 L -2.6355889603024227 1.9536822584879039 L -2.6177052517991566 1.8822864920591535 L -2.592909649383465 1.8129874257261829 L -2.561440948261266 1.7464524473805019 L -2.523602209226909 1.6833223252352987 L -2.479757840022053 1.624205036877266 L -2.430330085889911 1.5696699141100896 L -2.3757949631227344 1.5202421599779476 L -2.3166776747647013 1.4763977907730912 L -2.2535475526194984 1.4385590517387339 L -2.1870125742738176 1.407090350616535 L -2.117713507940847 1.3822947482008434 L -2.0463177415120963 1.3644110396975773 L -1.9735128552471704 1.3536114549958524 L -1.9000000000000001 1.35 L -1.82648714475283 1.3536114549958524 L -1.7536822584879037 1.3644110396975773 L -1.6822864920591534 1.3822947482008434 L -1.6129874257261825 1.407090350616535 L -1.5464524473805017 1.4385590517387339 L -1.4833223252352985 1.476397790773091 L -1.4242050368772659 1.5202421599779474 L -1.3696699141100894 1.5696699141100894 L -1.3202421599779475 1.6242050368772656 L -1.276397790773091 1.6833223252352985 L -1.2385590517387337 1.7464524473805016 L -1.207090350616535 1.8129874257261824 L -1.1822947482008432 1.882286492059153 L -1.164411039697577 1.9536822584879037 L -1.1536114549958523 2.0264871447528296 L -1.15 2.1 L -1.15 2.1 Z" fill="none" stroke="#000000" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M -1.5 2.1 L -1.5019261093311211 2.1392068561318243 L -1.5076858878387078 2.1780361288064514 L -1.5172238657071164 2.216113870901785 L -1.5304481869954851 2.253073372946036 L -1.5472314942606578 2.288558694730399 L -1.5674121550789817 2.322228093207841 L -1.5907958186549052 2.3537573136654584 L -1.6171572875253808 2.382842712474619 L -1.6462426863345416 2.409204181345095 L -1.677771906792159 2.4325878449210183 L -1.7114413052696007 2.4527685057393422 L -1.746926627053964 2.469551813004515 L -1.783886129098215 2.482776134292884 L -1.8219638711935486 2.492314112161292 L -1.8607931438681755 2.498073890668879 L -1.9 2.5 L -1.939206856131824 2.498073890668879 L -1.9780361288064512 2.492314112161292 L -2.0161138709017847 2.482776134292884 L -2.0530733729460358 2.469551813004515 L -2.088558694730399 2.4527685057393422 L -2.122228093207841 2.4325878449210183 L -2.153757313665458 2.409204181345095 L -2.182842712474619 2.382842712474619 L -2.2092041813450947 2.3537573136654584 L -2.232587844921018 2.322228093207841 L -2.252768505739342 2.288558694730399 L -2.2695518130045147 2.253073372946036 L -2.2827761342928836 2.216113870901785 L -2.292314112161292 2.1780361288064514 L -2.2980738906688787 2.1392068561318243 L -2.3 2.1 L -2.2980738906688787 2.060793143868176 L -2.292314112161292 2.021963871193549 L -2.2827761342928836 1.9838861290982153 L -2.2695518130045147 1.9469266270539642 L -2.252768505739342 1.911441305269601 L -2.232587844921018 1.8777719067921592 L -2.2092041813450947 1.846242686334542 L -2.182842712474619 1.8171572875253812 L -2.153757313665458 1.7907958186549053 L -2.122228093207841 1.7674121550789819 L -2.088558694730399 1.7472314942606582 L -2.053073372946036 1.7304481869954855 L -2.0161138709017847 1.7172238657071166 L -1.9780361288064514 1.707685887838708 L -1.939206856131824 1.7019261093311213 L -1.9 1.7000000000000002 L -1.860793143868176 1.7019261093311213 L -1.8219638711935486 1.707685887838708 L -1.783886129098215 1.7172238657071164 L -1.7469266270539638 1.7304481869954853 L -1.711441305269601 1.747231494260658 L -1.677771906792159 1.7674121550789819 L -1.6462426863345416 1.7907958186549053 L -1.617157287525381 1.817157287525381 L -1.5907958186549052 1.8462426863345418 L -1.5674121550789817 1.8777719067921592 L -1.547231494260658 1.9114413052696009 L -1.5304481869954853 1.9469266270539638 L -1.5172238657071164 1.983886129098215 L -1.5076858878387078 2.021963871193549 L -1.5019261093311211 2.060793143868176 L -1.5 2.1 L -1.5 2.1 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 3.1 -1.9 L 3.095184726672197 -1.8019828596704393 L 3.0807852804032305 -1.7049096779838717 L 3.056940335732209 -1.6097153227455376 L 3.0238795325112866 -1.51731656763491 L 2.981921264348355 -1.4286032631740022 L 2.9314696123025454 -1.3444297669803977 L 2.873010453362737 -1.2656067158363544 L 2.8071067811865476 -1.1928932188134524 L 2.7343932841636454 -1.126989546637263 L 2.6555702330196023 -1.0685303876974546 L 2.571396736825998 -1.018078735651645 L 2.48268343236509 -0.9761204674887132 L 2.3902846772544626 -0.9430596642677911 L 2.2950903220161285 -0.9192147195967695 L 2.198017140329561 -0.9048152733278031 L 2.1 -0.8999999999999999 L 2.0019828596704397 -0.904815273327803 L 1.904909677983872 -0.9192147195967695 L 1.809715322745538 -0.943059664267791 L 1.7173165676349105 -0.9761204674887132 L 1.6286032631740024 -1.018078735651645 L 1.5444297669803981 -1.0685303876974546 L 1.4656067158363548 -1.1269895466372628 L 1.3928932188134526 -1.1928932188134524 L 1.3269895466372632 -1.2656067158363544 L 1.2685303876974547 -1.3444297669803977 L 1.2180787356516452 -1.428603263174002 L 1.1761204674887134 -1.51731656763491 L 1.1430596642677913 -1.6097153227455374 L 1.1192147195967697 -1.7049096779838713 L 1.1048152733278034 -1.801982859670439 L 1.1 -1.8999999999999997 L 1.1048152733278032 -1.9980171403295606 L 1.1192147195967697 -2.0950903220161283 L 1.143059664267791 -2.190284677254462 L 1.1761204674887131 -2.2826834323650895 L 1.2180787356516452 -2.3713967368259974 L 1.2685303876974547 -2.4555702330196016 L 1.326989546637263 -2.534393284163645 L 1.3928932188134524 -2.6071067811865474 L 1.4656067158363544 -2.6730104533627363 L 1.544429766980398 -2.7314696123025453 L 1.6286032631740022 -2.781921264348355 L 1.7173165676349098 -2.8238795325112864 L 1.8097153227455376 -2.856940335732209 L 1.9049096779838715 -2.8807852804032303 L 2.0019828596704397 -2.8951847266721966 L 2.1 -2.9 L 2.19801714032956 -2.8951847266721966 L 2.2950903220161285 -2.8807852804032303 L 2.390284677254462 -2.856940335732209 L 2.48268343236509 -2.8238795325112864 L 2.5713967368259976 -2.781921264348355 L 2.655570233019602 -2.7314696123025453 L 2.734393284163646 -2.673010453362737 L 2.8071067811865476 -2.6071067811865474 L 2.8730104533627365 -2.534393284163646 L 2.9314696123025454 -2.455570233019602 L 2.981921264348355 -2.371396736825998 L 3.0238795325112866 -2.2826834323650904 L 3.056940335732209 -2.1902846772544624 L 3.0807852804032305 -2.0950903220161288 L 3.095184726672197 -1.9980171403295603 L 3.1 -1.9 L 3.1 -1.9 Z" fill="none" stroke="#000000" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 2.6 -1.9 L 2.5975923633360987 -1.8509914298352197 L 2.5903926402016153 -1.8024548389919357 L 2.5784701678661044 -1.7548576613727687 L 2.5619397662556436 -1.708658283817455 L 2.5409606321741776 -1.6643016315870012 L 2.5157348061512725 -1.6222148834901988 L 2.4865052266813685 -1.582803357918177 L 2.453553390593274 -1.5464466094067262 L 2.417196642081823 -1.5134947733186315 L 2.377785116509801 -1.4842651938487272 L 2.335698368412999 -1.4590393678258224 L 2.291341716182545 -1.4380602337443564 L 2.245142338627231 -1.4215298321338956 L 2.197545161008064 -1.4096073597983847 L 2.1490085701647805 -1.4024076366639016 L 2.1 -1.4 L 2.0509914298352196 -1.4024076366639013 L 2.002454838991936 -1.4096073597983847 L 1.954857661372769 -1.4215298321338954 L 1.9086582838174553 -1.4380602337443564 L 1.8643016315870011 -1.4590393678258224 L 1.822214883490199 -1.4842651938487272 L 1.7828033579181775 -1.5134947733186315 L 1.7464466094067264 -1.5464466094067262 L 1.7134947733186316 -1.582803357918177 L 1.6842651938487274 -1.6222148834901988 L 1.6590393678258226 -1.664301631587001 L 1.6380602337443566 -1.7086582838174549 L 1.6215298321338958 -1.7548576613727687 L 1.6096073597983849 -1.8024548389919357 L 1.6024076366639017 -1.8509914298352195 L 1.6 -1.9 L 1.6024076366639015 -1.9490085701647801 L 1.6096073597983849 -1.9975451610080641 L 1.6215298321338956 -2.045142338627231 L 1.6380602337443566 -2.0913417161825447 L 1.6590393678258226 -2.135698368412999 L 1.6842651938487274 -2.177785116509801 L 1.7134947733186316 -2.2171966420818228 L 1.7464466094067261 -2.2535533905932734 L 1.7828033579181772 -2.2865052266813684 L 1.822214883490199 -2.3157348061512724 L 1.8643016315870011 -2.3409606321741774 L 1.9086582838174548 -2.3619397662556434 L 1.9548576613727688 -2.378470167866104 L 2.0024548389919357 -2.390392640201615 L 2.0509914298352196 -2.3975923633360985 L 2.1 -2.4 L 2.14900857016478 -2.3975923633360985 L 2.197545161008064 -2.390392640201615 L 2.245142338627231 -2.378470167866104 L 2.291341716182545 -2.3619397662556434 L 2.335698368412999 -2.3409606321741774 L 2.377785116509801 -2.315734806151273 L 2.417196642081823 -2.2865052266813684 L 2.4535533905932736 -2.253553390593274 L 2.4865052266813685 -2.2171966420818228 L 2.5157348061512725 -2.177785116509801 L 2.5409606321741776 -2.135698368412999 L 2.5619397662556436 -2.091341716182545 L 2.5784701678661044 -2.0451423386272314 L 2.5903926402016153 -1.9975451610080643 L 2.5975923633360987 -1.9490085701647801 L 2.6 -1.9 L 2.6 -1.9 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M -4.9 -4.9 L 5.1 -4.9 L 5.1 5.1 L -4.9 5.1 L -4.9 -4.9 L -4.9 -4.9 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g></g>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="800" height="1400" viewBox="0 0 800 1400" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(0, 0)">
3
+ <style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="135.29411764705884" y="35.29411764705873" width="529.4117647058824" height="529.4117647058824" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 135.29411764705884 564.7058823529412 L 664.7058823529412 564.7058823529412 L 664.7058823529412 35.29411764705873 L 135.29411764705884 35.29411764705873 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="3.5294117647058827" data-type="pcb_board" data-pcb-layer="board"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="241.17647058823533" y="285.8823529411764" width="35.294117647058826" height="28.23529411764706" data-type="pcb_smtpad" data-pcb-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="311.76470588235304" y="285.8823529411764" width="35.294117647058826" height="28.23529411764706" data-type="pcb_smtpad" data-pcb-layer="top"/><path class="pcb-trace" stroke="rgb(200, 52, 52)" fill="none" d="M 329.41176470588243 299.99999999999994 L 470.5882352941177 299.99999999999994" stroke-width="10.588235294117647" stroke-linecap="round" stroke-linejoin="round" shape-rendering="crispEdges" data-type="pcb_trace" data-pcb-layer="top"/><g data-type="pcb_via" data-pcb-layer="through"><circle class="pcb-hole-outer" fill="rgb(200, 52, 52)" cx="470.5882352941177" cy="299.99999999999994" r="21.176470588235293" data-type="pcb_via" data-pcb-layer="top"/><circle class="pcb-hole-inner" fill="#FF26E2" cx="470.5882352941177" cy="299.99999999999994" r="10.588235294117647" data-type="pcb_via" data-pcb-layer="drill"/></g>
4
+ </g>
5
+ <g transform="translate(0, 600) scale(22.857142857142858, 22.857142857142858) translate(12.9, 17)">
6
+ <rect x="-12.9" y="-17" width="35" height="35" fill="white"/><g transform="matrix(1 0 0 -1 0 1)"><g transform="matrix(1,0,0,1,0,0)"><path d="M -2.9000000000000004 -7 L 12.1 -7 L 12.1 8 L -2.9000000000000004 8 L -2.9000000000000004 -7 L -2.9000000000000004 -7 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 6.8999999999999995 0.5 L 6.898555418001659 0.5294051420988681 L 6.894235584120969 0.5585270966048385 L 6.887082100719662 0.5870854031763387 L 6.877163859753385 0.6148050297095269 L 6.8645763793045065 0.6414190210477992 L 6.849440883690763 0.6666710699058807 L 6.831903136008821 0.6903179852490936 L 6.8121320343559635 0.7121320343559643 L 6.790317985249093 0.7319031360088211 L 6.766671069905881 0.7494408836907636 L 6.741419021047799 0.7645763793045064 L 6.7148050297095265 0.7771638597533861 L 6.687085403176338 0.7870821007196627 L 6.658527096604838 0.7942355841209692 L 6.629405142098868 0.798555418001659 L 6.6 0.8 L 6.570594857901131 0.7985554180016591 L 6.541472903395161 0.7942355841209692 L 6.512914596823661 0.7870821007196627 L 6.485194970290473 0.7771638597533861 L 6.458580978952201 0.7645763793045065 L 6.433328930094119 0.7494408836907636 L 6.409682014750906 0.7319031360088211 L 6.387867965644036 0.7121320343559643 L 6.368096863991179 0.6903179852490936 L 6.350559116309236 0.6666710699058807 L 6.335423620695493 0.6414190210477994 L 6.322836140246614 0.614805029709527 L 6.312917899280337 0.5870854031763387 L 6.305764415879031 0.5585270966048386 L 6.30144458199834 0.5294051420988682 L 6.3 0.5 L 6.30144458199834 0.4705948579011318 L 6.305764415879031 0.4414729033951615 L 6.312917899280337 0.4129145968236614 L 6.322836140246614 0.3851949702904731 L 6.335423620695493 0.3585809789522007 L 6.350559116309236 0.33332893009411946 L 6.368096863991179 0.3096820147509064 L 6.387867965644035 0.2878679656440358 L 6.4096820147509055 0.26809686399117905 L 6.4333289300941185 0.25055911630923644 L 6.458580978952201 0.23542362069549355 L 6.485194970290473 0.22283614024661408 L 6.512914596823661 0.21291789928033739 L 6.541472903395161 0.20576441587903094 L 6.570594857901131 0.20144458199834092 L 6.6 0.2 L 6.629405142098868 0.20144458199834092 L 6.658527096604838 0.20576441587903088 L 6.687085403176338 0.21291789928033733 L 6.7148050297095265 0.22283614024661402 L 6.741419021047799 0.2354236206954935 L 6.76667106990588 0.2505591163092364 L 6.790317985249093 0.26809686399117894 L 6.8121320343559635 0.2878679656440357 L 6.831903136008821 0.30968201475090623 L 6.849440883690763 0.33332893009411935 L 6.8645763793045065 0.35858097895220065 L 6.877163859753385 0.3851949702904729 L 6.887082100719662 0.4129145968236613 L 6.894235584120969 0.4414729033951614 L 6.898555418001659 0.47059485790113187 L 6.8999999999999995 0.5 L 6.8999999999999995 0.5 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 6.021522832986674 0.35 L 6.0456722804932275 0.27038994058094623 L 6.1011182326184725 0.16665786018823886 L 6.175735931288071 0.07573593128807155 L 6.266657860188238 0.0011182326184728808 L 6.370389940580946 -0.05432771950677184 L 6.4829458067903225 -0.08847116824193813 L 6.6 -0.09999999999999998 L 6.717054193209677 -0.08847116824193824 L 6.829610059419053 -0.054327719506771954 L 6.933342139811761 0.0011182326184727698 L 7.024264068711928 0.07573593128807138 L 7.098881767381527 0.1666578601882387 L 7.154327719506772 0.2703899405809458 L 7.1884711682419375 0.38294580679032275 L 7.199999999999999 0.5 L 7.1884711682419375 0.6170541932096769 L 7.154327719506772 0.7296100594190539 L 7.098881767381527 0.8333421398117613 L 7.024264068711928 0.9242640687119285 L 6.933342139811761 0.9988817673815271 L 6.829610059419053 1.0543277195067722 L 6.717054193209677 1.0884711682419383 L 6.6 1.1 L 6.4829458067903225 1.0884711682419383 L 6.370389940580946 1.0543277195067722 L 6.266657860188238 0.9988817673815271 L 6.175735931288071 0.9242640687119286 L 6.1011182326184725 0.8333421398117613 L 6.0456722804932275 0.729610059419054 L 6.021522832986674 0.65 L 3.0999999999999996 0.65 L 3.0999999999999996 0.9 L 2.0999999999999996 0.9 L 2.0999999999999996 0.09999999999999998 L 3.0999999999999996 0.09999999999999998 L 3.0999999999999996 0.35 L 6.021522832986674 0.35 L 6.021522832986674 0.35" fill="none" stroke="#000000" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 0.09999999999999964 0.09999999999999998 L 1.0999999999999996 0.09999999999999998 L 1.0999999999999996 0.9 L 0.09999999999999964 0.9 L 0.09999999999999964 0.09999999999999998 L 0.09999999999999964 0.09999999999999998" fill="none" stroke="#000000" stroke-width="0.1"/></g></g>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="800" height="1400" viewBox="0 0 800 1400" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(0, 0)">
3
+ <style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="150" y="50" width="500" height="500" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 150 550 L 650 550 L 650 50 L 150 50 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="5" data-type="pcb_board" data-pcb-layer="board"/><g data-type="pcb_via" data-pcb-layer="through"><circle class="pcb-hole-outer" fill="rgb(200, 52, 52)" cx="300" cy="200" r="37.5" data-type="pcb_via" data-pcb-layer="top"/><circle class="pcb-hole-inner" fill="#FF26E2" cx="300" cy="200" r="20" data-type="pcb_via" data-pcb-layer="drill"/></g><g data-type="pcb_via" data-pcb-layer="through"><circle class="pcb-hole-outer" fill="rgb(200, 52, 52)" cx="500" cy="400" r="50" data-type="pcb_via" data-pcb-layer="top"/><circle class="pcb-hole-inner" fill="#FF26E2" cx="500" cy="400" r="25" data-type="pcb_via" data-pcb-layer="drill"/></g>
4
+ </g>
5
+ <g transform="translate(0, 600) scale(26.666666666666668, 26.666666666666668) translate(14.9, 14.9)">
6
+ <rect x="-14.9" y="-14.9" width="30" height="30" fill="white"/><g transform="matrix(1 0 0 -1 0 0.1999999999999993)"><g transform="matrix(1,0,0,1,0,0)"><clipPath id="clip-1764624022137-oezzvwg71__stack1"><path d="M -1.0499999999999998 2.1 L -1.0540929823286325 2.183314569280127 L -1.066332511657254 2.265826773713709 L -1.0866007146276224 2.3467419756662933 L -1.1147023973654062 2.4252809175103263 L -1.1503669253038982 2.500687226302098 L -1.1932508295428366 2.572234698066662 L -1.2429411146416736 2.6392342915390987 L -1.2989592359914344 2.7010407640085656 L -1.3607657084609013 2.7570588853583264 L -1.427765301933338 2.8067491704571634 L -1.4993127736979017 2.8496330746961016 L -1.5747190824896735 2.885297602634594 L -1.653258024333707 2.9133992853723774 L -1.7341732262862908 2.933667488342746 L -1.8166854307198732 2.9459070176713675 L -1.9 2.95 L -1.9833145692801264 2.9459070176713675 L -2.065826773713709 2.933667488342746 L -2.1467419756662927 2.913399285372378 L -2.225280917510326 2.885297602634594 L -2.300687226302098 2.8496330746961016 L -2.3722346980666615 2.806749170457164 L -2.4392342915390985 2.757058885358327 L -2.5010407640085655 2.7010407640085656 L -2.5570588853583263 2.6392342915390987 L -2.6067491704571637 2.572234698066662 L -2.6496330746961014 2.500687226302098 L -2.6852976026345936 2.4252809175103263 L -2.713399285372377 2.3467419756662933 L -2.733667488342746 2.265826773713709 L -2.7459070176713674 2.183314569280127 L -2.75 2.1 L -2.7459070176713674 2.0166854307198734 L -2.733667488342746 1.934173226286291 L -2.7133992853723776 1.8532580243337073 L -2.6852976026345936 1.774719082489674 L -2.6496330746961014 1.6993127736979021 L -2.6067491704571637 1.6277653019333385 L -2.5570588853583267 1.5607657084609017 L -2.5010407640085655 1.4989592359914348 L -2.439234291539099 1.442941114641674 L -2.372234698066662 1.3932508295428367 L -2.3006872263020983 1.3503669253038986 L -2.2252809175103265 1.3147023973654066 L -2.146741975666293 1.2866007146276226 L -2.0658267737137095 1.2663325116572544 L -1.9833145692801264 1.2540929823286326 L -1.9000000000000001 1.25 L -1.8166854307198739 1.2540929823286326 L -1.7341732262862908 1.2663325116572541 L -1.6532580243337072 1.2866007146276224 L -1.5747190824896733 1.3147023973654064 L -1.499312773697902 1.3503669253038983 L -1.4277653019333383 1.3932508295428365 L -1.3607657084609013 1.4429411146416737 L -1.2989592359914348 1.4989592359914345 L -1.2429411146416738 1.560765708460901 L -1.1932508295428366 1.6277653019333382 L -1.1503669253038984 1.699312773697902 L -1.1147023973654064 1.7747190824896732 L -1.0866007146276224 1.853258024333707 L -1.0663325116572542 1.9341732262862907 L -1.0540929823286325 2.016685430719874 L -1.0499999999999998 2.1 L -1.0499999999999998 2.1 Z"/></clipPath><g clip-path="url(#clip-1764624022137-oezzvwg71__stack1)"><line x1="-1.2226493526370572" y1="1.25" x2="-1.0499999999999998" y2="1.4226493526370574" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.4772077938642145" y1="1.25" x2="-1.0499999999999998" y2="1.6772077938642147" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.7317662350913718" y1="1.25" x2="-1.0499999999999998" y2="1.931766235091372" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.986324676318529" y1="1.25" x2="-1.0499999999999998" y2="2.1863246763185287" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.2408831175456863" y1="1.25" x2="-1.0499999999999998" y2="2.440883117545686" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.4954415587728427" y1="1.25" x2="-1.0499999999999998" y2="2.695441558772843" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="1.25" x2="-1.0499999999999998" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="1.5045584412271573" x2="-1.304558441227157" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="1.7591168824543137" x2="-1.5591168824543136" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="2.013675323681471" x2="-1.8136753236814709" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="2.2682337649086284" x2="-2.068233764908628" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="2.5227922061357857" x2="-2.3227922061357855" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.75" y1="2.777350647362943" x2="-2.577350647362943" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="2.777350647362943" x2="-1.222649352637057" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="2.5227922061357857" x2="-1.4772077938642143" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="2.2682337649086284" x2="-1.7317662350913716" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="2.013675323681471" x2="-1.9863246763185287" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="1.7591168824543137" x2="-2.2408831175456863" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="1.5045584412271573" x2="-2.4954415587728427" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.0499999999999998" y1="1.25" x2="-2.7499999999999996" y2="2.95" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.3045584412271571" y1="1.25" x2="-2.75" y2="2.6954415587728433" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.559116882454314" y1="1.25" x2="-2.75" y2="2.4408831175456864" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-1.8136753236814709" y1="1.25" x2="-2.75" y2="2.186324676318529" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.0682337649086286" y1="1.25" x2="-2.75" y2="1.9317662350913716" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.3227922061357855" y1="1.25" x2="-2.75" y2="1.6772077938642145" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="-2.577350647362943" y1="1.25" x2="-2.75" y2="1.4226493526370572" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/></g><path d="M -1.0499999999999998 2.1 L -1.0540929823286325 2.183314569280127 L -1.066332511657254 2.265826773713709 L -1.0866007146276224 2.3467419756662933 L -1.1147023973654062 2.4252809175103263 L -1.1503669253038982 2.500687226302098 L -1.1932508295428366 2.572234698066662 L -1.2429411146416736 2.6392342915390987 L -1.2989592359914344 2.7010407640085656 L -1.3607657084609013 2.7570588853583264 L -1.427765301933338 2.8067491704571634 L -1.4993127736979017 2.8496330746961016 L -1.5747190824896735 2.885297602634594 L -1.653258024333707 2.9133992853723774 L -1.7341732262862908 2.933667488342746 L -1.8166854307198732 2.9459070176713675 L -1.9 2.95 L -1.9833145692801264 2.9459070176713675 L -2.065826773713709 2.933667488342746 L -2.1467419756662927 2.913399285372378 L -2.225280917510326 2.885297602634594 L -2.300687226302098 2.8496330746961016 L -2.3722346980666615 2.806749170457164 L -2.4392342915390985 2.757058885358327 L -2.5010407640085655 2.7010407640085656 L -2.5570588853583263 2.6392342915390987 L -2.6067491704571637 2.572234698066662 L -2.6496330746961014 2.500687226302098 L -2.6852976026345936 2.4252809175103263 L -2.713399285372377 2.3467419756662933 L -2.733667488342746 2.265826773713709 L -2.7459070176713674 2.183314569280127 L -2.75 2.1 L -2.7459070176713674 2.0166854307198734 L -2.733667488342746 1.934173226286291 L -2.7133992853723776 1.8532580243337073 L -2.6852976026345936 1.774719082489674 L -2.6496330746961014 1.6993127736979021 L -2.6067491704571637 1.6277653019333385 L -2.5570588853583267 1.5607657084609017 L -2.5010407640085655 1.4989592359914348 L -2.439234291539099 1.442941114641674 L -2.372234698066662 1.3932508295428367 L -2.3006872263020983 1.3503669253038986 L -2.2252809175103265 1.3147023973654066 L -2.146741975666293 1.2866007146276226 L -2.0658267737137095 1.2663325116572544 L -1.9833145692801264 1.2540929823286326 L -1.9000000000000001 1.25 L -1.8166854307198739 1.2540929823286326 L -1.7341732262862908 1.2663325116572541 L -1.6532580243337072 1.2866007146276224 L -1.5747190824896733 1.3147023973654064 L -1.499312773697902 1.3503669253038983 L -1.4277653019333383 1.3932508295428365 L -1.3607657084609013 1.4429411146416737 L -1.2989592359914348 1.4989592359914345 L -1.2429411146416738 1.560765708460901 L -1.1932508295428366 1.6277653019333382 L -1.1503669253038984 1.699312773697902 L -1.1147023973654064 1.7747190824896732 L -1.0866007146276224 1.853258024333707 L -1.0663325116572542 1.9341732262862907 L -1.0540929823286325 2.016685430719874 L -1.0499999999999998 2.1 L -1.0499999999999998 2.1 Z" fill="none" stroke="#FF0000" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M -1.5 2.1 L -1.5019261093311211 2.1392068561318243 L -1.5076858878387078 2.1780361288064514 L -1.5172238657071164 2.216113870901785 L -1.5304481869954851 2.253073372946036 L -1.5472314942606578 2.288558694730399 L -1.5674121550789817 2.322228093207841 L -1.5907958186549052 2.3537573136654584 L -1.6171572875253808 2.382842712474619 L -1.6462426863345416 2.409204181345095 L -1.677771906792159 2.4325878449210183 L -1.7114413052696007 2.4527685057393422 L -1.746926627053964 2.469551813004515 L -1.783886129098215 2.482776134292884 L -1.8219638711935486 2.492314112161292 L -1.8607931438681755 2.498073890668879 L -1.9 2.5 L -1.939206856131824 2.498073890668879 L -1.9780361288064512 2.492314112161292 L -2.0161138709017847 2.482776134292884 L -2.0530733729460358 2.469551813004515 L -2.088558694730399 2.4527685057393422 L -2.122228093207841 2.4325878449210183 L -2.153757313665458 2.409204181345095 L -2.182842712474619 2.382842712474619 L -2.2092041813450947 2.3537573136654584 L -2.232587844921018 2.322228093207841 L -2.252768505739342 2.288558694730399 L -2.2695518130045147 2.253073372946036 L -2.2827761342928836 2.216113870901785 L -2.292314112161292 2.1780361288064514 L -2.2980738906688787 2.1392068561318243 L -2.3 2.1 L -2.2980738906688787 2.060793143868176 L -2.292314112161292 2.021963871193549 L -2.2827761342928836 1.9838861290982153 L -2.2695518130045147 1.9469266270539642 L -2.252768505739342 1.911441305269601 L -2.232587844921018 1.8777719067921592 L -2.2092041813450947 1.846242686334542 L -2.182842712474619 1.8171572875253812 L -2.153757313665458 1.7907958186549053 L -2.122228093207841 1.7674121550789819 L -2.088558694730399 1.7472314942606582 L -2.053073372946036 1.7304481869954855 L -2.0161138709017847 1.7172238657071166 L -1.9780361288064514 1.707685887838708 L -1.939206856131824 1.7019261093311213 L -1.9 1.7000000000000002 L -1.860793143868176 1.7019261093311213 L -1.8219638711935486 1.707685887838708 L -1.783886129098215 1.7172238657071164 L -1.7469266270539638 1.7304481869954853 L -1.711441305269601 1.747231494260658 L -1.677771906792159 1.7674121550789819 L -1.6462426863345416 1.7907958186549053 L -1.617157287525381 1.817157287525381 L -1.5907958186549052 1.8462426863345418 L -1.5674121550789817 1.8777719067921592 L -1.547231494260658 1.9114413052696009 L -1.5304481869954853 1.9469266270539638 L -1.5172238657071164 1.983886129098215 L -1.5076858878387078 2.021963871193549 L -1.5019261093311211 2.060793143868176 L -1.5 2.1 L -1.5 2.1 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><clipPath id="clip-1764624022137-5kdk25wmt__stack1"><path d="M 3.2 -1.9 L 3.1947031993394166 -1.7921811456374832 L 3.1788638084435537 -1.6854006457822588 L 3.1526343693054297 -1.5806868550200912 L 3.1162674857624157 -1.4790482243984011 L 3.070113390783191 -1.3814635894914025 L 3.0146165735328 -1.2888727436784375 L 2.950311498699011 -1.2021673874199899 L 2.8778174593052026 -1.1221825406947976 L 2.7978326125800104 -1.0496885013009891 L 2.7111272563215625 -0.9853834264672001 L 2.6185364105085975 -0.9298866092168094 L 2.520951775601599 -0.8837325142375845 L 2.419313144979909 -0.84736563069457 L 2.314599354217741 -0.8211361915564463 L 2.207818854362517 -0.8052968006605834 L 2.1 -0.7999999999999998 L 1.9921811456374834 -0.8052968006605832 L 1.885400645782259 -0.8211361915564463 L 1.7806868550200916 -0.84736563069457 L 1.6790482243984013 -0.8837325142375845 L 1.5814635894914026 -0.9298866092168093 L 1.488872743678438 -0.9853834264672 L 1.4021673874199903 -1.049688501300989 L 1.3221825406947978 -1.1221825406947974 L 1.2496885013009893 -1.2021673874199899 L 1.1853834264672 -1.2888727436784375 L 1.1298866092168096 -1.3814635894914022 L 1.0837325142375847 -1.479048224398401 L 1.0473656306945702 -1.5806868550200912 L 1.0211361915564465 -1.6854006457822583 L 1.0052968006605836 -1.792181145637483 L 1 -1.8999999999999997 L 1.0052968006605834 -2.0078188543625166 L 1.0211361915564465 -2.114599354217741 L 1.0473656306945702 -2.219313144979908 L 1.0837325142375844 -2.3209517756015985 L 1.1298866092168094 -2.4185364105085974 L 1.1853834264672 -2.5111272563215623 L 1.249688501300989 -2.5978326125800097 L 1.3221825406947976 -2.677817459305202 L 1.4021673874199896 -2.75031149869901 L 1.4888727436784377 -2.8146165735328 L 1.5814635894914022 -2.8701133907831906 L 1.6790482243984006 -2.916267485762415 L 1.7806868550200914 -2.9526343693054296 L 1.8854006457822585 -2.9788638084435535 L 1.9921811456374836 -2.9947031993394164 L 2.1 -3 L 2.2078188543625163 -2.9947031993394164 L 2.314599354217741 -2.9788638084435535 L 2.4193131449799083 -2.9526343693054296 L 2.520951775601599 -2.9162674857624156 L 2.6185364105085975 -2.8701133907831906 L 2.711127256321562 -2.8146165735328 L 2.7978326125800104 -2.7503114986990105 L 2.877817459305202 -2.6778174593052024 L 2.95031149869901 -2.5978326125800106 L 3.0146165735328 -2.5111272563215623 L 3.0701133907831903 -2.418536410508598 L 3.1162674857624153 -2.3209517756015994 L 3.1526343693054297 -2.2193131449799086 L 3.1788638084435537 -2.1145993542177415 L 3.1947031993394166 -2.0078188543625166 L 3.2 -1.9 L 3.2 -1.9 Z"/></clipPath><g clip-path="url(#clip-1764624022137-5kdk25wmt__stack1)"><line x1="3.0364675298172568" y1="-3" x2="3.2" y2="-2.8364675298172566" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.7819090885901003" y1="-3" x2="3.2" y2="-2.5819090885901" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.527350647362943" y1="-3" x2="3.2" y2="-2.327350647362943" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.2727922061357857" y1="-3" x2="3.2" y2="-2.0727922061357855" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.0182337649086284" y1="-3" x2="3.2" y2="-1.8182337649086282" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.763675323681471" y1="-3" x2="3.2" y2="-1.563675323681471" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.5091168824543137" y1="-3" x2="3.2" y2="-1.309116882454314" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.254558441227157" y1="-3" x2="3.2" y2="-1.0545584412271576" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-3" x2="3.2" y2="-0.8000000000000007" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-2.7454415587728427" x2="2.9454415587728437" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-2.4908831175456854" x2="2.6908831175456864" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-2.2363246763185285" x2="2.436324676318529" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-1.9817662350913714" x2="2.181766235091372" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-1.7272077938642145" x2="1.927207793864215" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-1.472649352637057" x2="1.6726493526370572" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-1.2180909114099006" x2="1.4180909114099007" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1" y1="-0.9635324701827432" x2="1.1635324701827434" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-0.9635324701827432" x2="3.0364675298172568" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-1.2180909114099006" x2="2.7819090885900994" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-1.4726493526370577" x2="2.5273506473629426" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-1.7272077938642147" x2="2.2727922061357853" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-1.981766235091372" x2="2.0182337649086284" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-2.236324676318529" x2="1.7636753236814713" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-2.4908831175456867" x2="1.5091168824543142" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-2.7454415587728427" x2="1.2545584412271575" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="3.2" y1="-3" x2="1.0000000000000004" y2="-0.7999999999999998" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.945441558772843" y1="-3" x2="1" y2="-1.0545584412271567" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.6908831175456855" y1="-3" x2="1" y2="-1.3091168824543138" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.4363246763185282" y1="-3" x2="1" y2="-1.563675323681471" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="2.181766235091372" y1="-3" x2="1" y2="-1.818233764908628" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.9272077938642145" y1="-3" x2="1" y2="-2.0727922061357855" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.672649352637057" y1="-3" x2="1" y2="-2.327350647362943" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.4180909114099" y1="-3" x2="1" y2="-2.5819090885900997" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/><line x1="1.163532470182743" y1="-3" x2="1" y2="-2.836467529817257" stroke="#FF0000" stroke-width="0.1" stroke-opacity="0.8"/></g><path d="M 3.2 -1.9 L 3.1947031993394166 -1.7921811456374832 L 3.1788638084435537 -1.6854006457822588 L 3.1526343693054297 -1.5806868550200912 L 3.1162674857624157 -1.4790482243984011 L 3.070113390783191 -1.3814635894914025 L 3.0146165735328 -1.2888727436784375 L 2.950311498699011 -1.2021673874199899 L 2.8778174593052026 -1.1221825406947976 L 2.7978326125800104 -1.0496885013009891 L 2.7111272563215625 -0.9853834264672001 L 2.6185364105085975 -0.9298866092168094 L 2.520951775601599 -0.8837325142375845 L 2.419313144979909 -0.84736563069457 L 2.314599354217741 -0.8211361915564463 L 2.207818854362517 -0.8052968006605834 L 2.1 -0.7999999999999998 L 1.9921811456374834 -0.8052968006605832 L 1.885400645782259 -0.8211361915564463 L 1.7806868550200916 -0.84736563069457 L 1.6790482243984013 -0.8837325142375845 L 1.5814635894914026 -0.9298866092168093 L 1.488872743678438 -0.9853834264672 L 1.4021673874199903 -1.049688501300989 L 1.3221825406947978 -1.1221825406947974 L 1.2496885013009893 -1.2021673874199899 L 1.1853834264672 -1.2888727436784375 L 1.1298866092168096 -1.3814635894914022 L 1.0837325142375847 -1.479048224398401 L 1.0473656306945702 -1.5806868550200912 L 1.0211361915564465 -1.6854006457822583 L 1.0052968006605836 -1.792181145637483 L 1 -1.8999999999999997 L 1.0052968006605834 -2.0078188543625166 L 1.0211361915564465 -2.114599354217741 L 1.0473656306945702 -2.219313144979908 L 1.0837325142375844 -2.3209517756015985 L 1.1298866092168094 -2.4185364105085974 L 1.1853834264672 -2.5111272563215623 L 1.249688501300989 -2.5978326125800097 L 1.3221825406947976 -2.677817459305202 L 1.4021673874199896 -2.75031149869901 L 1.4888727436784377 -2.8146165735328 L 1.5814635894914022 -2.8701133907831906 L 1.6790482243984006 -2.916267485762415 L 1.7806868550200914 -2.9526343693054296 L 1.8854006457822585 -2.9788638084435535 L 1.9921811456374836 -2.9947031993394164 L 2.1 -3 L 2.2078188543625163 -2.9947031993394164 L 2.314599354217741 -2.9788638084435535 L 2.4193131449799083 -2.9526343693054296 L 2.520951775601599 -2.9162674857624156 L 2.6185364105085975 -2.8701133907831906 L 2.711127256321562 -2.8146165735328 L 2.7978326125800104 -2.7503114986990105 L 2.877817459305202 -2.6778174593052024 L 2.95031149869901 -2.5978326125800106 L 3.0146165735328 -2.5111272563215623 L 3.0701133907831903 -2.418536410508598 L 3.1162674857624153 -2.3209517756015994 L 3.1526343693054297 -2.2193131449799086 L 3.1788638084435537 -2.1145993542177415 L 3.1947031993394166 -2.0078188543625166 L 3.2 -1.9 L 3.2 -1.9 Z" fill="none" stroke="#FF0000" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 2.6 -1.9 L 2.5975923633360987 -1.8509914298352197 L 2.5903926402016153 -1.8024548389919357 L 2.5784701678661044 -1.7548576613727687 L 2.5619397662556436 -1.708658283817455 L 2.5409606321741776 -1.6643016315870012 L 2.5157348061512725 -1.6222148834901988 L 2.4865052266813685 -1.582803357918177 L 2.453553390593274 -1.5464466094067262 L 2.417196642081823 -1.5134947733186315 L 2.377785116509801 -1.4842651938487272 L 2.335698368412999 -1.4590393678258224 L 2.291341716182545 -1.4380602337443564 L 2.245142338627231 -1.4215298321338956 L 2.197545161008064 -1.4096073597983847 L 2.1490085701647805 -1.4024076366639016 L 2.1 -1.4 L 2.0509914298352196 -1.4024076366639013 L 2.002454838991936 -1.4096073597983847 L 1.954857661372769 -1.4215298321338954 L 1.9086582838174553 -1.4380602337443564 L 1.8643016315870011 -1.4590393678258224 L 1.822214883490199 -1.4842651938487272 L 1.7828033579181775 -1.5134947733186315 L 1.7464466094067264 -1.5464466094067262 L 1.7134947733186316 -1.582803357918177 L 1.6842651938487274 -1.6222148834901988 L 1.6590393678258226 -1.664301631587001 L 1.6380602337443566 -1.7086582838174549 L 1.6215298321338958 -1.7548576613727687 L 1.6096073597983849 -1.8024548389919357 L 1.6024076366639017 -1.8509914298352195 L 1.6 -1.9 L 1.6024076366639015 -1.9490085701647801 L 1.6096073597983849 -1.9975451610080641 L 1.6215298321338956 -2.045142338627231 L 1.6380602337443566 -2.0913417161825447 L 1.6590393678258226 -2.135698368412999 L 1.6842651938487274 -2.177785116509801 L 1.7134947733186316 -2.2171966420818228 L 1.7464466094067261 -2.2535533905932734 L 1.7828033579181772 -2.2865052266813684 L 1.822214883490199 -2.3157348061512724 L 1.8643016315870011 -2.3409606321741774 L 1.9086582838174548 -2.3619397662556434 L 1.9548576613727688 -2.378470167866104 L 2.0024548389919357 -2.390392640201615 L 2.0509914298352196 -2.3975923633360985 L 2.1 -2.4 L 2.14900857016478 -2.3975923633360985 L 2.197545161008064 -2.390392640201615 L 2.245142338627231 -2.378470167866104 L 2.291341716182545 -2.3619397662556434 L 2.335698368412999 -2.3409606321741774 L 2.377785116509801 -2.315734806151273 L 2.417196642081823 -2.2865052266813684 L 2.4535533905932736 -2.253553390593274 L 2.4865052266813685 -2.2171966420818228 L 2.5157348061512725 -2.177785116509801 L 2.5409606321741776 -2.135698368412999 L 2.5619397662556436 -2.091341716182545 L 2.5784701678661044 -2.0451423386272314 L 2.5903926402016153 -1.9975451610080643 L 2.5975923633360987 -1.9490085701647801 L 2.6 -1.9 L 2.6 -1.9 Z" fill="none" stroke="#0000FF" stroke-width="0.1"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M -4.9 -4.9 L 5.1 -4.9 L 5.1 5.1 L -4.9 5.1 L -4.9 -4.9 L -4.9 -4.9" fill="none" stroke="#FF0000" stroke-width="0.1"/></g></g>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,49 @@
1
+ import { test, expect } from "bun:test"
2
+ import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
3
+ import { generateLightBurnSvg } from "lbrnts"
4
+ import { convertCircuitJsonToLbrn } from "../../../lib"
5
+ import { stackSvgsVertically } from "stack-svgs"
6
+ import type { CircuitJson } from "circuit-json"
7
+
8
+ const circuitJson: CircuitJson = [
9
+ {
10
+ type: "pcb_board",
11
+ pcb_board_id: "board_1",
12
+ width: 10,
13
+ height: 10,
14
+ center: { x: 0, y: 0 },
15
+ thickness: 1.6,
16
+ num_layers: 2,
17
+ material: "fr4",
18
+ },
19
+ {
20
+ type: "pcb_via",
21
+ pcb_via_id: "via_1",
22
+ x: -2,
23
+ y: 2,
24
+ outer_diameter: 1.5,
25
+ hole_diameter: 0.8,
26
+ layers: ["top", "bottom"],
27
+ },
28
+ {
29
+ type: "pcb_via",
30
+ pcb_via_id: "via_2",
31
+ x: 2,
32
+ y: -2,
33
+ outer_diameter: 2,
34
+ hole_diameter: 1,
35
+ layers: ["top", "bottom"],
36
+ },
37
+ ]
38
+
39
+ test("renders basic pcb vias with copper and hole", async () => {
40
+ const pcbSvg = await convertCircuitJsonToPcbSvg(circuitJson)
41
+
42
+ const project = convertCircuitJsonToLbrn(circuitJson)
43
+
44
+ const lbrnSvg = generateLightBurnSvg(project)
45
+
46
+ expect(stackSvgsVertically([pcbSvg, lbrnSvg])).toMatchSvgSnapshot(
47
+ import.meta.filename,
48
+ )
49
+ })
@@ -0,0 +1,126 @@
1
+ import { test, expect } from "bun:test"
2
+ import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
3
+ import { generateLightBurnSvg } from "lbrnts"
4
+ import { convertCircuitJsonToLbrn } from "../../../lib"
5
+ import { stackSvgsVertically } from "stack-svgs"
6
+ import type { CircuitJson } from "circuit-json"
7
+
8
+ /**
9
+ * This test demonstrates a via connected to a trace through proper connectivity.
10
+ * The trace, via, and pad should be merged into a single copper geometry since they
11
+ * share the same net through the source_trace connectivity.
12
+ *
13
+ * Key requirements for connectivity:
14
+ * 1. pcb_trace must have a source_trace_id
15
+ * 2. Via needs a pcb_port with source_port_id
16
+ * 3. source_trace must list both source_port_ids in connected_source_port_ids
17
+ */
18
+ const circuitJson: CircuitJson = [
19
+ {
20
+ type: "pcb_board",
21
+ pcb_board_id: "board_1",
22
+ width: 15,
23
+ height: 15,
24
+ center: { x: 0, y: 0 },
25
+ thickness: 1.6,
26
+ num_layers: 2,
27
+ material: "fr4",
28
+ },
29
+ {
30
+ type: "source_port",
31
+ source_port_id: "source_port_1",
32
+ name: "pin1",
33
+ },
34
+ {
35
+ type: "source_port",
36
+ source_port_id: "source_port_2",
37
+ name: "pin2",
38
+ },
39
+ {
40
+ type: "source_port",
41
+ source_port_id: "source_port_3",
42
+ name: "via1",
43
+ },
44
+ {
45
+ type: "pcb_smtpad",
46
+ pcb_smtpad_id: "pcb_smtpad_1",
47
+ pcb_port_id: "pcb_port_1",
48
+ shape: "rect",
49
+ x: -4,
50
+ y: 0,
51
+ width: 1,
52
+ height: 0.8,
53
+ layer: "top",
54
+ },
55
+ {
56
+ type: "pcb_smtpad",
57
+ pcb_smtpad_id: "pcb_smtpad_2",
58
+ pcb_port_id: "pcb_port_2",
59
+ shape: "rect",
60
+ x: -2,
61
+ y: 0,
62
+ width: 1,
63
+ height: 0.8,
64
+ layer: "top",
65
+ },
66
+ {
67
+ type: "pcb_via",
68
+ pcb_via_id: "via_1",
69
+ x: 2,
70
+ y: 0,
71
+ outer_diameter: 1.2,
72
+ hole_diameter: 0.6,
73
+ layers: ["top", "bottom"],
74
+ },
75
+ {
76
+ type: "pcb_trace",
77
+ pcb_trace_id: "trace_1",
78
+ source_trace_id: "source_trace_1",
79
+ route: [
80
+ { x: -2, y: 0, width: 0.3, layer: "top", route_type: "wire" },
81
+ { x: 2, y: 0, width: 0.3, layer: "top", route_type: "wire" },
82
+ ],
83
+ },
84
+ {
85
+ type: "pcb_port",
86
+ pcb_port_id: "pcb_port_1",
87
+ source_port_id: "source_port_1",
88
+ x: -4,
89
+ y: 0,
90
+ layers: ["top"],
91
+ },
92
+ {
93
+ type: "pcb_port",
94
+ pcb_port_id: "pcb_port_2",
95
+ source_port_id: "source_port_2",
96
+ x: -2,
97
+ y: 0,
98
+ layers: ["top"],
99
+ },
100
+ {
101
+ type: "pcb_port",
102
+ pcb_port_id: "pcb_port_3",
103
+ source_port_id: "source_port_3",
104
+ x: 2,
105
+ y: 0,
106
+ layers: ["top", "bottom"],
107
+ },
108
+ {
109
+ type: "source_trace",
110
+ source_trace_id: "source_trace_1",
111
+ connected_source_port_ids: ["source_port_2", "source_port_3"],
112
+ connected_source_net_ids: [],
113
+ },
114
+ ]
115
+
116
+ test("renders pcb via connected to net with trace merging", async () => {
117
+ const pcbSvg = await convertCircuitJsonToPcbSvg(circuitJson)
118
+
119
+ const project = convertCircuitJsonToLbrn(circuitJson)
120
+
121
+ const lbrnSvg = generateLightBurnSvg(project)
122
+
123
+ expect(stackSvgsVertically([pcbSvg, lbrnSvg])).toMatchSvgSnapshot(
124
+ import.meta.filename,
125
+ )
126
+ })
@@ -0,0 +1,53 @@
1
+ import { test, expect } from "bun:test"
2
+ import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
3
+ import { generateLightBurnSvg } from "lbrnts"
4
+ import { convertCircuitJsonToLbrn } from "../../../lib"
5
+ import { stackSvgsVertically } from "stack-svgs"
6
+ import type { CircuitJson } from "circuit-json"
7
+
8
+ const circuitJson: CircuitJson = [
9
+ {
10
+ type: "pcb_board",
11
+ pcb_board_id: "board_1",
12
+ width: 10,
13
+ height: 10,
14
+ center: { x: 0, y: 0 },
15
+ thickness: 1.6,
16
+ num_layers: 2,
17
+ material: "fr4",
18
+ },
19
+ {
20
+ type: "pcb_via",
21
+ pcb_via_id: "via_1",
22
+ x: -2,
23
+ y: 2,
24
+ outer_diameter: 1.5,
25
+ hole_diameter: 0.8,
26
+ layers: ["top", "bottom"],
27
+ },
28
+ {
29
+ type: "pcb_via",
30
+ pcb_via_id: "via_2",
31
+ x: 2,
32
+ y: -2,
33
+ outer_diameter: 2,
34
+ hole_diameter: 1,
35
+ layers: ["top", "bottom"],
36
+ },
37
+ ]
38
+
39
+ test("renders pcb vias with soldermask opening", async () => {
40
+ const pcbSvg = await convertCircuitJsonToPcbSvg(circuitJson)
41
+
42
+ const project = convertCircuitJsonToLbrn(circuitJson, {
43
+ includeCopper: false,
44
+ includeSoldermask: true,
45
+ soldermaskMargin: 0.1,
46
+ })
47
+
48
+ const lbrnSvg = generateLightBurnSvg(project)
49
+
50
+ expect(stackSvgsVertically([pcbSvg, lbrnSvg])).toMatchSvgSnapshot(
51
+ import.meta.filename,
52
+ )
53
+ })