pixalynx/nrf9151-gps-tracker
A compact 44×32 mm, 4-layer nRF9151 LTE-M/NB-IoT/GNSS tracker PCB with nPM1300 LiPo/USB-C power, nano-SIM/eSIM switching, nRF7002 Wi‑Fi scanning, accelerometer, antennas, buzzer, LEDs, SOS button, and SWD/debug connectors.
- Version
- 0.1.4
- License
- unset
- Stars
- 0
scripts/render-zoom.ts
// Zoomed PCB render around a point: bun scripts/render-zoom.ts <x> <y> <halfWidth> <layer> [out]
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { Resvg } from "@resvg/resvg-js"
const [x, y, hw] = process.argv.slice(2, 5).map(Number)
const layer = (process.argv[5] ?? "top") as "top" | "bottom"
const out = process.argv[6] ?? `dist/index/zoom-${layer}.png`
const cj = await Bun.file("dist/index/circuit.json").json()
const svg = convertCircuitJsonToPcbSvg(cj, { layer, showCourtyards: false, shouldDrawErrors: true, width: 1600, height: 1600, backgroundColor: "#111111",
viewport: { minX: x - hw, maxX: x + hw, minY: y - hw, maxY: y + hw } })
await Bun.write(out, new Resvg(svg, { fitTo: { mode: "width", value: 1600 } }).render().asPng())
console.log(`wrote ${out}`)