Skip to content

Commit 26ff277

Browse files
committed
fixes
1 parent b98b410 commit 26ff277

File tree

49 files changed

+12316
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+12316
-566
lines changed

edg/electronics_model/SvgPcbBackend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def arrange_hierarchy(root: Tuple[str, ...]) -> PlacedBlock:
6262
elts: Dict[str, Tuple[Union[PlacedBlock, TransformUtil.Path], Tuple[float, float]]] = {}
6363
for name, width, height, entry in sorted(sub_placed, key=lambda x: -x[2]): # by height
6464
if not x_stack: # only on first component
65-
next_y = 0
65+
next_y = 0.0
6666
else:
6767
next_y = x_stack[-1][1] # y position of the next element
6868

examples/BasicKeyboard/BasicKeyboard.svgpcb.js

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
const board = new PCB();
2+
3+
const sw = SwitchMatrix_2_3_sw(pt(0, 0))
4+
const mcu = board.add(XIAO_RP2040_SMD, {
5+
translate: pt(0.348, 1.824), rotate: 0,
6+
id: 'mcu'
7+
})
8+
9+
const limit0 = pt(-0.07874015748031496, -0.07874015748031496);
10+
const limit1 = pt(2.039370078740158, 2.3332677165354334);
11+
const xMin = Math.min(limit0[0], limit1[0]);
12+
const xMax = Math.max(limit0[0], limit1[0]);
13+
const yMin = Math.min(limit0[1], limit1[1]);
14+
const yMax = Math.max(limit0[1], limit1[1]);
15+
16+
const filletRadius = 0.1;
17+
const outline = path(
18+
[(xMin+xMax/2), yMax],
19+
["fillet", filletRadius, [xMax, yMax]],
20+
["fillet", filletRadius, [xMax, yMin]],
21+
["fillet", filletRadius, [xMin, yMin]],
22+
["fillet", filletRadius, [xMin, yMax]],
23+
[(xMin+xMax/2), yMax],
24+
);
25+
board.addShape("outline", outline);
26+
27+
renderPCB({
28+
pcb: board,
29+
layerColors: {
30+
"F.Paste": "#000000ff",
31+
"F.Mask": "#000000ff",
32+
"B.Mask": "#000000ff",
33+
"componentLabels": "#00e5e5e5",
34+
"outline": "#002d00ff",
35+
"padLabels": "#ffff99e5",
36+
"B.Cu": "#ef4e4eff",
37+
"F.Cu": "#ff8c00cc",
38+
},
39+
limits: {
40+
x: [xMin, xMax],
41+
y: [yMin, yMax]
42+
},
43+
background: "#00000000",
44+
mmPerUnit: 25.4
45+
})
46+
147
function SwitchMatrix_2_3_sw(xy, colSpacing=1, rowSpacing=1, diodeOffset=[0.25, 0]) {
248
// Circuit generator params
349
const ncols = 2
@@ -68,8 +114,3 @@ function SwitchMatrix_2_3_sw(xy, colSpacing=1, rowSpacing=1, diodeOffset=[0.25,
68114
return obj
69115
}
70116

71-
const sw = SwitchMatrix_2_3_sw(pt(0, 0))
72-
const mcu = board.add(XIAO_RP2040_SMD, {
73-
translate: pt(8.835, 47.847), rotate: 0,
74-
id: 'mcu'
75-
})

0 commit comments

Comments
 (0)