gokul/usb3-sd-hub

Engineering draft: four-layer, computer-powered USB 3 hub with one USB-C host socket, two USB-C and two USB-A accessory sockets, and a full-size SD slot. Board and three schematic previews are available. Routing and production checks are incomplete; not fabrication ready.

Version
0.1.5
License
MIT
Stars
0

verification/issues/schema-repro.tsx

PCBPCB preview for verification/issues/schema-repro.tsx
SchematicSchematic preview for verification/issues/schema-repro.tsx
import {Circuit} from "tscircuit"
import {pcb_component,pcb_group,pcb_smtpad,pcb_silkscreen_text} from "circuit-json"

const cases = [
  {name:"numeric-offsets-and-group-anchor",element:<board width={20} height={20}><group><resistor name="R1" resistance="1k" footprint="0402" pcbX={0} pcbY={0}/></group></board>},
  {name:"board-level-primitives",element:<board width={20} height={20}><fiducial name="FID1" pcbX={-7} pcbY={7} padDiameter={1}/><silkscreentext text="USB HUB" pcbX={0} pcbY={0} fontSize={1}/></board>},
]
const schemas = {pcb_component,pcb_group,pcb_smtpad,pcb_silkscreen_text}
for(const example of cases){
 const c=new Circuit();c.schematicDisabled=true;c.pcbRoutingDisabled=true;c.add(example.element)
 await c.renderUntilSettled()
 for(const record of c.db.toArray()){
  const schema=schemas[record.type as keyof typeof schemas]
  if(!schema)continue
  const result=schema.safeParse(record)
  if(!result.success)console.log(JSON.stringify({case:example.name,record,issues:result.error.issues},null,2))
 }
}