circuit-json-to-lbrn 0.0.43 → 0.0.44
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/dist/index.js +53 -17
- package/lib/ConvertContext.ts +5 -0
- package/lib/createCopperCutFillForLayer.ts +1 -16
- package/lib/element-handlers/addPcbTrace/index.ts +35 -13
- package/lib/getManifold.ts +31 -0
- package/lib/index.ts +2 -0
- package/package.json +1 -1
- package/tests/examples/example05/__snapshots__/example05.snap.svg +1 -0
- package/tests/examples/example05/example05.circuit.json +9562 -0
- package/tests/examples/example05/example05.test.ts +31 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { test, expect } from "bun:test"
|
|
2
|
+
import circuitJson from "./example05.circuit.json" with { type: "json" }
|
|
3
|
+
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
|
|
4
|
+
import { generateLightBurnSvg } from "lbrnts"
|
|
5
|
+
import { convertCircuitJsonToLbrn } from "lib/index"
|
|
6
|
+
import { stackSvgsVertically } from "stack-svgs"
|
|
7
|
+
import type { CircuitJson } from "circuit-json"
|
|
8
|
+
|
|
9
|
+
test("example05 - copper fill conversion", async () => {
|
|
10
|
+
const pcbSvg = await convertCircuitJsonToPcbSvg(circuitJson as CircuitJson)
|
|
11
|
+
|
|
12
|
+
const project = await convertCircuitJsonToLbrn(circuitJson as CircuitJson, {
|
|
13
|
+
includeLayers: ["top"],
|
|
14
|
+
copperCutFillMargin: 0.5,
|
|
15
|
+
includeCopperCutFill: true,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
Bun.write("tmp/example05.lbrn2", project.getString(), {
|
|
19
|
+
createPath: true,
|
|
20
|
+
})
|
|
21
|
+
console.log("tmp/example05.lbrn2")
|
|
22
|
+
|
|
23
|
+
const lbrnSvg = await generateLightBurnSvg(project, {
|
|
24
|
+
margin: 0,
|
|
25
|
+
width: 600,
|
|
26
|
+
height: 400,
|
|
27
|
+
defaultStrokeWidth: 0.03,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
expect(lbrnSvg).toMatchSvgSnapshot(import.meta.filename)
|
|
31
|
+
})
|