mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-06 15:36:30 +02:00
Merge branch 'magnet_name' of https://github.com/martinbudden/NopSCADlib into martinbudden-magnet_name
This commit is contained in:
@@ -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;
|
||||
|
@@ -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 <magnet.scad>
|
||||
|
Reference in New Issue
Block a user