gokul/macro-six-usbc
USB-powered ATmega32U4 controller board with protected/switched 5 V power, six tactile keys, rotary encoder, reset/boot/ISP interfaces, power LED, and six daisy-chained SK6812 RGB LEDs driven through MOSFETs.
- Version
- 0.1.6
- License
- MIT
- Stars
- 0
lib/enclosure.tsx
import models from "../enclosure/viewer/models.json"
import { assembly } from "@tscircuit/core"
const printedParts = [
{ model: "bottom", name: "CASE_BOTTOM", color: "#202730" },
{ model: "open-plate", name: "CASE_SWITCH_PLATE", color: "#687e91" },
{ model: "keycaps-reference", name: "KEYCAP_FIT_REFERENCE" },
{ model: "knob-reference", name: "KNOB_FIT_REFERENCE" },
{ model: "control-extensions", name: "CONTROL_EXTENSIONS" },
]
function getCadModel(modelName: string) {
const asset = models.find(model => model.name === modelName)
if (!asset) throw new Error(`Missing enclosure model: ${modelName}`)
return { glbUrl: asset.url, modelOriginPosition: { x: 0, y: 0, z: 0 }, modelUnitToMmScale: 1 }
}
/** CAD-only parts; they create no PCB pads, holes or PCBA placements. */
export const Enclosure = () => <>
{printedParts.map(part => <assembly.printedpart key={part.name} name={part.name}
color={part.color} cadModel={getCadModel(part.model)} />)}
<assembly.part name="CASE_HARDWARE" cadModel={getCadModel("open-hardware")} />
</>