AnasSarkiz/magnetic-shutter-remote-r8

A USB‑C rechargeable battery-powered ESP32‑C3 wireless controller with Li‑ion charging, protected 3.3‑V buck‑boost regulation, thermal/safety monitoring, status LEDs, buttons, programming UART, crystal clock, and 2.4‑GHz antenna matching network.

Version
0.4.0-prototype
License
unset
Stars
0

scripts/render-r6-review.ts

import { Resvg } from "@resvg/resvg-js";
import { readFile, writeFile, mkdir } from "node:fs/promises";
const evidenceDirectory = Bun.argv[2] ?? "evidence/R6";
await mkdir(`${evidenceDirectory}/visual`, { recursive: true });
for (const name of [
	"CAM-top-all-drills",
	"CAM-bottom-all-drills",
	"F_Mask",
	"F_Paste",
	"B_Mask",
	"B_Paste",
	"Edge_Cuts",
]) {
	const svg = await readFile(
		`${evidenceDirectory}/cam-readback/${name}.svg`,
		"utf8",
	);
	await writeFile(
		`${evidenceDirectory}/visual/${name}.png`,
		new Resvg(svg, {
			background: "#ffffff",
			fitTo: { mode: "width", value: 1800 },
		})
			.render()
			.asPng(),
	);
}