mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-03 04:12:35 +02:00
Potentiometers now create a BOM entry and have a value specified.
This commit is contained in:
@@ -27,21 +27,21 @@ pot_proud = 0.3;
|
||||
spigot_r = 0.5;
|
||||
tab = [3.2, 0.5];
|
||||
|
||||
function pot_body(type) = type[0]; //! Body diameter or width & depth, height and corner radius
|
||||
function pot_face(type) = type[1]; //! Faceplate rib width, plate depth and plate height
|
||||
function pot_wafer(type) = type[2]; //! Width, diameter and thickness of the track wafer plus true if curved
|
||||
function pot_gangs(type) = type[3]; //! Number of gangs for mult-gang pot
|
||||
function pot_thread_d(type) = type[4]; //! Nomininal thread diameter
|
||||
function pot_thread_p(type) = type[5]; //! Thread pritch
|
||||
function pot_thread_h(type) = type[6]; //! Height of threaded part
|
||||
function pot_boss_d(type) = type[7]; //! Boss diameter
|
||||
function pot_boss_h(type) = type[8]; //! Boss height
|
||||
function pot_spigot(type) = type[9]; //! Spigot width, length and height above the boss
|
||||
function pot_spigot_x(type) = type[10]; //! Spigot offset from the shaft centre
|
||||
function pot_shaft(type) = type[11]; //! Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width
|
||||
function pot_neck(type) = type[12]; //! Diameter and length of the shaft neck
|
||||
function pot_nut(type) = type[13]; //! Across flat diameter and thickness of the nut
|
||||
function pot_washer(type) = type[14]; //! Outside diameter and thickness of the washer
|
||||
function pot_body(type) = type[1]; //! Body diameter or width & depth, height and corner radius
|
||||
function pot_face(type) = type[2]; //! Faceplate rib width, plate depth and plate height
|
||||
function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved
|
||||
function pot_gangs(type) = type[4]; //! Number of gangs for mult-gang pot
|
||||
function pot_thread_d(type) = type[5]; //! Nomininal thread diameter
|
||||
function pot_thread_p(type) = type[6]; //! Thread pritch
|
||||
function pot_thread_h(type) = type[7]; //! Height of threaded part
|
||||
function pot_boss_d(type) = type[8]; //! Boss diameter
|
||||
function pot_boss_h(type) = type[9]; //! Boss height
|
||||
function pot_spigot(type) = type[10]; //! Spigot width, length and height above the boss
|
||||
function pot_spigot_x(type) = type[11]; //! Spigot offset from the shaft centre
|
||||
function pot_shaft(type) = type[12]; //! Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width
|
||||
function pot_neck(type) = type[13]; //! Diameter and length of the shaft neck
|
||||
function pot_nut(type) = type[14]; //! Across flat diameter and thickness of the nut
|
||||
function pot_washer(type) = type[15]; //! Outside diameter and thickness of the washer
|
||||
|
||||
function pot_size(type) = let(d = pot_body(type)) len(d) > 3 ? [d.x , d.y, d.z] : [d.x, d.x, d.y]; //! Get pot body dimensions
|
||||
|
||||
@@ -86,7 +86,7 @@ module pot_nut(type, washer = true) { //! Draw the nut for a potentiometer and p
|
||||
}
|
||||
}
|
||||
|
||||
module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a potentiometer with nut spaced by specified thickness
|
||||
module potentiometer(type, thickness = 3, shaft_length = undef, value = false) {//! Draw a potentiometer with nut spaced by specified thickness
|
||||
bh = pot_boss_h(type);
|
||||
s = pot_size(type);
|
||||
face = pot_face(type);
|
||||
@@ -97,6 +97,7 @@ module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a pote
|
||||
thread_d = pot_thread_d(type);
|
||||
thread_h = pot_thread_h(type);
|
||||
shaft = pot_shaft(type);
|
||||
vitamin(str("potentiometer(", type[0], "): ", slice(type[0], start = -8) != "_encoder" ? "Potentiometer " : "", value ? value : type[0]));
|
||||
|
||||
color(dia_cast_colour) {
|
||||
// Boss
|
||||
|
@@ -17,12 +17,12 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
//! Potentiometers and rotary encoders
|
||||
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat d shaft h flat h colour neck nut washer
|
||||
imperial_pot_x2 = [[24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
|
||||
imperial_pot = [[24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
|
||||
metric_pot = [[23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0], [12.8, 2, silver], [17.7, 0.8, grey(20), 10]];
|
||||
KY_040_encoder = [[12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5],[9.8, 2.2, silver], [11.5, 0.4, silver]];
|
||||
BTT_encoder = [[12, 11, 6, 0.5], false, false, 1, 6, 0.8, 4.5, 0, 0, false, 0, [5, 0.75, 9.5, 9, silver], [3, 0.5]];
|
||||
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat d shaft h flat h colour neck nut washer
|
||||
imperial_pot_x2 = ["imperial_pot_x2", [24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
|
||||
imperial_pot = ["imperial_pot", [24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
|
||||
metric_pot = ["metric_pot", [23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0], [12.8, 2, silver], [17.7, 0.8, grey(20), 10]];
|
||||
KY_040_encoder = ["KY_040_encoder", [12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5],[9.8, 2.2, silver], [11.5, 0.4, silver]];
|
||||
BTT_encoder = ["BTT_encoder", [12, 11, 6, 0.5], false, false, 1, 6, 0.8, 4.5, 0, 0, false, 0, [5, 0.75, 9.5, 9, silver], [3, 0.5]];
|
||||
|
||||
potentiometers = [BTT_encoder, KY_040_encoder, metric_pot, imperial_pot, imperial_pot_x2];
|
||||
|
||||
|
Reference in New Issue
Block a user