circuit-json-to-tscircuit 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Convert [circuit json](https://github.com/tscircuit/circuit-json) code to [tscircuit](https://github.com/tscircuit/tscircuit) code.
4
4
 
5
+ Circuit JSON is more of a "compiled form" of a circuit and tscircuit code can't
6
+ necessarily be full reconstructed from it. That said, Circuit JSON is often
7
+ a great intermediary format when converting between different industry standards
8
+ like DSN, KiCad, and Eagle.
9
+
10
+ This converter is primarily useful for creating tscircuit components from
11
+ Circuit JSON, e.g. for a `kicad_mod` -> circuit json -> tscircuit conversion.
12
+
5
13
  ## Usage
6
14
 
7
15
  ```bash
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ export const ${componentName} = (props: Props) => {
89
89
 
90
90
  export const use${componentName} = createUseComponent(${componentName}, pinLabels)
91
91
 
92
- `.trim();
92
+ `.replace(/\n\s*\n/g, "\n").trim();
93
93
  };
94
94
 
95
95
  // lib/index.ts
@@ -52,5 +52,7 @@ export const ${componentName} = (props: Props) => {
52
52
 
53
53
  export const use${componentName} = createUseComponent(${componentName}, pinLabels)
54
54
 
55
- `.trim()
55
+ `
56
+ .replace(/\n\s*\n/g, "\n")
57
+ .trim()
56
58
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "circuit-json-to-tscircuit",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.3",
5
+ "version": "0.0.4",
6
6
  "scripts": {
7
7
  "build": "tsup-node lib/index.ts --format esm --dts",
8
8
  "test": "bun test",
@@ -26,21 +26,14 @@ test("test1 basic circuit", async () => {
26
26
  expect(tscircuit).toMatchInlineSnapshot(`
27
27
  "import { createUseComponent } from "@tscircuit/core"
28
28
  import type { CommonLayoutProps } from "@tscircuit/props"
29
-
30
29
  const pinLabels = undefined as const
31
-
32
30
  interface Props extends CommonLayoutProps {
33
31
  name: string
34
32
  }
35
-
36
33
  export const MyResistor = (props: Props) => {
37
34
  return (
38
35
  <chip
39
36
  {...props}
40
-
41
-
42
-
43
-
44
37
  footprint={<footprint>
45
38
  <smtpad portHints={["1","left"]} pcbX="-0.5mm" pcbY="0mm" width="0.6000000000000001mm" height="0.6000000000000001mm" shape="rect" />
46
39
  <smtpad portHints={["2","right"]} pcbX="0.5mm" pcbY="0mm" width="0.6000000000000001mm" height="0.6000000000000001mm" shape="rect" />
@@ -48,7 +41,6 @@ export const MyResistor = (props: Props) => {
48
41
  />
49
42
  )
50
43
  }
51
-
52
44
  export const useMyResistor = createUseComponent(MyResistor, pinLabels)"
53
45
  `)
54
46
  })
@@ -27,7 +27,6 @@ test("test2 getComponentUsingTemplate", async () => {
27
27
  expect(tscircuitCode).toMatchInlineSnapshot(`
28
28
  "import { createUseComponent } from "@tscircuit/core"
29
29
  import type { CommonLayoutProps } from "@tscircuit/props"
30
-
31
30
  const pinLabels = {
32
31
  "pin1": [
33
32
  "pin1"
@@ -36,11 +35,9 @@ const pinLabels = {
36
35
  "pin2"
37
36
  ]
38
37
  } as const
39
-
40
38
  interface Props extends CommonLayoutProps {
41
39
  name: string
42
40
  }
43
-
44
41
  export const MyResistor = (props: Props) => {
45
42
  return (
46
43
  <chip
@@ -71,7 +68,6 @@ export const MyResistor = (props: Props) => {
71
68
  />
72
69
  )
73
70
  }
74
-
75
71
  export const useMyResistor = createUseComponent(MyResistor, pinLabels)"
76
72
  `)
77
73
  })
@@ -0,0 +1,954 @@
1
+ import { test, expect } from "bun:test"
2
+ import { convertCircuitJsonToTscircuit } from "lib"
3
+
4
+ test("test3 kicad mod circuit json example", async () => {
5
+ const tscircuit = convertCircuitJsonToTscircuit(circuitJson, {
6
+ componentName: "Test3Component",
7
+ })
8
+
9
+ expect(tscircuit).toMatchInlineSnapshot(`
10
+ "import { createUseComponent } from "@tscircuit/core"
11
+ import type { CommonLayoutProps } from "@tscircuit/props"
12
+ const pinLabels = undefined as const
13
+ interface Props extends CommonLayoutProps {
14
+ name: string
15
+ }
16
+ export const Test3Component = (props: Props) => {
17
+ return (
18
+ <chip
19
+ {...props}
20
+ footprint={<footprint>
21
+ <platedhole portHints={["1"]} pcbX="-8.89mm" pcbY="7.62mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
22
+ <platedhole portHints={["2"]} pcbX="-8.89mm" pcbY="5.08mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
23
+ <platedhole portHints={["2"]} pcbX="-7.62mm" pcbY="5.08mm" outerDiameter="1.4mm" holeDiameter="0.85mm" shape="circle" />
24
+ <platedhole portHints={["3"]} pcbX="-8.89mm" pcbY="2.54mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
25
+ <platedhole portHints={["3"]} pcbX="-7.62mm" pcbY="2.54mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
26
+ <platedhole portHints={["4"]} pcbX="-8.89mm" pcbY="0mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
27
+ <platedhole portHints={["4"]} pcbX="-7.62mm" pcbY="0mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
28
+ <platedhole portHints={["5"]} pcbX="-8.89mm" pcbY="-2.54mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
29
+ <platedhole portHints={["5"]} pcbX="-7.62mm" pcbY="-2.54mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
30
+ <platedhole portHints={["6"]} pcbX="-8.89mm" pcbY="-5.08mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
31
+ <platedhole portHints={["6"]} pcbX="-7.62mm" pcbY="-5.08mm" outerDiameter="1.4mm" holeDiameter="0.85mm" shape="circle" />
32
+ <platedhole portHints={["7"]} pcbX="-8.89mm" pcbY="-7.62mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
33
+ <platedhole portHints={["7"]} pcbX="-7.62mm" pcbY="-7.62mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
34
+ <platedhole portHints={["8"]} pcbX="7.62mm" pcbY="-7.62mm" outerDiameter="1.524mm" holeDiameter="0.889mm" shape="circle" />
35
+ <platedhole portHints={["8"]} pcbX="8.89mm" pcbY="-7.62mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
36
+ <platedhole portHints={["9"]} pcbX="7.62mm" pcbY="-5.08mm" outerDiameter="1.4mm" holeDiameter="0.85mm" shape="circle" />
37
+ <platedhole portHints={["9"]} pcbX="8.89mm" pcbY="-5.08mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
38
+ <platedhole portHints={["10"]} pcbX="7.62mm" pcbY="-2.54mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
39
+ <platedhole portHints={["10"]} pcbX="8.89mm" pcbY="-2.54mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
40
+ <platedhole portHints={["11"]} pcbX="7.62mm" pcbY="0mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
41
+ <platedhole portHints={["11"]} pcbX="8.89mm" pcbY="0mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
42
+ <platedhole portHints={["12"]} pcbX="7.62mm" pcbY="2.54mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
43
+ <platedhole portHints={["12"]} pcbX="8.89mm" pcbY="2.54mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
44
+ <platedhole portHints={["13"]} pcbX="7.62mm" pcbY="5.08mm" outerDiameter="1.4mm" holeDiameter="0.85mm" shape="circle" />
45
+ <platedhole portHints={["13"]} pcbX="8.89mm" pcbY="5.08mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
46
+ <platedhole portHints={["14"]} pcbX="7.62mm" pcbY="7.62mm" outerDiameter="1.5mm" holeDiameter="0.85mm" shape="circle" />
47
+ <platedhole portHints={["14"]} pcbX="8.89mm" pcbY="7.62mm" outerDiameter="1.27mm" holeDiameter="0.7mm" shape="circle" />
48
+ <smtpad portHints={["1"]} pcbX="-8.278mm" pcbY="7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
49
+ <smtpad portHints={["1"]} pcbX="-8.278mm" pcbY="7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
50
+ <smtpad portHints={["2"]} pcbX="-8.337mm" pcbY="5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
51
+ <smtpad portHints={["2"]} pcbX="-8.337mm" pcbY="5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
52
+ <smtpad portHints={["3"]} pcbX="-8.278mm" pcbY="2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
53
+ <smtpad portHints={["3"]} pcbX="-8.278mm" pcbY="2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
54
+ <smtpad portHints={["4"]} pcbX="-8.278mm" pcbY="0mm" width="1.626mm" height="1.325mm" shape="rect" />
55
+ <smtpad portHints={["4"]} pcbX="-8.278mm" pcbY="0mm" width="1.626mm" height="1.325mm" shape="rect" />
56
+ <smtpad portHints={["5"]} pcbX="-8.278mm" pcbY="-2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
57
+ <smtpad portHints={["5"]} pcbX="-8.278mm" pcbY="-2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
58
+ <smtpad portHints={["6"]} pcbX="-8.337mm" pcbY="-5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
59
+ <smtpad portHints={["6"]} pcbX="-8.337mm" pcbY="-5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
60
+ <smtpad portHints={["7"]} pcbX="-8.278mm" pcbY="-7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
61
+ <smtpad portHints={["7"]} pcbX="-8.278mm" pcbY="-7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
62
+ <smtpad portHints={["8"]} pcbX="8.278mm" pcbY="-7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
63
+ <smtpad portHints={["8"]} pcbX="8.278mm" pcbY="-7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
64
+ <smtpad portHints={["9"]} pcbX="8.337mm" pcbY="-5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
65
+ <smtpad portHints={["9"]} pcbX="8.337mm" pcbY="-5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
66
+ <smtpad portHints={["10"]} pcbX="8.278mm" pcbY="-2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
67
+ <smtpad portHints={["10"]} pcbX="8.278mm" pcbY="-2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
68
+ <smtpad portHints={["11"]} pcbX="8.278mm" pcbY="0mm" width="1.626mm" height="1.325mm" shape="rect" />
69
+ <smtpad portHints={["11"]} pcbX="8.278mm" pcbY="0mm" width="1.626mm" height="1.325mm" shape="rect" />
70
+ <smtpad portHints={["12"]} pcbX="8.278mm" pcbY="2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
71
+ <smtpad portHints={["12"]} pcbX="8.278mm" pcbY="2.54mm" width="1.626mm" height="1.325mm" shape="rect" />
72
+ <smtpad portHints={["13"]} pcbX="8.337mm" pcbY="5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
73
+ <smtpad portHints={["13"]} pcbX="8.337mm" pcbY="5.08mm" width="1.626mm" height="1.208mm" shape="rect" />
74
+ <smtpad portHints={["14"]} pcbX="8.278mm" pcbY="7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
75
+ <smtpad portHints={["14"]} pcbX="8.278mm" pcbY="7.62mm" width="1.626mm" height="1.325mm" shape="rect" />
76
+ <silkscreenpath route={[{"x":-8.89,"y":-8.509},{"x":-8.89,"y":8.636}]} />
77
+ <silkscreenpath route={[{"x":-6.985,"y":-10.414},{"x":6.985,"y":-10.414}]} />
78
+ <silkscreenpath route={[{"x":6.985,"y":10.541},{"x":-6.985,"y":10.541}]} />
79
+ <silkscreenpath route={[{"x":8.89,"y":-8.509},{"x":8.89,"y":8.636}]} />
80
+ <silkscreenpath route={[{"x":-8.89,"y":8.636},{"x":-8.634777964987212,"y":9.588499698293818},{"x":-7.937499698293819,"y":10.285777964987211},{"x":-6.985,"y":10.541}]} />
81
+ <silkscreenpath route={[{"x":-6.985,"y":-10.414},{"x":-7.937499698293818,"y":-10.158777964987209},{"x":-8.63477796498721,"y":-9.461499698293817},{"x":-8.89,"y":-8.509}]} />
82
+ <silkscreenpath route={[{"x":6.985,"y":10.541},{"x":7.937499698293818,"y":10.285777964987211},{"x":8.63477796498721,"y":9.588499698293818},{"x":8.889999999999999,"y":8.636}]} />
83
+ <silkscreenpath route={[{"x":8.89,"y":-8.509},{"x":8.63477796498721,"y":-9.461499698293817},{"x":7.937499698293818,"y":-10.158777964987209},{"x":6.985,"y":-10.413999999999998}]} />
84
+ </footprint>}
85
+ />
86
+ )
87
+ }
88
+ export const useTest3Component = createUseComponent(Test3Component, pinLabels)"
89
+ `)
90
+ })
91
+
92
+ const circuitJson: any = [
93
+ {
94
+ type: "source_component",
95
+ source_component_id: "generic_0",
96
+ supplier_part_numbers: {},
97
+ },
98
+ {
99
+ type: "schematic_component",
100
+ schematic_component_id: "schematic_generic_component_0",
101
+ source_component_id: "generic_0",
102
+ center: {
103
+ x: 0,
104
+ y: 0,
105
+ },
106
+ rotation: 0,
107
+ size: {
108
+ width: 0,
109
+ height: 0,
110
+ },
111
+ },
112
+ {
113
+ type: "pcb_component",
114
+ source_component_id: "generic_0",
115
+ pcb_component_id: "pcb_generic_component_0",
116
+ layer: "top",
117
+ center: {
118
+ x: 0,
119
+ y: 0,
120
+ },
121
+ rotation: 0,
122
+ width: 19.05,
123
+ height: 16.752000000000002,
124
+ },
125
+ {
126
+ type: "pcb_plated_hole",
127
+ x: -8.89,
128
+ y: 7.62,
129
+ layers: ["top", "bottom"],
130
+ hole_diameter: 0.7,
131
+ shape: "circle",
132
+ outer_diameter: 1.27,
133
+ port_hints: ["1"],
134
+ pcb_component_id: "pcb_generic_component_0",
135
+ },
136
+ {
137
+ type: "pcb_smtpad",
138
+ pcb_smtpad_id: "pcb_smtpad_0",
139
+ shape: "rect",
140
+ x: -8.278,
141
+ y: 7.62,
142
+ width: 1.626,
143
+ height: 1.325,
144
+ layer: "top",
145
+ pcb_component_id: "pcb_generic_component_0",
146
+ port_hints: ["1"],
147
+ },
148
+ {
149
+ type: "pcb_smtpad",
150
+ pcb_smtpad_id: "pcb_smtpad_1",
151
+ shape: "rect",
152
+ x: -8.278,
153
+ y: 7.62,
154
+ width: 1.626,
155
+ height: 1.325,
156
+ layer: "top",
157
+ pcb_component_id: "pcb_generic_component_0",
158
+ port_hints: ["1"],
159
+ },
160
+ {
161
+ type: "pcb_plated_hole",
162
+ x: -8.89,
163
+ y: 5.08,
164
+ layers: ["top", "bottom"],
165
+ hole_diameter: 0.7,
166
+ shape: "circle",
167
+ outer_diameter: 1.27,
168
+ port_hints: ["2"],
169
+ pcb_component_id: "pcb_generic_component_0",
170
+ },
171
+ {
172
+ type: "pcb_smtpad",
173
+ pcb_smtpad_id: "pcb_smtpad_2",
174
+ shape: "rect",
175
+ x: -8.337,
176
+ y: 5.08,
177
+ width: 1.626,
178
+ height: 1.208,
179
+ layer: "top",
180
+ pcb_component_id: "pcb_generic_component_0",
181
+ port_hints: ["2"],
182
+ },
183
+ {
184
+ type: "pcb_smtpad",
185
+ pcb_smtpad_id: "pcb_smtpad_3",
186
+ shape: "rect",
187
+ x: -8.337,
188
+ y: 5.08,
189
+ width: 1.626,
190
+ height: 1.208,
191
+ layer: "top",
192
+ pcb_component_id: "pcb_generic_component_0",
193
+ port_hints: ["2"],
194
+ },
195
+ {
196
+ type: "pcb_plated_hole",
197
+ x: -7.62,
198
+ y: 5.08,
199
+ layers: ["top", "bottom"],
200
+ hole_diameter: 0.85,
201
+ shape: "circle",
202
+ outer_diameter: 1.4,
203
+ port_hints: ["2"],
204
+ pcb_component_id: "pcb_generic_component_0",
205
+ },
206
+ {
207
+ type: "pcb_plated_hole",
208
+ x: -8.89,
209
+ y: 2.54,
210
+ layers: ["top", "bottom"],
211
+ hole_diameter: 0.7,
212
+ shape: "circle",
213
+ outer_diameter: 1.27,
214
+ port_hints: ["3"],
215
+ pcb_component_id: "pcb_generic_component_0",
216
+ },
217
+ {
218
+ type: "pcb_smtpad",
219
+ pcb_smtpad_id: "pcb_smtpad_4",
220
+ shape: "rect",
221
+ x: -8.278,
222
+ y: 2.54,
223
+ width: 1.626,
224
+ height: 1.325,
225
+ layer: "top",
226
+ pcb_component_id: "pcb_generic_component_0",
227
+ port_hints: ["3"],
228
+ },
229
+ {
230
+ type: "pcb_smtpad",
231
+ pcb_smtpad_id: "pcb_smtpad_5",
232
+ shape: "rect",
233
+ x: -8.278,
234
+ y: 2.54,
235
+ width: 1.626,
236
+ height: 1.325,
237
+ layer: "top",
238
+ pcb_component_id: "pcb_generic_component_0",
239
+ port_hints: ["3"],
240
+ },
241
+ {
242
+ type: "pcb_plated_hole",
243
+ x: -7.62,
244
+ y: 2.54,
245
+ layers: ["top", "bottom"],
246
+ hole_diameter: 0.85,
247
+ shape: "circle",
248
+ outer_diameter: 1.5,
249
+ port_hints: ["3"],
250
+ pcb_component_id: "pcb_generic_component_0",
251
+ },
252
+ {
253
+ type: "pcb_plated_hole",
254
+ x: -8.89,
255
+ y: 0,
256
+ layers: ["top", "bottom"],
257
+ hole_diameter: 0.7,
258
+ shape: "circle",
259
+ outer_diameter: 1.27,
260
+ port_hints: ["4"],
261
+ pcb_component_id: "pcb_generic_component_0",
262
+ },
263
+ {
264
+ type: "pcb_smtpad",
265
+ pcb_smtpad_id: "pcb_smtpad_6",
266
+ shape: "rect",
267
+ x: -8.278,
268
+ y: 0,
269
+ width: 1.626,
270
+ height: 1.325,
271
+ layer: "top",
272
+ pcb_component_id: "pcb_generic_component_0",
273
+ port_hints: ["4"],
274
+ },
275
+ {
276
+ type: "pcb_smtpad",
277
+ pcb_smtpad_id: "pcb_smtpad_7",
278
+ shape: "rect",
279
+ x: -8.278,
280
+ y: 0,
281
+ width: 1.626,
282
+ height: 1.325,
283
+ layer: "top",
284
+ pcb_component_id: "pcb_generic_component_0",
285
+ port_hints: ["4"],
286
+ },
287
+ {
288
+ type: "pcb_plated_hole",
289
+ x: -7.62,
290
+ y: 0,
291
+ layers: ["top", "bottom"],
292
+ hole_diameter: 0.85,
293
+ shape: "circle",
294
+ outer_diameter: 1.5,
295
+ port_hints: ["4"],
296
+ pcb_component_id: "pcb_generic_component_0",
297
+ },
298
+ {
299
+ type: "pcb_plated_hole",
300
+ x: -8.89,
301
+ y: -2.54,
302
+ layers: ["top", "bottom"],
303
+ hole_diameter: 0.7,
304
+ shape: "circle",
305
+ outer_diameter: 1.27,
306
+ port_hints: ["5"],
307
+ pcb_component_id: "pcb_generic_component_0",
308
+ },
309
+ {
310
+ type: "pcb_smtpad",
311
+ pcb_smtpad_id: "pcb_smtpad_8",
312
+ shape: "rect",
313
+ x: -8.278,
314
+ y: -2.54,
315
+ width: 1.626,
316
+ height: 1.325,
317
+ layer: "top",
318
+ pcb_component_id: "pcb_generic_component_0",
319
+ port_hints: ["5"],
320
+ },
321
+ {
322
+ type: "pcb_smtpad",
323
+ pcb_smtpad_id: "pcb_smtpad_9",
324
+ shape: "rect",
325
+ x: -8.278,
326
+ y: -2.54,
327
+ width: 1.626,
328
+ height: 1.325,
329
+ layer: "top",
330
+ pcb_component_id: "pcb_generic_component_0",
331
+ port_hints: ["5"],
332
+ },
333
+ {
334
+ type: "pcb_plated_hole",
335
+ x: -7.62,
336
+ y: -2.54,
337
+ layers: ["top", "bottom"],
338
+ hole_diameter: 0.85,
339
+ shape: "circle",
340
+ outer_diameter: 1.5,
341
+ port_hints: ["5"],
342
+ pcb_component_id: "pcb_generic_component_0",
343
+ },
344
+ {
345
+ type: "pcb_plated_hole",
346
+ x: -8.89,
347
+ y: -5.08,
348
+ layers: ["top", "bottom"],
349
+ hole_diameter: 0.7,
350
+ shape: "circle",
351
+ outer_diameter: 1.27,
352
+ port_hints: ["6"],
353
+ pcb_component_id: "pcb_generic_component_0",
354
+ },
355
+ {
356
+ type: "pcb_smtpad",
357
+ pcb_smtpad_id: "pcb_smtpad_10",
358
+ shape: "rect",
359
+ x: -8.337,
360
+ y: -5.08,
361
+ width: 1.626,
362
+ height: 1.208,
363
+ layer: "top",
364
+ pcb_component_id: "pcb_generic_component_0",
365
+ port_hints: ["6"],
366
+ },
367
+ {
368
+ type: "pcb_smtpad",
369
+ pcb_smtpad_id: "pcb_smtpad_11",
370
+ shape: "rect",
371
+ x: -8.337,
372
+ y: -5.08,
373
+ width: 1.626,
374
+ height: 1.208,
375
+ layer: "top",
376
+ pcb_component_id: "pcb_generic_component_0",
377
+ port_hints: ["6"],
378
+ },
379
+ {
380
+ type: "pcb_plated_hole",
381
+ x: -7.62,
382
+ y: -5.08,
383
+ layers: ["top", "bottom"],
384
+ hole_diameter: 0.85,
385
+ shape: "circle",
386
+ outer_diameter: 1.4,
387
+ port_hints: ["6"],
388
+ pcb_component_id: "pcb_generic_component_0",
389
+ },
390
+ {
391
+ type: "pcb_plated_hole",
392
+ x: -8.89,
393
+ y: -7.62,
394
+ layers: ["top", "bottom"],
395
+ hole_diameter: 0.7,
396
+ shape: "circle",
397
+ outer_diameter: 1.27,
398
+ port_hints: ["7"],
399
+ pcb_component_id: "pcb_generic_component_0",
400
+ },
401
+ {
402
+ type: "pcb_smtpad",
403
+ pcb_smtpad_id: "pcb_smtpad_12",
404
+ shape: "rect",
405
+ x: -8.278,
406
+ y: -7.62,
407
+ width: 1.626,
408
+ height: 1.325,
409
+ layer: "top",
410
+ pcb_component_id: "pcb_generic_component_0",
411
+ port_hints: ["7"],
412
+ },
413
+ {
414
+ type: "pcb_smtpad",
415
+ pcb_smtpad_id: "pcb_smtpad_13",
416
+ shape: "rect",
417
+ x: -8.278,
418
+ y: -7.62,
419
+ width: 1.626,
420
+ height: 1.325,
421
+ layer: "top",
422
+ pcb_component_id: "pcb_generic_component_0",
423
+ port_hints: ["7"],
424
+ },
425
+ {
426
+ type: "pcb_plated_hole",
427
+ x: -7.62,
428
+ y: -7.62,
429
+ layers: ["top", "bottom"],
430
+ hole_diameter: 0.85,
431
+ shape: "circle",
432
+ outer_diameter: 1.5,
433
+ port_hints: ["7"],
434
+ pcb_component_id: "pcb_generic_component_0",
435
+ },
436
+ {
437
+ type: "pcb_plated_hole",
438
+ x: 7.62,
439
+ y: -7.62,
440
+ layers: ["top", "bottom"],
441
+ hole_diameter: 0.889,
442
+ shape: "circle",
443
+ outer_diameter: 1.524,
444
+ port_hints: ["8"],
445
+ pcb_component_id: "pcb_generic_component_0",
446
+ },
447
+ {
448
+ type: "pcb_smtpad",
449
+ pcb_smtpad_id: "pcb_smtpad_14",
450
+ shape: "rect",
451
+ x: 8.278,
452
+ y: -7.62,
453
+ width: 1.626,
454
+ height: 1.325,
455
+ layer: "top",
456
+ pcb_component_id: "pcb_generic_component_0",
457
+ port_hints: ["8"],
458
+ },
459
+ {
460
+ type: "pcb_smtpad",
461
+ pcb_smtpad_id: "pcb_smtpad_15",
462
+ shape: "rect",
463
+ x: 8.278,
464
+ y: -7.62,
465
+ width: 1.626,
466
+ height: 1.325,
467
+ layer: "top",
468
+ pcb_component_id: "pcb_generic_component_0",
469
+ port_hints: ["8"],
470
+ },
471
+ {
472
+ type: "pcb_plated_hole",
473
+ x: 8.89,
474
+ y: -7.62,
475
+ layers: ["top", "bottom"],
476
+ hole_diameter: 0.7,
477
+ shape: "circle",
478
+ outer_diameter: 1.27,
479
+ port_hints: ["8"],
480
+ pcb_component_id: "pcb_generic_component_0",
481
+ },
482
+ {
483
+ type: "pcb_plated_hole",
484
+ x: 7.62,
485
+ y: -5.08,
486
+ layers: ["top", "bottom"],
487
+ hole_diameter: 0.85,
488
+ shape: "circle",
489
+ outer_diameter: 1.4,
490
+ port_hints: ["9"],
491
+ pcb_component_id: "pcb_generic_component_0",
492
+ },
493
+ {
494
+ type: "pcb_smtpad",
495
+ pcb_smtpad_id: "pcb_smtpad_16",
496
+ shape: "rect",
497
+ x: 8.337,
498
+ y: -5.08,
499
+ width: 1.626,
500
+ height: 1.208,
501
+ layer: "top",
502
+ pcb_component_id: "pcb_generic_component_0",
503
+ port_hints: ["9"],
504
+ },
505
+ {
506
+ type: "pcb_smtpad",
507
+ pcb_smtpad_id: "pcb_smtpad_17",
508
+ shape: "rect",
509
+ x: 8.337,
510
+ y: -5.08,
511
+ width: 1.626,
512
+ height: 1.208,
513
+ layer: "top",
514
+ pcb_component_id: "pcb_generic_component_0",
515
+ port_hints: ["9"],
516
+ },
517
+ {
518
+ type: "pcb_plated_hole",
519
+ x: 8.89,
520
+ y: -5.08,
521
+ layers: ["top", "bottom"],
522
+ hole_diameter: 0.7,
523
+ shape: "circle",
524
+ outer_diameter: 1.27,
525
+ port_hints: ["9"],
526
+ pcb_component_id: "pcb_generic_component_0",
527
+ },
528
+ {
529
+ type: "pcb_plated_hole",
530
+ x: 7.62,
531
+ y: -2.54,
532
+ layers: ["top", "bottom"],
533
+ hole_diameter: 0.85,
534
+ shape: "circle",
535
+ outer_diameter: 1.5,
536
+ port_hints: ["10"],
537
+ pcb_component_id: "pcb_generic_component_0",
538
+ },
539
+ {
540
+ type: "pcb_smtpad",
541
+ pcb_smtpad_id: "pcb_smtpad_18",
542
+ shape: "rect",
543
+ x: 8.278,
544
+ y: -2.54,
545
+ width: 1.626,
546
+ height: 1.325,
547
+ layer: "top",
548
+ pcb_component_id: "pcb_generic_component_0",
549
+ port_hints: ["10"],
550
+ },
551
+ {
552
+ type: "pcb_smtpad",
553
+ pcb_smtpad_id: "pcb_smtpad_19",
554
+ shape: "rect",
555
+ x: 8.278,
556
+ y: -2.54,
557
+ width: 1.626,
558
+ height: 1.325,
559
+ layer: "top",
560
+ pcb_component_id: "pcb_generic_component_0",
561
+ port_hints: ["10"],
562
+ },
563
+ {
564
+ type: "pcb_plated_hole",
565
+ x: 8.89,
566
+ y: -2.54,
567
+ layers: ["top", "bottom"],
568
+ hole_diameter: 0.7,
569
+ shape: "circle",
570
+ outer_diameter: 1.27,
571
+ port_hints: ["10"],
572
+ pcb_component_id: "pcb_generic_component_0",
573
+ },
574
+ {
575
+ type: "pcb_plated_hole",
576
+ x: 7.62,
577
+ y: 0,
578
+ layers: ["top", "bottom"],
579
+ hole_diameter: 0.85,
580
+ shape: "circle",
581
+ outer_diameter: 1.5,
582
+ port_hints: ["11"],
583
+ pcb_component_id: "pcb_generic_component_0",
584
+ },
585
+ {
586
+ type: "pcb_smtpad",
587
+ pcb_smtpad_id: "pcb_smtpad_20",
588
+ shape: "rect",
589
+ x: 8.278,
590
+ y: 0,
591
+ width: 1.626,
592
+ height: 1.325,
593
+ layer: "top",
594
+ pcb_component_id: "pcb_generic_component_0",
595
+ port_hints: ["11"],
596
+ },
597
+ {
598
+ type: "pcb_smtpad",
599
+ pcb_smtpad_id: "pcb_smtpad_21",
600
+ shape: "rect",
601
+ x: 8.278,
602
+ y: 0,
603
+ width: 1.626,
604
+ height: 1.325,
605
+ layer: "top",
606
+ pcb_component_id: "pcb_generic_component_0",
607
+ port_hints: ["11"],
608
+ },
609
+ {
610
+ type: "pcb_plated_hole",
611
+ x: 8.89,
612
+ y: 0,
613
+ layers: ["top", "bottom"],
614
+ hole_diameter: 0.7,
615
+ shape: "circle",
616
+ outer_diameter: 1.27,
617
+ port_hints: ["11"],
618
+ pcb_component_id: "pcb_generic_component_0",
619
+ },
620
+ {
621
+ type: "pcb_plated_hole",
622
+ x: 7.62,
623
+ y: 2.54,
624
+ layers: ["top", "bottom"],
625
+ hole_diameter: 0.85,
626
+ shape: "circle",
627
+ outer_diameter: 1.5,
628
+ port_hints: ["12"],
629
+ pcb_component_id: "pcb_generic_component_0",
630
+ },
631
+ {
632
+ type: "pcb_smtpad",
633
+ pcb_smtpad_id: "pcb_smtpad_22",
634
+ shape: "rect",
635
+ x: 8.278,
636
+ y: 2.54,
637
+ width: 1.626,
638
+ height: 1.325,
639
+ layer: "top",
640
+ pcb_component_id: "pcb_generic_component_0",
641
+ port_hints: ["12"],
642
+ },
643
+ {
644
+ type: "pcb_smtpad",
645
+ pcb_smtpad_id: "pcb_smtpad_23",
646
+ shape: "rect",
647
+ x: 8.278,
648
+ y: 2.54,
649
+ width: 1.626,
650
+ height: 1.325,
651
+ layer: "top",
652
+ pcb_component_id: "pcb_generic_component_0",
653
+ port_hints: ["12"],
654
+ },
655
+ {
656
+ type: "pcb_plated_hole",
657
+ x: 8.89,
658
+ y: 2.54,
659
+ layers: ["top", "bottom"],
660
+ hole_diameter: 0.7,
661
+ shape: "circle",
662
+ outer_diameter: 1.27,
663
+ port_hints: ["12"],
664
+ pcb_component_id: "pcb_generic_component_0",
665
+ },
666
+ {
667
+ type: "pcb_plated_hole",
668
+ x: 7.62,
669
+ y: 5.08,
670
+ layers: ["top", "bottom"],
671
+ hole_diameter: 0.85,
672
+ shape: "circle",
673
+ outer_diameter: 1.4,
674
+ port_hints: ["13"],
675
+ pcb_component_id: "pcb_generic_component_0",
676
+ },
677
+ {
678
+ type: "pcb_smtpad",
679
+ pcb_smtpad_id: "pcb_smtpad_24",
680
+ shape: "rect",
681
+ x: 8.337,
682
+ y: 5.08,
683
+ width: 1.626,
684
+ height: 1.208,
685
+ layer: "top",
686
+ pcb_component_id: "pcb_generic_component_0",
687
+ port_hints: ["13"],
688
+ },
689
+ {
690
+ type: "pcb_smtpad",
691
+ pcb_smtpad_id: "pcb_smtpad_25",
692
+ shape: "rect",
693
+ x: 8.337,
694
+ y: 5.08,
695
+ width: 1.626,
696
+ height: 1.208,
697
+ layer: "top",
698
+ pcb_component_id: "pcb_generic_component_0",
699
+ port_hints: ["13"],
700
+ },
701
+ {
702
+ type: "pcb_plated_hole",
703
+ x: 8.89,
704
+ y: 5.08,
705
+ layers: ["top", "bottom"],
706
+ hole_diameter: 0.7,
707
+ shape: "circle",
708
+ outer_diameter: 1.27,
709
+ port_hints: ["13"],
710
+ pcb_component_id: "pcb_generic_component_0",
711
+ },
712
+ {
713
+ type: "pcb_plated_hole",
714
+ x: 7.62,
715
+ y: 7.62,
716
+ layers: ["top", "bottom"],
717
+ hole_diameter: 0.85,
718
+ shape: "circle",
719
+ outer_diameter: 1.5,
720
+ port_hints: ["14"],
721
+ pcb_component_id: "pcb_generic_component_0",
722
+ },
723
+ {
724
+ type: "pcb_smtpad",
725
+ pcb_smtpad_id: "pcb_smtpad_26",
726
+ shape: "rect",
727
+ x: 8.278,
728
+ y: 7.62,
729
+ width: 1.626,
730
+ height: 1.325,
731
+ layer: "top",
732
+ pcb_component_id: "pcb_generic_component_0",
733
+ port_hints: ["14"],
734
+ },
735
+ {
736
+ type: "pcb_smtpad",
737
+ pcb_smtpad_id: "pcb_smtpad_27",
738
+ shape: "rect",
739
+ x: 8.278,
740
+ y: 7.62,
741
+ width: 1.626,
742
+ height: 1.325,
743
+ layer: "top",
744
+ pcb_component_id: "pcb_generic_component_0",
745
+ port_hints: ["14"],
746
+ },
747
+ {
748
+ type: "pcb_plated_hole",
749
+ x: 8.89,
750
+ y: 7.62,
751
+ layers: ["top", "bottom"],
752
+ hole_diameter: 0.7,
753
+ shape: "circle",
754
+ outer_diameter: 1.27,
755
+ port_hints: ["14"],
756
+ pcb_component_id: "pcb_generic_component_0",
757
+ },
758
+ {
759
+ type: "pcb_silkscreen_path",
760
+ layer: "top",
761
+ pcb_component_id: "pcb_generic_component_0",
762
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_0",
763
+ route: [
764
+ {
765
+ x: -8.89,
766
+ y: -8.509,
767
+ },
768
+ {
769
+ x: -8.89,
770
+ y: 8.636,
771
+ },
772
+ ],
773
+ stroke_width: 0.1,
774
+ },
775
+ {
776
+ type: "pcb_silkscreen_path",
777
+ layer: "top",
778
+ pcb_component_id: "pcb_generic_component_0",
779
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_1",
780
+ route: [
781
+ {
782
+ x: -6.985,
783
+ y: -10.414,
784
+ },
785
+ {
786
+ x: 6.985,
787
+ y: -10.414,
788
+ },
789
+ ],
790
+ stroke_width: 0.1,
791
+ },
792
+ {
793
+ type: "pcb_silkscreen_path",
794
+ layer: "top",
795
+ pcb_component_id: "pcb_generic_component_0",
796
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_2",
797
+ route: [
798
+ {
799
+ x: 6.985,
800
+ y: 10.541,
801
+ },
802
+ {
803
+ x: -6.985,
804
+ y: 10.541,
805
+ },
806
+ ],
807
+ stroke_width: 0.1,
808
+ },
809
+ {
810
+ type: "pcb_silkscreen_path",
811
+ layer: "top",
812
+ pcb_component_id: "pcb_generic_component_0",
813
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_3",
814
+ route: [
815
+ {
816
+ x: 8.89,
817
+ y: -8.509,
818
+ },
819
+ {
820
+ x: 8.89,
821
+ y: 8.636,
822
+ },
823
+ ],
824
+ stroke_width: 0.1,
825
+ },
826
+ {
827
+ type: "pcb_silkscreen_path",
828
+ layer: "top",
829
+ pcb_component_id: "pcb_generic_component_0",
830
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_4",
831
+ route: [
832
+ {
833
+ x: -8.89,
834
+ y: 8.636,
835
+ },
836
+ {
837
+ x: -8.634777964987212,
838
+ y: 9.588499698293818,
839
+ },
840
+ {
841
+ x: -7.937499698293819,
842
+ y: 10.285777964987211,
843
+ },
844
+ {
845
+ x: -6.985,
846
+ y: 10.541,
847
+ },
848
+ ],
849
+ stroke_width: 0.1,
850
+ },
851
+ {
852
+ type: "pcb_silkscreen_path",
853
+ layer: "top",
854
+ pcb_component_id: "pcb_generic_component_0",
855
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_5",
856
+ route: [
857
+ {
858
+ x: -6.985,
859
+ y: -10.414,
860
+ },
861
+ {
862
+ x: -7.937499698293818,
863
+ y: -10.158777964987209,
864
+ },
865
+ {
866
+ x: -8.63477796498721,
867
+ y: -9.461499698293817,
868
+ },
869
+ {
870
+ x: -8.89,
871
+ y: -8.509,
872
+ },
873
+ ],
874
+ stroke_width: 0.1,
875
+ },
876
+ {
877
+ type: "pcb_silkscreen_path",
878
+ layer: "top",
879
+ pcb_component_id: "pcb_generic_component_0",
880
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_6",
881
+ route: [
882
+ {
883
+ x: 6.985,
884
+ y: 10.541,
885
+ },
886
+ {
887
+ x: 7.937499698293818,
888
+ y: 10.285777964987211,
889
+ },
890
+ {
891
+ x: 8.63477796498721,
892
+ y: 9.588499698293818,
893
+ },
894
+ {
895
+ x: 8.889999999999999,
896
+ y: 8.636,
897
+ },
898
+ ],
899
+ stroke_width: 0.1,
900
+ },
901
+ {
902
+ type: "pcb_silkscreen_path",
903
+ layer: "top",
904
+ pcb_component_id: "pcb_generic_component_0",
905
+ pcb_silkscreen_path_id: "pcb_silkscreen_path_7",
906
+ route: [
907
+ {
908
+ x: 8.89,
909
+ y: -8.509,
910
+ },
911
+ {
912
+ x: 8.63477796498721,
913
+ y: -9.461499698293817,
914
+ },
915
+ {
916
+ x: 7.937499698293818,
917
+ y: -10.158777964987209,
918
+ },
919
+ {
920
+ x: 6.985,
921
+ y: -10.413999999999998,
922
+ },
923
+ ],
924
+ stroke_width: 0.1,
925
+ },
926
+ {
927
+ type: "pcb_fabrication_note_text",
928
+ layer: "top",
929
+ font: "tscircuit2024",
930
+ font_size: 1.27,
931
+ pcb_component_id: "pcb_generic_component_0",
932
+ anchor_position: {
933
+ x: -8,
934
+ y: 11.5,
935
+ },
936
+ anchor_alignment: "center",
937
+ text: "REF**",
938
+ port_hints: [],
939
+ },
940
+ {
941
+ type: "pcb_fabrication_note_text",
942
+ layer: "top",
943
+ font: "tscircuit2024",
944
+ font_size: 1.27,
945
+ pcb_component_id: "pcb_generic_component_0",
946
+ anchor_position: {
947
+ x: 0,
948
+ y: 0,
949
+ },
950
+ anchor_alignment: "center",
951
+ text: "XIAO-Add-On",
952
+ port_hints: [],
953
+ },
954
+ ]