3D PCB viewer for KiCad files in React
npm install kicad-pcb-renderer-3d3D PCB viewer for KiCad files in React.
``bash`
npm install react three @react-three/fiber @react-three/drei sexp
`jsx
import { PCBViewerWithUpload } from './src';
`
`jsx
import { PCBViewer } from './src';
function App() {
const [file, setFile] = useState(null);
return (
<>
setFile(e.target.files[0])} />
>
);
}
`
`jsx
import { usePCBData } from './src';
function CustomViewer({ file }) {
const { data, loading, error } = usePCBData(file);
// Use data however you want
console.log(data.tracks, data.vias, data.zones);
}
`
`bash`
npm install
npm run dev
```
src/
├── core/ # Pure parsing logic
├── materials/ # Three.js materials
├── geometry/ # Geometry builders
├── components/ # React 3D components
├── hooks/ # React hooks
└── index.js # Public API