Devesh36/pocket-audio-player
A portable, rechargeable microSD audio player built around an RP2040, SPI flash, USB‑C charging/power management, LCD/button controls, PCM5102A I²S DAC, and TPA6132A headphone amplifier in a 3D‑printed enclosure.
- Version
- 1.0.12
- License
- unset
- Stars
- 0
scripts/render-reference-views.ts
import {renderGLTFToPNGFromGLB} from 'poppygl'
const glb=await Bun.file('dist/index/3d.glb').arrayBuffer()
// The tscircuit exporter converts authored XYZ to (-X,Z,Y).
await Bun.write('dist/index/ipod-front.png',await renderGLTFToPNGFromGLB(glb,{width:780,height:1100,supersampling:2,realistic:false,ambient:0.6,gamma:false,camPos:[0,280,-7],lookAt:[0,0,-7],up:'z+',fov:27,backgroundColor:'#f3f3f1'}))
await Bun.write('dist/index/ipod-perspective.png',await renderGLTFToPNGFromGLB(glb,{width:1000,height:1100,supersampling:2,realistic:false,ambient:0.6,gamma:false,camPos:[-95,235,-85],lookAt:[0,0,-7],up:'z+',fov:30,backgroundColor:'#f3f3f1'}))
await Bun.write('dist/index/ipod-side.png',await renderGLTFToPNGFromGLB(glb,{width:1200,height:400,supersampling:2,realistic:false,ambient:0.6,gamma:false,camPos:[150,1.8,-7],lookAt:[0,1.8,-7],up:'y+',fov:45,backgroundColor:'#f3f3f1'}))
console.log('Rendered front and perspective views from the native tscircuit GLB')
const exploded=await Bun.file('dist/enclosure-preview/3d.glb').arrayBuffer()
await Bun.write('dist/enclosure/battery-inspection.png',await renderGLTFToPNGFromGLB(exploded,{width:1200,height:1000,supersampling:2,realistic:false,ambient:0.6,gamma:false,camPos:[-145,235,-125],lookAt:[-23,3,-7],up:'z+',fov:40,backgroundColor:'#f3f3f1'}))
console.log('Rendered the exploded assembly including its battery and harness')