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/repro-parent-slot.tsx

PCBPCB preview for verification/issues/repro-parent-slot.tsx
SchematicSchematic preview for verification/issues/repro-parent-slot.tsx
import {Circuit} from 'tscircuit'
import {any_circuit_element} from 'circuit-json'
const comparisons=[]
for(const parentRotation of [0,90,180,270]){
  for(const explicitRotation of [false,true]){
    const circuit=new Circuit({platform:{partsEngineDisabled:true,useCloudAutorouter:false}})
    circuit.schematicDisabled=true;circuit.pcbRoutingDisabled=true
    circuit.add(<board width={20} height={20}><chip name="J1" pcbX={0} pcbY={0} pcbRotation={parentRotation} pinLabels={{pin1:'GND'}} footprint={<footprint><smtpad portHints={['pin1']} shape="rect" width={1} height={1}/><hole shape="pill" pcbX={3} pcbY={0} width={2} height={1} pcbRotation={explicitRotation?parentRotation:undefined}/><courtyardrect width={9} height={5}/></footprint>}/></board>)
    await circuit.renderUntilSettled()
    const hole=circuit.db.toArray().find((row)=>row.type==='pcb_hole')
    comparisons.push({parent_rotation_degrees:parentRotation,explicit_hole_rotation:explicitRotation,hole,schema_valid:any_circuit_element.safeParse(hole).success})
  }
}
await Bun.write(new URL('./parent-slot-rotation-repro.json',import.meta.url),JSON.stringify({tscircuit:'0.0.2911',comparisons},null,2))
console.log(comparisons.map(({parent_rotation_degrees,explicit_hole_rotation,hole})=>({parent_rotation_degrees,explicit_hole_rotation,hole})))