Merged master

This commit is contained in:
Chris Palmer 2020-02-22 18:32:35 +00:00
commit 1614f50b73
15 changed files with 351 additions and 52 deletions

View File

@ -62,6 +62,7 @@ include <vitamins/spools.scad>
include <vitamins/mains_sockets.scad> include <vitamins/mains_sockets.scad>
include <vitamins/ldrs.scad> include <vitamins/ldrs.scad>
include <vitamins/geared_steppers.scad> include <vitamins/geared_steppers.scad>
include <vitamins/extrusions.scad>
use <vitamins/jack.scad> use <vitamins/jack.scad>
use <vitamins/meter.scad> use <vitamins/meter.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 KiB

After

Width:  |  Height:  |  Size: 760 KiB

View File

@ -32,6 +32,7 @@ use <tests/cable_strips.scad>
use <tests/components.scad> use <tests/components.scad>
use <tests/d_connectors.scad> use <tests/d_connectors.scad>
use <tests/displays.scad> use <tests/displays.scad>
use <tests/extrusions.scad>
use <tests/fans.scad> use <tests/fans.scad>
use <tests/fuseholder.scad> use <tests/fuseholder.scad>
use <tests/geared_steppers.scad> use <tests/geared_steppers.scad>
@ -135,7 +136,7 @@ translate([x5, cable_grommets_y + 250])
translate([900, 600]) translate([900, 600])
box_test(); box_test();
translate([850, 1170]) translate([850, 1220])
bbox_test(); bbox_test();
x0 = 0; x0 = 0;
@ -152,7 +153,7 @@ leadnuts_y = pillars_y + 40;
pulleys_y = leadnuts_y +40; pulleys_y = leadnuts_y +40;
hot_ends_y = pulleys_y + 60; hot_ends_y = pulleys_y + 60;
linear_bearings_y = hot_ends_y + 50; linear_bearings_y = hot_ends_y + 50;
sheets_y = linear_bearings_y + 50; sheets_y = linear_bearings_y + 100;
pcbs_y = sheets_y + 40; pcbs_y = sheets_y + 40;
displays_y = pcbs_y + 150; displays_y = pcbs_y + 150;
fans_y = displays_y + 100; fans_y = displays_y + 100;
@ -203,6 +204,10 @@ translate([x0, linear_bearings_y]) {
rods(); rods();
} }
translate([x0+150, linear_bearings_y+30]) {
extrusions();
}
translate([x0 + 10, hot_ends_y]) translate([x0 + 10, hot_ends_y])
hot_ends(); hot_ends();

101
readme.md
View File

