diff --git a/libtest.png b/libtest.png index 147b0ae..fa565e5 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/readme.md b/readme.md index 7a258d8..bce27e2 100644 --- a/readme.md +++ b/readme.md @@ -1881,6 +1881,7 @@ Cylindrical and ring magnets. |:--- |:--- | | `magnet_h(type)` | Height | | `magnet_id(type)` | Inside diameter if a ring | +| `magnet_name(type)` | Name | | `magnet_od(type)` | Outer diameter | | `magnet_r(type)` | Corner radius | @@ -1894,9 +1895,10 @@ Cylindrical and ring magnets. ### Vitamins | Qty | Module call | BOM entry | | ---:|:--- |:---| -| 1 | `magnet(MAG484)` | Magnet 6.35mm diameter, 6.35mm high, 3.175mm bore | -| 1 | `magnet(MAG8x4x4p2)` | Magnet 8mm diameter, 4mm high, 4.2mm bore | -| 1 | `magnet(MAG5x8)` | Magnet 8mm diameter, 5mm high | +| 1 | `magnet(MAG484)` | Magnet, 6.35mm diameter, 6.35mm high, 3.175mm bore | +| 1 | `magnet(MAG8x4x4p2)` | Magnet, 8mm diameter, 4mm high, 4.2mm bore | +| 1 | `magnet(MAG5x8)` | Magnet, 8mm diameter, 5mm high | +| 1 | `magnet(MAGRE6x2p5)` | Radial encoder magnet, 6mm diameter, 2.5mm high | Top diff --git a/tests/png/magnets.png b/tests/png/magnets.png index 0ef675a..8524d28 100644 Binary files a/tests/png/magnets.png and b/tests/png/magnets.png differ diff --git a/vitamins/magnet.scad b/vitamins/magnet.scad index 33efb00..a7b283e 100644 --- a/vitamins/magnet.scad +++ b/vitamins/magnet.scad @@ -22,10 +22,11 @@ // include <../utils/core/core.scad> -function magnet_od(type) = type[1]; //! Outer diameter -function magnet_id(type) = type[2]; //! Inside diameter if a ring -function magnet_h(type) = type[3]; //! Height -function magnet_r(type) = type[4]; //! Corner radius +function magnet_name(type) = type[1]; //! Name +function magnet_od(type) = type[2]; //! Outer diameter +function magnet_id(type) = type[3]; //! Inside diameter if a ring +function magnet_h(type) = type[4]; //! Height +function magnet_r(type) = type[5]; //! Corner radius module magnet(type) { //! Draw specified magnet od = magnet_od(type); @@ -33,7 +34,7 @@ module magnet(type) { //! Draw specified magnet h = magnet_h(type); r = magnet_r(type); - vitamin(str("magnet(", type[0], "): Magnet ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" )); + vitamin(str("magnet(", type[0], "): ", magnet_name(type), ", ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" )); or = od / 2; ir = id / 2; diff --git a/vitamins/magnets.scad b/vitamins/magnets.scad index 714d41f..3dc78b4 100644 --- a/vitamins/magnets.scad +++ b/vitamins/magnets.scad @@ -20,11 +20,12 @@ //! Cylindrical and ring magnets. // -// od, id, h, r -MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5]; -MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5]; -MAG5x8 = ["MAG5x8", 8, 0, 5, 0.5]; +// name, od, id, h, r +MAG8x4x4p2 = ["MAG8x4x4p2", "Magnet", 8, 4.2, 4, 0.5]; +MAG484 = ["MAG484", "Magnet", inch(1/4), inch(1/8), inch(1/4), 0.5]; +MAG5x8 = ["MAG5x8", "Magnet", 8, 0, 5, 0.5]; +MAGRE6x2p5 = ["MAGRE6x2p5", "Radial encoder magnet", 6, 0, 2.5, 0.5]; -magnets = [MAG8x4x4p2, MAG484, MAG5x8]; +magnets = [MAG8x4x4p2, MAG484, MAG5x8, MAGRE6x2p5]; use