@tscircuit/footprinter 0.0.1

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/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # @tscircuit/footprinter
2
+
3
+ Footprinter is tscircuit's DSL and micro-builder for creating footprints
4
+
5
+ You can create very custom footprints using the `<footprint>` element, but the
6
+ compressability is poor. `footprinter` produces very short, low parameter
7
+ mini-programs for generating footprints, this makes it suitable for standardized
8
+ footprints.
9
+
10
+ Here are some example programs:
11
+
12
+ ```ts
13
+ import { fp } from "@tscircuit/footprinter"
14
+
15
+ fp.cap().w(0.4).h(0.2)
16
+ fp.cap().p(0.1).pw(0.1).ph(0.1) // pitch, pad width and pad height
17
+ fp.cap().metric("0402")
18
+ fp.res().imperial("01005")
19
+ fp.dip(4).w(7.62)
20
+ fp.dip(4).w(7.62).socket()
21
+ ```
22
+
23
+ ## Footprinter Strings
24
+
25
+ A footprinter string is a string that maps to a set of builder calls.
26
+
27
+ ```ts
28
+ import { fp } from "@tscircuit/footprinter"
29
+
30
+ fp.string("dip4_w7.62") // same as fp.dip(4).w(7.62)
31
+ fp.string("dip4_w7.62mm") // same as fp.dip(4).w(7.62)
32
+ fp.string("dip4_w0.3in") // same as fp.dip(4).w("0.3in")
33
+ ```
34
+
35
+ ## Magic
36
+
37
+ `footprinter` comes with a `fp.magic` function which calls a remote server that
38
+ attempts to convert the specified string into a `footprinter` string. This can
39
+ help when you're looking at a random package designator from an online site. You
40
+ should always confirm these footprints against the datasheet.
41
+
42
+ ## Generation Defaults
43
+
44
+ - Pins are CCW starting at the top left
45
+ - Y is upward-positive, X is rightward-positive
package/ava.config.js ADDED
@@ -0,0 +1,5 @@
1
+ export default {
2
+ files: ["tests/**/*.test.ts"],
3
+ extensions: ["ts"],
4
+ require: ["esbuild-register"],
5
+ }