@tscircuit/copper-pour-solver 0.0.9 → 0.0.11

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