circuit-json-to-gerber 0.0.13 → 0.0.15
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 +59 -6
- package/dist/chunk-X6WYJTQL.js +1695 -0
- package/dist/chunk-X6WYJTQL.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +54 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +108 -4
- package/dist/index.js +10 -1406
- package/dist/index.js.map +1 -1
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -1,12 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# circuit-json-to-gerber
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Convert a [Circuit JSON](https://github.com/tscircuit/circuit-json) to Gerber/Excellon files.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Global installation for CLI usage
|
|
9
|
+
npm install -g circuit-json-to-gerber
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## CLI Usage
|
|
13
|
+
|
|
14
|
+
Convert a circuit JSON file to Gerber/Excellon files:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Basic usage - outputs to input.gerbers.zip
|
|
18
|
+
circuit-to-gerber input.circuit.json
|
|
19
|
+
|
|
20
|
+
# Specify custom output file
|
|
21
|
+
circuit-to-gerber input.circuit.json -o output.zip
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The output ZIP file will contain:
|
|
25
|
+
|
|
26
|
+
- Gerber files (\*.gbr) for each layer
|
|
27
|
+
- Plated drill file (plated.drl)
|
|
28
|
+
- Unplated drill file (unplated.drl)
|
|
29
|
+
|
|
30
|
+
## Library Usage
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import {
|
|
34
|
+
convertSoupToGerberCommands,
|
|
35
|
+
stringifyGerberCommandLayers,
|
|
36
|
+
} from "circuit-json-to-gerber"
|
|
37
|
+
import {
|
|
38
|
+
convertSoupToExcellonDrillCommands,
|
|
39
|
+
stringifyExcellonDrill,
|
|
40
|
+
} from "circuit-json-to-gerber"
|
|
41
|
+
|
|
42
|
+
// Convert Circuit JSON to Gerber commands
|
|
43
|
+
const gerberCommands = convertSoupToGerberCommands(circuitJson)
|
|
44
|
+
|
|
45
|
+
// Convert to Gerber file content
|
|
46
|
+
const gerberOutput = stringifyGerberCommandLayers(gerberCommands)
|
|
47
|
+
|
|
48
|
+
// Generate drill files
|
|
49
|
+
const platedDrillCommands = convertSoupToExcellonDrillCommands({
|
|
50
|
+
circuitJson,
|
|
51
|
+
is_plated: true,
|
|
52
|
+
})
|
|
53
|
+
const unplatedDrillCommands = convertSoupToExcellonDrillCommands({
|
|
54
|
+
circuitJson,
|
|
55
|
+
is_plated: false,
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const platedDrillOutput = stringifyExcellonDrill(platedDrillCommands)
|
|
59
|
+
const unplatedDrillOutput = stringifyExcellonDrill(unplatedDrillCommands)
|
|
60
|
+
```
|
|
9
61
|
|
|
10
62
|
## References
|
|
11
63
|
|
|
12
64
|
- [Gerber Format Specification (2022)](https://www.ucamco.com/files/downloads/file_en/456/gerber-layer-format-specification-revision-2022-02_en.pdf?7b3ca7f0753aa2d77f5f9afe31b9f826)
|
|
65
|
+
- [Excellon Drill Format Specification](https://gist.github.com/katyo/5692b935abc085b1037e)
|