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 CHANGED
@@ -1,12 +1,65 @@
1
- # Gerber Stringification
1
+ # circuit-json-to-gerber
2
2
 
3
- Some components of this gerber system:
3
+ Convert a [Circuit JSON](https://github.com/tscircuit/circuit-json) to Gerber/Excellon files.
4
4
 
5
- - A JSON command representation (defined in part with zod), all gerber command
6
- definitions are in [./commands](./commands)
7
- - Each command features a stringification function
8
- - A function that converts soup to the Gerber commands [./src/convert-soup-to-gerber-commands](./convert-soup-to-gerber-commands)
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)