@rulecad/rules 0.1.1 → 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/README.md CHANGED
@@ -17,12 +17,15 @@ it comes from and when it was checked, so a design built on it can be traced and
17
17
  | `pico` | Raspberry Pi Pico: outline, headers, the GPIO on each pin | 18 |
18
18
  | `promicro` | Pro Micro controller | 9 |
19
19
  | `sod123` | SOD-123 diode footprint | 3 |
20
+ | `xiao` | Seeed Studio XIAO modules: outline, headers, the pin on each pad | 8 |
21
+ | `qwiic` | Qwiic / STEMMA QT sockets (JST SH, 4 pins): land pattern and pinout | 10 |
22
+ | `jstph` | JST PH (2.0 mm) battery connector | 3 |
20
23
  | `jlcpcb` | JLCPCB's limits for two-layer boards | 10 |
21
24
  | `wiring` | Room for hand wiring | 1 |
22
25
 
23
26
  `kind` says how far to trust a value: **spec** (a datasheet or manufacturer), **community** (a widely used figure, such
24
- as KiCad's library or KeyV2), **default** (a setting that works), or **estimate** (nobody has published it: measure it
25
- and correct it). Use them with `@rulecad/variables` (`uses: ['x1c']`, then `x1c.line * 3` in any expression), or read
27
+ as KiCad's library or KeyV2), **default** (a setting that works), **derived** (read off someone else's model with `cad measure`: check it
28
+ against the real thing, and see its `licence`), or **estimate** (nobody has published it: measure it and correct it). Use them with `@rulecad/variables` (`uses: ['x1c']`, then `x1c.line * 3` in any expression), or read
26
29
  the JSON from anywhere.
27
30
 
28
31
  **Corrections are the most useful contribution.** If you measured something, use the "Correct a rule" issue form on
