@rulecad/rules 0.3.0 → 0.3.5
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 +7 -2
- package/jlcpcb.json +41 -9
- package/package.json +1 -1
- package/rp2040.json +54 -0
- package/x1c.json +16 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ it comes from and when it was checked, so a design built on it can be traced and
|
|
|
10
10
|
|
|
11
11
|
| Set | What | Values |
|
|
12
12
|
|---|---|---|
|
|
13
|
-
| `x1c` | Bambu Lab X1 Carbon: bed, line width, layer, overhang, bridges, fits and hole compensation |
|
|
13
|
+
| `x1c` | Bambu Lab X1 Carbon: bed, line width, layer, overhang, bridges, fits, the gap parts printed in place need (and how far the first layer spreads), and hole compensation | 13 |
|
|
14
14
|
| `mx` | Cherry MX switches: plate cut-out, stem, housing, travel, key pitch | 29 |
|
|
15
15
|
| `oem` | OEM keycap profile: heights and top tilt per row (from KeyV2) | 12 |
|
|
16
16
|
| `m2` | M2 heat-set inserts and screws | 5 |
|
|
@@ -20,8 +20,13 @@ it comes from and when it was checked, so a design built on it can be traced and
|
|
|
20
20
|
| `xiao` | Seeed Studio XIAO modules: outline, headers, the pin on each pad | 8 |
|
|
21
21
|
| `qwiic` | Qwiic / STEMMA QT sockets (JST SH, 4 pins): land pattern and pinout | 10 |
|
|
22
22
|
| `jstph` | JST PH (2.0 mm) battery connector | 3 |
|
|
23
|
-
| `jlcpcb` | JLCPCB's limits for two-layer boards |
|
|
23
|
+
| `jlcpcb` | JLCPCB's limits for two-layer boards | 14 |
|
|
24
24
|
| `wiring` | Room for hand wiring | 1 |
|
|
25
|
+
| `m4`, `m5` | M4 and M5 socket head screws and hex nuts | 5 each |
|
|
26
|
+
| `rp2040` | The RP2040 microcontroller: which package pins carry which GPIO | 2 |
|
|
27
|
+
| `dial-indicator` | A dial indicator with a plunger, for measuring small movements | 2 |
|
|
28
|
+
| `pla`, `petg` | Bambu Lab PLA Basic and PETG HF, printed, for analysis: stiffness and strength along the layers and across them | 5, 6 |
|
|
29
|
+
| `al6061`, `al7075`, `s275`, `ss304`, `ti64` | Aluminium 6061-T6 and 7075-T6, structural steel S275, stainless 304, titanium Ti-6Al-4V, for analysis | 4 or 5 each |
|
|
25
30
|
|
|
26
31
|
`kind` says how far to trust a value: **spec** (a datasheet or manufacturer), **community** (a widely used figure, such
|
|
27
32
|
as KiCad's library or KeyV2), **default** (a setting that works), **derived** (read off someone else's model with `cad measure`: check it
|
package/jlcpcb.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"rule": "Narrowest track",
|
|
9
9
|
"kind": "spec",
|
|
10
10
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
11
|
-
"checked": "2026-
|
|
11
|
+
"checked": "2026-11-07"
|
|
12
12
|
},
|
|
13
13
|
"gap_min": {
|
|
14
14
|
"value": 0.1,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"rule": "Smallest gap between tracks",
|
|
17
17
|
"kind": "spec",
|
|
18
18
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
19
|
-
"checked": "2026-
|
|
19
|
+
"checked": "2026-11-07"
|
|
20
20
|
},
|
|
21
21
|
"drill_min": {
|
|
22
22
|
"value": 0.15,
|
|
@@ -24,7 +24,31 @@
|
|
|
24
24
|
"rule": "Smallest drilled hole on a two-layer board",
|
|
25
25
|
"kind": "spec",
|
|
26
26
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
27
|
-
"checked": "2026-
|
|
27
|
+
"checked": "2026-11-07"
|
|
28
|
+
},
|
|
29
|
+
"npth_min": {
|
|
30
|
+
"value": 0.5,
|
|
31
|
+
"unit": "mm",
|
|
32
|
+
"rule": "Smallest unplated (non-plated through) hole on a 1 to 2 layer board",
|
|
33
|
+
"kind": "spec",
|
|
34
|
+
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
35
|
+
"checked": "2026-11-07"
|
|
36
|
+
},
|
|
37
|
+
"castellated_drill_min": {
|
|
38
|
+
"value": 0.6,
|
|
39
|
+
"unit": "mm",
|
|
40
|
+
"rule": "Smallest castellated (half) hole on a rigid board",
|
|
41
|
+
"kind": "spec",
|
|
42
|
+
"source": "https://jlcpcb.com/blog/142-castellated-pcbs-introduction-and-design-requirements",
|
|
43
|
+
"checked": "2026-10-31"
|
|
44
|
+
},
|
|
45
|
+
"castellated_gap_min": {
|
|
46
|
+
"value": 0.6,
|
|
47
|
+
"unit": "mm",
|
|
48
|
+
"rule": "Castellated holes: edge to edge, at least (JLCPCB also gives 0.5 mm elsewhere: this is the stricter)",
|
|
49
|
+
"kind": "spec",
|
|
50
|
+
"source": "https://jlcpcb.com/blog/142-castellated-pcbs-introduction-and-design-requirements",
|
|
51
|
+
"checked": "2026-10-31"
|
|
28
52
|
},
|
|
29
53
|
"via_hole": {
|
|
30
54
|
"value": 0.15,
|
|
@@ -32,7 +56,7 @@
|
|
|
32
56
|
"rule": "Smallest via hole",
|
|
33
57
|
"kind": "spec",
|
|
34
58
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
35
|
-
"checked": "2026-
|
|
59
|
+
"checked": "2026-11-07"
|
|
36
60
|
},
|
|
37
61
|
"via_pad": {
|
|
38
62
|
"value": 0.25,
|
|
@@ -40,7 +64,7 @@
|
|
|
40
64
|
"rule": "Smallest via pad diameter",
|
|
41
65
|
"kind": "spec",
|
|
42
66
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
43
|
-
"checked": "2026-
|
|
67
|
+
"checked": "2026-11-07"
|
|
44
68
|
},
|
|
45
69
|
"annular": {
|
|
46
70
|
"value": 0.25,
|
|
@@ -48,7 +72,15 @@
|
|
|
48
72
|
"rule": "Annular ring, recommended (0.18 mm absolute minimum)",
|
|
49
73
|
"kind": "spec",
|
|
50
74
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
51
|
-
"checked": "2026-
|
|
75
|
+
"checked": "2026-11-07"
|
|
76
|
+
},
|
|
77
|
+
"annular_min": {
|
|
78
|
+
"value": 0.18,
|
|
79
|
+
"unit": "mm",
|
|
80
|
+
"rule": "Annular ring, absolute minimum: a via or plated hole with less fails; between this and annular is a warning",
|
|
81
|
+
"kind": "spec",
|
|
82
|
+
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
83
|
+
"checked": "2026-11-07"
|
|
52
84
|
},
|
|
53
85
|
"silk_line": {
|
|
54
86
|
"value": 0.15,
|
|
@@ -56,7 +88,7 @@
|
|
|
56
88
|
"rule": "Thinnest silkscreen line",
|
|
57
89
|
"kind": "spec",
|
|
58
90
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
59
|
-
"checked": "2026-
|
|
91
|
+
"checked": "2026-11-07"
|
|
60
92
|
},
|
|
61
93
|
"silk_text": {
|
|
62
94
|
"value": 1.0,
|
|
@@ -64,7 +96,7 @@
|
|
|
64
96
|
"rule": "Smallest silkscreen text height",
|
|
65
97
|
"kind": "spec",
|
|
66
98
|
"source": "https://jlcpcb.com/capabilities/pcb-capabilities",
|
|
67
|
-
"checked": "2026-
|
|
99
|
+
"checked": "2026-11-07"
|
|
68
100
|
},
|
|
69
101
|
"thickness": {
|
|
70
102
|
"value": 1.6,
|
|
@@ -77,7 +109,7 @@
|
|
|
77
109
|
"cheap_size": {
|
|
78
110
|
"value": 100,
|
|
79
111
|
"unit": "mm",
|
|
80
|
-
"rule": "Two-layer boards up to 100
|
|
112
|
+
"rule": "Two-layer boards up to 100 \u00d7 100 mm get JLCPCB's lowest price; past that it rises steeply",
|
|
81
113
|
"kind": "community",
|
|
82
114
|
"source": "https://hwdocs.hackclub.dev/user-contrib-guides/jlc-cost-optimizing/",
|
|
83
115
|
"checked": "2026-10-14"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulecad/rules",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Researched rule sets as open data: a Bambu Lab X1C, Cherry MX switches, OEM keycaps, M2 inserts, the Raspberry Pi Pico, materials for analysis (printed PLA and PETG, aluminium, steel, titanium) and more, each value with its source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/rp2040.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_doc": "The Raspberry Pi RP2040 microcontroller: which of its package pins carry which GPIO. kind as in x1c.json.",
|
|
3
|
+
"name": "rp2040",
|
|
4
|
+
"rules": {
|
|
5
|
+
"package_pins": {
|
|
6
|
+
"value": 56,
|
|
7
|
+
"unit": "pins",
|
|
8
|
+
"rule": "QFN-56, 7 x 7 mm, 0.4 mm pitch",
|
|
9
|
+
"kind": "spec",
|
|
10
|
+
"source": "https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf",
|
|
11
|
+
"checked": "2026-11-01"
|
|
12
|
+
},
|
|
13
|
+
"gpio": {
|
|
14
|
+
"value": 30,
|
|
15
|
+
"unit": "pins",
|
|
16
|
+
"rule": "Package pins that carry GPIO, listed in pins (package pin: GPIO). GPIO26 to 29 are also ADC0 to 3",
|
|
17
|
+
"kind": "community",
|
|
18
|
+
"source": "RP2040 datasheet, 1.4.3 Pin Descriptions (https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf); written from it, and checked against Sea-Picro's net names for the 23 GPIO it brings out",
|
|
19
|
+
"checked": "2026-11-01",
|
|
20
|
+
"pins": {
|
|
21
|
+
"2": "GPIO0",
|
|
22
|
+
"3": "GPIO1",
|
|
23
|
+
"4": "GPIO2",
|
|
24
|
+
"5": "GPIO3",
|
|
25
|
+
"6": "GPIO4",
|
|
26
|
+
"7": "GPIO5",
|
|
27
|
+
"8": "GPIO6",
|
|
28
|
+
"9": "GPIO7",
|
|
29
|
+
"11": "GPIO8",
|
|
30
|
+
"12": "GPIO9",
|
|
31
|
+
"13": "GPIO10",
|
|
32
|
+
"14": "GPIO11",
|
|
33
|
+
"15": "GPIO12",
|
|
34
|
+
"16": "GPIO13",
|
|
35
|
+
"17": "GPIO14",
|
|
36
|
+
"18": "GPIO15",
|
|
37
|
+
"27": "GPIO16",
|
|
38
|
+
"28": "GPIO17",
|
|
39
|
+
"29": "GPIO18",
|
|
40
|
+
"30": "GPIO19",
|
|
41
|
+
"31": "GPIO20",
|
|
42
|
+
"32": "GPIO21",
|
|
43
|
+
"34": "GPIO22",
|
|
44
|
+
"35": "GPIO23",
|
|
45
|
+
"36": "GPIO24",
|
|
46
|
+
"37": "GPIO25",
|
|
47
|
+
"38": "GPIO26",
|
|
48
|
+
"39": "GPIO27",
|
|
49
|
+
"40": "GPIO28",
|
|
50
|
+
"41": "GPIO29"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/x1c.json
CHANGED
|
@@ -58,6 +58,14 @@
|
|
|
58
58
|
"source": "Common FDM practice; tune with a test print",
|
|
59
59
|
"checked": "2026-10-11"
|
|
60
60
|
},
|
|
61
|
+
"print_gap": {
|
|
62
|
+
"value": 0.3,
|
|
63
|
+
"unit": "mm",
|
|
64
|
+
"rule": "Narrowest gap between parts printed in place, side by side, that still prints apart (a flexure and the frame round it, a shuttle in its slot): the gap each side, not the total",
|
|
65
|
+
"kind": "estimate",
|
|
66
|
+
"source": "A reasoned guess for a 0.42 mm line; measure it with the fit test plate (examples/bench/projects/launcher/objects/fittest)",
|
|
67
|
+
"checked": "2026-11-01"
|
|
68
|
+
},
|
|
61
69
|
"overhang": {
|
|
62
70
|
"value": 45,
|
|
63
71
|
"unit": "\u00b0",
|
|
@@ -89,6 +97,14 @@
|
|
|
89
97
|
"kind": "community",
|
|
90
98
|
"source": "Common FDM practice",
|
|
91
99
|
"checked": "2026-10-11"
|
|
100
|
+
},
|
|
101
|
+
"foot": {
|
|
102
|
+
"value": 0.15,
|
|
103
|
+
"unit": "mm",
|
|
104
|
+
"rule": "How far the first layer spreads each side as it is squashed on to the bed (elephant's foot): two parts printed in place must stand print_gap plus twice this apart there, or they print as one",
|
|
105
|
+
"kind": "community",
|
|
106
|
+
"source": "Bambu Studio's default elephant foot compensation, 0.15 mm, the amount it shrinks the first layer by to undo the spread",
|
|
107
|
+
"checked": "2026-11-07"
|
|
92
108
|
}
|
|
93
109
|
}
|
|
94
110
|
}
|