@ -28,24 +28,25 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr> <tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr> <tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr> <tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr> <tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr> <tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Pcb_mount">Pcb_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr> <tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Pcb_mount">Pcb_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr> <tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr> <tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr> <tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr> <tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr> <tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr> <tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Ldrs">Ldrs</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Ldrs">Ldrs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td></td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Modules">Modules</a> </td><td></td><td></td><td></td><td></td></tr> <tr><td> <a href = "#Modules">Modules</a> </td><td></td><td></td><td></td><td></td></tr>
</table> </table>
@ -585,6 +586,54 @@ LCD dispays.
| 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" | | 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" |
<a href="#top">Top</a>
---
<a name="Extrusions"></a>
## Extrusions
Aluminium extrusion.
[vitamins/extrusions.scad](vitamins/extrusions.scad) Object definitions.
[vitamins/extrusion.scad](vitamins/extrusion.scad) Implementation.
[tests/extrusions.scad](tests/extrusions.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```extrusion_center_hole(type)``` | Diameter of center hole |
| ```extrusion_center_square(type)``` | Size of center square |
| ```extrusion_channel_width(type)``` | Channel width |
| ```extrusion_channel_width_internal(type)``` | Internal channel width |
| ```extrusion_corner_hole(type)``` | Diameter of corner hole |
| ```extrusion_fillet(type)``` | Radius of corner fillet |
| ```extrusion_height(type)``` | Height of extrusion |
| ```extrusion_spar_thickness(type)``` | Spar thickness |
| ```extrusion_tab_thickness(type)``` | Tab thickness |
| ```extrusion_width(type)``` | Width of extrusion |
### Modules
| Module | Description |
|:--- |:--- |
| ```extrusion(type, length, cornerHole = false)``` | Draw the specified extrusion |
![extrusions](tests/png/extrusions.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```extrusion(E2020, 80)``` | Extrusion E2020 x 80mm |
| 1 | ```extrusion(E2040, 80)``` | Extrusion E2040 x 80mm |
| 1 | ```extrusion(E2060, 80)``` | Extrusion E2060 x 80mm |
| 1 | ```extrusion(E2080, 80)``` | Extrusion E2080 x 80mm |
| 1 | ```extrusion(E3030, 80)``` | Extrusion E3030 x 80mm |
| 1 | ```extrusion(E3060, 80)``` | Extrusion E3060 x 80mm |
| 1 | ```extrusion(E4040, 80)``` | Extrusion E4040 x 80mm |
| 1 | ```extrusion(E4080, 80)``` | Extrusion E4080 x 80mm |
<a href="#top">Top</a> <a href="#top">Top</a>
--- ---
@ -1244,6 +1293,9 @@ LMnUU linear bearings.
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| ```bearing_dia(type)``` | Outside diameter | | ```bearing_dia(type)``` | Outside diameter |
| ```bearing_groove_dia(type)``` | Groove diameter |
| ```bearing_groove_length(type)``` | Groove length |
| ```bearing_groove_spacing(type)``` | Spacing between grooves, outer to outer, ie includes the grooves themselves |
| ```bearing_length(type)``` | Total length | | ```bearing_length(type)``` | Total length |
| ```bearing_rod_dia(type)``` | Internal diameter | | ```bearing_rod_dia(type)``` | Internal diameter |
@ -1262,12 +1314,21 @@ LMnUU linear bearings.
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```linear_bearing(LM10LUU)``` | Linear bearing LM10LUU |
| 1 | ```linear_bearing(LM10UU)``` | Linear bearing LM10UU | | 1 | ```linear_bearing(LM10UU)``` | Linear bearing LM10UU |
| 1 | ```linear_bearing(LM12LUU)``` | Linear bearing LM12LUU |
| 1 | ```linear_bearing(LM12UU)``` | Linear bearing LM12UU | | 1 | ```linear_bearing(LM12UU)``` | Linear bearing LM12UU |
| 1 | ```linear_bearing(LM16LUU)``` | Linear bearing LM16LUU |
| 1 | ```linear_bearing(LM16UU)``` | Linear bearing LM16UU |
| 1 | ```linear_bearing(LM3LUU)``` | Linear bearing LM3LUU |
| 1 | ```linear_bearing(LM3UU)``` | Linear bearing LM3UU | | 1 | ```linear_bearing(LM3UU)``` | Linear bearing LM3UU |
| 1 | ```linear_bearing(LM4LUU)``` | Linear bearing LM4LUU |
| 1 | ```linear_bearing(LM4UU)``` | Linear bearing LM4UU | | 1 | ```linear_bearing(LM4UU)``` | Linear bearing LM4UU |
| 1 | ```linear_bearing(LM5LUU)``` | Linear bearing LM5LUU |
| 1 | ```linear_bearing(LM5UU)``` | Linear bearing LM5UU | | 1 | ```linear_bearing(LM5UU)``` | Linear bearing LM5UU |
| 1 | ```linear_bearing(LM6LUU)``` | Linear bearing LM6LUU |
| 1 | ```linear_bearing(LM6UU)``` | Linear bearing LM6UU | | 1 | ```linear_bearing(LM6UU)``` | Linear bearing LM6UU |
| 1 | ```linear_bearing(LM8LUU)``` | Linear bearing LM8LUU |
| 1 | ```linear_bearing(LM8UU)``` | Linear bearing LM8UU | | 1 | ```linear_bearing(LM8UU)``` | Linear bearing LM8UU |
@ -2164,7 +2225,7 @@ Ring terminals and earth assemblies for DiBond panels.
--- ---
<a name="Rockers"></a> <a name="Rockers"></a>
## Rockers ## Rockers
Rocket switch. Also used for neon indicator in the same form factor. Rocker switch. Also used for neon indicator in the same form factor.
[vitamins/rockers.scad](vitamins/rockers.scad) Object definitions. [vitamins/rockers.scad](vitamins/rockers.scad) Object definitions.
@ -2230,6 +2291,7 @@ Steel rods and studding with chamfered ends.
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```rod(10, 80)``` | Smooth rod 10mm x 80mm | | 1 | ```rod(10, 80)``` | Smooth rod 10mm x 80mm |
| 1 | ```rod(12, 80)``` | Smooth rod 12mm x 80mm | | 1 | ```rod(12, 80)``` | Smooth rod 12mm x 80mm |
| 1 | ```rod(16, 80)``` | Smooth rod 16mm x 80mm |
| 1 | ```rod(3, 80)``` | Smooth rod 3mm x 80mm | | 1 | ```rod(3, 80)``` | Smooth rod 3mm x 80mm |
| 1 | ```rod(4, 80)``` | Smooth rod 4mm x 80mm | | 1 | ```rod(4, 80)``` | Smooth rod 4mm x 80mm |
| 1 | ```rod(5, 80)``` | Smooth rod 5mm x 80mm | | 1 | ```rod(5, 80)``` | Smooth rod 5mm x 80mm |
@ -2237,6 +2299,7 @@ Steel rods and studding with chamfered ends.
| 1 | ```rod(8, 80)``` | Smooth rod 8mm x 80mm | | 1 | ```rod(8, 80)``` | Smooth rod 8mm x 80mm |
| 1 | ```studding(10, 80)``` | Threaded rod M10 x 80mm | | 1 | ```studding(10, 80)``` | Threaded rod M10 x 80mm |
| 1 | ```studding(12, 80)``` | Threaded rod M12 x 80mm | | 1 | ```studding(12, 80)``` | Threaded rod M12 x 80mm |
| 1 | ```studding(16, 80)``` | Threaded rod M16 x 80mm |
| 1 | ```studding(3, 80)``` | Threaded rod M3 x 80mm | | 1 | ```studding(3, 80)``` | Threaded rod M3 x 80mm |
| 1 | ```studding(4, 80)``` | Threaded rod M4 x 80mm | | 1 | ```studding(4, 80)``` | Threaded rod M4 x 80mm |
| 1 | ```studding(5, 80)``` | Threaded rod M5 x 80mm | | 1 | ```studding(5, 80)``` | Threaded rod M5 x 80mm |

30
tests/extrusions.scad Normal file
View File

@ -0,0 +1,30 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../utils/layout.scad>
include <../vitamins/extrusions.scad>
module extrusions()
layout([for(e = extrusions) extrusion_width(e)], 10)
extrusion(extrusions[$i], 80);
if ($preview)
extrusions();

View File

@ -22,8 +22,12 @@ use <../utils/layout.scad>
include <../vitamins/linear_bearings.scad> include <../vitamins/linear_bearings.scad>
module linear_bearings() module linear_bearings()
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) layout([for(b = linear_bearings) 2 * bearing_radius(b)]) {
linear_bearing(linear_bearings[$i]); linear_bearing(linear_bearings[$i]);
translate([0, 30])
linear_bearing(long_linear_bearings[$i]);
}
if($preview) if($preview)
linear_bearings(); linear_bearings();

BIN
tests/png/extrusions.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -28,7 +28,7 @@ module rods()
rod(bearing_rod_dia(linear_bearings[$i]), 80); rod(bearing_rod_dia(linear_bearings[$i]), 80);
translate([0, 20]) translate([0, 30])
studding(bearing_rod_dia(linear_bearings[$i]), 80); studding(bearing_rod_dia(linear_bearings[$i]), 80);
} }

