copperflow 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +265 -2
- package/dist/app/THIRD_PARTY_LICENSES.txt +118 -0
- package/dist/app/assets/NewPartDialog-Qb7NwhBb.js +160 -0
- package/dist/app/assets/index-CSWIIMFE.css +1 -0
- package/dist/app/assets/index-C_TXwo-N.js +19 -0
- package/dist/app/index.html +15 -0
- package/dist/app/theme-boot.js +3 -0
- package/dist/cli-commands.d.ts +14 -0
- package/dist/cli-commands.js +285 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +24 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/analyze.d.ts +29 -0
- package/dist/core/analyze.js +284 -0
- package/dist/core/analyze.js.map +1 -0
- package/dist/core/annotations.d.ts +77 -0
- package/dist/core/annotations.js +138 -0
- package/dist/core/annotations.js.map +1 -0
- package/dist/core/board-edits.d.ts +8 -0
- package/dist/core/board-edits.js +56 -0
- package/dist/core/board-edits.js.map +1 -0
- package/dist/core/board-items.d.ts +40 -0
- package/dist/core/board-items.js +95 -0
- package/dist/core/board-items.js.map +1 -0
- package/dist/core/bom.d.ts +35 -0
- package/dist/core/bom.js +146 -0
- package/dist/core/bom.js.map +1 -0
- package/dist/core/check.d.ts +42 -0
- package/dist/core/check.js +91 -0
- package/dist/core/check.js.map +1 -0
- package/dist/core/checks-line.d.ts +7 -0
- package/dist/core/checks-line.js +8 -0
- package/dist/core/checks-line.js.map +1 -0
- package/dist/core/connection-names.d.ts +2 -0
- package/dist/core/connection-names.js +16 -0
- package/dist/core/connection-names.js.map +1 -0
- package/dist/core/design-source.d.ts +6 -0
- package/dist/core/design-source.js +14 -0
- package/dist/core/design-source.js.map +1 -0
- package/dist/core/drawing-edits.d.ts +19 -0
- package/dist/core/drawing-edits.js +158 -0
- package/dist/core/drawing-edits.js.map +1 -0
- package/dist/core/drawing-identity.d.ts +12 -0
- package/dist/core/drawing-identity.js +32 -0
- package/dist/core/drawing-identity.js.map +1 -0
- package/dist/core/drawing-names.d.ts +10 -0
- package/dist/core/drawing-names.js +30 -0
- package/dist/core/drawing-names.js.map +1 -0
- package/dist/core/drawing-scan.d.ts +41 -0
- package/dist/core/drawing-scan.js +82 -0
- package/dist/core/drawing-scan.js.map +1 -0
- package/dist/core/edit-error.d.ts +5 -0
- package/dist/core/edit-error.js +9 -0
- package/dist/core/edit-error.js.map +1 -0
- package/dist/core/edit-text.d.ts +28 -0
- package/dist/core/edit-text.js +89 -0
- package/dist/core/edit-text.js.map +1 -0
- package/dist/core/edit.d.ts +13 -0
- package/dist/core/edit.js +341 -0
- package/dist/core/edit.js.map +1 -0
- package/dist/core/fabrication.d.ts +39 -0
- package/dist/core/fabrication.js +94 -0
- package/dist/core/fabrication.js.map +1 -0
- package/dist/core/file-writes.d.ts +18 -0
- package/dist/core/file-writes.js +81 -0
- package/dist/core/file-writes.js.map +1 -0
- package/dist/core/fs-utils.d.ts +13 -0
- package/dist/core/fs-utils.js +51 -0
- package/dist/core/fs-utils.js.map +1 -0
- package/dist/core/history.d.ts +80 -0
- package/dist/core/history.js +161 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/index.d.ts +21 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/instance-edits.d.ts +15 -0
- package/dist/core/instance-edits.js +69 -0
- package/dist/core/instance-edits.js.map +1 -0
- package/dist/core/instance-locks.d.ts +10 -0
- package/dist/core/instance-locks.js +16 -0
- package/dist/core/instance-locks.js.map +1 -0
- package/dist/core/instance-requests.d.ts +45 -0
- package/dist/core/instance-requests.js +93 -0
- package/dist/core/instance-requests.js.map +1 -0
- package/dist/core/layout-edits.d.ts +51 -0
- package/dist/core/layout-edits.js +82 -0
- package/dist/core/layout-edits.js.map +1 -0
- package/dist/core/layout-file.d.ts +80 -0
- package/dist/core/layout-file.js +209 -0
- package/dist/core/layout-file.js.map +1 -0
- package/dist/core/layout-locks.d.ts +38 -0
- package/dist/core/layout-locks.js +39 -0
- package/dist/core/layout-locks.js.map +1 -0
- package/dist/core/layout-records.d.ts +72 -0
- package/dist/core/layout-records.js +146 -0
- package/dist/core/layout-records.js.map +1 -0
- package/dist/core/library.d.ts +128 -0
- package/dist/core/library.js +378 -0
- package/dist/core/library.js.map +1 -0
- package/dist/core/literals.d.ts +19 -0
- package/dist/core/literals.js +106 -0
- package/dist/core/literals.js.map +1 -0
- package/dist/core/make-sheet.d.ts +44 -0
- package/dist/core/make-sheet.js +130 -0
- package/dist/core/make-sheet.js.map +1 -0
- package/dist/core/netlist.d.ts +41 -0
- package/dist/core/netlist.js +147 -0
- package/dist/core/netlist.js.map +1 -0
- package/dist/core/new-circuit-sheets.d.ts +35 -0
- package/dist/core/new-circuit-sheets.js +146 -0
- package/dist/core/new-circuit-sheets.js.map +1 -0
- package/dist/core/new-circuit.d.ts +65 -0
- package/dist/core/new-circuit.js +83 -0
- package/dist/core/new-circuit.js.map +1 -0
- package/dist/core/page-edits.d.ts +25 -0
- package/dist/core/page-edits.js +180 -0
- package/dist/core/page-edits.js.map +1 -0
- package/dist/core/pin-types.d.ts +8 -0
- package/dist/core/pin-types.js +10 -0
- package/dist/core/pin-types.js.map +1 -0
- package/dist/core/place.d.ts +30 -0
- package/dist/core/place.js +77 -0
- package/dist/core/place.js.map +1 -0
- package/dist/core/placement-write.d.ts +56 -0
- package/dist/core/placement-write.js +222 -0
- package/dist/core/placement-write.js.map +1 -0
- package/dist/core/pour-edits.d.ts +20 -0
- package/dist/core/pour-edits.js +241 -0
- package/dist/core/pour-edits.js.map +1 -0
- package/dist/core/project-text.d.ts +15 -0
- package/dist/core/project-text.js +58 -0
- package/dist/core/project-text.js.map +1 -0
- package/dist/core/project.d.ts +23 -0
- package/dist/core/project.js +63 -0
- package/dist/core/project.js.map +1 -0
- package/dist/core/rename-designators.d.ts +23 -0
- package/dist/core/rename-designators.js +83 -0
- package/dist/core/rename-designators.js.map +1 -0
- package/dist/core/rename-parts.d.ts +12 -0
- package/dist/core/rename-parts.js +129 -0
- package/dist/core/rename-parts.js.map +1 -0
- package/dist/core/rules-edit.d.ts +7 -0
- package/dist/core/rules-edit.js +56 -0
- package/dist/core/rules-edit.js.map +1 -0
- package/dist/core/selectors.d.ts +11 -0
- package/dist/core/selectors.js +33 -0
- package/dist/core/selectors.js.map +1 -0
- package/dist/core/sheet-cut-layout.d.ts +13 -0
- package/dist/core/sheet-cut-layout.js +62 -0
- package/dist/core/sheet-cut-layout.js.map +1 -0
- package/dist/core/sheet-cut-text.d.ts +23 -0
- package/dist/core/sheet-cut-text.js +129 -0
- package/dist/core/sheet-cut-text.js.map +1 -0
- package/dist/core/sheet-cut.d.ts +55 -0
- package/dist/core/sheet-cut.js +204 -0
- package/dist/core/sheet-cut.js.map +1 -0
- package/dist/core/sheet-edits.d.ts +12 -0
- package/dist/core/sheet-edits.js +107 -0
- package/dist/core/sheet-edits.js.map +1 -0
- package/dist/core/sheet-files.d.ts +31 -0
- package/dist/core/sheet-files.js +134 -0
- package/dist/core/sheet-files.js.map +1 -0
- package/dist/core/sheet-layout.d.ts +27 -0
- package/dist/core/sheet-layout.js +60 -0
- package/dist/core/sheet-layout.js.map +1 -0
- package/dist/core/summary.d.ts +10 -0
- package/dist/core/summary.js +79 -0
- package/dist/core/summary.js.map +1 -0
- package/dist/core/track-split.d.ts +22 -0
- package/dist/core/track-split.js +24 -0
- package/dist/core/track-split.js.map +1 -0
- package/dist/core/types.d.ts +309 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/unroute.d.ts +56 -0
- package/dist/core/unroute.js +87 -0
- package/dist/core/unroute.js.map +1 -0
- package/dist/core/workspace.d.ts +94 -0
- package/dist/core/workspace.js +376 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/engine/autoplace.d.ts +18 -0
- package/dist/engine/autoplace.js +68 -0
- package/dist/engine/autoplace.js.map +1 -0
- package/dist/engine/board.d.ts +12 -0
- package/dist/engine/board.js +60 -0
- package/dist/engine/board.js.map +1 -0
- package/dist/engine/checks/copper-clearance.d.ts +7 -0
- package/dist/engine/checks/copper-clearance.js +116 -0
- package/dist/engine/checks/copper-clearance.js.map +1 -0
- package/dist/engine/checks/copper-notes.d.ts +11 -0
- package/dist/engine/checks/copper-notes.js +17 -0
- package/dist/engine/checks/copper-notes.js.map +1 -0
- package/dist/engine/checks/copper-pieces.d.ts +26 -0
- package/dist/engine/checks/copper-pieces.js +42 -0
- package/dist/engine/checks/copper-pieces.js.map +1 -0
- package/dist/engine/checks/copper-violation.d.ts +9 -0
- package/dist/engine/checks/copper-violation.js +11 -0
- package/dist/engine/checks/copper-violation.js.map +1 -0
- package/dist/engine/checks/drc-copper.d.ts +14 -0
- package/dist/engine/checks/drc-copper.js +139 -0
- package/dist/engine/checks/drc-copper.js.map +1 -0
- package/dist/engine/checks/drc-pads.d.ts +8 -0
- package/dist/engine/checks/drc-pads.js +172 -0
- package/dist/engine/checks/drc-pads.js.map +1 -0
- package/dist/engine/checks/drc-parts.d.ts +5 -0
- package/dist/engine/checks/drc-parts.js +208 -0
- package/dist/engine/checks/drc-parts.js.map +1 -0
- package/dist/engine/checks/drc-pours.d.ts +6 -0
- package/dist/engine/checks/drc-pours.js +240 -0
- package/dist/engine/checks/drc-pours.js.map +1 -0
- package/dist/engine/checks/erc.d.ts +6 -0
- package/dist/engine/checks/erc.js +94 -0
- package/dist/engine/checks/erc.js.map +1 -0
- package/dist/engine/checks/fillet-guard.d.ts +29 -0
- package/dist/engine/checks/fillet-guard.js +75 -0
- package/dist/engine/checks/fillet-guard.js.map +1 -0
- package/dist/engine/checks/geometry.d.ts +25 -0
- package/dist/engine/checks/geometry.js +182 -0
- package/dist/engine/checks/geometry.js.map +1 -0
- package/dist/engine/checks/grid-index.d.ts +24 -0
- package/dist/engine/checks/grid-index.js +57 -0
- package/dist/engine/checks/grid-index.js.map +1 -0
- package/dist/engine/checks/index.d.ts +16 -0
- package/dist/engine/checks/index.js +55 -0
- package/dist/engine/checks/index.js.map +1 -0
- package/dist/engine/checks/limits.d.ts +7 -0
- package/dist/engine/checks/limits.js +10 -0
- package/dist/engine/checks/limits.js.map +1 -0
- package/dist/engine/checks/unplaced-parts.d.ts +4 -0
- package/dist/engine/checks/unplaced-parts.js +29 -0
- package/dist/engine/checks/unplaced-parts.js.map +1 -0
- package/dist/engine/checks/violation.d.ts +14 -0
- package/dist/engine/checks/violation.js +7 -0
- package/dist/engine/checks/violation.js.map +1 -0
- package/dist/engine/component.d.ts +34 -0
- package/dist/engine/component.js +125 -0
- package/dist/engine/component.js.map +1 -0
- package/dist/engine/copper.d.ts +63 -0
- package/dist/engine/copper.js +276 -0
- package/dist/engine/copper.js.map +1 -0
- package/dist/engine/design.d.ts +21 -0
- package/dist/engine/design.js +63 -0
- package/dist/engine/design.js.map +1 -0
- package/dist/engine/diagnostics.d.ts +2 -0
- package/dist/engine/diagnostics.js +6 -0
- package/dist/engine/diagnostics.js.map +1 -0
- package/dist/engine/drawing-ids.d.ts +23 -0
- package/dist/engine/drawing-ids.js +45 -0
- package/dist/engine/drawing-ids.js.map +1 -0
- package/dist/engine/drawing-kinds.d.ts +18 -0
- package/dist/engine/drawing-kinds.js +102 -0
- package/dist/engine/drawing-kinds.js.map +1 -0
- package/dist/engine/drawing-reader.d.ts +42 -0
- package/dist/engine/drawing-reader.js +97 -0
- package/dist/engine/drawing-reader.js.map +1 -0
- package/dist/engine/drawings.d.ts +35 -0
- package/dist/engine/drawings.js +94 -0
- package/dist/engine/drawings.js.map +1 -0
- package/dist/engine/elaborate.d.ts +8 -0
- package/dist/engine/elaborate.js +490 -0
- package/dist/engine/elaborate.js.map +1 -0
- package/dist/engine/engine-worker.d.ts +1 -0
- package/dist/engine/engine-worker.js +17 -0
- package/dist/engine/engine-worker.js.map +1 -0
- package/dist/engine/engine.d.ts +41 -0
- package/dist/engine/engine.js +95 -0
- package/dist/engine/engine.js.map +1 -0
- package/dist/engine/evaluate.d.ts +10 -0
- package/dist/engine/evaluate.js +125 -0
- package/dist/engine/evaluate.js.map +1 -0
- package/dist/engine/fab/bom-csv.d.ts +5 -0
- package/dist/engine/fab/bom-csv.js +16 -0
- package/dist/engine/fab/bom-csv.js.map +1 -0
- package/dist/engine/fab/csv.d.ts +4 -0
- package/dist/engine/fab/csv.js +11 -0
- package/dist/engine/fab/csv.js.map +1 -0
- package/dist/engine/fab/designators.d.ts +42 -0
- package/dist/engine/fab/designators.js +109 -0
- package/dist/engine/fab/designators.js.map +1 -0
- package/dist/engine/fab/excellon.d.ts +23 -0
- package/dist/engine/fab/excellon.js +82 -0
- package/dist/engine/fab/excellon.js.map +1 -0
- package/dist/engine/fab/export.d.ts +33 -0
- package/dist/engine/fab/export.js +105 -0
- package/dist/engine/fab/export.js.map +1 -0
- package/dist/engine/fab/gerber.d.ts +53 -0
- package/dist/engine/fab/gerber.js +151 -0
- package/dist/engine/fab/gerber.js.map +1 -0
- package/dist/engine/fab/layers.d.ts +26 -0
- package/dist/engine/fab/layers.js +162 -0
- package/dist/engine/fab/layers.js.map +1 -0
- package/dist/engine/fab/names.d.ts +20 -0
- package/dist/engine/fab/names.js +58 -0
- package/dist/engine/fab/names.js.map +1 -0
- package/dist/engine/fab/pick-and-place.d.ts +5 -0
- package/dist/engine/fab/pick-and-place.js +36 -0
- package/dist/engine/fab/pick-and-place.js.map +1 -0
- package/dist/engine/fab/stroke-font.d.ts +8 -0
- package/dist/engine/fab/stroke-font.js +83 -0
- package/dist/engine/fab/stroke-font.js.map +1 -0
- package/dist/engine/fab/zip.d.ts +14 -0
- package/dist/engine/fab/zip.js +93 -0
- package/dist/engine/fab/zip.js.map +1 -0
- package/dist/engine/fillet-plan.d.ts +39 -0
- package/dist/engine/fillet-plan.js +87 -0
- package/dist/engine/fillet-plan.js.map +1 -0
- package/dist/engine/fillet.d.ts +54 -0
- package/dist/engine/fillet.js +175 -0
- package/dist/engine/fillet.js.map +1 -0
- package/dist/engine/footprints/bga.d.ts +14 -0
- package/dist/engine/footprints/bga.js +122 -0
- package/dist/engine/footprints/bga.js.map +1 -0
- package/dist/engine/footprints/chip.d.ts +3 -0
- package/dist/engine/footprints/chip.js +52 -0
- package/dist/engine/footprints/chip.js.map +1 -0
- package/dist/engine/footprints/crystal.d.ts +4 -0
- package/dist/engine/footprints/crystal.js +47 -0
- package/dist/engine/footprints/crystal.js.map +1 -0
- package/dist/engine/footprints/dfn.d.ts +13 -0
- package/dist/engine/footprints/dfn.js +52 -0
- package/dist/engine/footprints/dfn.js.map +1 -0
- package/dist/engine/footprints/dip.d.ts +8 -0
- package/dist/engine/footprints/dip.js +65 -0
- package/dist/engine/footprints/dip.js.map +1 -0
- package/dist/engine/footprints/dual.d.ts +14 -0
- package/dist/engine/footprints/dual.js +171 -0
- package/dist/engine/footprints/dual.js.map +1 -0
- package/dist/engine/footprints/exposed.d.ts +27 -0
- package/dist/engine/footprints/exposed.js +50 -0
- package/dist/engine/footprints/exposed.js.map +1 -0
- package/dist/engine/footprints/file.d.ts +65 -0
- package/dist/engine/footprints/file.js +141 -0
- package/dist/engine/footprints/file.js.map +1 -0
- package/dist/engine/footprints/ic.d.ts +34 -0
- package/dist/engine/footprints/ic.js +31 -0
- package/dist/engine/footprints/ic.js.map +1 -0
- package/dist/engine/footprints/index.d.ts +17 -0
- package/dist/engine/footprints/index.js +104 -0
- package/dist/engine/footprints/index.js.map +1 -0
- package/dist/engine/footprints/ipc7251.d.ts +30 -0
- package/dist/engine/footprints/ipc7251.js +44 -0
- package/dist/engine/footprints/ipc7251.js.map +1 -0
- package/dist/engine/footprints/ipc7351.d.ts +179 -0
- package/dist/engine/footprints/ipc7351.js +194 -0
- package/dist/engine/footprints/ipc7351.js.map +1 -0
- package/dist/engine/footprints/jedec.d.ts +24 -0
- package/dist/engine/footprints/jedec.js +148 -0
- package/dist/engine/footprints/jedec.js.map +1 -0
- package/dist/engine/footprints/known.d.ts +6 -0
- package/dist/engine/footprints/known.js +76 -0
- package/dist/engine/footprints/known.js.map +1 -0
- package/dist/engine/footprints/molded.d.ts +8 -0
- package/dist/engine/footprints/molded.js +76 -0
- package/dist/engine/footprints/molded.js.map +1 -0
- package/dist/engine/footprints/outline.d.ts +64 -0
- package/dist/engine/footprints/outline.js +187 -0
- package/dist/engine/footprints/outline.js.map +1 -0
- package/dist/engine/footprints/parse.d.ts +32 -0
- package/dist/engine/footprints/parse.js +68 -0
- package/dist/engine/footprints/parse.js.map +1 -0
- package/dist/engine/footprints/pinrow.d.ts +11 -0
- package/dist/engine/footprints/pinrow.js +102 -0
- package/dist/engine/footprints/pinrow.js.map +1 -0
- package/dist/engine/footprints/quad.d.ts +7 -0
- package/dist/engine/footprints/quad.js +135 -0
- package/dist/engine/footprints/quad.js.map +1 -0
- package/dist/engine/footprints/radial.d.ts +7 -0
- package/dist/engine/footprints/radial.js +62 -0
- package/dist/engine/footprints/radial.js.map +1 -0
- package/dist/engine/footprints/sod.d.ts +8 -0
- package/dist/engine/footprints/sod.js +60 -0
- package/dist/engine/footprints/sod.js.map +1 -0
- package/dist/engine/footprints/sot.d.ts +4 -0
- package/dist/engine/footprints/sot.js +72 -0
- package/dist/engine/footprints/sot.js.map +1 -0
- package/dist/engine/footprints/sotpower.d.ts +4 -0
- package/dist/engine/footprints/sotpower.js +98 -0
- package/dist/engine/footprints/sotpower.js.map +1 -0
- package/dist/engine/footprints/to220.d.ts +4 -0
- package/dist/engine/footprints/to220.js +49 -0
- package/dist/engine/footprints/to220.js.map +1 -0
- package/dist/engine/footprints/to92.d.ts +4 -0
- package/dist/engine/footprints/to92.js +43 -0
- package/dist/engine/footprints/to92.js.map +1 -0
- package/dist/engine/footprints/types.d.ts +50 -0
- package/dist/engine/footprints/types.js +3 -0
- package/dist/engine/footprints/types.js.map +1 -0
- package/dist/engine/hole.d.ts +15 -0
- package/dist/engine/hole.js +28 -0
- package/dist/engine/hole.js.map +1 -0
- package/dist/engine/index.d.ts +6 -0
- package/dist/engine/index.js +6 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/instance-anchor.d.ts +16 -0
- package/dist/engine/instance-anchor.js +45 -0
- package/dist/engine/instance-anchor.js.map +1 -0
- package/dist/engine/jsx-runtime.d.ts +26 -0
- package/dist/engine/jsx-runtime.js +49 -0
- package/dist/engine/jsx-runtime.js.map +1 -0
- package/dist/engine/keepout.d.ts +9 -0
- package/dist/engine/keepout.js +50 -0
- package/dist/engine/keepout.js.map +1 -0
- package/dist/engine/kinds.d.ts +34 -0
- package/dist/engine/kinds.js +134 -0
- package/dist/engine/kinds.js.map +1 -0
- package/dist/engine/model.d.ts +310 -0
- package/dist/engine/model.js +5 -0
- package/dist/engine/model.js.map +1 -0
- package/dist/engine/nets.d.ts +6 -0
- package/dist/engine/nets.js +49 -0
- package/dist/engine/nets.js.map +1 -0
- package/dist/engine/no-connect.d.ts +28 -0
- package/dist/engine/no-connect.js +36 -0
- package/dist/engine/no-connect.js.map +1 -0
- package/dist/engine/order.d.ts +7 -0
- package/dist/engine/order.js +25 -0
- package/dist/engine/order.js.map +1 -0
- package/dist/engine/pad-text.d.ts +20 -0
- package/dist/engine/pad-text.js +26 -0
- package/dist/engine/pad-text.js.map +1 -0
- package/dist/engine/part-labels.d.ts +29 -0
- package/dist/engine/part-labels.js +28 -0
- package/dist/engine/part-labels.js.map +1 -0
- package/dist/engine/pcb-place/blocks.d.ts +46 -0
- package/dist/engine/pcb-place/blocks.js +186 -0
- package/dist/engine/pcb-place/blocks.js.map +1 -0
- package/dist/engine/pcb-place/constructive.d.ts +73 -0
- package/dist/engine/pcb-place/constructive.js +515 -0
- package/dist/engine/pcb-place/constructive.js.map +1 -0
- package/dist/engine/pcb-place/edge.d.ts +7 -0
- package/dist/engine/pcb-place/edge.js +78 -0
- package/dist/engine/pcb-place/edge.js.map +1 -0
- package/dist/engine/pcb-place/fit-board.d.ts +22 -0
- package/dist/engine/pcb-place/fit-board.js +48 -0
- package/dist/engine/pcb-place/fit-board.js.map +1 -0
- package/dist/engine/pcb-place/geometry.d.ts +45 -0
- package/dist/engine/pcb-place/geometry.js +158 -0
- package/dist/engine/pcb-place/geometry.js.map +1 -0
- package/dist/engine/pcb-place/index.d.ts +81 -0
- package/dist/engine/pcb-place/index.js +98 -0
- package/dist/engine/pcb-place/index.js.map +1 -0
- package/dist/engine/pcb-place/refine.d.ts +32 -0
- package/dist/engine/pcb-place/refine.js +220 -0
- package/dist/engine/pcb-place/refine.js.map +1 -0
- package/dist/engine/pcb-place/roles.d.ts +37 -0
- package/dist/engine/pcb-place/roles.js +127 -0
- package/dist/engine/pcb-place/roles.js.map +1 -0
- package/dist/engine/pcb-place/scope.d.ts +80 -0
- package/dist/engine/pcb-place/scope.js +107 -0
- package/dist/engine/pcb-place/scope.js.map +1 -0
- package/dist/engine/pcb-place/score.d.ts +40 -0
- package/dist/engine/pcb-place/score.js +140 -0
- package/dist/engine/pcb-place/score.js.map +1 -0
- package/dist/engine/pcb.d.ts +72 -0
- package/dist/engine/pcb.js +153 -0
- package/dist/engine/pcb.js.map +1 -0
- package/dist/engine/pour/build.d.ts +32 -0
- package/dist/engine/pour/build.js +108 -0
- package/dist/engine/pour/build.js.map +1 -0
- package/dist/engine/pour/cache.d.ts +8 -0
- package/dist/engine/pour/cache.js +55 -0
- package/dist/engine/pour/cache.js.map +1 -0
- package/dist/engine/pour/clip.d.ts +50 -0
- package/dist/engine/pour/clip.js +72 -0
- package/dist/engine/pour/clip.js.map +1 -0
- package/dist/engine/pour/fill.d.ts +22 -0
- package/dist/engine/pour/fill.js +112 -0
- package/dist/engine/pour/fill.js.map +1 -0
- package/dist/engine/pour/islands.d.ts +8 -0
- package/dist/engine/pour/islands.js +19 -0
- package/dist/engine/pour/islands.js.map +1 -0
- package/dist/engine/pour/joins.d.ts +18 -0
- package/dist/engine/pour/joins.js +74 -0
- package/dist/engine/pour/joins.js.map +1 -0
- package/dist/engine/pour/obstacles.d.ts +45 -0
- package/dist/engine/pour/obstacles.js +85 -0
- package/dist/engine/pour/obstacles.js.map +1 -0
- package/dist/engine/pour/resolve.d.ts +21 -0
- package/dist/engine/pour/resolve.js +19 -0
- package/dist/engine/pour/resolve.js.map +1 -0
- package/dist/engine/pour/shapes.d.ts +9 -0
- package/dist/engine/pour/shapes.js +62 -0
- package/dist/engine/pour/shapes.js.map +1 -0
- package/dist/engine/pour/thermal.d.ts +16 -0
- package/dist/engine/pour/thermal.js +38 -0
- package/dist/engine/pour/thermal.js.map +1 -0
- package/dist/engine/project-files.d.ts +18 -0
- package/dist/engine/project-files.js +58 -0
- package/dist/engine/project-files.js.map +1 -0
- package/dist/engine/ratsnest.d.ts +16 -0
- package/dist/engine/ratsnest.js +69 -0
- package/dist/engine/ratsnest.js.map +1 -0
- package/dist/engine/read-props.d.ts +22 -0
- package/dist/engine/read-props.js +74 -0
- package/dist/engine/read-props.js.map +1 -0
- package/dist/engine/router/astar.d.ts +74 -0
- package/dist/engine/router/astar.js +231 -0
- package/dist/engine/router/astar.js.map +1 -0
- package/dist/engine/router/blockers.d.ts +4 -0
- package/dist/engine/router/blockers.js +69 -0
- package/dist/engine/router/blockers.js.map +1 -0
- package/dist/engine/router/cleanup.d.ts +21 -0
- package/dist/engine/router/cleanup.js +157 -0
- package/dist/engine/router/cleanup.js.map +1 -0
- package/dist/engine/router/clear.d.ts +18 -0
- package/dist/engine/router/clear.js +39 -0
- package/dist/engine/router/clear.js.map +1 -0
- package/dist/engine/router/congestion.d.ts +79 -0
- package/dist/engine/router/congestion.js +212 -0
- package/dist/engine/router/congestion.js.map +1 -0
- package/dist/engine/router/connect.d.ts +79 -0
- package/dist/engine/router/connect.js +174 -0
- package/dist/engine/router/connect.js.map +1 -0
- package/dist/engine/router/ends.d.ts +25 -0
- package/dist/engine/router/ends.js +135 -0
- package/dist/engine/router/ends.js.map +1 -0
- package/dist/engine/router/grid.d.ts +131 -0
- package/dist/engine/router/grid.js +297 -0
- package/dist/engine/router/grid.js.map +1 -0
- package/dist/engine/router/keep-clear.d.ts +10 -0
- package/dist/engine/router/keep-clear.js +60 -0
- package/dist/engine/router/keep-clear.js.map +1 -0
- package/dist/engine/router/obstacles.d.ts +18 -0
- package/dist/engine/router/obstacles.js +66 -0
- package/dist/engine/router/obstacles.js.map +1 -0
- package/dist/engine/router/path.d.ts +34 -0
- package/dist/engine/router/path.js +41 -0
- package/dist/engine/router/path.js.map +1 -0
- package/dist/engine/router/pour-rounds.d.ts +17 -0
- package/dist/engine/router/pour-rounds.js +124 -0
- package/dist/engine/router/pour-rounds.js.map +1 -0
- package/dist/engine/router/replicate.d.ts +32 -0
- package/dist/engine/router/replicate.js +143 -0
- package/dist/engine/router/replicate.js.map +1 -0
- package/dist/engine/router/rip-up.d.ts +5 -0
- package/dist/engine/router/rip-up.js +95 -0
- package/dist/engine/router/rip-up.js.map +1 -0
- package/dist/engine/router/route-board.d.ts +109 -0
- package/dist/engine/router/route-board.js +223 -0
- package/dist/engine/router/route-board.js.map +1 -0
- package/dist/engine/rules/classes.d.ts +14 -0
- package/dist/engine/rules/classes.js +50 -0
- package/dist/engine/rules/classes.js.map +1 -0
- package/dist/engine/rules/load.d.ts +14 -0
- package/dist/engine/rules/load.js +146 -0
- package/dist/engine/rules/load.js.map +1 -0
- package/dist/engine/rules/profiles.d.ts +5 -0
- package/dist/engine/rules/profiles.js +53 -0
- package/dist/engine/rules/profiles.js.map +1 -0
- package/dist/engine/rules/rotations.d.ts +31 -0
- package/dist/engine/rules/rotations.js +124 -0
- package/dist/engine/rules/rotations.js.map +1 -0
- package/dist/engine/rules/schema.d.ts +82 -0
- package/dist/engine/rules/schema.js +59 -0
- package/dist/engine/rules/schema.js.map +1 -0
- package/dist/engine/rules/track-defaults.d.ts +23 -0
- package/dist/engine/rules/track-defaults.js +26 -0
- package/dist/engine/rules/track-defaults.js.map +1 -0
- package/dist/engine/schematic-astar.d.ts +37 -0
- package/dist/engine/schematic-astar.js +202 -0
- package/dist/engine/schematic-astar.js.map +1 -0
- package/dist/engine/schematic-geometry.d.ts +23 -0
- package/dist/engine/schematic-geometry.js +49 -0
- package/dist/engine/schematic-geometry.js.map +1 -0
- package/dist/engine/schematic-grid.d.ts +60 -0
- package/dist/engine/schematic-grid.js +150 -0
- package/dist/engine/schematic-grid.js.map +1 -0
- package/dist/engine/schematic-nets.d.ts +38 -0
- package/dist/engine/schematic-nets.js +157 -0
- package/dist/engine/schematic-nets.js.map +1 -0
- package/dist/engine/schematic-pages.d.ts +9 -0
- package/dist/engine/schematic-pages.js +52 -0
- package/dist/engine/schematic-pages.js.map +1 -0
- package/dist/engine/schematic-place-chains.d.ts +22 -0
- package/dist/engine/schematic-place-chains.js +111 -0
- package/dist/engine/schematic-place-chains.js.map +1 -0
- package/dist/engine/schematic-place-plan.d.ts +43 -0
- package/dist/engine/schematic-place-plan.js +155 -0
- package/dist/engine/schematic-place-plan.js.map +1 -0
- package/dist/engine/schematic-place-units.d.ts +38 -0
- package/dist/engine/schematic-place-units.js +101 -0
- package/dist/engine/schematic-place-units.js.map +1 -0
- package/dist/engine/schematic-place.d.ts +5 -0
- package/dist/engine/schematic-place.js +268 -0
- package/dist/engine/schematic-place.js.map +1 -0
- package/dist/engine/schematic-route.d.ts +37 -0
- package/dist/engine/schematic-route.js +288 -0
- package/dist/engine/schematic-route.js.map +1 -0
- package/dist/engine/schematic-sheets.d.ts +22 -0
- package/dist/engine/schematic-sheets.js +104 -0
- package/dist/engine/schematic-sheets.js.map +1 -0
- package/dist/engine/schematic.d.ts +64 -0
- package/dist/engine/schematic.js +200 -0
- package/dist/engine/schematic.js.map +1 -0
- package/dist/engine/selectors.d.ts +25 -0
- package/dist/engine/selectors.js +28 -0
- package/dist/engine/selectors.js.map +1 -0
- package/dist/engine/sheet-ports.d.ts +44 -0
- package/dist/engine/sheet-ports.js +126 -0
- package/dist/engine/sheet-ports.js.map +1 -0
- package/dist/engine/sheet-symbol.d.ts +52 -0
- package/dist/engine/sheet-symbol.js +92 -0
- package/dist/engine/sheet-symbol.js.map +1 -0
- package/dist/engine/sheets.d.ts +79 -0
- package/dist/engine/sheets.js +159 -0
- package/dist/engine/sheets.js.map +1 -0
- package/dist/engine/symbols/box.d.ts +8 -0
- package/dist/engine/symbols/box.js +83 -0
- package/dist/engine/symbols/box.js.map +1 -0
- package/dist/engine/symbols/index.d.ts +8 -0
- package/dist/engine/symbols/index.js +58 -0
- package/dist/engine/symbols/index.js.map +1 -0
- package/dist/engine/symbols/passives.d.ts +16 -0
- package/dist/engine/symbols/passives.js +58 -0
- package/dist/engine/symbols/passives.js.map +1 -0
- package/dist/engine/symbols/power.d.ts +5 -0
- package/dist/engine/symbols/power.js +10 -0
- package/dist/engine/symbols/power.js.map +1 -0
- package/dist/engine/symbols/semis.d.ts +10 -0
- package/dist/engine/symbols/semis.js +62 -0
- package/dist/engine/symbols/semis.js.map +1 -0
- package/dist/engine/symbols/types.d.ts +83 -0
- package/dist/engine/symbols/types.js +61 -0
- package/dist/engine/symbols/types.js.map +1 -0
- package/dist/engine/traces.d.ts +29 -0
- package/dist/engine/traces.js +102 -0
- package/dist/engine/traces.js.map +1 -0
- package/dist/engine/units.d.ts +4 -0
- package/dist/engine/units.js +31 -0
- package/dist/engine/units.js.map +1 -0
- package/dist/engine/worker-env.d.ts +9 -0
- package/dist/engine/worker-env.js +12 -0
- package/dist/engine/worker-env.js.map +1 -0
- package/dist/library/attach-datasheet.d.ts +20 -0
- package/dist/library/attach-datasheet.js +61 -0
- package/dist/library/attach-datasheet.js.map +1 -0
- package/dist/library/easyeda-footprint.d.ts +41 -0
- package/dist/library/easyeda-footprint.js +255 -0
- package/dist/library/easyeda-footprint.js.map +1 -0
- package/dist/library/easyeda-path.d.ts +13 -0
- package/dist/library/easyeda-path.js +133 -0
- package/dist/library/easyeda-path.js.map +1 -0
- package/dist/library/easyeda-symbol.d.ts +20 -0
- package/dist/library/easyeda-symbol.js +53 -0
- package/dist/library/easyeda-symbol.js.map +1 -0
- package/dist/library/import-lcsc.d.ts +30 -0
- package/dist/library/import-lcsc.js +155 -0
- package/dist/library/import-lcsc.js.map +1 -0
- package/dist/library/lcsc-part.d.ts +40 -0
- package/dist/library/lcsc-part.js +153 -0
- package/dist/library/lcsc-part.js.map +1 -0
- package/dist/library/new-part.d.ts +50 -0
- package/dist/library/new-part.js +160 -0
- package/dist/library/new-part.js.map +1 -0
- package/dist/library/pin-table.d.ts +23 -0
- package/dist/library/pin-table.js +92 -0
- package/dist/library/pin-table.js.map +1 -0
- package/dist/mcp/batch.d.ts +111 -0
- package/dist/mcp/batch.js +241 -0
- package/dist/mcp/batch.js.map +1 -0
- package/dist/mcp/board-summary.d.ts +19 -0
- package/dist/mcp/board-summary.js +144 -0
- package/dist/mcp/board-summary.js.map +1 -0
- package/dist/mcp/compact-sheets.d.ts +31 -0
- package/dist/mcp/compact-sheets.js +63 -0
- package/dist/mcp/compact-sheets.js.map +1 -0
- package/dist/mcp/compact-tool-list.d.ts +8 -0
- package/dist/mcp/compact-tool-list.js +42 -0
- package/dist/mcp/compact-tool-list.js.map +1 -0
- package/dist/mcp/compact.d.ts +33 -0
- package/dist/mcp/compact.js +189 -0
- package/dist/mcp/compact.js.map +1 -0
- package/dist/mcp/copper-summary.d.ts +26 -0
- package/dist/mcp/copper-summary.js +122 -0
- package/dist/mcp/copper-summary.js.map +1 -0
- package/dist/mcp/copper-tools.d.ts +93 -0
- package/dist/mcp/copper-tools.js +228 -0
- package/dist/mcp/copper-tools.js.map +1 -0
- package/dist/mcp/copper-under.d.ts +16 -0
- package/dist/mcp/copper-under.js +46 -0
- package/dist/mcp/copper-under.js.map +1 -0
- package/dist/mcp/create-part.d.ts +71 -0
- package/dist/mcp/create-part.js +31 -0
- package/dist/mcp/create-part.js.map +1 -0
- package/dist/mcp/datasheet-tools.d.ts +14 -0
- package/dist/mcp/datasheet-tools.js +15 -0
- package/dist/mcp/datasheet-tools.js.map +1 -0
- package/dist/mcp/fillet-tools.d.ts +24 -0
- package/dist/mcp/fillet-tools.js +52 -0
- package/dist/mcp/fillet-tools.js.map +1 -0
- package/dist/mcp/guide.d.ts +37 -0
- package/dist/mcp/guide.js +78 -0
- package/dist/mcp/guide.js.map +1 -0
- package/dist/mcp/import-part.d.ts +13 -0
- package/dist/mcp/import-part.js +20 -0
- package/dist/mcp/import-part.js.map +1 -0
- package/dist/mcp/make-sheet.d.ts +18 -0
- package/dist/mcp/make-sheet.js +29 -0
- package/dist/mcp/make-sheet.js.map +1 -0
- package/dist/mcp/new-circuit.d.ts +77 -0
- package/dist/mcp/new-circuit.js +114 -0
- package/dist/mcp/new-circuit.js.map +1 -0
- package/dist/mcp/place-tools.d.ts +46 -0
- package/dist/mcp/place-tools.js +121 -0
- package/dist/mcp/place-tools.js.map +1 -0
- package/dist/mcp/pour-tools.d.ts +126 -0
- package/dist/mcp/pour-tools.js +105 -0
- package/dist/mcp/pour-tools.js.map +1 -0
- package/dist/mcp/project-tools.d.ts +36 -0
- package/dist/mcp/project-tools.js +115 -0
- package/dist/mcp/project-tools.js.map +1 -0
- package/dist/mcp/route-by-ref.d.ts +20 -0
- package/dist/mcp/route-by-ref.js +70 -0
- package/dist/mcp/route-by-ref.js.map +1 -0
- package/dist/mcp/route-tools.d.ts +54 -0
- package/dist/mcp/route-tools.js +173 -0
- package/dist/mcp/route-tools.js.map +1 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.js +290 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/skill-install.d.ts +13 -0
- package/dist/skill-install.js +28 -0
- package/dist/skill-install.js.map +1 -0
- package/dist/studio/fit-board.d.ts +11 -0
- package/dist/studio/fit-board.js +15 -0
- package/dist/studio/fit-board.js.map +1 -0
- package/dist/studio/layout-schema.d.ts +157 -0
- package/dist/studio/layout-schema.js +32 -0
- package/dist/studio/layout-schema.js.map +1 -0
- package/dist/studio/live.d.ts +79 -0
- package/dist/studio/live.js +187 -0
- package/dist/studio/live.js.map +1 -0
- package/dist/studio/place-events.d.ts +60 -0
- package/dist/studio/place-events.js +42 -0
- package/dist/studio/place-events.js.map +1 -0
- package/dist/studio/place-runner.d.ts +62 -0
- package/dist/studio/place-runner.js +205 -0
- package/dist/studio/place-runner.js.map +1 -0
- package/dist/studio/place-worker.d.ts +1 -0
- package/dist/studio/place-worker.js +23 -0
- package/dist/studio/place-worker.js.map +1 -0
- package/dist/studio/route-events.d.ts +64 -0
- package/dist/studio/route-events.js +61 -0
- package/dist/studio/route-events.js.map +1 -0
- package/dist/studio/route-runner.d.ts +90 -0
- package/dist/studio/route-runner.js +272 -0
- package/dist/studio/route-runner.js.map +1 -0
- package/dist/studio/router-worker.d.ts +1 -0
- package/dist/studio/router-worker.js +17 -0
- package/dist/studio/router-worker.js.map +1 -0
- package/dist/studio/server.d.ts +32 -0
- package/dist/studio/server.js +610 -0
- package/dist/studio/server.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +64 -4
- package/skills/copperflow/SKILL.md +199 -0
- package/skills/copperflow/references/copper.md +82 -0
- package/skills/copperflow/references/design-rules.md +163 -0
- package/skills/copperflow/references/design-workflow.md +199 -0
- package/skills/copperflow/references/editable-subset.md +83 -0
- package/skills/copperflow/references/parts-library.md +83 -0
- package/skills/copperflow/references/writing-circuits.md +62 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { parse } from "yaml";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** Free space the courtyard keeps around the pads when the file draws none, in mm. */
|
|
4
|
+
export const DEFAULT_COURTYARD_EXCESS = 0.25;
|
|
5
|
+
const length = z.number().finite();
|
|
6
|
+
const size = z.number().finite().positive();
|
|
7
|
+
const point = z.tuple([length, length]);
|
|
8
|
+
const PadEntrySchema = z
|
|
9
|
+
.object({
|
|
10
|
+
number: z.string().regex(/^[1-9][0-9]*$/, "pad numbers are pin numbers: digits, starting at 1"),
|
|
11
|
+
shape: z.enum(["rect", "roundrect", "circle", "oval"]),
|
|
12
|
+
x: length,
|
|
13
|
+
y: length,
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
rotation: length.optional(),
|
|
17
|
+
layers: z.enum(["top", "through"]).optional(),
|
|
18
|
+
drill: z.union([size, z.object({ width: size, height: size }).strict()]).optional(),
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
/** The land pattern as a person writes it in footprint.yaml: pads in mm, y up, origin at the part centre. */
|
|
22
|
+
export const FootprintFileSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
pads: z.array(PadEntrySchema).min(1),
|
|
25
|
+
courtyard: z.array(point).min(3).optional(),
|
|
26
|
+
silkscreen: z.array(z.array(point).min(2)).optional(),
|
|
27
|
+
body: z.array(point).min(3).optional(),
|
|
28
|
+
/** The pads are not the land pattern yet (the part wizard's stub): the board refuses the part until a person draws them. */
|
|
29
|
+
placeholder: z.boolean().optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
/**
|
|
33
|
+
* The footprint a footprint.yaml describes, or an error that names the file and, for pad
|
|
34
|
+
* problems, the pad. Which pins the part has is checked separately, with `pinErrors`.
|
|
35
|
+
*/
|
|
36
|
+
export function footprintFromFile(path, text) {
|
|
37
|
+
const failure = (reason) => ({ error: `${path}: ${reason}` });
|
|
38
|
+
let data;
|
|
39
|
+
try {
|
|
40
|
+
data = parse(text);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return failure(`not valid YAML (${error.message.split("\n")[0]})`);
|
|
44
|
+
}
|
|
45
|
+
const parsed = FootprintFileSchema.safeParse(padNumbersAsText(data));
|
|
46
|
+
if (!parsed.success)
|
|
47
|
+
return failure(parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; "));
|
|
48
|
+
const problems = padErrors(parsed.data);
|
|
49
|
+
if (problems.length > 0)
|
|
50
|
+
return failure(problems.join("; "));
|
|
51
|
+
return buildFootprint(path, parsed.data);
|
|
52
|
+
}
|
|
53
|
+
/** Problems with single pads: a hole belongs to through pads only, and every through pad needs one. */
|
|
54
|
+
export function padErrors(file) {
|
|
55
|
+
const problems = [];
|
|
56
|
+
for (const [index, pad] of file.pads.entries()) {
|
|
57
|
+
const label = `pad ${pad.number} (entry ${index + 1})`;
|
|
58
|
+
const through = pad.layers === "through";
|
|
59
|
+
if (through && pad.drill === undefined)
|
|
60
|
+
problems.push(`${label} is a through pad and needs a drill`);
|
|
61
|
+
if (!through && pad.drill !== undefined)
|
|
62
|
+
problems.push(`${label} is a top pad and must not have a drill`);
|
|
63
|
+
}
|
|
64
|
+
return problems;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Problems between the pads and the part's pins: a pad must belong to a pin, and every pin
|
|
68
|
+
* except no_connect needs a pad. Several pads may share a number.
|
|
69
|
+
*/
|
|
70
|
+
export function pinErrors(file, part) {
|
|
71
|
+
const padNumbers = new Set(file.pads.map((pad) => pad.number));
|
|
72
|
+
const unknown = [...padNumbers].filter((number) => !(number in part.pins));
|
|
73
|
+
const missing = Object.entries(part.pins).filter(([number, pin]) => pin.type !== "no_connect" && !padNumbers.has(number));
|
|
74
|
+
return [
|
|
75
|
+
...unknown.map((number) => `pad ${number} is not a pin in part.yaml`),
|
|
76
|
+
...missing.map(([number, pin]) => `pin ${number} (${pin.name}) has no pad`),
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
function buildFootprint(path, file) {
|
|
80
|
+
const pads = file.pads.map(toPad);
|
|
81
|
+
const toPoint = ([x, y]) => ({ x, y });
|
|
82
|
+
const closed = (points) => [...points, ...(points[0] ? [points[0]] : [])];
|
|
83
|
+
return {
|
|
84
|
+
name: path,
|
|
85
|
+
pads,
|
|
86
|
+
courtyard: file.courtyard ? file.courtyard.map(toPoint) : paddedBounds(pads, DEFAULT_COURTYARD_EXCESS),
|
|
87
|
+
silkscreen: (file.silkscreen ?? []).map((line) => line.map(toPoint)),
|
|
88
|
+
fabrication: file.body ? [closed(file.body.map(toPoint))] : [],
|
|
89
|
+
origin: `copperflow footprint file ${path}`,
|
|
90
|
+
...(file.placeholder ? { placeholder: true } : {}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function toPad(entry) {
|
|
94
|
+
const drill = typeof entry.drill === "number" ? { width: entry.drill, height: entry.drill } : entry.drill;
|
|
95
|
+
return {
|
|
96
|
+
number: entry.number,
|
|
97
|
+
shape: entry.shape,
|
|
98
|
+
x: entry.x,
|
|
99
|
+
y: entry.y,
|
|
100
|
+
width: entry.width,
|
|
101
|
+
height: entry.height,
|
|
102
|
+
rotation: entry.rotation ?? 0,
|
|
103
|
+
layers: entry.layers ?? "top",
|
|
104
|
+
...(drill ? { drill: { ...drill } } : {}),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A rectangle around every pad and the extra points (such as a body outline), counter-clockwise from the lower left,
|
|
109
|
+
* `excess` mm larger on each side.
|
|
110
|
+
*/
|
|
111
|
+
export function paddedBounds(pads, excess, points = []) {
|
|
112
|
+
const xs = points.map((p) => p.x);
|
|
113
|
+
const ys = points.map((p) => p.y);
|
|
114
|
+
for (const pad of pads) {
|
|
115
|
+
const angle = (pad.rotation * Math.PI) / 180;
|
|
116
|
+
const halfX = (Math.abs(pad.width * Math.cos(angle)) + Math.abs(pad.height * Math.sin(angle))) / 2;
|
|
117
|
+
const halfY = (Math.abs(pad.width * Math.sin(angle)) + Math.abs(pad.height * Math.cos(angle))) / 2;
|
|
118
|
+
xs.push(pad.x - halfX, pad.x + halfX);
|
|
119
|
+
ys.push(pad.y - halfY, pad.y + halfY);
|
|
120
|
+
}
|
|
121
|
+
const minX = Math.min(...xs) - excess;
|
|
122
|
+
const maxX = Math.max(...xs) + excess;
|
|
123
|
+
const minY = Math.min(...ys) - excess;
|
|
124
|
+
const maxY = Math.max(...ys) + excess;
|
|
125
|
+
return [
|
|
126
|
+
{ x: minX, y: minY },
|
|
127
|
+
{ x: maxX, y: minY },
|
|
128
|
+
{ x: maxX, y: maxY },
|
|
129
|
+
{ x: minX, y: maxY },
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
/** People write `number: 1` in YAML; pad numbers are text, so a whole number becomes its digits. */
|
|
133
|
+
function padNumbersAsText(data) {
|
|
134
|
+
if (data === null || typeof data !== "object" || !Array.isArray(data.pads))
|
|
135
|
+
return data;
|
|
136
|
+
const pads = data.pads.map((pad) => pad !== null && typeof pad === "object" && Number.isInteger(pad.number)
|
|
137
|
+
? { ...pad, number: String(pad.number) }
|
|
138
|
+
: pad);
|
|
139
|
+
return { ...data, pads };
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/engine/footprints/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,sFAAsF;AACtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AAE5C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAA;AAClC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAA;AAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEvC,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,oDAAoD,CAAC;IAC/F,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,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4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1D,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAE,GAA4B,CAAC,MAAM,CAAC;QAC/F,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,CAAE,GAA0B,CAAC,MAAM,CAAC,EAAE;QAChE,CAAC,CAAC,GAAG,CACR,CAAA;IACD,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type GoalTable, type PadRow, type Range } from "./ipc7351.js";
|
|
2
|
+
import type { ParsedFootprint } from "./parse.js";
|
|
3
|
+
/** An IC package as its outline drawing gives it. Lengths in mm. */
|
|
4
|
+
export interface IcPackage {
|
|
5
|
+
/** For `origin`, e.g. "SOIC-8". */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Between neighbouring leads of one row. */
|
|
8
|
+
pitch: number;
|
|
9
|
+
/** Across two opposite rows, toe to toe (HE, E, HD). For a no-lead package, the body. */
|
|
10
|
+
span: Range;
|
|
11
|
+
/** The part of the lead or terminal that lies on the board (L, Lp). */
|
|
12
|
+
terminal: Range;
|
|
13
|
+
/** Lead or terminal width (b, bp). */
|
|
14
|
+
leadWidth: Range;
|
|
15
|
+
/** The body between two opposite rows, measured along the leads: Amax of IPC-7351B Table 3-2 Note 1. */
|
|
16
|
+
bodyAcross: Range;
|
|
17
|
+
/** The body measured along a row. */
|
|
18
|
+
bodyAlong: Range;
|
|
19
|
+
}
|
|
20
|
+
export declare const range: (min: number, max: number) => Range;
|
|
21
|
+
/** A row of pads and the IPC-7351B table it came from (for round-off and courtyard). */
|
|
22
|
+
export interface IcRow {
|
|
23
|
+
row: PadRow;
|
|
24
|
+
table: Readonly<GoalTable>;
|
|
25
|
+
}
|
|
26
|
+
/** Gull-wing leads: IPC-7351B Table 3-2 or 3-3 by pitch, with Note 1 against the body across the leads. */
|
|
27
|
+
export declare function gullWingRow(pkg: IcPackage): IcRow;
|
|
28
|
+
/** No-lead terminals that end at the body edge: IPC-7351B Table 3-15, with the body as the span. */
|
|
29
|
+
export declare function leadlessRow(pkg: IcPackage): IcRow;
|
|
30
|
+
/**
|
|
31
|
+
* `_p` and `_w` may only confirm the package: `_p` its pitch, `_w` its nominal span. `flags` lists
|
|
32
|
+
* the bare flags (such as `ep`) the family accepts; anything else refuses the string.
|
|
33
|
+
*/
|
|
34
|
+
export declare function confirmsPackage(params: ParsedFootprint["params"], pkg: IcPackage, flags?: readonly string[]): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { gullWingGoals, gullWingPattern, gullWingTable, IPC_TOLERANCES, landPattern, padRow, QFN_TABLE, } from "./ipc7351.js";
|
|
2
|
+
export const range = (min, max) => ({ min, max });
|
|
3
|
+
function leadOf(pkg) {
|
|
4
|
+
return { span: pkg.span, terminal: pkg.terminal, width: pkg.leadWidth };
|
|
5
|
+
}
|
|
6
|
+
/** Gull-wing leads: IPC-7351B Table 3-2 or 3-3 by pitch, with Note 1 against the body across the leads. */
|
|
7
|
+
export function gullWingRow(pkg) {
|
|
8
|
+
const table = gullWingTable(pkg.pitch);
|
|
9
|
+
const goals = gullWingGoals(leadOf(pkg), pkg.bodyAcross.max, table);
|
|
10
|
+
return { row: padRow(gullWingPattern(leadOf(pkg), goals, IPC_TOLERANCES), table.roundOff), table };
|
|
11
|
+
}
|
|
12
|
+
/** No-lead terminals that end at the body edge: IPC-7351B Table 3-15, with the body as the span. */
|
|
13
|
+
export function leadlessRow(pkg) {
|
|
14
|
+
return { row: padRow(landPattern(leadOf(pkg), QFN_TABLE.goals, IPC_TOLERANCES), QFN_TABLE.roundOff), table: QFN_TABLE };
|
|
15
|
+
}
|
|
16
|
+
const SAME = 1e-6;
|
|
17
|
+
const nominal = (r) => (r.min + r.max) / 2;
|
|
18
|
+
/**
|
|
19
|
+
* `_p` and `_w` may only confirm the package: `_p` its pitch, `_w` its nominal span. `flags` lists
|
|
20
|
+
* the bare flags (such as `ep`) the family accepts; anything else refuses the string.
|
|
21
|
+
*/
|
|
22
|
+
export function confirmsPackage(params, pkg, flags = []) {
|
|
23
|
+
return Object.entries(params).every(([key, value]) => {
|
|
24
|
+
if (key === "p")
|
|
25
|
+
return value !== true && Math.abs(value - pkg.pitch) < SAME;
|
|
26
|
+
if (key === "w")
|
|
27
|
+
return value !== true && Math.abs(value - nominal(pkg.span)) < SAME;
|
|
28
|
+
return flags.includes(key) && value === true;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ic.js","sourceRoot":"","sources":["../../../src/engine/footprints/ic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,MAAM,EACN,SAAS,GAIV,MAAM,cAAc,CAAA;AAqBrB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;AAQxE,SAAS,MAAM,CAAC,GAAc;IAC5B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,SAAS,EAAE,CAAA;AACzE,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,WAAW,CAAC,GAAc;IACxC,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACnE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC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js";
|
|
2
|
+
export type FootprintResult = Footprint | {
|
|
3
|
+
error: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The footprint for a footprint string such as "0603", "sod123", "soic8", "qfn32_ep" or
|
|
7
|
+
* "pinrow4_p2.54mm", or an error naming the string.
|
|
8
|
+
* Results for strings are cached by text and frozen. A string that is a path
|
|
9
|
+
* ("parts/<id>/footprint.yaml") is read through `readFile` every time, because the file can change
|
|
10
|
+
* while the text of the path does not.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateFootprint(text: string, readFile?: (path: string) => string | undefined): FootprintResult;
|
|
13
|
+
/**
|
|
14
|
+
* How many pins the footprint has pads for (its distinct pad numbers: a SOT-89's tab is a second pad 2, so it counts
|
|
15
|
+
* 3), or undefined when copperflow cannot make it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function padCount(text: string): number | undefined;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { bgaFootprint } from "./bga.js";
|
|
2
|
+
import { chipFootprint } from "./chip.js";
|
|
3
|
+
import { crystalFootprint } from "./crystal.js";
|
|
4
|
+
import { dfnFootprint } from "./dfn.js";
|
|
5
|
+
import { dipFootprint } from "./dip.js";
|
|
6
|
+
import { dualFootprint } from "./dual.js";
|
|
7
|
+
import { footprintFromFile } from "./file.js";
|
|
8
|
+
import { unknownFootprint } from "./known.js";
|
|
9
|
+
import { isSimple, parseFootprint } from "./parse.js";
|
|
10
|
+
import { moldedFootprint } from "./molded.js";
|
|
11
|
+
import { pinRowFootprint } from "./pinrow.js";
|
|
12
|
+
import { quadFootprint } from "./quad.js";
|
|
13
|
+
import { radialFootprint } from "./radial.js";
|
|
14
|
+
import { sodFootprint } from "./sod.js";
|
|
15
|
+
import { sotFootprint } from "./sot.js";
|
|
16
|
+
import { powerSotFootprint } from "./sotpower.js";
|
|
17
|
+
import { to220Footprint } from "./to220.js";
|
|
18
|
+
import { to92Footprint } from "./to92.js";
|
|
19
|
+
import { isRefusal } from "./types.js";
|
|
20
|
+
/** No variant and no parameters: "0603", not "0603_5" or "0603_p0.5mm". */
|
|
21
|
+
const isPlain = (parsed) => isSimple(parsed) && parsed.variant === undefined && Object.keys(parsed.params).length === 0;
|
|
22
|
+
/** Tried in order; the first family that accepts the string makes the footprint. */
|
|
23
|
+
const FAMILIES = [
|
|
24
|
+
(parsed) => (parsed.kind === "" && isPlain(parsed) ? chipFootprint(parsed.code) : undefined),
|
|
25
|
+
(parsed) => (parsed.kind === "sod" && isPlain(parsed) ? sodFootprint(parsed.code) : undefined),
|
|
26
|
+
sotFootprint,
|
|
27
|
+
powerSotFootprint,
|
|
28
|
+
moldedFootprint,
|
|
29
|
+
dualFootprint,
|
|
30
|
+
quadFootprint,
|
|
31
|
+
dfnFootprint,
|
|
32
|
+
bgaFootprint,
|
|
33
|
+
pinRowFootprint,
|
|
34
|
+
dipFootprint,
|
|
35
|
+
to220Footprint,
|
|
36
|
+
to92Footprint,
|
|
37
|
+
crystalFootprint,
|
|
38
|
+
radialFootprint,
|
|
39
|
+
];
|
|
40
|
+
/** Footprint strings in a project are few; the bound only guards against unbounded growth. */
|
|
41
|
+
const MAX_CACHED = 512;
|
|
42
|
+
const cache = new Map();
|
|
43
|
+
/** The only files a footprint is read from: the footprint.yaml inside a library part's folder. */
|
|
44
|
+
const FILE_PATH = /^parts\/[A-Za-z0-9._-]+\/footprint\.yaml$/;
|
|
45
|
+
/** Footprint strings never contain "/"; anything that does names a file. */
|
|
46
|
+
const isFilePath = (text) => text.includes("/");
|
|
47
|
+
/**
|
|
48
|
+
* The footprint for a footprint string such as "0603", "sod123", "soic8", "qfn32_ep" or
|
|
49
|
+
* "pinrow4_p2.54mm", or an error naming the string.
|
|
50
|
+
* Results for strings are cached by text and frozen. A string that is a path
|
|
51
|
+
* ("parts/<id>/footprint.yaml") is read through `readFile` every time, because the file can change
|
|
52
|
+
* while the text of the path does not.
|
|
53
|
+
*/
|
|
54
|
+
export function generateFootprint(text, readFile) {
|
|
55
|
+
if (isFilePath(text))
|
|
56
|
+
return deepFreeze(fromFile(text, readFile));
|
|
57
|
+
const cached = cache.get(text);
|
|
58
|
+
if (cached)
|
|
59
|
+
return cached;
|
|
60
|
+
const result = deepFreeze(build(text));
|
|
61
|
+
if (cache.size >= MAX_CACHED)
|
|
62
|
+
cache.delete(cache.keys().next().value);
|
|
63
|
+
cache.set(text, result);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
function fromFile(path, readFile) {
|
|
67
|
+
if (!FILE_PATH.test(path) || path.split("/").some((part) => part.includes(".."))) {
|
|
68
|
+
return { error: `"${path}" is not a footprint file: only parts/<id>/footprint.yaml can be read` };
|
|
69
|
+
}
|
|
70
|
+
if (!readFile)
|
|
71
|
+
return { error: `"${path}" is a footprint file and needs a way to read files` };
|
|
72
|
+
const source = readFile(path);
|
|
73
|
+
return source === undefined ? { error: `${path}: footprint file not found` } : footprintFromFile(path, source);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* How many pins the footprint has pads for (its distinct pad numbers: a SOT-89's tab is a second pad 2, so it counts
|
|
77
|
+
* 3), or undefined when copperflow cannot make it.
|
|
78
|
+
*/
|
|
79
|
+
export function padCount(text) {
|
|
80
|
+
const result = generateFootprint(text);
|
|
81
|
+
return "error" in result ? undefined : new Set(result.pads.map((pad) => pad.number)).size;
|
|
82
|
+
}
|
|
83
|
+
function build(text) {
|
|
84
|
+
const parsed = parseFootprint(text);
|
|
85
|
+
if (parsed) {
|
|
86
|
+
for (const family of FAMILIES) {
|
|
87
|
+
const footprint = family(parsed);
|
|
88
|
+
if (isRefusal(footprint))
|
|
89
|
+
return { error: `copperflow cannot make footprint "${text}": ${footprint.refused}` };
|
|
90
|
+
if (footprint)
|
|
91
|
+
return footprint;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { error: unknownFootprint(text) };
|
|
95
|
+
}
|
|
96
|
+
function deepFreeze(value) {
|
|
97
|
+
if (value !== null && typeof value === "object" && !Object.isFrozen(value)) {
|
|
98
|
+
for (const child of Object.values(value))
|
|
99
|
+
deepFreeze(child);
|
|
100
|
+
Object.freeze(value);
|
|
101
|
+
}
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/engine/footprints/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAgC,MAAM,YAAY,CAAA;AAUpE,2EAA2E;AAC3E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AG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;AAC3F,CAAC;AAED,SAAS,KAAK,CAAC,IAAY;IACzB,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;IACnC,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;YAChC,IAAI,SAAS,CAAC,SAAS,CAAC;gBAAE,OAAO,EAAE,KAAK,EAAE,qCAAqC,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE,EAAE,CAAA;YAC9G,IAAI,SAAS;gBAAE,OAAO,SAAS,CAAA;QACjC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAA;AAC1C,CAAC;AAED,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,UAAU,CAAC,KAAK,CAAC,CAAA;QAC3D,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Through-hole lands: the hole from the largest lead and the round land around it, after the
|
|
3
|
+
* IPC-2222 / IPC-7251 rules for density level B (nominal). The numbers are written from general
|
|
4
|
+
* knowledge of those standards, not transcribed from them:
|
|
5
|
+
* - hole = the largest lead diameter (for a rectangular lead, its diagonal) + 0.20 mm, rounded up to
|
|
6
|
+
* 0.05 mm;
|
|
7
|
+
* - land = hole + 2 × 0.05 mm minimum annular ring + 0.50 mm fabrication allowance, rounded up to
|
|
8
|
+
* 0.05 mm.
|
|
9
|
+
*/
|
|
10
|
+
import { type Range } from "./ipc7351.js";
|
|
11
|
+
import type { Pad } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Courtyard for through-hole parts: 0.25 mm around the larger of the pads and the body, rounded up
|
|
14
|
+
* to 0.05 mm, the same excess as the IPC-7351B level B surface-mount tables and the engine plan's
|
|
15
|
+
* rule for pin rows.
|
|
16
|
+
*/
|
|
17
|
+
export declare const THROUGH_HOLE_COURTYARD: {
|
|
18
|
+
courtyardExcess: number;
|
|
19
|
+
roundOff: number;
|
|
20
|
+
};
|
|
21
|
+
export interface Land {
|
|
22
|
+
drill: number;
|
|
23
|
+
pad: number;
|
|
24
|
+
}
|
|
25
|
+
/** The diameter a lead needs through a hole: a round lead's diameter, a rectangular lead's diagonal. */
|
|
26
|
+
export declare function leadDiameter(width: Range, thickness?: Range): number;
|
|
27
|
+
/** Hole and land for a lead of this diameter. */
|
|
28
|
+
export declare function throughHoleLand(diameter: number): Land;
|
|
29
|
+
/** A through-hole pad: square for pin 1 (`square`), round otherwise. */
|
|
30
|
+
export declare function throughHolePad(number: string, x: number, y: number, land: Land, square?: boolean): Pad;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Through-hole lands: the hole from the largest lead and the round land around it, after the
|
|
3
|
+
* IPC-2222 / IPC-7251 rules for density level B (nominal). The numbers are written from general
|
|
4
|
+
* knowledge of those standards, not transcribed from them:
|
|
5
|
+
* - hole = the largest lead diameter (for a rectangular lead, its diagonal) + 0.20 mm, rounded up to
|
|
6
|
+
* 0.05 mm;
|
|
7
|
+
* - land = hole + 2 × 0.05 mm minimum annular ring + 0.50 mm fabrication allowance, rounded up to
|
|
8
|
+
* 0.05 mm.
|
|
9
|
+
*/
|
|
10
|
+
import { roundUpToStep } from "./ipc7351.js";
|
|
11
|
+
const HOLE_ALLOWANCE = 0.2;
|
|
12
|
+
const MIN_ANNULAR_RING = 0.05;
|
|
13
|
+
const FABRICATION_ALLOWANCE = 0.5;
|
|
14
|
+
const ROUND_OFF = 0.05;
|
|
15
|
+
/**
|
|
16
|
+
* Courtyard for through-hole parts: 0.25 mm around the larger of the pads and the body, rounded up
|
|
17
|
+
* to 0.05 mm, the same excess as the IPC-7351B level B surface-mount tables and the engine plan's
|
|
18
|
+
* rule for pin rows.
|
|
19
|
+
*/
|
|
20
|
+
export const THROUGH_HOLE_COURTYARD = { courtyardExcess: 0.25, roundOff: ROUND_OFF };
|
|
21
|
+
/** The diameter a lead needs through a hole: a round lead's diameter, a rectangular lead's diagonal. */
|
|
22
|
+
export function leadDiameter(width, thickness) {
|
|
23
|
+
return thickness ? Math.hypot(width.max, thickness.max) : width.max;
|
|
24
|
+
}
|
|
25
|
+
/** Hole and land for a lead of this diameter. */
|
|
26
|
+
export function throughHoleLand(diameter) {
|
|
27
|
+
const drill = roundUpToStep(diameter + HOLE_ALLOWANCE, ROUND_OFF);
|
|
28
|
+
return { drill, pad: roundUpToStep(drill + 2 * MIN_ANNULAR_RING + FABRICATION_ALLOWANCE, ROUND_OFF) };
|
|
29
|
+
}
|
|
30
|
+
/** A through-hole pad: square for pin 1 (`square`), round otherwise. */
|
|
31
|
+
export function throughHolePad(number, x, y, land, square = false) {
|
|
32
|
+
return {
|
|
33
|
+
number,
|
|
34
|
+
shape: square ? "rect" : "circle",
|
|
35
|
+
x,
|
|
36
|
+
y,
|
|
37
|
+
width: land.pad,
|
|
38
|
+
height: land.pad,
|
|
39
|
+
rotation: 0,
|
|
40
|
+
layers: "through",
|
|
41
|
+
drill: { width: land.drill, height: land.drill },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ipc7251.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipc7251.js","sourceRoot":"","sources":["../../../src/engine/footpr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AAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;KACjD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPC-7351B nominal (density level B) land patterns: the equations, the solder joint goal tables, the
|
|
3
|
+
* round-off and the rows of pads that come out of them. Lengths are in mm. Every constant names
|
|
4
|
+
* its source. The IPC-7351B tables were read from page images that PCB Libraries reproduces; its
|
|
5
|
+
* running text (equations, tolerances, rounding) was not seen, so those come from the 2005 edition
|
|
6
|
+
* and from PCB Libraries' published calculator outputs, as noted at each place.
|
|
7
|
+
*
|
|
8
|
+
* Sources cited below:
|
|
9
|
+
* - [IPC-7351B] IPC-7351B, "Generic Requirements for Surface Mount Design and Land Pattern Standard",
|
|
10
|
+
* June 2010. Table numbers and pages as listed in its table of contents
|
|
11
|
+
* (https://www.ipc.org/TOC/IPC-7351B.pdf, now served from https://www.electronics.org/TOC/IPC-7351B.pdf).
|
|
12
|
+
* - [IPC-7351] IPC-7351, same title, February 2005 (the edition IPC-7351B revises).
|
|
13
|
+
* - [PCBL-2025] PCB Libraries, Inc., "PCB Design Perfection Starts in the CAD Library", PCEA, 2025,
|
|
14
|
+
* https://pcea.net/wp-content/uploads/2025/09/PCB-Design-Perfection-Starts-in-the-CAD-Library.pdf
|
|
15
|
+
* - [PCBL-2587] PCB Libraries Forum, "IPC-J-STD-001 Gull Wing Leads and Solder Joints", Tom H,
|
|
16
|
+
* 26 Dec 2019, https://www.pcblibraries.com/forum/printer_friendly_posts.asp?TID=2587
|
|
17
|
+
* - [PCBL-2588] PCB Libraries Forum, "IPC-J-STD-001 Chip Component Solder Joints", Tom H,
|
|
18
|
+
* 27 Dec 2019, https://www.pcblibraries.com/forum/printer_friendly_posts.asp?TID=2588
|
|
19
|
+
* - [PCBL-1744] PCB Libraries Forum, "Dimensional Principles of IPC-7351B", 2015–2025,
|
|
20
|
+
* https://www.pcblibraries.com/forum/printer_friendly_posts.asp?TID=1744
|
|
21
|
+
* - [PCBL-30] PCB Libraries Forum, "0402 Min Size Land Pattern", Library Expert Lite output posted
|
|
22
|
+
* by jayx, 20 Apr 2015, https://www.pcblibraries.com/FORUM/printer_friendly_posts.asp?TID=30
|
|
23
|
+
* - [PCBL-785] PCB Libraries Forum, "IPC-7351 SMD & PTH Reference Calculators", post by Jeff.M,
|
|
24
|
+
* 25 Feb 2021, https://www.pcblibraries.com/forum/printer_friendly_posts.asp?TID=785
|
|
25
|
+
* - [FOOTAG2] endofexclusive/footag2, src/ipc7351b/table.c, a transcription of the IPC-7351B goal
|
|
26
|
+
* tables, https://github.com/endofexclusive/footag2/blob/master/src/ipc7351b/table.c (values cited,
|
|
27
|
+
* no code taken). Its Tables 3-2, 3-5 and 3-6 and the goal rows of its Table 3-3 agree with the
|
|
28
|
+
* page images that PCB Libraries reproduces.
|
|
29
|
+
*/
|
|
30
|
+
import type { Pad } from "./types.js";
|
|
31
|
+
export interface Range {
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
}
|
|
35
|
+
export interface FilletGoals {
|
|
36
|
+
toe: number;
|
|
37
|
+
heel: number;
|
|
38
|
+
side: number;
|
|
39
|
+
}
|
|
40
|
+
export interface Tolerances {
|
|
41
|
+
fabrication: number;
|
|
42
|
+
placement: number;
|
|
43
|
+
}
|
|
44
|
+
/** Outer pad extent Z, inner gap G and pad width X, before rounding. */
|
|
45
|
+
export interface LandPattern {
|
|
46
|
+
Z: number;
|
|
47
|
+
G: number;
|
|
48
|
+
X: number;
|
|
49
|
+
}
|
|
50
|
+
/** A row of terminals measured as IPC-7351 does: toe-to-toe span L, terminal length T, width W. */
|
|
51
|
+
export interface Lead {
|
|
52
|
+
span: Range;
|
|
53
|
+
terminal: Range;
|
|
54
|
+
width: Range;
|
|
55
|
+
}
|
|
56
|
+
/** One IPC-7351B solder joint goal table at density level B. */
|
|
57
|
+
export interface GoalTable {
|
|
58
|
+
goals: FilletGoals;
|
|
59
|
+
/** The table's round-off step: Z, G and X go to the nearest multiple, the courtyard up to one. */
|
|
60
|
+
roundOff: number;
|
|
61
|
+
/** Added on every side of the larger of the pads and the component. */
|
|
62
|
+
courtyardExcess: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The land pattern equations as [IPC-7351] §3.1.5 (p. 10) gives them; the IPC-7351B wording was not
|
|
66
|
+
* seen:
|
|
67
|
+
* Z = Lmin + 2·Jt + √(CL² + F² + P²)
|
|
68
|
+
* G = Smax' − 2·Jh − √(CSrms² + F² + P²)
|
|
69
|
+
* X = Wmin + 2·Js + √(CW² + F² + P²)
|
|
70
|
+
* with Smin = Lmin − 2·Tmax, Smax = Lmax − 2·Tmin and CSrms = √(CL² + 2·CT²). Smax' takes half of
|
|
71
|
+
* the difference between the worst-case and the root-sum-square S tolerance off Smax, as PCB
|
|
72
|
+
* Libraries' calculator does ([PCBL-2025] slide 18); its published outputs ([PCBL-2025] slide 15,
|
|
73
|
+
* [PCBL-30]) come out of these equations. [IPC-7351] §3.1.1 (p. 9) instead adds CSrms to Smin,
|
|
74
|
+
* which gives a smaller G; [PCBL-785] quotes the SOIC example of [IPC-7351B] §3.1.1 (L 5.8–6.2,
|
|
75
|
+
* T 0.4–1.27, Smin 3.26, Smax 5.40) and says IPC-7351B takes the Smax' form.
|
|
76
|
+
*/
|
|
77
|
+
export declare function landPattern(lead: Lead, goals: FilletGoals, tol: Tolerances): LandPattern;
|
|
78
|
+
/**
|
|
79
|
+
* The land pattern of a row of gull-wing leads at the nominal density level. Z and X are those of
|
|
80
|
+
* `landPattern`. The heel side is
|
|
81
|
+
* G = Smax' − 2·Jh − √(CL² + F² + P²)
|
|
82
|
+
* with F 0.10 and P 0.05 (IPC_TOLERANCES). This form is chosen because it reproduces the published
|
|
83
|
+
* IPC-7351B nominal pattern SOIC127P600X175-8N (pads 1.55 × 0.60 at ±2.70, inner edges 3.85 apart):
|
|
84
|
+
* for L 5.80–6.20, T 0.41–1.27 it gives G 3.8449 → 3.85. The `landPattern` form, with
|
|
85
|
+
* √(CSrms² + F² + P²) in place of the last term, gives 2.95 for the same package. The IPC-7351B text
|
|
86
|
+
* for this equation was not seen, so the choice rests on that one published pattern.
|
|
87
|
+
*/
|
|
88
|
+
export declare function gullWingPattern(lead: Lead, goals: FilletGoals, tol: Tolerances): LandPattern;
|
|
89
|
+
/**
|
|
90
|
+
* F, the board fabrication tolerance (0.10 mm), and P, the placement tolerance (0.05 mm), as assumed
|
|
91
|
+
* values in [IPC-7351] §3.1.4, p. 10; the IPC-7351B wording was not seen. PCB Libraries writes the
|
|
92
|
+
* same tolerances as ±0.05 and ±0.025 ([PCBL-2025] slides 15 and 19), and its published outputs
|
|
93
|
+
* ([PCBL-2025] slide 15, [PCBL-30]) only come out with F = 0.10 and P = 0.05 in the equations.
|
|
94
|
+
*/
|
|
95
|
+
export declare const IPC_TOLERANCES: Readonly<Tolerances>;
|
|
96
|
+
/**
|
|
97
|
+
* Rectangular or square-end components equal to or larger than 1608 (0603), level B:
|
|
98
|
+
* [IPC-7351B] Table 3-5, p. 17, reproduced in [PCBL-2588] and [PCBL-2025] slide 13. Toe 0.35,
|
|
99
|
+
* heel 0, side 0; round-off to the nearest 0.05 mm; courtyard excess 0.25.
|
|
100
|
+
*/
|
|
101
|
+
export declare const CHIP_TABLE: Readonly<GoalTable>;
|
|
102
|
+
/**
|
|
103
|
+
* The same, smaller than 1608 (0603): [IPC-7351B] Table 3-6, p. 17, reproduced in [PCBL-2588] and
|
|
104
|
+
* [PCBL-2025] slide 13. Toe 0.20, heel 0, side 0; round-off to the nearest 0.02 mm; courtyard
|
|
105
|
+
* excess 0.15.
|
|
106
|
+
*/
|
|
107
|
+
export declare const SMALL_CHIP_TABLE: Readonly<GoalTable>;
|
|
108
|
+
/**
|
|
109
|
+
* Flat ribbon L and gull-wing leads with a pitch over 0.625 mm (two-terminal SOD packages have no
|
|
110
|
+
* pitch), level B: [IPC-7351B] Table 3-2, p. 16, reproduced in [PCBL-2587] and [PCBL-1744]; the table
|
|
111
|
+
* names small outline diodes (section 8.8) among its families. Toe 0.35, heel 0.35, side 0.03;
|
|
112
|
+
* round-off to the nearest 0.05 mm; courtyard excess 0.25.
|
|
113
|
+
*/
|
|
114
|
+
export declare const GULL_WING_TABLE: Readonly<GoalTable>;
|
|
115
|
+
/**
|
|
116
|
+
* The same leads with a pitch of 0.625 mm or less, level B: [IPC-7351B] Table 3-3, p. 16. Toe 0.35,
|
|
117
|
+
* heel 0.35, side −0.02, as in the page image reproduced in [PCBL-2587]. That image stops after the
|
|
118
|
+
* side row; the round-off (nearest 0.05 mm) and courtyard excess (0.25) come from [FOOTAG2] and are
|
|
119
|
+
* the same as Table 3-2's.
|
|
120
|
+
*/
|
|
121
|
+
export declare const FINE_PITCH_GULL_WING_TABLE: Readonly<GoalTable>;
|
|
122
|
+
/** Table 3-2 for a pitch over 0.625 mm, Table 3-3 for 0.625 mm and under. */
|
|
123
|
+
export declare function gullWingTable(pitch: number): Readonly<GoalTable>;
|
|
124
|
+
/**
|
|
125
|
+
* Quad flat no-lead packages, level B: [IPC-7351B] Table 3-15 "Quad Flat No-Lead", p. 19 (title and
|
|
126
|
+
* page from the table of contents). Toe 0.30, heel 0, side −0.04; round-off to the nearest 0.05 mm;
|
|
127
|
+
* courtyard excess 0.25, as transcribed in [FOOTAG2]. No page image of this table was found, so
|
|
128
|
+
* [FOOTAG2] is the only source for these values.
|
|
129
|
+
*/
|
|
130
|
+
export declare const QFN_TABLE: Readonly<GoalTable>;
|
|
131
|
+
/**
|
|
132
|
+
* Molded-body components with inward L-bend terminals (DO-214 diodes, molded tantalum capacitors),
|
|
133
|
+
* level B: toe 0.15, heel 0.50, side −0.05; round-off to the nearest 0.05 mm; courtyard excess 0.25.
|
|
134
|
+
* These goals are written from general knowledge of the IPC-7351B molded-body table; no source for
|
|
135
|
+
* that table was at hand, so they are not checked against it.
|
|
136
|
+
*/
|
|
137
|
+
export declare const MOLDED_BODY_TABLE: Readonly<GoalTable>;
|
|
138
|
+
export declare function chipTable(bodyLength: Range): Readonly<GoalTable>;
|
|
139
|
+
/**
|
|
140
|
+
* The goals of a gull-wing table (Table 3-2 by default, or Table 3-3) with Note 1 applied.
|
|
141
|
+
*
|
|
142
|
+
* `aMax` is the largest size of the package body measured between the two rows of leads, along the
|
|
143
|
+
* leads: E1 of a SOIC or TSSOP, E of a SOT-23, the body of a QFP, the body length of a SOD. Note 1
|
|
144
|
+
* then gives the shorter heel to feet that reach back under the body.
|
|
145
|
+
*
|
|
146
|
+
* How the reading was settled. In [PCBL-1744], Tom H posted on 6 Feb 2025 (3:59 pm) the lead-style
|
|
147
|
+
* drawing PCB Libraries made when it helped IPC define the two lead forms (Mini_Gull-Wing_Formula.JPG).
|
|
148
|
+
* It states both cases in the form of Notes 1 and 2 (mini gull-wing when Smin ≤ Amax and the
|
|
149
|
+
* terminal tolerance is under 0.5 mm, standard gull-wing otherwise) and draws A across the body and
|
|
150
|
+
* S between the inner ends of the feet. Posts in the same thread (5 Aug 2015; 6 Feb 2025, 9:23 am)
|
|
151
|
+
* call Amax the lead span, toe to toe; but Smin = Lmin − 2·Tmax is always below the lead span, so that
|
|
152
|
+
* reading would apply Note 1 to every gull-wing part and leave its condition without effect. No
|
|
153
|
+
* independent IPC-7351B nominal pattern was found for a package where the two readings differ
|
|
154
|
+
* (TSSOP, SOP and QFP do; SOT-23 and SOIC-8 do not), so this is a sourced reading, not one checked
|
|
155
|
+
* against such a pattern.
|
|
156
|
+
*/
|
|
157
|
+
export declare function gullWingGoals(lead: Lead, aMax: number, goalTable?: Readonly<GoalTable>): FilletGoals;
|
|
158
|
+
/** `value` rounded up to a multiple of `step`, without floating-point noise. */
|
|
159
|
+
export declare function roundUpToStep(value: number, step: number): number;
|
|
160
|
+
/** One row of identical pads, as a land pattern gives it. */
|
|
161
|
+
export interface PadRow {
|
|
162
|
+
/** (Z − G)/2, along the lead. */
|
|
163
|
+
length: number;
|
|
164
|
+
/** X, across the lead. */
|
|
165
|
+
width: number;
|
|
166
|
+
/** (Z + G)/4, from the part centre to the pad centre. */
|
|
167
|
+
centre: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The pads of a land pattern after rounding Z, G and X to the nearest multiple of the table's
|
|
171
|
+
* round-off step, as the round-off rows of [IPC-7351B] Tables 3-2, 3-3, 3-5, 3-6 and 3-15 put it
|
|
172
|
+
* ([IPC-7351] §3.1.5.1, p. 11, likewise lets the round-off go up or down). Throws when the rounded
|
|
173
|
+
* pattern leaves no gap, which means the package table is wrong.
|
|
174
|
+
*/
|
|
175
|
+
export declare function padRow(pattern: LandPattern, roundOff: number): PadRow;
|
|
176
|
+
/** The two pads of a two-terminal land pattern, along x, pad 1 at negative x. */
|
|
177
|
+
export declare function twoTerminalPads(pattern: LandPattern, roundOff: number): Pad[];
|
|
178
|
+
/** A top-side round-rectangle pad, `width` along x and `height` along y. */
|
|
179
|
+
export declare function roundRectPad(number: string, x: number, y: number, width: number, height: number): Pad;
|