circuit-json-to-step 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +55 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,58 @@
1
1
  # circuit-json-to-step
2
2
 
3
- IN PROGRESS
3
+ Convert [Circuit JSON](https://github.com/tscircuit/circuit-json) to STEP format for CAD integration.
4
4
 
5
- This repo helps convert circuit boards into a STEP representation suitable for import
6
- into CAD tools. This can help you align your circuit board in larger mechanical projects
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install circuit-json-to-step
9
+ # or
10
+ bun add circuit-json-to-step
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Basic Example
16
+
17
+ ```typescript
18
+ import { circuitJsonToStep } from "circuit-json-to-step"
19
+ import { writeFileSync } from "fs"
20
+
21
+ const circuitJson = [
22
+ {
23
+ type: "pcb_board",
24
+ pcb_board_id: "pcb_board_1",
25
+ width: 20,
26
+ height: 15,
27
+ thickness: 1.6,
28
+ center: { x: 0, y: 0 },
29
+ },
30
+ {
31
+ type: "pcb_hole",
32
+ pcb_hole_id: "pcb_hole_1",
33
+ hole_shape: "circle",
34
+ hole_diameter: 3.2,
35
+ x: 2.5,
36
+ y: 2.5,
37
+ },
38
+ ]
39
+
40
+ const stepText = await circuitJsonToStep(circuitJson, {
41
+ boardWidth: 20,
42
+ boardHeight: 15,
43
+ boardThickness: 1.6,
44
+ productName: "MyPCB",
45
+ })
46
+
47
+ writeFileSync("output.step", stepText)
48
+ ```
49
+
50
+ ## Related Projects
51
+
52
+ - [circuit-json](https://github.com/tscircuit/circuit-json) - Circuit JSON specification
53
+ - [stepts](https://github.com/tscircuit/stepts) - STEP file generation library
54
+ - [tscircuit](https://github.com/tscircuit/tscircuit) - Design circuits with code
55
+
56
+ ## License
57
+
58
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "circuit-json-to-step",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "pull-reference": "git clone https://github.com/tscircuit/circuit-json.git && find circuit-json/tests -name '*.test.ts' -exec bash -c 'mv \"$0\" \"${0%.test.ts}.ts\"' {} \\; && git clone https://github.com/tscircuit/stepts.git && find stepts/tests -name '*.test.ts' -exec bash -c 'mv \"$0\" \"${0%.test.ts}.ts\"' {} \\;",