View File

@ -61,34 +61,35 @@ heater_y = heater_width / 2;
fan_x_offset = rad_dia / 2 + 4; fan_x_offset = rad_dia / 2 + 4;
module e3d_resistor(type, resistor_wire_rotate = [0,0,0]) { module e3d_resistor(type, naked = false, resistor_wire_rotate = [0,0,0]) {
translate([11 - heater_x, -3 - heater_y, heater_height / 2 + nozzle_h]) { translate([11 - heater_x, -3 - heater_y, heater_height / 2 + nozzle_h]) {
color("grey") color("grey")
rotate([-90, 0, 0]) rotate([-90, 0, 0])
cylinder(r = resistor_dia / 2, h = resistor_len); cylinder(r = resistor_dia / 2, h = resistor_len);
color("red") if(!naked)
translate([0, resistor_len + 3.5/2 + 1, 0]) { color("red")
rotate(resistor_wire_rotate) { translate([0, resistor_len + 3.5/2 + 1, 0]) {
translate([-3.5/2, 0, 0]) { rotate(resistor_wire_rotate) {
cylinder(d = 3.5, h = 36); translate([-3.5/2, 0, 0]) {
cylinder(d = 3.5, h = 36);
translate([3.5, 0, 0]) translate([3.5, 0, 0])
cylinder(r = 3.5 / 2, h = 36); cylinder(r = 3.5 / 2, h = 36);
} }
} }
} }
} }
} }
module heater_block(type, resistor_wire_rotate = [0,0,0]) { module heater_block(type, naked = false, resistor_wire_rotate = [0,0,0]) {
translate_z(-hot_end_length(type)) { translate_z(-hot_end_length(type)) {
translate_z(nozzle_h) translate_z(nozzle_h)
color("lightgrey") color("lightgrey")
translate([-heater_x, -heater_y, 0]) translate([-heater_x, -heater_y, 0])
cube([heater_length, heater_width, heater_height]); cube([heater_length, heater_width, heater_height]);
e3d_resistor(type, resistor_wire_rotate); e3d_resistor(type, naked, resistor_wire_rotate);
e3d_nozzle(type); e3d_nozzle(type);
} }
} }
@ -150,7 +151,7 @@ module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]
} }
rotate(90) rotate(90)
heater_block(type, resistor_wire_rotate); heater_block(type, naked, resistor_wire_rotate);
if(!naked) if(!naked)
translate_z(inset - insulator_length) translate_z(inset - insulator_length)

