MustafaMulla29/rp2040-bldc-motor-controller
Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.
- Version
- 2.0.40
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/rp2040-bldc-motor-controller # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controllerIn 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/render-release-thumbnail.ts
import {readFile,writeFile,copyFile} from "node:fs/promises"
import {convertCircuitJsonToGltf,getBestCameraPosition} from "circuit-json-to-gltf"
import {renderGLTFToPNGFromGLB} from "poppygl"
const root=new URL("../",import.meta.url)
process.chdir(new URL(root).pathname)
const rows=JSON.parse(await readFile("dist/index/circuit.json","utf8"))
if(rows.some((r:any)=>r.type.endsWith("_error")))throw Error("Refusing thumbnail for a circuit with errors")
const glb=await convertCircuitJsonToGltf(rows,{format:"glb",projectBaseUrl:root.href,includeModels:true})
const png=await renderGLTFToPNGFromGLB(glb as ArrayBuffer,{...getBestCameraPosition(rows),width:480,height:320,supersampling:2,realistic:true})
await writeFile("dist/index/3d.png",png)
for(const name of ["pcb.png","schematic.png"])await copyFile(`dist/pcb/${name}`,`dist/index/${name}`)
console.log("Regenerated release thumbnails from the verified native model")