shibosoftwaredev/f1c100s-linux-nema8-stepper-controller

Restores component part numbers and CAD models, removes test-point 3D bodies, and validates that solder paste exists only on top-side SMT pads without altering copper or DRC.

Version
0.3.5
License
unset
Stars
0

scripts/check-footprinter.tsx

import { Circuit } from "tscircuit"
import { F1C100S } from "../modules/f1c100s/imports/F1C100S"
import baseline from "../footprints/f1c100s-pad-baseline.json"
import assert from "node:assert/strict"
const c = new Circuit()
c.add(<board width={20} height={20} routingDisabled><F1C100S name="U1" /></board>)
await c.renderUntilSettled()
const j = c.getCircuitJson() as any[]
const pcbPorts = new Map(j.filter(e => e.type === "pcb_port").map(e => [e.pcb_port_id,e]))
const sourcePorts = new Map(j.filter(e => e.type === "source_port").map(e => [e.source_port_id,e]))
const pads = j.filter(e => e.type === "pcb_smtpad")
assert.equal(pads.length,89)
const seen = new Set<number>()
let maxDelta = 0
for (const p of pads) {
 const pp = pcbPorts.get(p.pcb_port_id), sp = sourcePorts.get(pp?.source_port_id)
 assert.ok(sp, "every pad maps to a source pin")
 const n = sp.pin_number as number
 assert.ok(!seen.has(n)); seen.add(n)
 const original = baseline[String(n) as keyof typeof baseline]
 assert.ok(original)
 const rotated = (p.ccw_rotation ?? 0) % 180 === 90
 const physical = {x:p.x,y:p.y,width:rotated?p.height:p.width,height:rotated?p.width:p.height}
 for (const key of ["x","y","width","height"] as const) {
  const delta=Math.abs(physical[key]-original[key]);maxDelta=Math.max(maxDelta,delta)
  assert.ok(delta<0.0002, `pin ${n} ${key} changes less than 0.0002 mm`)
 }
 assert.equal(p.corner_radius ?? 0,0)
 assert.equal(p.layer,original.layer)
 if(n===89){assert.equal(sp.requires_ground,true);assert.ok(sp.port_hints.includes("thermalpad"))}
}
assert.equal(seen.size,89)
console.log(`89 pad identities and square corners verified; max geometry difference ${maxDelta} mm`)