128
vitamins/extrusion.scad Normal file
View File

@ -0,0 +1,128 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//! Aluminium extrusion.
//
include <../core.scad>
function extrusion_width(type) = type[1]; //! Width of extrusion
function extrusion_height(type) = type[2]; //! Height of extrusion
function extrusion_center_hole(type) = type[3]; //! Diameter of center hole
function extrusion_corner_hole(type) = type[4]; //! Diameter of corner hole
function extrusion_center_square(type) = type[5]; //! Size of center square
function extrusion_channel_width(type) = type[6]; //! Channel width
function extrusion_channel_width_internal(type) = type[7]; //! Internal channel width
function extrusion_tab_thickness(type) = type[8]; //! Tab thickness
function extrusion_spar_thickness(type) = type[9]; //! Spar thickness
function extrusion_fillet(type) = type[10]; //! Radius of corner fillet
module extrusion_cross_section(type, cornerHole) {
module extrusion_corner(type, cornerHole) {
width = extrusion_width(type);
tabThickness = extrusion_tab_thickness(type);
sparThickness = extrusion_spar_thickness(type);
centerSquare = extrusion_center_square(type);
channelWidth = extrusion_channel_width(type);
fillet = extrusion_fillet(type);
cornerSize = (width-channelWidth)/2;
cornerSquare = (width-extrusion_channel_width_internal(type))/2;
cornerHoleDiameter =extrusion_corner_hole(type);
translate([-width/2,-width/2]) {
difference() {
union() {
translate([fillet,0])
square([cornerSize-fillet,tabThickness]);
translate([0,fillet])
square([tabThickness,cornerSize-fillet]);
translate([fillet,fillet])
circle(fillet);
translate([fillet,fillet])
square([cornerSquare-fillet,cornerSquare-fillet]);
}
if(cornerHole)
translate([cornerSquare/2,cornerSquare/2])
circle(d=cornerHoleDiameter);
}
}
rotate(-135) translate([centerSquare/2,-sparThickness/2]) square([sqrt(2)*(width-centerSquare-cornerSquare)/2,sparThickness]);
}
module extrusion_center_section(type) {
width = extrusion_width(type);
tabThickness = extrusion_tab_thickness(type);
sparThickness = extrusion_spar_thickness(type);
centerSquare = extrusion_center_square(type);
channelWidth = extrusion_channel_width(type);
translate([0,width/2])
for(angle=[225,315])
rotate(angle)
translate([centerSquare/2,-sparThickness/2])
square([sqrt(2)*(width-centerSquare)/2,sparThickness]);
translate([0,-width/2])
for(angle=[45,135])
rotate(angle)
translate([centerSquare/2,-sparThickness/2])
square([sqrt(2)*(width-centerSquare)/2,sparThickness]);
centerHeight = width-channelWidth;
translate([-width/2,-centerHeight/2])
square([tabThickness,centerHeight]);
translate([width/2-tabThickness,-centerHeight/2])
square([tabThickness,centerHeight]);
}
centerSquare = extrusion_center_square(type);
width = extrusion_width(type);
height = extrusion_height(type);
count = (height-width)/width;
for(i=[0:count])
translate([0,i*width+(width-height)/2])
difference() {
square([centerSquare,centerSquare],center=true);
circle(d=extrusion_center_hole(type));
}
translate([0,(width-height)/2])
for(angle=[0,90])
rotate(angle)
extrusion_corner(type, cornerHole);
translate([0,-(width-height)/2])
for(angle=[180,270])
rotate(angle)
extrusion_corner(type, cornerHole);
if(count>=1)
for(i=[1:count])
translate([0,i*width-height/2])
extrusion_center_section(type);
}
module extrusion(type, length, cornerHole = false) { //! Draw the specified extrusion
vitamin(str("extrusion(", type[0], ", ", length, "): Extrusion ", type[0], " x ", length, "mm"));
color(grey90)
linear_extrude(height = length)
extrusion_cross_section(type, cornerHole);
}