package/al6061.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "Aluminium alloy 6061-T6, for analysis.",
3
+ "name": "al6061",
4
+ "rules": {
5
+ "modulus": {"value": 68900, "unit": "MPa", "rule": "Young's modulus", "kind": "spec", "source": "ASM Aerospace Specification Metals, Aluminum 6061-T6, https://asm.matweb.com/search/specificmaterial.asp?bassnum=ma6061t6", "checked": "2026-10-27"},
6
+ "poisson": {"value": 0.33, "rule": "Poisson's ratio", "kind": "spec", "source": "ASM, Aluminum 6061-T6", "checked": "2026-10-27"},
7
+ "strength": {"value": 276, "unit": "MPa", "rule": "Tensile yield strength", "kind": "spec", "source": "ASM, Aluminum 6061-T6", "checked": "2026-10-27"},
8
+ "fatigue": {"value": 96.5, "unit": "MPa", "rule": "Fatigue strength at 500,000,000 cycles (completely reversed, R. R. Moore test)", "kind": "spec", "source": "ASM, Aluminum 6061-T6", "checked": "2026-10-27"},
9
+ "density": {"value": 2.7, "unit": "g/cm³", "rule": "Density", "kind": "spec", "source": "ASM, Aluminum 6061-T6", "checked": "2026-10-27"}
10
+ }
11
+ }
package/al7075.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "Aluminium alloy 7075-T6, for analysis.",
3
+ "name": "al7075",
4
+ "rules": {
5
+ "modulus": {"value": 71700, "unit": "MPa", "rule": "Young's modulus", "kind": "spec", "source": "ASM Aerospace Specification Metals, Aluminum 7075-T6, https://asm.matweb.com/search/specificmaterial.asp?bassnum=ma7075t6", "checked": "2026-10-27"},
6
+ "poisson": {"value": 0.33, "rule": "Poisson's ratio", "kind": "spec", "source": "ASM, Aluminum 7075-T6", "checked": "2026-10-27"},
7
+ "strength": {"value": 503, "unit": "MPa", "rule": "Tensile yield strength", "kind": "spec", "source": "ASM, Aluminum 7075-T6", "checked": "2026-10-27"},
8
+ "fatigue": {"value": 159, "unit": "MPa", "rule": "Fatigue strength at 500,000,000 cycles (completely reversed, R. R. Moore test)", "kind": "spec", "source": "ASM, Aluminum 7075-T6", "checked": "2026-10-27"},
9
+ "density": {"value": 2.81, "unit": "g/cm³", "rule": "Density", "kind": "spec", "source": "ASM, Aluminum 7075-T6", "checked": "2026-10-27"}
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "_doc": "A dial indicator (dial test gauge) with a plunger, for measuring small movements. kind as in x1c.json.",
3
+ "name": "dial-indicator",
4
+ "rules": {
5
+ "stem": {"value": 8, "unit": "mm", "rule": "Mounting stem diameter (8h6)", "kind": "spec", "source": "DIN 878 / ISO 463", "checked": "2026-10-27"},
6
+ "travel": {"value": 10, "unit": "mm", "rule": "Plunger travel of the common 0.01 mm, 10 mm range gauge", "kind": "community", "source": "Typical 0.01 mm / 10 mm dial indicators (Mitutoyo 2046 series and alike)", "checked": "2026-10-27"}
7
+ }
8
+ }
package/jstph.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "_doc": "JST PH (2.0 mm), the usual connector on battery packs and LiPo cells. Through-hole, top entry (B*B-PH-K-S). kind as in x1c.json.",
3
+ "name": "jstph",
4
+ "rules": {
5
+ "pitch": { "value": 2.0, "unit": "mm", "rule": "Contact pitch", "kind": "spec", "source": "JST PH series datasheet", "checked": "2026-10-16" },
6
+ "drill": { "value": 0.8, "unit": "mm", "rule": "Hole for the 0.64 mm square post (datasheet 0.7 mm, plus fab tolerance)", "kind": "community", "source": "KiCad library, JST_PH_B2B-PH-K", "checked": "2026-10-16" },
7
+ "pad": { "value": 1.5, "unit": "mm", "rule": "Round pad", "kind": "community", "source": "KiCad library, JST_PH_B2B-PH-K", "checked": "2026-10-16" }
8
+ }
9
+ }
package/m4.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "M4 socket head screws and hex nuts. kind as in x1c.json.",
3
+ "name": "m4",
4
+ "rules": {
5
+ "clearance": {"value": 4.5, "unit": "mm", "rule": "Clearance hole for an M4 screw, medium fit", "kind": "spec", "source": "ISO 273", "checked": "2026-10-27"},
6
+ "head": {"value": 7, "unit": "mm", "rule": "M4 socket head cap screw head diameter", "kind": "spec", "source": "ISO 4762", "checked": "2026-10-27"},
7
+ "head_height": {"value": 4, "unit": "mm", "rule": "M4 socket head cap screw head height", "kind": "spec", "source": "ISO 4762", "checked": "2026-10-27"},
8
+ "nut_flats": {"value": 7, "unit": "mm", "rule": "M4 hex nut width across flats", "kind": "spec", "source": "ISO 4032", "checked": "2026-10-27"},
9
+ "nut_height": {"value": 3.2, "unit": "mm", "rule": "M4 hex nut height", "kind": "spec", "source": "ISO 4032", "checked": "2026-10-27"}
10
+ }
11
+ }
package/m5.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "M5 socket head screws and hex nuts. kind as in x1c.json.",
3
+ "name": "m5",
4
+ "rules": {
5
+ "clearance": {"value": 5.5, "unit": "mm", "rule": "Clearance hole for an M5 screw, medium fit", "kind": "spec", "source": "ISO 273", "checked": "2026-10-27"},
6
+ "head": {"value": 8.5, "unit": "mm", "rule": "M5 socket head cap screw head diameter", "kind": "spec", "source": "ISO 4762", "checked": "2026-10-27"},
7
+ "head_height": {"value": 5, "unit": "mm", "rule": "M5 socket head cap screw head height", "kind": "spec", "source": "ISO 4762", "checked": "2026-10-27"},
8
+ "nut_flats": {"value": 8, "unit": "mm", "rule": "M5 hex nut width across flats", "kind": "spec", "source": "ISO 4032", "checked": "2026-10-27"},
9
+ "nut_height": {"value": 4.7, "unit": "mm", "rule": "M5 hex nut height", "kind": "spec", "source": "ISO 4032", "checked": "2026-10-27"}
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rulecad/rules",
3
- "version": "0.1.1",
4
- "description": "Researched rule sets as open data: a Bambu Lab X1C, Cherry MX switches, OEM keycaps, M2 inserts, the Raspberry Pi Pico and more, each value with its source.",
3
+ "version": "0.3.0",
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": {
7
7
  "./*": "./*"
package/petg.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "_doc": "Bambu Lab PETG HF, printed, for analysis: stiffness and strength along the layers (x-y) and across them (z). Printed values vary with the printer, settings and spool: measure your own (the lever bench does) and record it as kind measured.",
3
+ "name": "petg",
4
+ "rules": {
5
+ "modulus": {"value": 1810, "unit": "MPa", "rule": "Young's modulus along the layers (x-y), ± 190", "kind": "spec", "source": "Bambu Lab PETG HF technical data sheet V1.0 (ISO 527), https://store.bblcdn.com/3a230e260a3a47c2b0db0156e07eef91.pdf", "checked": "2026-10-27"},
6
+ "modulus_z": {"value": 1540, "unit": "MPa", "rule": "Young's modulus across the layers (z), ± 130", "kind": "spec", "source": "Bambu Lab PETG HF technical data sheet V1.0 (ISO 527)", "checked": "2026-10-27"},
7
+ "strength": {"value": 34, "unit": "MPa", "rule": "Tensile strength along the layers (x-y), ± 4", "kind": "spec", "source": "Bambu Lab PETG HF technical data sheet V1.0 (ISO 527)", "checked": "2026-10-27"},
8
+ "strength_z": {"value": 23, "unit": "MPa", "rule": "Tensile strength across the layers (z), ± 4", "kind": "spec", "source": "Bambu Lab PETG HF technical data sheet V1.0 (ISO 527)", "checked": "2026-10-27"},
9
+ "poisson": {"value": 0.38, "rule": "Poisson's ratio (Bambu publish none)", "kind": "estimate", "source": "Typical for PETG; printed parts vary", "checked": "2026-10-27"},
10
+ "density": {"value": 1.27, "unit": "g/cm³", "rule": "Density of PETG", "kind": "estimate", "source": "Typical for PETG (1.23 to 1.29 g/cm³ across makers' data sheets)", "checked": "2026-10-27"}
11
+ }
12
+ }
package/pla.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "Bambu Lab PLA Basic, printed, for analysis: stiffness and strength along the layers (x-y) and across them (z). Printed values vary with the printer, settings and spool: measure your own (the lever bench does) and record it as kind measured.",
3
+ "name": "pla",
4
+ "rules": {
5
+ "modulus": {"value": 2680, "unit": "MPa", "rule": "Young's modulus along the layers (x-y), ± 130", "kind": "spec", "source": "Bambu Lab PLA Basic technical data sheet V2.0 (ISO 527), https://www.impresoras3d.com/wp-content/uploads/2023/08/TDS-Bambu-PLA-Basic-Technical-Data-Sheet.pdf", "checked": "2026-10-27"},
6
+ "modulus_z": {"value": 2160, "unit": "MPa", "rule": "Young's modulus across the layers (z), ± 90", "kind": "spec", "source": "Bambu Lab PLA Basic technical data sheet V2.0 (ISO 527)", "checked": "2026-10-27"},
7
+ "strength": {"value": 39, "unit": "MPa", "rule": "Tensile strength along the layers (x-y), ± 2", "kind": "community", "source": "Bambu Lab PLA Basic technical data sheet V2.0 (ISO 527), as quoted by resellers: check the current sheet", "checked": "2026-10-27"},
8
+ "poisson": {"value": 0.36, "rule": "Poisson's ratio (Bambu publish none)", "kind": "estimate", "source": "Typical for PLA; Farah, Anderson, Langer (2016), Physical and mechanical properties of PLA, Advanced Drug Delivery Reviews 107", "checked": "2026-10-27"},
9
+ "density": {"value": 1.26, "unit": "g/cm³", "rule": "Density of the filament", "kind": "spec", "source": "Bambu Lab PLA Basic technical data sheet V2.0", "checked": "2026-10-27"}
10
+ }
11
+ }
package/qwiic.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "_doc": "Qwiic / STEMMA QT: a 4-pin JST SH (1.0 mm) I2C connector used by SparkFun, Adafruit and others, so sensors from any of them plug in with one cable. Land pattern for the side-entry SM04B-SRSS-TB, from the socket's centre, the plug going in from +y. kind as in x1c.json.",
3
+ "name": "qwiic",
4
+ "rules": {
5
+ "pitch": { "value": 1.0, "unit": "mm", "rule": "Contact pitch", "kind": "spec", "source": "JST SH series datasheet (SM04B-SRSS-TB)", "checked": "2026-10-16" },
6
+ "pad_w": { "value": 0.6, "unit": "mm", "rule": "Signal pad width", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
7
+ "pad_h": { "value": 1.55, "unit": "mm", "rule": "Signal pad length", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
8
+ "pad_y": { "value": -1.325, "unit": "mm", "rule": "Signal pads from the centre, away from the plug", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
9
+ "tab_w": { "value": 1.2, "unit": "mm", "rule": "Mounting tab pad width", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
10
+ "tab_h": { "value": 1.8, "unit": "mm", "rule": "Mounting tab pad length", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
11
+ "tab_x": { "value": 2.8, "unit": "mm", "rule": "Mounting tabs either side of the centre", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
12
+ "tab_y": { "value": 1.22, "unit": "mm", "rule": "Mounting tabs from the centre, toward the plug", "kind": "spec", "source": "JST SH series datasheet, recommended PCB layout", "checked": "2026-10-16" },
13
+ "body_w": { "value": 6, "unit": "mm", "rule": "Socket body width", "kind": "spec", "source": "JST SH series datasheet (4 circuits)", "checked": "2026-10-16" },
14
+ "pins": { "value": 4, "unit": "pins", "rule": "Pin 1 GND, 2 3V3, 3 SDA, 4 SCL", "kind": "spec", "source": "https://www.sparkfun.com/qwiic", "checked": "2026-10-16",
15
+ "pins": { "1": "GND", "2": "3V3", "3": "SDA", "4": "SCL" } }
16
+ }
17
+ }
package/s275.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "_doc": "Structural steel S275 (EN 10025-2), for analysis.",
3
+ "name": "s275",
4
+ "rules": {
5
+ "modulus": {"value": 210000, "unit": "MPa", "rule": "Young's modulus", "kind": "spec", "source": "EN 1993-1-1, 3.2.6", "checked": "2026-10-27"},
6
+ "poisson": {"value": 0.3, "rule": "Poisson's ratio", "kind": "spec", "source": "EN 1993-1-1, 3.2.6", "checked": "2026-10-27"},
7
+ "strength": {"value": 275, "unit": "MPa", "rule": "Yield strength, up to 16 mm thick", "kind": "spec", "source": "EN 10025-2", "checked": "2026-10-27"},
8
+ "density": {"value": 7.85, "unit": "g/cm³", "rule": "Density", "kind": "spec", "source": "EN 1991-1-1, table A.4", "checked": "2026-10-27"}
9
+ }
10
+ }
package/ss304.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "_doc": "Stainless steel 304, annealed, for analysis.",
3
+ "name": "ss304",
4
+ "rules": {
5
+ "modulus": {"value": 193000, "unit": "MPa", "rule": "Young's modulus", "kind": "spec", "source": "ASM Aerospace Specification Metals, AISI Type 304 Stainless Steel, https://asm.matweb.com/search/specificmaterial.asp?bassnum=mq304a", "checked": "2026-10-27"},
6
+ "poisson": {"value": 0.29, "rule": "Poisson's ratio", "kind": "spec", "source": "ASM, AISI Type 304", "checked": "2026-10-27"},
7
+ "strength": {"value": 215, "unit": "MPa", "rule": "Tensile yield strength, annealed", "kind": "spec", "source": "ASM, AISI Type 304", "checked": "2026-10-27"},
8
+ "density": {"value": 8.0, "unit": "g/cm³", "rule": "Density", "kind": "spec", "source": "ASM, AISI Type 304", "checked": "2026-10-27"}
9
+ }
10
+ }
package/ti64.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "_doc": "Titanium Ti-6Al-4V (grade 5), annealed, for analysis.",
3
+ "name": "ti64",
4
+ "rules": {
5
+ "modulus": {"value": 113800, "unit": "MPa", "rule": "Young's modulus", "kind": "spec", "source": "ASM Aerospace Specification Metals, Titanium Ti-6Al-4V (Grade 5), Annealed, https://asm.matweb.com/search/specificmaterial.asp?bassnum=mtp641", "checked": "2026-10-27"},
6
+ "poisson": {"value": 0.342, "rule": "Poisson's ratio", "kind": "spec", "source": "ASM, Ti-6Al-4V annealed", "checked": "2026-10-27"},
7
+ "strength": {"value": 880, "unit": "MPa", "rule": "Tensile yield strength", "kind": "spec", "source": "ASM, Ti-6Al-4V annealed", "checked": "2026-10-27"},
8
+ "fatigue": {"value": 510, "unit": "MPa", "rule": "Fatigue strength at 10,000,000 cycles, unnotched", "kind": "spec", "source": "ASM, Ti-6Al-4V annealed", "checked": "2026-10-27"},
9
+ "density": {"value": 4.43, "unit": "g/cm³", "rule": "Density", "kind": "spec", "source": "ASM, Ti-6Al-4V annealed", "checked": "2026-10-27"}
10
+ }
11
+ }
package/xiao.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "_doc": "Seeed Studio XIAO modules (ESP32-C3/C6/S3, nRF52840, RP2040, RP2350, SAMD21 ...): one size and pinout across the family, so a board can take any of them. kind as in x1c.json.",
3
+ "name": "xiao",
4
+ "rules": {
5
+ "length": { "value": 21, "unit": "mm", "rule": "Module length, USB end to far end", "kind": "spec", "source": "https://wiki.seeedstudio.com/xiao_rp2350_arduino", "checked": "2026-10-16" },
6
+ "width": { "value": 17.8, "unit": "mm", "rule": "Module width", "kind": "spec", "source": "https://wiki.seeedstudio.com/xiao_rp2350_arduino", "checked": "2026-10-16" },
7
+ "pitch": { "value": 2.54, "unit": "mm", "rule": "Pitch of the 7 pins down each side", "kind": "spec", "source": "https://wiki.seeedstudio.com/XIAO-RP2040", "checked": "2026-10-16" },
8
+ "row_spacing": { "value": 15.24, "unit": "mm", "rule": "Centre to centre of the two pin rows (0.6 in: the width less one castellation each side)", "kind": "estimate", "source": "17.8 mm module less 2 x 1.27 mm. Check against Seeed's KiCad footprint or measure", "checked": "2026-10-16" },
9
+ "drill": { "value": 1.0, "unit": "mm", "rule": "Hole for a 0.64 mm square header pin", "kind": "community", "source": "KiCad library, PinHeader_2.54mm", "checked": "2026-10-16" },
10
+ "pad": { "value": 1.7, "unit": "mm", "rule": "Round pad around a header hole", "kind": "community", "source": "KiCad library, PinHeader_2.54mm", "checked": "2026-10-16" },
11
+ "height": { "value": 3.5, "unit": "mm", "rule": "Module above the board it sits on: its board plus the USB-C socket, the tallest part", "kind": "estimate", "source": "USB-C receptacle about 3.2 mm on a 1 mm module board. Measure one", "checked": "2026-10-16" },
12
+ "pins": { "value": 14, "unit": "pins", "rule": "Seen from above, USB at the top: D0 to D6 down the left (pins 1 to 7), D7 to D10, 3V3, GND, 5V up the right (pins 8 to 14). D4 is SDA and D5 SCL on every XIAO", "kind": "spec", "source": "https://wiki.seeedstudio.com/xiao_rp2350_arduino", "checked": "2026-10-16",
13
+ "pins": { "1": "D0", "2": "D1", "3": "D2", "4": "D3", "5": "D4", "6": "D5", "7": "D6", "8": "D7", "9": "D8", "10": "D9", "11": "D10", "12": "3V3", "13": "GND", "14": "5V" } }
14
+ }
15
+ }