@tscircuit/copper-pour-solver 0.0.2 → 0.0.4

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.
@@ -0,0 +1,15 @@
1
+ import { expect, test } from "bun:test"
2
+ import circuitJson from "./assets/circuit-6.json"
3
+ import { runSolverAndRenderToSvg } from "./utils/run-solver-and-render-to-svg"
4
+
5
+ test("circuit-7", async () => {
6
+ const svg = runSolverAndRenderToSvg(circuitJson as any, {
7
+ layer: "top",
8
+ net_name: "GND",
9
+ pad_margin: 0.4,
10
+ trace_margin: 0.2,
11
+ boardEdgeMargin: 1,
12
+ })
13
+
14
+ await expect(svg).toMatchSvgSnapshot(import.meta.path, "circuit-7")
15
+ })
@@ -0,0 +1,16 @@
1
+ import { expect, test } from "bun:test"
2
+ import circuitJson from "./assets/circuit-8.json"
3
+ import { runSolverAndRenderToSvg } from "./utils/run-solver-and-render-to-svg"
4
+ import type { AnyCircuitElement } from "circuit-json"
5
+
6
+ test("circuit 8", async () => {
7
+ const svg = runSolverAndRenderToSvg(circuitJson as AnyCircuitElement[], {
8
+ layer: "top",
9
+ net_name: "GND",
10
+ pad_margin: 0.4,
11
+ trace_margin: 0.2,
12
+ boardEdgeMargin: 1,
13
+ })
14
+
15
+ await expect(svg).toMatchSvgSnapshot(import.meta.path, "circuit-8")
16
+ })
@@ -17,6 +17,7 @@ export const runSolverAndRenderToSvg = (
17
17
  net_name: string
18
18
  pad_margin: number
19
19
  trace_margin: number
20
+ boardEdgeMargin?: number
20
21
  },
21
22
  ) => {
22
23
  const source_net = circuitJson.find(