35
vitamins/extrusions.scad Normal file
View File

@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// Extrusion
//
// W H d1 d2 s cw cwi t st f
E2020 = [ "E2020", 20, 20, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2040 = [ "E2040", 20, 40, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2060 = [ "E2060", 20, 60, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2080 = [ "E2080", 20, 80, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E3030 = [ "E3030", 30, 30, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E3060 = [ "E3060", 30, 60, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E4040 = [ "E4040", 40, 40, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
E4080 = [ "E4080", 40, 80, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
extrusions = [E2020,E2040,E2060,E2080,E3030,E3060,E4040,E4080];
use <extrusion.scad>

View File

@ -25,20 +25,41 @@ include <../core.scad>
use <../utils/tube.scad> use <../utils/tube.scad>
bearing_colour = grey70; bearing_colour = grey70;
groove_colour = grey60;
seal_colour = grey20; seal_colour = grey20;
function bearing_length(type) = type[1]; //! Total length
function bearing_dia(type) = type[2]; //! Outside diameter function bearing_length(type) = type[1]; //! Total length
function bearing_rod_dia(type) = type[3]; //! Internal diameter function bearing_dia(type) = type[2]; //! Outside diameter
function bearing_rod_dia(type) = type[3]; //! Internal diameter
function bearing_groove_length(type) = type[4]; //! Groove length
function bearing_groove_dia(type) = type[5]; //! Groove diameter
function bearing_groove_spacing(type) = type[6]; //! Spacing between grooves, outer to outer, ie includes the grooves themselves
function bearing_radius(type) = bearing_dia(type) / 2; //! Outside radius function bearing_radius(type) = bearing_dia(type) / 2; //! Outside radius
module linear_bearing(type) { //! Draw specified linear bearing module linear_bearing(type) { //! Draw specified linear bearing
vitamin(str("linear_bearing(", type[0], "): Linear bearing LM", bearing_rod_dia(type),"UU")); vitamin(str("linear_bearing(", type[0], "): Linear bearing ", type[0]));
casing_t = bearing_radius(type) / 10; casing_t = bearing_radius(type) / 10;
casing_ir = bearing_radius(type) - casing_t; casing_ir = bearing_radius(type) - casing_t;
length = bearing_length(type);
or = bearing_radius(type);
gl = bearing_groove_length(type);
gr = bearing_groove_dia(type) / 2;
gs = bearing_groove_spacing(type);
offset = (length-gs)/2;
color(bearing_colour) tube(or = bearing_radius(type), ir = casing_ir, h = bearing_length(type)); if(gs==0) {
color(seal_colour) tube(or = casing_ir, ir = bearing_rod_dia(type) / 2, h = bearing_length(type) - 0.5); color(bearing_colour) tube(or = or, ir = casing_ir, h = length);
} else {
translate_z(-length/2) {
color(bearing_colour) tube(or = or, ir = casing_ir, h = offset, center = false);
color(groove_colour) translate_z(offset) tube(or = gr, ir = casing_ir, h = gl,center = false);
color(bearing_colour) translate_z(offset+gl) tube(or = or, ir = casing_ir, h = gs-2*gl, center = false);
color(groove_colour) translate_z(offset+gs-gl) tube(or = gr, ir = casing_ir, h = gl, center = false);
color(bearing_colour) translate_z(offset+gs) tube(or = or, ir = casing_ir, h = offset, center = false);
}
}
color(seal_colour) tube(or = casing_ir, ir = bearing_rod_dia(type) / 2, h = length - 0.5);
} }

View File

@ -20,14 +20,25 @@
// //
// Linear bearings // Linear bearings
// //
LM12UU = ["LM12UU", 30, 21, 12]; // L od id gl gd gs
LM10UU = ["LM10UU", 29, 19, 10]; LM16UU = ["LM16UU", 37, 28, 16, 1.6, 27.0, 26.5];
LM8UU = ["LM8UU", 24, 15, 8]; LM16LUU = ["LM16LUU", 70, 28, 16, 1.6, 27.0, 53.0];
LM6UU = ["LM6UU", 19, 12, 6]; LM12UU = ["LM12UU", 30, 21, 12, 1.3, 20.0, 23.0];
LM5UU = ["LM5UU", 15, 10, 5]; LM12LUU = ["LM12LUU", 57, 21, 12, 1.3, 20.0, 46.0];
LM4UU = ["LM4UU", 12, 8, 4]; LM10UU = ["LM10UU", 29, 19, 10, 1.3, 18.0, 22.0];
LM3UU = ["LM3UU", 10, 7, 3]; LM10LUU = ["LM10LUU", 55, 19, 10, 1.3, 18.0, 44.0];
LM8UU = ["LM8UU", 24, 15, 8, 1.1, 14.3, 17.5];
LM8LUU = ["LM8LUU", 45, 15, 8, 1.1, 14.3, 35.0];
LM6UU = ["LM6UU", 19, 12, 6, 1.1, 11.5, 13.5];
LM6LUU = ["LM6LUU", 35, 12, 6, 1.1, 11.5, 27.0];
LM5UU = ["LM5UU", 15, 10, 5, 1.1, 9.5, 10.2];
LM5LUU = ["LM5LUU", 28, 10, 5, 1.1, 9.5, 20.4];
LM4UU = ["LM4UU", 12, 8, 4, 0, 0, 0];
LM4LUU = ["LM4LUU", 23, 8, 4, 0, 0, 0];
LM3UU = ["LM3UU", 10, 7, 3, 0, 0, 0];
LM3LUU = ["LM3LUU", 19, 7, 3, 0, 0, 0];
linear_bearings = [LM3UU, LM4UU, LM5UU, LM6UU, LM8UU, LM10UU, LM12UU]; linear_bearings = [LM3UU, LM4UU, LM5UU, LM6UU, LM8UU, LM10UU, LM12UU, LM16UU];
long_linear_bearings = [LM3LUU, LM4LUU, LM5LUU, LM6LUU, LM8LUU, LM10LUU, LM12LUU, LM16LUU];
use <linear_bearing.scad> use <linear_bearing.scad>

View File

@ -18,7 +18,7 @@
// //
// //
//! Rocket switch. Also used for neon indicator in the same form factor. //! Rocker switch. Also used for neon indicator in the same form factor.
// //
include <../core.scad> include <../core.scad>
use <spade.scad> use <spade.scad>