imrishabh18/corne-keyboard

The code defines and renders two surface-mount chip components with SMT pads, silkscreen outlines, and 3D CAD models (OBJ and STEP) for PCB assembly.

Version
2.0.21
License
unset
Stars
1

scripts/finish-left.ts

import fs from 'node:fs'
import {runAllRoutingChecks,checkCopperToBoardEdgeClearance,checkPcbCopperOverKeepout,dedupePcbDrcErrors} from '@tscircuit/checks'
const c=JSON.parse(fs.readFileSync('../left-local.circuit.json','utf8'))
const trace=c.find((x:any)=>x.type==='pcb_trace'&&x.pcb_trace_id==='source_trace_106_mst0_0')
trace.route.splice(16,1)
const errors=dedupePcbDrcErrors([...(await runAllRoutingChecks(c)),...checkCopperToBoardEdgeClearance(c),...checkPcbCopperOverKeepout(c)])
console.log(errors.length,errors.map((e:any)=>e.message))
fs.writeFileSync('../left-final-candidate.circuit.json',JSON.stringify(c,null,2))
fs.writeFileSync('../left-final-candidate.errors.json',JSON.stringify(errors,null,2))