circuit-json-to-lbrn 0.0.8 → 0.0.10

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 (39) hide show
  1. package/README.md +39 -2
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +596 -122
  4. package/lib/ConvertContext.ts +4 -0
  5. package/lib/element-handlers/addPcbTrace/index.ts +7 -1
  6. package/lib/element-handlers/addPlatedHole/addCirclePlatedHole.ts +38 -4
  7. package/lib/element-handlers/addPlatedHole/addCircularHoleWithRectPad.ts +32 -11
  8. package/lib/element-handlers/addPlatedHole/addHoleWithPolygonPad.ts +31 -9
  9. package/lib/element-handlers/addPlatedHole/addOvalPlatedHole.ts +38 -4
  10. package/lib/element-handlers/addPlatedHole/addPillHoleWithRectPad.ts +31 -9
  11. package/lib/element-handlers/addPlatedHole/addPillPlatedHole.ts +38 -4
  12. package/lib/element-handlers/addPlatedHole/addRotatedPillHoleWithRectPad.ts +31 -9
  13. package/lib/element-handlers/addSmtPad/addCircleSmtPad.ts +62 -0
  14. package/lib/element-handlers/addSmtPad/addPillSmtPad.ts +58 -0
  15. package/lib/element-handlers/addSmtPad/addPolygonSmtPad.ts +57 -0
  16. package/lib/element-handlers/addSmtPad/addRectSmtPad.ts +80 -12
  17. package/lib/element-handlers/addSmtPad/addRotatedPillSmtPad.ts +64 -0
  18. package/lib/element-handlers/addSmtPad/addRotatedRectSmtPad.ts +68 -0
  19. package/lib/element-handlers/addSmtPad/index.ts +25 -7
  20. package/lib/helpers/pathToPolygon.ts +14 -0
  21. package/lib/index.ts +39 -32
  22. package/package.json +2 -2
  23. package/tests/examples/__snapshots__/lga-interconnect.snap.svg +1 -1
  24. package/tests/examples/addPlatedHole/__snapshots__/pcb-plated-hole-circle.snap.svg +1 -1
  25. package/tests/examples/addPlatedHole/__snapshots__/pcb-plated-hole-oval.snap.svg +1 -1
  26. package/tests/examples/addSmtPad/__snapshots__/circleSmtPad.snap.svg +8 -0
  27. package/tests/examples/addSmtPad/__snapshots__/pillSmtPad.snap.svg +8 -0
  28. package/tests/examples/addSmtPad/__snapshots__/polygonSmtPad.snap.svg +8 -0
  29. package/tests/examples/addSmtPad/__snapshots__/rotatedPillSmtPad.snap.svg +8 -0
  30. package/tests/examples/addSmtPad/__snapshots__/rotatedRectSmtPad.snap.svg +8 -0
  31. package/tests/examples/addSmtPad/circleSmtPad.test.ts +45 -0
  32. package/tests/examples/addSmtPad/pillSmtPad.test.ts +47 -0
  33. package/tests/examples/addSmtPad/polygonSmtPad.test.ts +51 -0
  34. package/tests/examples/addSmtPad/rotatedPillSmtPad.test.ts +48 -0
  35. package/tests/examples/addSmtPad/rotatedRectSmtPad.test.ts +59 -0
  36. package/tests/examples/soldermask/__snapshots__/copper-and-soldermask.snap.svg +8 -0
  37. package/tests/examples/soldermask/__snapshots__/soldermask-only.snap.svg +8 -0
  38. package/tests/examples/soldermask/copper-and-soldermask.test.ts +96 -0
  39. package/tests/examples/soldermask/soldermask-only.test.ts +96 -0
package/README.md CHANGED
@@ -7,7 +7,44 @@ Convert Circuit JSON to LBRN XML for PCB fabrication via laser ablation.
7
7
  ```tsx
8
8
  import { convertCircuitJsonToLbrn } from "circuit-json-to-lbrn"
9
9
 
10
- const lbrnXml = convertCircuitJsonToLbrn(circuitJson, {
11
- includeSilkscreen: true,
10
+ // Generate copper layer only
11
+ const copperLbrn = convertCircuitJsonToLbrn(circuitJson, {
12
+ includeCopper: true,
13
+ includeSoldermask: false,
12
14
  })
15
+
16
+ // Generate soldermask layer only (for cutting polyimide sheet)
17
+ const soldermaskLbrn = convertCircuitJsonToLbrn(circuitJson, {
18
+ includeCopper: false,
19
+ includeSoldermask: true,
20
+ })
21
+
22
+ // Generate both layers together in one file
23
+ const bothLbrn = convertCircuitJsonToLbrn(circuitJson, {
24
+ includeCopper: true,
25
+ includeSoldermask: true,
26
+ })
27
+
28
+ // Default behavior (copper only, backward compatible)
29
+ const defaultLbrn = convertCircuitJsonToLbrn(circuitJson)
13
30
  ```
31
+
32
+ ## Options
33
+
34
+ - `includeCopper?: boolean` - Include copper traces and pads (default: `true`)
35
+ - `includeSoldermask?: boolean` - Include soldermask openings for cutting polyimide sheet (default: `false`)
36
+ - `includeSilkscreen?: boolean` - Include silkscreen layer (not implemented yet)
37
+ - `origin?: { x: number; y: number }` - Set the origin point for the conversion
38
+ - `margin?: number` - Set the margin around the PCB
39
+
40
+ ## Soldermask Support
41
+
42
+ The `includeSoldermask` flag enables generation of soldermask openings for cutting polyimide sheet. When enabled:
43
+ - SMT pads and plated holes will have soldermask openings
44
+ - Traces are NOT included in the soldermask layer (to avoid accidental bridging during soldering)
45
+ - Holes are always cut through the board regardless of the mode
46
+
47
+ You can generate:
48
+ - **Copper only**: `{ includeCopper: true, includeSoldermask: false }` - Traditional copper cutting
49
+ - **Soldermask only**: `{ includeCopper: false, includeSoldermask: true }` - Just polyimide cutting patterns
50
+ - **Both**: `{ includeCopper: true, includeSoldermask: true }` - Complete fabrication file with both layers
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ declare const convertCircuitJsonToLbrn: (circuitJson: CircuitJson, options?: {
8
8
  y: number;
9
9
  };
10
10
  margin?: number;
11
+ includeCopper?: boolean;
12
+ includeSoldermask?: boolean;
11
13
  }) => LightBurnProject;
12
14
 
13
15
  export { convertCircuitJsonToLbrn };