Devesh36/clear-mouse
A transparent, right-handed wireless mouse assembly with a 44×58 mm control PCB, LiPo battery, optical sensor, click buttons, scroll encoder, DPI/middle buttons, USB‑C charging, and 3D‑printed housing/mechanical hardware.
- Version
- 0.1.5
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone Devesh36/clear-mouse # download the package files into ./clear-mouse
tsci add Devesh36/clear-mouse # add it to your project as @tsci/Devesh36.clear-mouseIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
scripts/prepare-controls-model.ts
import { NodeIO } from "@gltf-transform/core";
import {KHRMeshQuantization} from "@gltf-transform/extensions";
import {weld,dedup,prune,quantize} from "@gltf-transform/functions";
// tscircuit's exported GLB is Y-up: (-pcbX, pcbZ, pcbY).
// Put the generated preview in PCB XYZ coordinates before mounting at 60 degrees.
const io = new NodeIO().registerExtensions([KHRMeshQuantization]);
const doc = await io.read("dist/controls/3d.glb");
for (const scene of doc.getRoot().listScenes()) {
const children = scene.listChildren();
const transform = doc
.createNode("PCB_COORDINATES")
.setRotation([0, Math.SQRT1_2, Math.SQRT1_2, 0]);
for (const node of children) {
scene.removeChild(node);
transform.addChild(node);
}
scene.addChild(transform);
}
// Compact only the display mesh; original routed geometry remains in circuit JSON.
await doc.transform(weld(),dedup(),prune(),quantize({quantizePosition:16,quantizeNormal:12,quantizeTexcoord:14}));
await io.write("assets/controls.glb", doc);