mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-30 17:09:06 +02:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6b8ea9685e | ||
|
0cf8cb7d28 | ||
|
7c439a687f | ||
|
4a95ce528e | ||
|
138f45730b | ||
|
8d1ff3584c | ||
|
26b2b63b6e | ||
|
611772d960 | ||
|
b6e648b485 | ||
|
e224ee0ad2 | ||
|
10c3df466b | ||
|
3e4eedc25f | ||
|
029265e1b9 | ||
|
7449857ab7 | ||
|
49f6da767a |
@@ -26,7 +26,7 @@
|
|||||||
// Setting $bom after including lib overrides bom in the libs but not in the local file.
|
// Setting $bom after including lib overrides bom in the libs but not in the local file.
|
||||||
// Setting $_bom in the local file overrides it in the local file but not in the libs.
|
// Setting $_bom in the local file overrides it in the local file but not in the libs.
|
||||||
//
|
//
|
||||||
//function is_undef(x) = x == undef;
|
rr_green = [0, 146/255, 0]; // RepRap logo colour
|
||||||
|
|
||||||
$_bom = is_undef($bom) ? 0 : $bom; // 0 no bom, 1 assemblies and stls, 2 vitamins as well
|
$_bom = is_undef($bom) ? 0 : $bom; // 0 no bom, 1 assemblies and stls, 2 vitamins as well
|
||||||
$exploded = is_undef($explode) ? 0 : $explode; // 1 for exploded view
|
$exploded = is_undef($explode) ? 0 : $explode; // 1 for exploded view
|
||||||
@@ -34,7 +34,7 @@ layer_height = is_undef($layer_height) ? 0.25 : $layer_height; // lay
|
|||||||
extrusion_width = is_undef($extrusion_width) ? 0.5 : $extrusion_width; // filament width when printing
|
extrusion_width = is_undef($extrusion_width) ? 0.5 : $extrusion_width; // filament width when printing
|
||||||
nozzle = is_undef($nozzle) ? 0.45 : $nozzle; // 3D printer nozzle
|
nozzle = is_undef($nozzle) ? 0.45 : $nozzle; // 3D printer nozzle
|
||||||
cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // minimum tool radius when milling 2D objects
|
cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // minimum tool radius when milling 2D objects
|
||||||
pp1_colour = is_undef($pp1_colour) ? [0, 146/255, 0] : $pp1_colour; // printed part colour 1, RepRap logo colour
|
pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour; // printed part colour 1, RepRap logo colour
|
||||||
pp2_colour = is_undef($pp2_colour) ? "Crimson" : $pp2_colour; // printed part colour 2
|
pp2_colour = is_undef($pp2_colour) ? "Crimson" : $pp2_colour; // printed part colour 2
|
||||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour; // printed part colour 3
|
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour; // printed part colour 3
|
||||||
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
||||||
|
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 860 KiB After Width: | Height: | Size: 862 KiB |
@@ -351,7 +351,7 @@ modules_y = iecs_y + 60;
|
|||||||
ssrs_y = modules_y + 80;
|
ssrs_y = modules_y + 80;
|
||||||
blowers_y = ssrs_y + 60;
|
blowers_y = ssrs_y + 60;
|
||||||
batteries_y = blowers_y + 100;
|
batteries_y = blowers_y + 100;
|
||||||
steppers_y = batteries_y + 70;
|
steppers_y = batteries_y + 55;
|
||||||
panel_meters_y = steppers_y + 70;
|
panel_meters_y = steppers_y + 70;
|
||||||
extrusions_y = panel_meters_y + 80;
|
extrusions_y = panel_meters_y + 80;
|
||||||
|
|
||||||
|
22
readme.md
22
readme.md
@@ -1687,6 +1687,13 @@ 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 |
|
||||||
|
|
||||||
|
|
||||||
<a href="#top">Top</a>
|
<a href="#top">Top</a>
|
||||||
|
|
||||||
@@ -2785,11 +2792,17 @@ Rocker switch. Also used for neon indicator in the same form factor.
|
|||||||
| `rocker_spades(type)` | Spade types and positions |
|
| `rocker_spades(type)` | Spade types and positions |
|
||||||
| `rocker_width(type)` | Body width |
|
| `rocker_width(type)` | Body width |
|
||||||
|
|
||||||
|
### Functions
|
||||||
|
| Function | Description |
|
||||||
|
|:--- |:--- |
|
||||||
|
| `rocker_size(type)` | Width, height, and depth in a vector |
|
||||||
|
| `rocker_slot(type)` | Rocker slot in a vector |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `rocker(type, colour)` | Draw the specified rocker switch |
|
| `rocker(type, colour)` | Draw the specified rocker switch |
|
||||||
| `rocker_hole(type, h = 0)` | Make a hole to accept a rocker switch, by default 2D, set h for 3D |
|
| `rocker_hole(type, h = 0, rounded = true)` | Make a hole to accept a rocker switch, by default 2D, set h for 3D |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -3455,15 +3468,16 @@ NEMA stepper motor model.
|
|||||||
| Qty | Module call | BOM entry |
|
| Qty | Module call | BOM entry |
|
||||||
| ---:|:--- |:---|
|
| ---:|:--- |:---|
|
||||||
| 4 | `ring_terminal(M3_ringterm)` | Ring terminal 3mm |
|
| 4 | `ring_terminal(M3_ringterm)` | Ring terminal 3mm |
|
||||||
| 15 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm |
|
| 20 | `screw(M3_pan_screw, 8)` | Screw M3 pan x 8mm |
|
||||||
| 1 | `NEMA(NEMA14)` | Stepper motor NEMA14 x 36mm |
|
| 1 | `NEMA(NEMA14)` | Stepper motor NEMA14 x 36mm |
|
||||||
| 1 | `NEMA(NEMA16)` | Stepper motor NEMA16 x 19.2mm |
|
| 1 | `NEMA(NEMA16)` | Stepper motor NEMA16 x 19.2mm |
|
||||||
|
| 1 | `NEMA(NEMA17P)` | Stepper motor NEMA17 x 26.5mm |
|
||||||
| 1 | `NEMA(NEMA17S)` | Stepper motor NEMA17 x 34mm |
|
| 1 | `NEMA(NEMA17S)` | Stepper motor NEMA17 x 34mm |
|
||||||
| 1 | `NEMA(NEMA17M)` | Stepper motor NEMA17 x 40mm |
|
| 1 | `NEMA(NEMA17M)` | Stepper motor NEMA17 x 40mm |
|
||||||
| 1 | `NEMA(NEMA17)` | Stepper motor NEMA17 x 47mm |
|
| 1 | `NEMA(NEMA17)` | Stepper motor NEMA17 x 47mm |
|
||||||
| 1 | `NEMA(NEMA23)` | Stepper motor NEMA22 x 51.2mm |
|
| 1 | `NEMA(NEMA23)` | Stepper motor NEMA22 x 51.2mm |
|
||||||
| 11 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
| 16 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||||
| 15 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
|
| 20 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
|
||||||
|
|
||||||
|
|
||||||
<a href="#top">Top</a>
|
<a href="#top">Top</a>
|
||||||
|
@@ -25,7 +25,7 @@ from __future__ import print_function
|
|||||||
import subprocess, sys
|
import subprocess, sys
|
||||||
|
|
||||||
def run_list(args, silent = False, verbose = False):
|
def run_list(args, silent = False, verbose = False):
|
||||||
cmd = ["openscad.exe"] + args
|
cmd = ["openscad"] + args
|
||||||
if not silent:
|
if not silent:
|
||||||
for arg in cmd:
|
for arg in cmd:
|
||||||
print(arg, end=" ")
|
print(arg, end=" ")
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Binary file not shown.
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 107 KiB |
@@ -107,7 +107,7 @@ assembly("box1") {
|
|||||||
screw_and_washer(foot_screw(foot), 6);
|
screw_and_washer(foot_screw(foot), 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate_z(height + top_thickness + base_thickness + eps) vflip()
|
translate_z(height + top_thickness + base_thickness + 2 * eps) vflip()
|
||||||
%render() box1_base_stl();
|
%render() box1_base_stl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,9 +22,9 @@ include <../vitamins/stepper_motors.scad>
|
|||||||
use <../utils/layout.scad>
|
use <../utils/layout.scad>
|
||||||
|
|
||||||
module stepper_motors()
|
module stepper_motors()
|
||||||
layout([for(s = stepper_motors) NEMA_width(s)], 5) let(m = stepper_motors[$i]) {
|
layout([for(s = stepper_motors) NEMA_width(s)], 5, no_offset = true) let(m = stepper_motors[$i]) {
|
||||||
rotate(180)
|
rotate(180)
|
||||||
NEMA(m, 0, m == NEMA17M || m == NEMA17M8);
|
NEMA(m, 0, m == NEMA17P || m == NEMA17M || m == NEMA17M8);
|
||||||
|
|
||||||
translate_z(4)
|
translate_z(4)
|
||||||
NEMA_screws(m, M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
|
NEMA_screws(m, M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
|
||||||
|
@@ -33,7 +33,7 @@ module magnet(type) { //! Draw specified magnet
|
|||||||
h = magnet_h(type);
|
h = magnet_h(type);
|
||||||
r = magnet_r(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 ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
|
||||||
|
|
||||||
or = od / 2;
|
or = od / 2;
|
||||||
ir = id / 2;
|
ir = id / 2;
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// od, id, h, r
|
// od, id, h, r
|
||||||
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
|
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
|
||||||
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
|
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
|
||||||
MAG5x8 = ["MAG484", 8, 0, 5, 0.5];
|
MAG5x8 = ["MAG5x8", 8, 0, 5, 0.5];
|
||||||
|
|
||||||
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
|
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ function rail_holes(type, length) = //! Number of holes in a rail given its `len
|
|||||||
module rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true) { //! Position children over screw holes
|
module rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true) { //! Position children over screw holes
|
||||||
pitch = rail_pitch(type);
|
pitch = rail_pitch(type);
|
||||||
holes = rail_holes(type, length);
|
holes = rail_holes(type, length);
|
||||||
last = first + screws;
|
last = first + min(screws, both_ends ? ceil(holes / 2) : holes);
|
||||||
for(i = [first : holes - 1], j = holes - 1 - i)
|
for(i = [first : holes - 1], j = holes - 1 - i)
|
||||||
if(i < last || both_ends && (j >= first && j < last))
|
if(i < last || both_ends && (j >= first && j < last))
|
||||||
translate([i * pitch - length / 2 + (length - (holes - 1) * pitch) / 2, 0])
|
translate([i * pitch - length / 2 + (length - (holes - 1) * pitch) / 2, 0])
|
||||||
@@ -194,6 +194,6 @@ module rail_screws(type, length, thickness, screws = 100) { //! Place screws in
|
|||||||
screw(end_screw, end_screw_len);
|
screw(end_screw, end_screw_len);
|
||||||
|
|
||||||
translate_z(rail_screw_height(type, screw))
|
translate_z(rail_screw_height(type, screw))
|
||||||
rail_hole_positions(type, length, index_screws, min(screws, rail_holes(type, length)) - 2 * index_screws)
|
rail_hole_positions(type, length, index_screws)
|
||||||
screw(screw, screw_len);
|
screw(screw, screw_len);
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,8 @@ function rocker_bezel(type) = type[10]; //! Bezel width
|
|||||||
function rocker_pivot(type) = type[11]; //! Pivot distance from the back of the flange
|
function rocker_pivot(type) = type[11]; //! Pivot distance from the back of the flange
|
||||||
function rocker_button(type) = type[12]; //! How far the button extends from the bezel
|
function rocker_button(type) = type[12]; //! How far the button extends from the bezel
|
||||||
function rocker_spades(type) = type[13]; //! Spade types and positions
|
function rocker_spades(type) = type[13]; //! Spade types and positions
|
||||||
|
function rocker_size(type) = [rocker_width(type), rocker_height(type), rocker_depth(type)]; //! Width, height, and depth in a vector
|
||||||
|
function rocker_slot(type) = [rocker_slot_w(type), rocker_slot_h(type)]; //! Rocker slot in a vector
|
||||||
|
|
||||||
module rocker(type, colour) { //! Draw the specified rocker switch
|
module rocker(type, colour) { //! Draw the specified rocker switch
|
||||||
vitamin(str("rocker(", type[0], "): ", rocker_part(type)));
|
vitamin(str("rocker(", type[0], "): ", rocker_part(type)));
|
||||||
@@ -87,6 +89,6 @@ module rocker(type, colour) { //! Draw the specified rocker switch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module rocker_hole(type, h = 0) //! Make a hole to accept a rocker switch, by default 2D, set h for 3D
|
module rocker_hole(type, h = 0, rounded = true) //! Make a hole to accept a rocker switch, by default 2D, set h for 3D
|
||||||
extrude_if(h)
|
extrude_if(h)
|
||||||
rounded_square([rocker_slot_w(type), rocker_slot_h(type)], 1, center = true);
|
rounded_square([rocker_slot_w(type), rocker_slot_h(type)], rounded ? 1 : 0, center = true);
|
||||||
|
@@ -295,8 +295,10 @@ module screw_polysink(type, h = 100, alt = false) { //! A countersink hole made
|
|||||||
poly_cylinder(r = r, h = lh, center = false);
|
poly_cylinder(r = r, h = lh, center = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate_z(layers * layer_height)
|
remainder = h / 2 - layers * layer_height;
|
||||||
poly_cylinder(r = rmin, h = h / 2 - layers * layer_height, center = false);
|
if(remainder > 0)
|
||||||
|
translate_z(layers * layer_height)
|
||||||
|
poly_cylinder(r = rmin, h = remainder, center = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,10 +27,11 @@ NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24,
|
|||||||
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11]];
|
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31, [12.5, 11]];
|
||||||
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11]];
|
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31, [12.5, 11]];
|
||||||
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8]];
|
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31, [8, 8]];
|
||||||
|
NEMA17P = ["NEMA17P", 42.3, 26.5, 53.6/2, 25, 11, 2, 5, 26.5, 31, [10, 8]];
|
||||||
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8]];
|
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31, [8, 8]];
|
||||||
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8]];
|
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26, [8, 8]];
|
||||||
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8]];
|
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1, [8, 8]];
|
||||||
|
|
||||||
stepper_motors = [NEMA14, NEMA16, NEMA17S, NEMA17M, NEMA17, NEMA23];
|
stepper_motors = [NEMA14, NEMA16, NEMA17P, NEMA17S, NEMA17M, NEMA17, NEMA23];
|
||||||
|
|
||||||
use <stepper_motor.scad>
|
use <stepper_motor.scad>
|
||||||
|
Reference in New Issue
Block a user