astra/pd-power-supply

USB-PD Power Supply with RP2040 controller

Version
1.1.6
License
unset
Stars
0

scripts/verify-copper-geometry.mjs

import assert from 'node:assert/strict'
import {getViaPolygon} from '@tscircuit/circuit-json-util'
import {Point} from '@flatten-js/core'
const solid=getViaPolygon({x:1,y:2},.8,0)
const drilled=getViaPolygon({x:1,y:2},.8,.3)
assert.equal(solid.faces.size,1)
assert.equal(drilled.faces.size,2)
assert.ok(solid.contains(new Point(1,2)))
assert.ok(!drilled.contains(new Point(1,2)))
assert.ok(drilled.contains(new Point(1.3,2)))
console.log('PASS: copper geometry workaround preserves real drills and removes only zero-radius holes.')