Skip to content

fix(quad): validate pitch > 0 instead of producing NaN coordinates (#871) - #891

Open
marcos452652258-gif wants to merge 1 commit into
tscircuit:mainfrom
marcos452652258-gif:fix/871-zero-pitch-quad-error
Open

marcos452652258-gif wants to merge 1 commit into
tscircuit:mainfrom
marcos452652258-gif:fix/871-zero-pitch-quad-error

Conversation

@marcos452652258-gif

Copy link
Copy Markdown

Summary

Fixes #871.

Passing an explicit zero or negative pitch to quad-family footprints (e.g. lcc_p0mm, qfn16_p0mm) resulted in v.p: 0 being treated as falsy, skipping dimension calculation and producing NaN pad coordinates that serialize as null in circuit-json without throwing.

Changes

  • In src/fn/quad.ts, validate that p, px, and py must be strictly positive (> 0) in quadTransform and throw a descriptive error when <= 0 is received.
  • Add test in tests/zero-pitch-quad.test.ts verifying that lcc_p0mm and qfn16_p0mm throw descriptive errors instead of emitting NaN coordinates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: zero pitch on quad-family footprints produces NaN pad coordinates

1 participant