Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1fb429e9a5 | ||
|
9571e68629 | ||
|
b01e6a673c | ||
|
ba5e5fa390 | ||
|
c7dfdd0fb9 | ||
|
814ce4f15d | ||
|
f661cf6934 | ||
|
305d2146f2 | ||
|
e39ee1797d | ||
|
520569cb30 | ||
|
f73a7b46a2 | ||
|
fb9eca85c6 | ||
|
166ed05d4a | ||
|
ce6aec428d | ||
|
4e9d169c31 | ||
|
1810160103 | ||
|
0c9ae8d60c | ||
|
9a0bad4e61 | ||
|
90047815b0 | ||
|
b583202fb7 | ||
|
eac0086199 | ||
|
03beaec470 | ||
|
51c649cc53 | ||
|
5fa33d7c4d | ||
|
78ce51d045 | ||
|
23cbadf6df | ||
|
c9c2ffafba | ||
|
2e0e833d40 | ||
|
6c51f8726c | ||
|
0b035dbd15 | ||
|
34b58e3b64 | ||
|
df43fe7dc6 | ||
|
b5fe03fcb2 | ||
|
1658f6f0b4 | ||
|
7b126f9792 | ||
|
479207fd4f | ||
|
3ee55981f9 | ||
|
8c2b4a20fe | ||
|
1529759406 | ||
|
c4a986aa21 | ||
|
ebee729d08 | ||
|
90e7f1a315 |
@@ -18,7 +18,7 @@
|
||||
//
|
||||
|
||||
//
|
||||
// Include this file to use the miniumum library plus screws, nuts and washers
|
||||
// Include this file to use the minimum library plus screws, nuts and washers
|
||||
//
|
||||
include <utils/core/core.scad>
|
||||
//
|
||||
|
@@ -33,7 +33,7 @@ $exploded = is_undef($explode) ? 0 : $explode; // 1 f
|
||||
layer_height = is_undef($layer_height) ? 0.25 : $layer_height; // layer heigth 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
|
||||
cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // miniumum 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
|
||||
pp2_colour = is_undef($pp2_colour) ? "red" : $pp2_colour; // printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "blue" : $pp3_colour; // printed part colour 3
|
||||
|
1
lib.scad
@@ -54,6 +54,7 @@ include <vitamins/ring_terminals.scad>
|
||||
include <vitamins/rails.scad>
|
||||
include <vitamins/rod.scad>
|
||||
include <vitamins/scs_bearing_blocks.scad>
|
||||
include <vitamins/shaft_couplings.scad>
|
||||
include <vitamins/sheets.scad>
|
||||
include <vitamins/sk_brackets.scad>
|
||||
include <vitamins/spools.scad>
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 819 KiB After Width: | Height: | Size: 820 KiB |
21
libtest.scad
@@ -17,6 +17,23 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//!# NopSCADlib
|
||||
//! An ever expanding library of parts modelled in OpenSCAD useful for 3D printers and enclosures for electronics, etc.
|
||||
//!
|
||||
//! It contains lots of vitamins (the RepRap term for non-printed parts), some general purpose printed parts and some utilities.
|
||||
//! There are also Python scripts to generate Bills of Materials (BOMs),
|
||||
//! STL files for all the printed parts, DXF files for CNC routed parts in a project and a manual containing assembly
|
||||
//! instructions and exploded views by scraping markdown embedded in OpenSCAD comments, [see scripts](scripts/readme.md).
|
||||
//!
|
||||
//! A simple example project can be found [here](examples/MainsBreakOutBox/readme.md).
|
||||
//!
|
||||
//! For more examples of what it can make see the [gallery](gallery/readme.md).
|
||||
//!
|
||||
//! The license is GNU General Public License v3.0, see [COPYING](COPYING).
|
||||
//!
|
||||
//! See [usage](docs/usage.md) for requirements, installation instructions and a usage guide.
|
||||
//!
|
||||
//! <img src="libtest.png" width="100%"/>
|
||||
//
|
||||
// This file shows all the parts in the library.
|
||||
//
|
||||
@@ -68,6 +85,7 @@ use <tests/rod.scad>
|
||||
use <tests/screws.scad>
|
||||
use <tests/SCS_bearing_blocks.scad>
|
||||
use <tests/sealing_strip.scad>
|
||||
use <tests/shaft_couplings.scad>
|
||||
use <tests/sheets.scad>
|
||||
use <tests/SK_brackets.scad>
|
||||
use <tests/spades.scad>
|
||||
@@ -412,6 +430,9 @@ translate([x4, sk_brackets_y])
|
||||
translate([x4, extrusion_brackets_y])
|
||||
extrusion_brackets();
|
||||
|
||||
translate([x4 + 120, extrusion_brackets_y])
|
||||
shaft_couplings();
|
||||
|
||||
translate([x4, scs_bearing_blocks_y])
|
||||
scs_bearing_blocks();
|
||||
|
||||
|
126
readme.md
@@ -1,10 +1,12 @@
|
||||
# NopSCADlib
|
||||
An ever expanding library of parts modelled in OpenSCAD useful for 3D printers and enclosures for electronics, etc.
|
||||
|
||||
It contains lots of vitamins (the RepRap term for non-printed parts), some general purpose printed parts and
|
||||
some utilities. There are also Python scripts to generate Bills of Materials (BOMs),
|
||||
STL files for all the printed parts, DXF files for CNC routed parts in a project and a manual containing assembly
|
||||
instructions and exploded views by scraping markdown embedded in OpenSCAD comments, [see scripts](scripts/readme.md). A simple example project can be found [here](examples/MainsBreakOutBox/readme.md).
|
||||
It contains lots of vitamins (the RepRap term for non-printed parts), some general purpose printed parts and some utilities.
|
||||
There are also Python scripts to generate Bills of Materials (BOMs),
|
||||
STL files for all the printed parts, DXF files for CNC routed parts in a project and a manual containing assembly
|
||||
instructions and exploded views by scraping markdown embedded in OpenSCAD comments, [see scripts](scripts/readme.md).
|
||||
|
||||
A simple example project can be found [here](examples/MainsBreakOutBox/readme.md).
|
||||
|
||||
For more examples of what it can make see the [gallery](gallery/readme.md).
|
||||
|
||||
@@ -28,20 +30,21 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#SSRs">SSRs</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Horiholes">Horiholes</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Cameras">Cameras</a> </td><td> <a href = "#Magnets">Magnets</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Layout">Layout</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Circlips">Circlips</a> </td><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Maths">Maths</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#DIP">DIP</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Handle">Handle</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 = "#Modules">Modules</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Socket_box">Socket_box</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 = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Inserts">Inserts</a> </td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Shaft_couplings">Shaft_couplings</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#DIP">DIP</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Handle">Handle</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 = "#Modules">Modules</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Socket_box">Socket_box</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 = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Inserts">Inserts</a> </td><td></td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td></td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
@@ -403,7 +406,7 @@ PCB mounted buttons. Can optionally have a coloured cap
|
||||
## Cable_strips
|
||||
A strip of polypropylene used with ribbon cable to make a cable flexible in one direction only.
|
||||
|
||||
Modelled with a Bezier spline, which is not quite the same as a miniumum energy curve but very close, epecially
|
||||
Modelled with a Bezier spline, which is not quite the same as a minimum energy curve but very close, epecially
|
||||
near the extreme positions, where the model needs to be accurate.
|
||||
|
||||
When the sides are constrained then a circular model is more accurate.
|
||||
@@ -1102,7 +1105,7 @@ Needs updating as mostly obsolete versions.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0])``` | Draw specified hot end |
|
||||
| ```hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0], bowden = false)``` | Draw specified hot end |
|
||||
|
||||

|
||||
|
||||
@@ -2332,14 +2335,14 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | ```pcb(EnviroPlus)``` | Enviro+ |
|
||||
| 1 | ```pcb(ExtruderPCB)``` | Extruder connection PCB |
|
||||
| 1 | ```pcb(Keyes5p1)``` | Keyes5.1 Arduino Uno expansion board |
|
||||
| 1 | ```pcb(MP1584EN)``` | MP1584EN 3A buck converter |
|
||||
| 1 | ```pcb(MT3608)``` | MT3608 boost converter module |
|
||||
| 1 | ```pcb(Melzi)``` | Melzi electronics |
|
||||
| 5 | | Micro SD card |
|
||||
| 4 | | Micro SD card |
|
||||
| 1 | ```molex_254(2)``` | Molex KK header 2 way |
|
||||
| 1 | ```molex_254(3)``` | Molex KK header 3 way |
|
||||
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
|
||||
| 34 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
|
||||
| 16 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 12 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
|
||||
| 1 | ```pcb(PSU12V1A)``` | PSU 12V 1A |
|
||||
@@ -2355,24 +2358,21 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | ```pcb(RPI0)``` | Raspberry Pi Zero |
|
||||
| 12 | ```screw(M2_cap_screw, 16)``` | Screw M2 cap x 16mm |
|
||||
| 4 | ```screw(M2_cap_screw, 20)``` | Screw M2 cap x 20mm |
|
||||
| 2 | ```screw(M2p5_cap_screw, 16)``` | Screw M2.5 cap x 16mm |
|
||||
| 4 | ```screw(M2p5_cap_screw, 20)``` | Screw M2.5 cap x 20mm |
|
||||
| 4 | ```screw(M2p5_cap_screw, 25)``` | Screw M2.5 cap x 25mm |
|
||||
| 2 | ```screw(M2p5_cap_screw, 20)``` | Screw M2.5 cap x 20mm |
|
||||
| 8 | ```screw(M2p5_cap_screw, 25)``` | Screw M2.5 cap x 25mm |
|
||||
| 8 | ```screw(M2p5_cap_screw, 30)``` | Screw M2.5 cap x 30mm |
|
||||
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
|
||||
| 12 | ```screw(M2p5_pan_screw, 25)``` | Screw M2.5 pan x 25mm |
|
||||
| 4 | ```screw(M3_cap_screw, 16)``` | Screw M3 cap x 16mm |
|
||||
| 8 | ```screw(M3_cap_screw, 30)``` | Screw M3 cap x 30mm |
|
||||
| 4 | ```screw(M3_cap_screw, 35)``` | Screw M3 cap x 35mm |
|
||||
| 12 | ```screw(M4_cap_screw, 35)``` | Screw M4 cap x 35mm |
|
||||
| 1 | ```pcb(TP4056)``` | TP4056 Li-lon Battery charger module |
|
||||
| 3 | ```terminal_35(2)``` | Terminal block 2 way 3.5mm |
|
||||
| 2 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
|
||||
| 1 | | USB A to Mini B lead |
|
||||
| 1 | ```pcb(WD2002SJ)``` | WD2002SJ Buck Boost DC-DC converter |
|
||||
| 16 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
|
||||
| 34 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
|
||||
| 16 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
|
||||
| 1 | ```pcb(ZC_A0591)``` | ZC-A0591 ULN2003 driver PCB |
|
||||
|
||||
@@ -2383,22 +2383,21 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 4 | pcb_spacer2070.stl |
|
||||
| 4 | pcb_spacer2080.stl |
|
||||
| 4 | pcb_spacer2090.stl |
|
||||
| 4 | pcb_spacer25100.stl |
|
||||
| 4 | pcb_spacer25110.stl |
|
||||
| 4 | pcb_spacer25120.stl |
|
||||
| 4 | pcb_spacer25130_2.stl |
|
||||
| 4 | pcb_spacer25130.stl |
|
||||
| 4 | pcb_spacer25140_2.stl |
|
||||
| 4 | pcb_spacer25150_2.stl |
|
||||
| 4 | pcb_spacer25180.stl |
|
||||
| 4 | pcb_spacer25160_2.stl |
|
||||
| 4 | pcb_spacer25190.stl |
|
||||
| 2 | pcb_spacer2570.stl |
|
||||
| 4 | pcb_spacer30160.stl |
|
||||
| 4 | pcb_spacer25200.stl |
|
||||
| 2 | pcb_spacer2580.stl |
|
||||
| 4 | pcb_spacer30170.stl |
|
||||
| 4 | pcb_spacer30230.stl |
|
||||
| 4 | pcb_spacer30180.stl |
|
||||
| 4 | pcb_spacer3050.stl |
|
||||
| 4 | pcb_spacer40200.stl |
|
||||
| 4 | pcb_spacer40210.stl |
|
||||
| 4 | pcb_spacer40220.stl |
|
||||
| 4 | pcb_spacer40230.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -2467,12 +2466,17 @@ Pin headers and sockets, etc.
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```hdr_base_colour(type)``` | Header insulator colour |
|
||||
| ```hdr_box_size(type)``` | Box header outside dimensions |
|
||||
| ```hdr_box_wall(type)``` | Box header wall thickness |
|
||||
| ```hdr_pin_below(type)``` | Header pin length underneath |
|
||||
| ```hdr_pin_colour(type)``` | Header pin colour |
|
||||
| ```hdr_pin_length(type)``` | Header pin length |
|
||||
| ```hdr_pin_width(type)``` | Header pin size |
|
||||
| ```hdr_pitch(type)``` | Header pitch |
|
||||
| ```hdr_ra_box_offset(type)``` | Offset between back of the box and the pins |
|
||||
| ```hdr_ra_height(type)``` | Height of right angle connector |
|
||||
| ```hdr_socket_depth(type)``` | Socket depth for female housing |
|
||||
| ```hdr_y_offset(type)``` | Y offset of pins from center of the box |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
@@ -2639,6 +2643,7 @@ Timing belt pulleys, both toothed and plain with internal bearings for idlers.
|
||||
| 1 | ```pulley(GT2x20_toothed_idler)``` | Pulley GT2 idler 20 teeth |
|
||||
| 1 | ```pulley(GT2x20_plain_idler)``` | Pulley GT2 idler smooth 12mm |
|
||||
| 1 | ```pulley(GT2x16_plain_idler)``` | Pulley GT2 idler smooth 9.63mm |
|
||||
| 1 | ```pulley(GT2x16x7_plain_idler)``` | Pulley GT2 idler smooth 9.63mm |
|
||||
| 1 | ```pulley(GT2x20ob_pulley)``` | Pulley GT2OB 20 teeth |
|
||||
| 1 | ```pulley(GT2x12_pulley)``` | Pulley GT2RD 12 teeth |
|
||||
| 1 | ```pulley(GT2x20um_pulley)``` | Pulley GT2UM 20 teeth |
|
||||
@@ -3050,6 +3055,41 @@ Sealing strip from B&Q used to seal around the door of 3D printers.
|
||||
| 1 | ```sealing_strip(100)``` | Sealing strip 10mm x 4mm x 100mm |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Shaft_couplings"></a>
|
||||
## Shaft_couplings
|
||||
Shaft couplings
|
||||
|
||||
|
||||
[vitamins/shaft_couplings.scad](vitamins/shaft_couplings.scad) Object definitions.
|
||||
|
||||
[vitamins/shaft_coupling.scad](vitamins/shaft_coupling.scad) Implementation.
|
||||
|
||||
[tests/shaft_couplings.scad](tests/shaft_couplings.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```sc_diameter(type)``` | Coupling outer diameter |
|
||||
| ```sc_diameter1(type)``` | Diameter of smaller shaft |
|
||||
| ```sc_diameter2(type)``` | Diameter of larger shaft |
|
||||
| ```sc_length(type)``` | Coupling length |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```shaft_coupling(type, colour = "silver")``` | Draw the shaft coupling |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```shaft_coupling(SC_5x8_rigid)``` | Shaft coupling SC_5x8_rigid |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -3410,6 +3450,7 @@ NEMA stepper motor model.
|
||||
| ```NEMA_body_radius(type)``` | Body radius |
|
||||
| ```NEMA_boss_height(type)``` | Boss height |
|
||||
| ```NEMA_boss_radius(type)``` | Boss around the spindle radius |
|
||||
| ```NEMA_cap_heights(type)``` | Height of the end cap at the corner and the side |
|
||||
| ```NEMA_hole_pitch(type)``` | Screw hole pitch |
|
||||
| ```NEMA_length(type)``` | Body length |
|
||||
| ```NEMA_radius(type)``` | End cap radius |
|
||||
@@ -3426,7 +3467,7 @@ NEMA stepper motor model.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```NEMA(type, shaft_angle = 0)``` | Draw specified NEMA stepper motor |
|
||||
| ```NEMA(type, shaft_angle = 0, jst_connector = false)``` | Draw specified NEMA stepper motor |
|
||||
| ```NEMA_outline(type)``` | 2D outline |
|
||||
| ```NEMA_screw_positions(type, n = 4)``` | Positions children at the screw holes |
|
||||
| ```NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef)``` | Place screws and optional earth tag |
|
||||
@@ -3648,6 +3689,7 @@ Tubing and sleeving. The internal diameter can be forced to stretch it over some
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```tubing(CBNFIB10)``` | Carbon fiber OD 10mm ID 8mm x 15mm |
|
||||
| 1 | ```tubing(HSHRNK16)``` | Heatshrink sleeving ID 1.6mm x 15mm |
|
||||
| 1 | ```tubing(HSHRNK100)``` | Heatshrink sleeving ID 10mm x 15mm |
|
||||
| 1 | ```tubing(HSHRNK24)``` | Heatshrink sleeving ID 2.4mm x 15mm |
|
||||
@@ -5391,6 +5433,8 @@ Method to print holes in mid air. See <https://hydraraptor.blogspot.com/2014/03/
|
||||
## Horiholes
|
||||
Utilities for depicting the staircase slicing of horizontal holes made with [`teardrop_plus()`](#teardrops), see <https://hydraraptor.blogspot.com/2020/07/horiholes-2.html>
|
||||
|
||||
```horicylinder()``` makes cylinders that fit inside a round hole. Layers that are less than 2 filaments wide and layers that need more than a 45 degree overhang are omitted.
|
||||
|
||||
|
||||
[utils/horiholes.scad](utils/horiholes.scad) Implementation.
|
||||
|
||||
@@ -5399,11 +5443,13 @@ Utilities for depicting the staircase slicing of horizontal holes made with [`te
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```teardrop_minus_x(r, y, h)``` | Calculate the ordinate of a compensated teardrop given y and layer height. |
|
||||
| ```teardrop_plus_x(r, y, h)``` | Calculate the ordinate of a compensated teardrop given y and layer height. |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```horicylinder(r, z, h = 0, center = true)``` | For making horizontal cylinders that don't need support material and are correct dimensions |
|
||||
| ```horihole(r, z, h = 0, center = true)``` | For making horizontal holes that don't need support material and are correct dimensions |
|
||||
|
||||

|
||||
@@ -5455,6 +5501,7 @@ Maths utilities for manipulating vectors and matrices.
|
||||
| ```argsinh(x)``` | inverse hyperbolic sine |
|
||||
| ```argtanh(x)``` | inverse hyperbolic tangent |
|
||||
| ```augment(m)``` | Augment a matrix by adding an identity matrix to the right |
|
||||
| ```circle_intersect(c1, r1, c2, r2)``` | Calculate one point where two circles in the X-Z plane intersect, clockwise around c1 |
|
||||
| ```cosh(x)``` | hyperbolic cosine |
|
||||
| ```coth(x)``` | hyperbolic cotangent |
|
||||
| ```degrees(radians)``` | Convert degrees to radians |
|
||||
@@ -5663,7 +5710,7 @@ An additional twist around the path can be specified. If the path is closed this
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```sweep(path, profile, loop = false, twist = 0)``` | Draw a polyhedron that is the swept volume |
|
||||
| ```sweep(path, profile, loop = false, twist = 0, convexity = 1)``` | Draw a polyhedron that is the swept volume |
|
||||
|
||||

|
||||
|
||||
@@ -5731,6 +5778,7 @@ Simple tube or ring
|
||||
|:--- |:--- |
|
||||
| ```ring(or, ir)``` | Create a ring with specified external and internal radii |
|
||||
| ```tube(or, ir, h, center = true)``` | Create a tube with specified external and internal radii and height ```h``` |
|
||||
| ```woven_tube(or, ir, h, center= true, colour = grey(30)``` | Create a woven tube with specified external and internal radii, height ```h```, colours, warp and weft |
|
||||
|
||||

|
||||
|
||||
@@ -5855,11 +5903,13 @@ Global constants, functions and modules. This file is used directly or indirectl
|
||||
| ```foot(x)``` | Foot to mm conversion |
|
||||
| ```in(list, x)``` | Returns true if ```x``` is an element in the ```list``` |
|
||||
| ```inch(x)``` | Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.) |
|
||||
| ```limit(x, min, max)``` | Force x in range min <= x <= max |
|
||||
| ```m(x)``` | m to mm conversion |
|
||||
| ```mm(x)``` | Explicit mm specified |
|
||||
| ```no_point(str)``` | Replace decimal point in string with 'p' |
|
||||
| ```r2sides(r)``` | Replicates the OpenSCAD logic to calculate the number of sides from the radius |
|
||||
| ```r2sides4n(r)``` | Round up the number of sides to a multiple of 4 to ensure points land on all axes |
|
||||
| ```slice(list, start = 0, end = undef)``` | Slice a list or string with Python type semantics |
|
||||
| ```sqr(x)``` | Returns the square of ```x``` |
|
||||
| ```yard(x)``` | Yard to mm conversion |
|
||||
|
||||
|
@@ -97,7 +97,6 @@ def tests(tests):
|
||||
for dir in [deps_dir, png_dir, bom_dir]:
|
||||
if not os.path.isdir(dir):
|
||||
os.makedirs(dir)
|
||||
doc_name = "readme.md"
|
||||
index = {}
|
||||
bodies = {}
|
||||
done = []
|
||||
@@ -108,19 +107,33 @@ def tests(tests):
|
||||
#
|
||||
png_name = "libtest.png"
|
||||
scad_name = "libtest.scad"
|
||||
if not os.path.isfile(png_name):
|
||||
openscad.run(colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall", "-o", png_name, scad_name);
|
||||
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", background, "-border", "10", png_name])
|
||||
if os.path.isfile(scad_name):
|
||||
libtest = True
|
||||
lib_blurb = scrape_blurb(scad_name)
|
||||
if not os.path.isfile(png_name):
|
||||
openscad.run(colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall", "-o", png_name, scad_name);
|
||||
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", background, "-border", "10", png_name])
|
||||
else:
|
||||
#
|
||||
# Project tests so just a title
|
||||
#
|
||||
libtest = False
|
||||
project = ' '.join(word[0].upper() + word[1:] for word in os.path.basename(os.getcwd()).split('_'))
|
||||
lib_blurb = '#' + project + ' Tests\n'
|
||||
|
||||
doc_base_name = "readme" if libtest else "tests"
|
||||
doc_name = doc_base_name + ".md"
|
||||
#
|
||||
# List of individual part files
|
||||
#
|
||||
scads = [i for i in sorted(os.listdir(scad_dir), key = lambda s: s.lower()) if i[-5:] == ".scad"]
|
||||
|
||||
scads = [i for i in sorted(os.listdir(scad_dir), key = lambda s: s.lower()) if i[-5:] == ".scad"]
|
||||
types = []
|
||||
for scad in scads:
|
||||
base_name = scad[:-5]
|
||||
if not tests or base_name in tests:
|
||||
done.append(base_name)
|
||||
print(base_name)
|
||||
print('\n'+base_name)
|
||||
cap_name = base_name[0].capitalize() + base_name[1:]
|
||||
base_name = base_name.lower()
|
||||
scad_name = scad_dir + '/' + scad
|
||||
@@ -132,29 +145,42 @@ def tests(tests):
|
||||
if is_plural(base_name) and os.path.isfile(vits_name):
|
||||
objects_name = vits_name
|
||||
|
||||
locations = [
|
||||
('vitamins/' + depluralise(base_name) + '.scad', 'Vitamins'),
|
||||
('printed/' + base_name + '.scad', 'Printed'),
|
||||
('utils/' + base_name + '.scad', 'Utilities'),
|
||||
('utils/core/' + base_name + '.scad', 'Core Utilities'),
|
||||
]
|
||||
locations = []
|
||||
if os.path.isdir('vitamins'):
|
||||
locations.append(('vitamins/' + depluralise(base_name) + '.scad', 'Vitamins'))
|
||||
if os.path.isdir('printed'):
|
||||
locations.append(('printed/' + base_name + '.scad', 'Printed'))
|
||||
if os.path.isdir('utils'):
|
||||
locations.append(('utils/' + base_name + '.scad', 'Utilities'))
|
||||
if libtest and os.path.isdir('utils/core'):
|
||||
locations.append(('utils/core/' + base_name + '.scad', 'Core Utilities'))
|
||||
|
||||
for name, type in locations:
|
||||
if os.path.isfile(name):
|
||||
impl_name = name
|
||||
break
|
||||
else:
|
||||
print("Can't find implementation!")
|
||||
continue
|
||||
if libtest:
|
||||
print("Can't find implementation!")
|
||||
continue
|
||||
else:
|
||||
type = 'Tests' # OK when testing part of a project
|
||||
impl_name = None
|
||||
|
||||
vsplit = "AJR" + chr(ord('Z') + 1)
|
||||
vtype = locations[0][1]
|
||||
types = [vtype + ' ' + vsplit[i] + '-' + chr(ord(vsplit[i + 1]) - 1) for i in range(len(vsplit) - 1)] + [loc[1] for loc in locations[1 :]]
|
||||
if type == vtype:
|
||||
for i in range(1, len(vsplit)):
|
||||
if cap_name[0] < vsplit[i]:
|
||||
type = types[i - 1]
|
||||
break
|
||||
if libtest:
|
||||
vsplit = "AJR" + chr(ord('Z') + 1)
|
||||
vtype = locations[0][1]
|
||||
types = [vtype + ' ' + vsplit[i] + '-' + chr(ord(vsplit[i + 1]) - 1) for i in range(len(vsplit) - 1)] + [loc[1] for loc in locations[1 :]]
|
||||
if type == vtype:
|
||||
for i in range(1, len(vsplit)):
|
||||
if cap_name[0] < vsplit[i]:
|
||||
type = types[i - 1]
|
||||
break
|
||||
else:
|
||||
if not types:
|
||||
types = [loc[1] for loc in locations] # No need to split up the vitamin list
|
||||
if not type in types: # Will happen when implementation is not found and type is set to Tests
|
||||
types.append(type)
|
||||
|
||||
for t in types:
|
||||
if not t in bodies:
|
||||
@@ -250,24 +276,7 @@ def tests(tests):
|
||||
usage()
|
||||
|
||||
with open(doc_name, "wt") as doc_file:
|
||||
print('# NopSCADlib', file = doc_file)
|
||||
print('''\
|
||||
An ever expanding library of parts modelled in OpenSCAD useful for 3D printers and enclosures for electronics, etc.
|
||||
|
||||
It contains lots of vitamins (the RepRap term for non-printed parts), some general purpose printed parts and
|
||||
some utilities. There are also Python scripts to generate Bills of Materials (BOMs),
|
||||
STL files for all the printed parts, DXF files for CNC routed parts in a project and a manual containing assembly
|
||||
instructions and exploded views by scraping markdown embedded in OpenSCAD comments, [see scripts](scripts/readme.md). A simple example project can be found [here](examples/MainsBreakOutBox/readme.md).
|
||||
|
||||
For more examples of what it can make see the [gallery](gallery/readme.md).
|
||||
|
||||
The license is GNU General Public License v3.0, see [COPYING](COPYING).
|
||||
|
||||
See [usage](docs/usage.md) for requirements, installation instructions and a usage guide.
|
||||
|
||||
<img src="libtest.png" width="100%"/>\n
|
||||
''', file = doc_file)
|
||||
|
||||
print(lib_blurb, file = doc_file)
|
||||
print('## Table of Contents<a name="top"/>', file = doc_file)
|
||||
print('<table><tr>', file = doc_file)
|
||||
n = 0
|
||||
@@ -288,10 +297,10 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
for type in types:
|
||||
for line in bodies[type]:
|
||||
print(line, file = doc_file)
|
||||
with open("readme.html", "wt") as html_file:
|
||||
do_cmd("python -m markdown -x tables readme.md".split(), html_file)
|
||||
with open(doc_base_name + ".html", "wt") as html_file:
|
||||
do_cmd(("python -m markdown -x tables " + doc_name).split(), html_file)
|
||||
times.print_times()
|
||||
do_cmd('codespell -L od readme.md'.split())
|
||||
do_cmd(('codespell -L od ' + doc_name).split())
|
||||
|
||||
if __name__ == '__main__':
|
||||
for arg in sys.argv[1:]:
|
||||
|
@@ -29,6 +29,23 @@ module globals() {
|
||||
translate([50, 0])
|
||||
right_triangle(10, 20, 0);
|
||||
}
|
||||
assert(slice("ABCD") == "ABCD");
|
||||
assert(slice("ABCD", 1) == "BCD");
|
||||
assert(slice("ABCD", 2) == "CD");
|
||||
assert(slice("ABCD", 3) == "D");
|
||||
assert(slice("ABCD", 4) == "");
|
||||
assert(slice("ABCD", 1, -1) == "BC");
|
||||
assert(slice("ABCD", 2, -1) == "C");
|
||||
assert(slice("ABCD", 3, -1) == "");
|
||||
assert(slice("ABCD", 4, -1) == "");
|
||||
assert(slice("ABCD", 0, -1) == "ABC");
|
||||
assert(slice("ABCD", 0, -2) == "AB");
|
||||
assert(slice("ABCD", 0, -3) == "A");
|
||||
assert(slice("ABCD", 0, -4) == "");
|
||||
assert(slice("ABCD", 0, 0) == "");
|
||||
assert(slice("ABCD", 0, 1) == "A");
|
||||
assert(slice("ABCD", 0, 2) == "AB");
|
||||
assert(slice("ABCD", 0, 3) == "ABC");
|
||||
}
|
||||
|
||||
rotate([70, 0, 315]) globals();
|
||||
|
@@ -69,9 +69,13 @@ module horiholes() {
|
||||
color(silver)
|
||||
cylinder(r = $r, h = eps, center = true, $fn = 360);
|
||||
|
||||
hole_positions()
|
||||
color("blue")
|
||||
horicylinder(r = $r, z = $z, h = 2 * eps, center = true, $fn = 360);
|
||||
|
||||
hole_positions()
|
||||
color("red")
|
||||
linear_extrude(2 * eps, center = true)
|
||||
linear_extrude(3 * eps, center = true)
|
||||
intersection() {
|
||||
difference() {
|
||||
square(8, center = true);
|
||||
|
@@ -25,7 +25,7 @@ module hot_ends()
|
||||
layout([for(h = hot_ends) 40])
|
||||
translate([-20, 0])
|
||||
rotate(90)
|
||||
hot_end(hot_ends[$i], 3);
|
||||
hot_end(hot_ends[$i], 3, bowden = $i == 3);
|
||||
|
||||
if($preview)
|
||||
hot_ends();
|
||||
|
@@ -69,6 +69,33 @@ module maths() {
|
||||
// Test Euler
|
||||
//
|
||||
assert(euler(rotate(r)) == r, "euler() failed");
|
||||
//
|
||||
// Circle intersect
|
||||
//
|
||||
r1 = 10;
|
||||
c1 = [50, 0, 10];
|
||||
r2 = 20;
|
||||
c2 = [67, 0, 0];
|
||||
p1 = circle_intersect(c1, r1, c2, r2);
|
||||
p2 = circle_intersect(c2, r2, c1, r1);
|
||||
|
||||
rotate(90) {
|
||||
color(grey(90))
|
||||
translate(c1) rotate([90, 0, 0]) cylinder(r = r1, h = 4 * eps, center = true);
|
||||
|
||||
color(grey(80))
|
||||
translate(c2) rotate([90, 0, 0]) cylinder(r = r2, h = eps, center = true);
|
||||
|
||||
color("red")
|
||||
translate(p1) rotate([90, 0, 0]) cylinder(r = 0.1, h = 6 * eps, center = true);
|
||||
|
||||
color("blue")
|
||||
translate(p2) rotate([90, 0, 0]) cylinder(r = 0.1, h = 6 * eps, center = true);
|
||||
|
||||
translate(p1) arrow();
|
||||
|
||||
translate(p2) vflip() arrow();
|
||||
}
|
||||
}
|
||||
|
||||
rotate(45)
|
||||
|
@@ -64,11 +64,14 @@ module pin_headers() {
|
||||
pin_socket(pin_headers[$i], 3, 3, right_angle = true);
|
||||
}
|
||||
|
||||
translate([-20, 0])
|
||||
jst_xh_header(jst_xh_header, 5);
|
||||
for(i = [0, 1], p = [5, 2][i], j = [0 , 1]) {
|
||||
h = [jst_ph_header, jst_xh_header][j];
|
||||
translate([-20 * (i + 1), 0 + j * 40])
|
||||
jst_xh_header(h, p);
|
||||
|
||||
translate([-20, 20])
|
||||
jst_xh_header(jst_xh_header, 5, true);
|
||||
translate([-20 * (i + 1), 20 + j * 40])
|
||||
jst_xh_header(h, p, true);
|
||||
}
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 42 KiB |
BIN
tests/png/shaft_couplings.png
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 26 KiB |
30
tests/shaft_couplings.scad
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// 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>
|
||||
include <../vitamins/shaft_couplings.scad>
|
||||
|
||||
use <../utils/layout.scad>
|
||||
|
||||
module shaft_couplings()
|
||||
layout([for(s = shaft_couplings) sc_diameter(s)],5)
|
||||
shaft_coupling(shaft_couplings[$i]);
|
||||
|
||||
if($preview)
|
||||
shaft_couplings();
|
||||
|
@@ -22,12 +22,12 @@ include <../vitamins/stepper_motors.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
module stepper_motors()
|
||||
layout([for(s = stepper_motors) NEMA_width(s)], 5) {
|
||||
layout([for(s = stepper_motors) NEMA_width(s)], 5) let(m = stepper_motors[$i]) {
|
||||
rotate(180)
|
||||
NEMA(stepper_motors[$i]);
|
||||
NEMA(m, 0, m == NEMA17M || m == NEMA17M8);
|
||||
|
||||
translate_z(4)
|
||||
NEMA_screws(stepper_motors[$i], 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);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
@@ -22,7 +22,7 @@ use <../utils/layout.scad>
|
||||
include <../vitamins/tubings.scad>
|
||||
|
||||
module tubings()
|
||||
layout([for(t = tubings) tubing_od(t)], 10)
|
||||
layout([for(t = tubings) tubing_od(t)], 8)
|
||||
tubing(tubings[$i]);
|
||||
|
||||
if($preview)
|
||||
|
@@ -18,7 +18,7 @@
|
||||
//
|
||||
|
||||
//
|
||||
// Include this file to use the miniumum library
|
||||
// Include this file to use the minimum library
|
||||
//
|
||||
include <../../global_defs.scad>
|
||||
//
|
||||
|
@@ -36,12 +36,22 @@ function in(list, x) = !!len([for(v = list) if(v == x) true]);
|
||||
function Len(x) = is_list(x) ? len(x) : 0; //! Returns the length of a list or 0 if ```x``` is not a list
|
||||
function r2sides(r) = $fn ? $fn : ceil(max(min(360/ $fa, r * 2 * PI / $fs), 5)); //! Replicates the OpenSCAD logic to calculate the number of sides from the radius
|
||||
function r2sides4n(r) = floor((r2sides(r) + 3) / 4) * 4; //! Round up the number of sides to a multiple of 4 to ensure points land on all axes
|
||||
function limit(x, min, max) = max(min(x, max), min); //! Force x in range min <= x <= max
|
||||
|
||||
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
|
||||
module vflip() rotate([180, 0, 0]) children(); //! Invert children by doing a 180° flip around the X axis
|
||||
module hflip() rotate([0, 180, 0]) children(); //! Invert children by doing a 180° flip around the Y axis
|
||||
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
|
||||
|
||||
function slice_str(str, start, end, s ="") = start >= end ? s : slice_str(str, start + 1, end, str(s, str[start])); // Helper for slice()
|
||||
|
||||
function slice(list, start = 0, end = undef) = let( //! Slice a list or string with Python type semantics
|
||||
len = len(list),
|
||||
start = limit(start < 0 ? len + start : start, 0, len),
|
||||
end = is_undef(end) ? len : limit(end < 0 ? len + end : end, 0, len)
|
||||
) is_string(list) ? slice_str(list, start, end) : [for(i = [start : 1 : end - 1]) list[i]];
|
||||
|
||||
|
||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
|
||||
if(h)
|
||||
linear_extrude(h, center = center, convexity = 2) // 3D
|
||||
|
@@ -19,6 +19,8 @@
|
||||
|
||||
//
|
||||
//! Utilities for depicting the staircase slicing of horizontal holes made with [`teardrop_plus()`](#teardrops), see <https://hydraraptor.blogspot.com/2020/07/horiholes-2.html>
|
||||
//!
|
||||
//! ```horicylinder()``` makes cylinders that fit inside a round hole. Layers that are less than 2 filaments wide and layers that need more than a 45 degree overhang are omitted.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
@@ -53,3 +55,29 @@ module horihole(r, z, h = 0, center = true) { //! For making horizontal holes th
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function teardrop_minus_x(r, y, h) = //! Calculate the ordinate of a compensated teardrop given y and layer height.
|
||||
let(fr = h / 2,
|
||||
hpot = r - fr,
|
||||
x2 = sqr(hpot) - sqr(y),
|
||||
x = x2 > 0 ? sqrt(x2) : 0,
|
||||
X = y >= -hpot / sqrt(2) ? x + fr : 0
|
||||
)
|
||||
X >= extrusion_width ? X : 0;
|
||||
|
||||
module horicylinder(r, z, h = 0, center = true) { //! For making horizontal cylinders that don't need support material and are correct dimensions
|
||||
bot_layer = floor((z - r) / layer_height);
|
||||
top_layer = ceil((z + r) / layer_height);
|
||||
render(convexity = 5)
|
||||
extrude_if(h, center)
|
||||
for(i = [bot_layer : top_layer]) {
|
||||
Z = i * layer_height;
|
||||
y = Z - z + layer_height / 2;
|
||||
x = teardrop_minus_x(r, y, layer_height);
|
||||
if(x >= extrusion_width)
|
||||
hull()
|
||||
for(end = [-1, 1])
|
||||
translate([end * (x - layer_height / 2), y])
|
||||
circle(d = layer_height, $fn = 32);
|
||||
}
|
||||
}
|
||||
|
@@ -146,3 +146,10 @@ function invert(m) = let(n =len(m), m = solve(augment(m))) [ //! Invert a matrix
|
||||
each m[i][j]
|
||||
]
|
||||
];
|
||||
|
||||
function circle_intersect(c1, r1, c2, r2) = //! Calculate one point where two circles in the X-Z plane intersect, clockwise around c1
|
||||
let(
|
||||
v = c1 - c2, // Line between centres
|
||||
d = norm(v), // Distance between centres
|
||||
a = atan2(v.z, v.x) - acos((sqr(d) + sqr(r2) - sqr(r1)) / (2 * d * r2)) // Cosine rule to find angle from c2
|
||||
) c2 + r2 * [cos(a), 0, sin(a)]; // Point on second circle
|
||||
|
@@ -34,14 +34,22 @@ function transpose3(m) = [ [m[0].x, m[1].x, m[2].x],
|
||||
[m[0].y, m[1].y, m[2].y],
|
||||
[m[0].z, m[1].z, m[2].z] ];
|
||||
//
|
||||
// Find the first non-colinear point
|
||||
//
|
||||
tiny = 0.00001;
|
||||
function find_curve(tangents, i = 1) =
|
||||
i >= len(tangents) - 1 || norm(cross(tangents[0], tangents[i] - tangents[0])) > tiny ? i
|
||||
: find_curve(tangents, i + 1);
|
||||
//
|
||||
// Frenet-Serret frame
|
||||
//
|
||||
function fs_frame(tangents) =
|
||||
let(tangent = tangents[0],
|
||||
normal = tangents[1] - tangents[0],
|
||||
i = find_curve(tangents),
|
||||
normal = tangents[i] - tangents[0],
|
||||
binormal = cross(tangent, normal),
|
||||
z = unit(tangent),
|
||||
x = assert(norm(binormal) > 0.00001, "first three points are colinear") unit(binormal),
|
||||
x = assert(norm(binormal) > tiny, "all points are colinear") unit(binormal),
|
||||
y = unit(cross(z, x))
|
||||
) [[x.x, y.x, z.x],
|
||||
[x.y, y.y, z.y],
|
||||
@@ -70,7 +78,6 @@ function orientate(p, r) =
|
||||
[x.y, y.y, z.y],
|
||||
[x.z, y.z, z.z],
|
||||
[p.x, p.y, p.z]];
|
||||
|
||||
//
|
||||
// Rotate around z
|
||||
//
|
||||
@@ -145,10 +152,10 @@ function sweep(path, profile, loop = false, twist = 0) = //! Generate the point
|
||||
faces = loop ? skin_faces : concat([cap(facets)], skin_faces, [cap(facets, npoints - 1)])
|
||||
) [points, faces];
|
||||
|
||||
module sweep(path, profile, loop = false, twist = 0) { //! Draw a polyhedron that is the swept volume
|
||||
module sweep(path, profile, loop = false, twist = 0, convexity = 1) { //! Draw a polyhedron that is the swept volume
|
||||
mesh = sweep(path, profile, loop, twist);
|
||||
|
||||
polyhedron(points = mesh[0], faces = mesh[1]);
|
||||
polyhedron(points = mesh[0], faces = mesh[1], convexity = convexity);
|
||||
}
|
||||
|
||||
function path_length(path, i = 0, length = 0) = //! Calculated the length along a path
|
||||
|
@@ -31,3 +31,41 @@ module ring(or, ir) //! Create a ring with specified external and internal radii
|
||||
module tube(or, ir, h, center = true) //! Create a tube with specified external and internal radii and height ```h```
|
||||
linear_extrude(h, center = center, convexity = 5)
|
||||
ring(or, ir);
|
||||
|
||||
module woven_tube(or, ir, h, center= true, colour = grey(30), colour2, warp = 2, weft) {//! Create a woven tube with specified external and internal radii, height ```h```, colours, warp and weft
|
||||
colour2 = colour2 ? colour2 : colour * 0.8;
|
||||
weft = weft ? weft : warp;
|
||||
warp_count = max(floor(PI * or / warp), 0.5);
|
||||
angle = 360 / (2 * warp_count);
|
||||
|
||||
module layer(weft) {
|
||||
points = [[ir, weft / 2], [or, weft / 2], [or, -weft / 2], [ir, -weft / 2]];
|
||||
color(colour)
|
||||
for (i = [0 : warp_count])
|
||||
rotate(2 * i * angle)
|
||||
rotate_extrude(angle = angle)
|
||||
polygon(points);
|
||||
color(colour2)
|
||||
for (i = [0 : warp_count])
|
||||
rotate((2 * i + 1) * angle)
|
||||
rotate_extrude(angle = angle)
|
||||
polygon(points);
|
||||
}
|
||||
|
||||
translate_z(center ? -h / 2 : 0) {
|
||||
weft_count = floor(h / weft);
|
||||
if (weft_count > 0)
|
||||
for (i = [0 : weft_count - 1]) {
|
||||
translate_z(i * weft + weft / 2)
|
||||
rotate(i * angle)
|
||||
layer(weft);
|
||||
}
|
||||
remainder = h - weft * weft_count;
|
||||
if (remainder) {
|
||||
translate_z(weft_count * weft + remainder / 2)
|
||||
rotate(weft_count * angle)
|
||||
layer(remainder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! A strip of polypropylene used with ribbon cable to make a cable flexible in one direction only.
|
||||
//!
|
||||
//! Modelled with a Bezier spline, which is not quite the same as a miniumum energy curve but very close, epecially
|
||||
//! Modelled with a Bezier spline, which is not quite the same as a minimum energy curve but very close, epecially
|
||||
//! near the extreme positions, where the model needs to be accurate.
|
||||
//!
|
||||
//! When the sides are constrained then a circular model is more accurate.
|
||||
|
@@ -161,13 +161,13 @@ module al_clad_resistor(type, value, leads = true) { //! Draw an aluminium clad
|
||||
}
|
||||
linear_extrude(thickness)
|
||||
difference() {
|
||||
for(end = [-1, 1])
|
||||
translate([end * (length - tab) / 2, end * (width - width / 2) / 2])
|
||||
square([tab, width / 2], center = true);
|
||||
union()
|
||||
for(end = [-1, 1])
|
||||
translate([end * (length - tab) / 2, end * (width - width / 2) / 2])
|
||||
square([tab, width / 2], center = true);
|
||||
|
||||
al_clad_resistor_hole_positions(type)
|
||||
circle(d = al_clad_hole(type));
|
||||
|
||||
}
|
||||
if(leads) {
|
||||
translate_z(height / 2)
|
||||
|
@@ -26,6 +26,8 @@ include <tubings.scad>
|
||||
include <zipties.scad>
|
||||
include <fans.scad>
|
||||
|
||||
use <../utils/rounded_cylinder.scad>
|
||||
use <../utils/thread.scad>
|
||||
use <../utils/tube.scad>
|
||||
|
||||
rad_dia = 22; // Diam of the part with ailettes
|
||||
@@ -94,7 +96,34 @@ module heater_block(type, naked = false, resistor_wire_rotate = [0,0,0]) {
|
||||
}
|
||||
}
|
||||
|
||||
module bowden_connector(cap_colour = grey(20)) {
|
||||
ir = 4.25 / 2;
|
||||
body_colour = silver;
|
||||
|
||||
color(body_colour) {
|
||||
translate_z(-4.5) {
|
||||
tube(or = 2.5, ir = ir, h = 4.5, center = false);
|
||||
male_metric_thread(6, metric_coarse_pitch(5), length = 4.5, center = false, solid = false, colour = body_colour);
|
||||
}
|
||||
tube(or = 7.7 / 2, ir = ir, h = 2, center = false);
|
||||
translate_z(2)
|
||||
linear_extrude(6.5)
|
||||
difference() {
|
||||
circle(d = 11.55, $fn = 6);
|
||||
circle(r = ir);
|
||||
}
|
||||
translate_z(8.5)
|
||||
rounded_cylinder(r = 9.8 / 2, h = 2, r2 = 1.5, ir = ir);
|
||||
translate_z(10.5)
|
||||
tube(or = 3.5, ir = ir, h = 0.5, center = false);
|
||||
}
|
||||
color(cap_colour) {
|
||||
translate_z(11)
|
||||
tube(or = 3, ir = ir, h = 1, center = false);
|
||||
translate_z(12)
|
||||
tube(or = 5.5, ir = ir, h = 1.75, center = false);
|
||||
}
|
||||
}
|
||||
|
||||
module e3d_fan_duct(type) {
|
||||
color("DeepSkyBlue")
|
||||
@@ -123,7 +152,7 @@ module e3d_fan(type) {
|
||||
fan(fan30x10);
|
||||
}
|
||||
|
||||
module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) {
|
||||
module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0], bowden = false) {
|
||||
insulator_length = hot_end_insulator_length(type);
|
||||
inset = hot_end_inset(type);
|
||||
h_ailettes = rad_len / (2 * rad_nb_ailettes - 1);
|
||||
@@ -150,6 +179,10 @@ module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]
|
||||
square([100, hot_end_groove(type)]);
|
||||
}
|
||||
|
||||
if(bowden)
|
||||
translate_z(inset)
|
||||
bowden_connector();
|
||||
|
||||
rotate(90)
|
||||
heater_block(type, naked, resistor_wire_rotate);
|
||||
|
||||
@@ -158,10 +191,10 @@ module e3d_hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]
|
||||
e3d_fan();
|
||||
}
|
||||
|
||||
module e3d_hot_end_assembly(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) {
|
||||
module e3d_hot_end_assembly(type, filament, naked = false, resistor_wire_rotate = [0,0,0], bowden = false) {
|
||||
bundle = 3.2;
|
||||
|
||||
e3d_hot_end(type, filament, naked, resistor_wire_rotate);
|
||||
e3d_hot_end(type, filament, naked, resistor_wire_rotate, bowden);
|
||||
|
||||
// Wire and ziptie
|
||||
if(!naked)
|
||||
|
@@ -44,10 +44,10 @@ function hot_end_length(type) = hot_end_total_length(type) - hot_end_inset(type)
|
||||
use <jhead.scad>
|
||||
use <e3d.scad>
|
||||
|
||||
module hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0]) { //! Draw specified hot end
|
||||
module hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0], bowden = false) { //! Draw specified hot end
|
||||
if(hot_end_style(type) == jhead)
|
||||
jhead_hot_end_assembly(type, filament, naked);
|
||||
|
||||
if(hot_end_style(type) == e3d)
|
||||
e3d_hot_end_assembly(type, filament, naked, resistor_wire_rotate);
|
||||
e3d_hot_end_assembly(type, filament, naked, resistor_wire_rotate, bowden);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ DSP5005 = ["DSP5005", "Ruideng DSP5005 Power supply module", [7
|
||||
[[-25, 9, 0], [ 6.5, 4.5, 1], 0.5, "yellow"],
|
||||
]];
|
||||
|
||||
DSN_VC288PCB = ["", "", 41, 21, 1, 0, 0, 0, "green", false, [], [[ 5, -3, 0, "jst_xh", 3], ], []];
|
||||
DSN_VC288PCB = ["", "", 41, 21, 1, 0, 0, 0, "green", false, [], [[ 5, -3.525, 0, "jst_xh", 3], ], []];
|
||||
|
||||
DSN_VC288 = ["DSN_VC288","DSN-VC288 DC 100V 10A Voltmeter ammeter", [45.3, 26, 17.4], [47.8, 28.8, 2.5], 0, [1, 1.8], [36, 18, 2.5], [], 0, 2,
|
||||
[], 0, DSN_VC288PCB, 5, 0];
|
||||
|
@@ -1021,8 +1021,6 @@ module pcb(type) { //! Draw specified PCB
|
||||
for(part = pcb_accessories(type))
|
||||
vitamin(part);
|
||||
|
||||
pcb_components(type);
|
||||
|
||||
color(pcb_colour(type)) linear_extrude(t) difference() {
|
||||
if(Len(pcb_polygon(type)))
|
||||
polygon(pcb_polygon(type));
|
||||
@@ -1076,6 +1074,8 @@ module pcb(type) { //! Draw specified PCB
|
||||
circle(d = 2);
|
||||
}
|
||||
}
|
||||
|
||||
pcb_components(type);
|
||||
}
|
||||
|
||||
module pcb_spacer(screw, height, wall = 1.8, taper = 0) { //! Generate STL for PCB spacer
|
||||
|
@@ -348,7 +348,7 @@ PI_IO = ["PI_IO", "PI_IO V2", 35.56, 25.4, 1.6, 0, 0, 0, "green", tru
|
||||
], []];
|
||||
|
||||
ZC_A0591 = ["ZC_A0591", "ZC-A0591 ULN2003 driver PCB", 35, 32, 1.6, 0, 2.5, 0, "green", false, [[2.25, 3.25], [-2.25, 3.25], [2.25, -3.25], [-2.25, -3.25] ],
|
||||
[ [ 12.25, 8.3, -90, "jst_xh", 5],
|
||||
[ [ 11.725, 8.3, -90, "jst_xh", 5],
|
||||
[ -6.5, 10, 0, "2p54header", 1, 4],
|
||||
[ 20.4, -4.5, 0, "2p54header", 4, 1],
|
||||
[ 20.4, 11, 180, "pdip", 16, "ULN2803AN", true],
|
||||
@@ -385,6 +385,11 @@ WD2002SJ = ["WD2002SJ", "WD2002SJ Buck Boost DC-DC converter", 78, 47, 1.6, 0, 3
|
||||
],
|
||||
[]];
|
||||
|
||||
MP1584EN = ["MP1584EN", "MP1584EN 3A buck converter", 22, 17, 1.2, 0, 1, [2, 2], "green", false,
|
||||
[[1.75, 1.75], [1.75, -1.75], [-1.75, 1.75], [-1.75, -1.75], [-1.75, -4.4], [-1.75, 4.48], [1.75, -4.4], [1.75, 4.4]],
|
||||
[]
|
||||
];
|
||||
|
||||
PERF80x20 = ["PERF80x20", "Perfboard 80 x 20mm", 80, 20, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
|
||||
PERF70x50 = ["PERF70x50", "Perfboard 70 x 50mm", 70, 50, 1.6, 0, 2.3, 0, "green", true, [[2,2],[-2,2],[2,-2],[-2,-2]], [], [], [5.87, 3.49]];
|
||||
@@ -403,14 +408,14 @@ RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
|
||||
[2, 2, false], [2, 13.5, false], [17, 13.5], [36, 13.5]
|
||||
],
|
||||
[
|
||||
[ 12, 8, -90, "jst_xh", 3, true, "white", "silver"],
|
||||
[ 11.6, 8, -90, "jst_xh", 3, true, "white", "silver"],
|
||||
[ 26.5, 12.75, 0, "microswitch", small_microswitch],
|
||||
[ 27.5, 17.5, 15, "chip", 15, 0.5, 4.5, "silver"],
|
||||
],
|
||||
[]];
|
||||
|
||||
|
||||
pcbs = [TP4056, MT3608, RAMPSEndstop, ExtruderPCB, PI_IO, ZC_A0591, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PSU12V1A, WD2002SJ, RPI3, RPI4, DuetE, Duex2, Duex5, Melzi];
|
||||
pcbs = [MP1584EN, TP4056, MT3608, RAMPSEndstop, ExtruderPCB, PI_IO, ZC_A0591, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PSU12V1A, WD2002SJ, RPI3, RPI4, DuetE, Duex2, Duex5];
|
||||
|
||||
perfboards = [PERF74x51, PERF70x50, PERF60x40, PERF70x30, PERF80x20];
|
||||
|
||||
|
@@ -29,13 +29,18 @@ function hdr_pin_width(type) = type[4]; //! Header pin size
|
||||
function hdr_pin_colour(type) = type[5]; //! Header pin colour
|
||||
function hdr_base_colour(type) = type[6]; //! Header insulator colour
|
||||
function hdr_socket_depth(type) = type[7]; //! Socket depth for female housing
|
||||
function hdr_box_size(type) = type[8]; //! Box header outside dimensions
|
||||
function hdr_box_wall(type) = type[9]; //! Box header wall thickness
|
||||
function hdr_y_offset(type) = type[10]; //! Y offset of pins from center of the box
|
||||
function hdr_ra_box_offset(type)= type[11]; //! Offset between back of the box and the pins
|
||||
function hdr_ra_height(type) = type[12]; //! Height of right angle connector
|
||||
|
||||
module pin(type, length = undef) { //! Draw a header pin
|
||||
w = hdr_pin_width(type);
|
||||
l = length == undef ? hdr_pin_length(type) : length;
|
||||
chamfer = w / 2;
|
||||
color(hdr_pin_colour(type))
|
||||
translate_z(l / 2 -hdr_pin_below(type))
|
||||
translate_z(l / 2 - hdr_pin_below(type))
|
||||
hull() {
|
||||
cube([w, w, l - 2 * chamfer], center = true);
|
||||
|
||||
@@ -108,9 +113,11 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
|
||||
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type);
|
||||
w = cols * pitch + 7.62;
|
||||
l = rows * pitch + 3.52;
|
||||
h = 8.7;
|
||||
h = size.z;
|
||||
t = hdr_box_wall(type);
|
||||
base = h - 6.4;
|
||||
|
||||
if(cutout)
|
||||
@@ -131,7 +138,7 @@ module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! D
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
|
||||
square([w - 2.4, l - 2.4], center = true);
|
||||
square([w - t, l - t], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
@@ -225,65 +232,95 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
|
||||
module jst_xh_header(type, pin_count, right_angle = false, colour = false, pin_colour = false) { //! Draw JST XH connector
|
||||
colour = colour ? colour : hdr_base_colour(type);
|
||||
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
|
||||
sizeY = 5.75;
|
||||
pitch = hdr_pitch(type);
|
||||
size = hdr_box_size(type) + [(pin_count - 1) * pitch, 0, 0];
|
||||
pinOffsetX = hdr_box_size(type).x / 2; // Offset from last pin to box edge
|
||||
wallThickness = hdr_box_wall(type);
|
||||
y_offset = hdr_y_offset(type);
|
||||
ra_box_offset = hdr_ra_box_offset(type);
|
||||
ra_h = hdr_ra_height(type);
|
||||
ra_z = ra_h - size.y / 2;
|
||||
ra_extra = ra_h - size.y; // thicker base for right angle version
|
||||
pinWidth = hdr_pin_width(type);
|
||||
|
||||
module jst_xh_socket(type, pin_count) {
|
||||
socketSizeZ = hdr_socket_depth(type);
|
||||
pinOffsetX = 2.45;
|
||||
sizeY = 5.75;
|
||||
wallThickness = 0.8;
|
||||
size = [pinOffsetX * 2 + (pin_count - 1) * pitch, sizeY, socketSizeZ];
|
||||
translate([-size[0] / 2, -size[1] / 2, 0]) {
|
||||
// the base
|
||||
cube([size[0], size[1], wallThickness]);
|
||||
// the three full sides
|
||||
translate([0, size[1] - wallThickness, 0])
|
||||
cube([size[0], wallThickness, size[2]]);
|
||||
cube([wallThickness, size[1], size[2]]);
|
||||
translate([size[0] - wallThickness, 0, 0])
|
||||
cube([wallThickness, size[1], size[2]]);
|
||||
// the sides with cutouts
|
||||
cube([size[0], wallThickness, 2]);
|
||||
cutoutWidth = 1;
|
||||
cutoutOffset = pinOffsetX - cutoutWidth / 2;
|
||||
cube([cutoutOffset, wallThickness, size[2]]);
|
||||
translate([size[0] - cutoutOffset, 0, 0])
|
||||
cube([cutoutOffset, wallThickness, size[2]]);
|
||||
cube([cutoutOffset, wallThickness, size[2]]);
|
||||
translate([size[0]-cutoutOffset, 0, 0])
|
||||
cube([cutoutOffset, wallThickness, size[2]]);
|
||||
translate([cutoutOffset + cutoutWidth, 0, 0])
|
||||
cube([size[0] - 2 * (cutoutWidth + cutoutOffset), wallThickness, size[2]]);
|
||||
module jst_xh_socket(type, pin_count, ra = false) {
|
||||
module wall() {
|
||||
difference() {
|
||||
square([size.x, size.y], center = true);
|
||||
|
||||
offset(-wallThickness)
|
||||
square([size.x, size.y], center = true);
|
||||
}
|
||||
if(right_angle)
|
||||
translate([0, size.y / 2 + ra_extra / 2])
|
||||
square([size.x, ra_extra], center = true);
|
||||
}
|
||||
} // end module
|
||||
|
||||
module slots() {
|
||||
cutoutWidth = 1.3;
|
||||
cutoutOffset = pinOffsetX + cutoutWidth / 2 - hdr_pin_width(type) / 2;
|
||||
for(side = [-1, 1])
|
||||
translate([side * (size.x / 2 - cutoutOffset), -size.y / 2 + wallThickness / 2])
|
||||
square([cutoutWidth, 2 * wallThickness], center = true);
|
||||
}
|
||||
|
||||
linear_extrude(wallThickness)
|
||||
square([size.x, size.y], center = true); // the base
|
||||
|
||||
linear_extrude(size.z / 2) // full walls up to the slots
|
||||
wall();
|
||||
|
||||
linear_extrude(size.z) // slotted walls to the top
|
||||
difference() {
|
||||
wall();
|
||||
|
||||
if(type[0] == "jst_xh_header") {
|
||||
if(pin_count > 2)
|
||||
slots();
|
||||
else
|
||||
hull()
|
||||
slots();
|
||||
|
||||
translate([0, -size.y / 2 + 3 * wallThickness / 2])
|
||||
square([size.x + 1, wallThickness], center = true);
|
||||
}
|
||||
|
||||
if(type[0] == "jst_ph_header") {
|
||||
translate([0, -size.y / 2 + wallThickness / 2])
|
||||
square([max((pin_count - 2) * pitch, 1), 2 * wallThickness], center = true);
|
||||
|
||||
translate([0, -y_offset / 2 - pinWidth / 4])
|
||||
square([size.x + 1, y_offset + pinWidth / 2], center = true);
|
||||
}
|
||||
}
|
||||
} // end module
|
||||
|
||||
color(colour)
|
||||
if(right_angle)
|
||||
translate([0, -1, sizeY / 2])
|
||||
translate([0, -ra_box_offset, ra_z])
|
||||
rotate([-90, 0, 180])
|
||||
jst_xh_socket(type, pin_count);
|
||||
jst_xh_socket(type, pin_count, true);
|
||||
else
|
||||
jst_xh_socket(type, pin_count);
|
||||
translate([0, y_offset])
|
||||
jst_xh_socket(type, pin_count);
|
||||
|
||||
color(pin_colour)
|
||||
for(x = [0 : pin_count - 1]) {
|
||||
pinWidth = hdr_pin_width(type);
|
||||
verticalPinLength = right_angle ? hdr_pin_below(type) + sizeY / 2 : hdr_pin_length(type);
|
||||
translate([pitch * (x - (pin_count - 1) / 2), 0, 0]) {
|
||||
verticalPinLength = right_angle ? hdr_pin_below(type) + ra_z + y_offset : hdr_pin_length(type);
|
||||
horizontalPinLength = hdr_pin_length(type) - hdr_pin_below(type) + ra_box_offset;
|
||||
translate([pitch * (x - (pin_count - 1) / 2), 0]) {
|
||||
pin(type, verticalPinLength);
|
||||
|
||||
if(right_angle) {
|
||||
translate([0, -pinWidth / 2, sizeY / 2 - pinWidth / 2])
|
||||
translate([0, -pinWidth / 2, ra_z - pinWidth / 2 + y_offset])
|
||||
rotate([0, -90, 0])
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
translate([0, -pinWidth / 2])
|
||||
square(pinWidth);
|
||||
|
||||
translate([0, -sizeY / 2 - 3 * pinWidth / 4, sizeY / 2])
|
||||
rotate([90,0,0])
|
||||
pin(type, hdr_pin_length(type) - hdr_pin_below(type));
|
||||
translate([0, -hdr_pin_below(type), ra_z + y_offset])
|
||||
rotate([90, 0, 0])
|
||||
pin(type, horizontalPinLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,15 +17,16 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
// p p b p p b Socket depth
|
||||
// i i e i i a
|
||||
// t n l n n s
|
||||
// c o e
|
||||
// h l w w c
|
||||
// c
|
||||
//
|
||||
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, "gold", grey(20), 8.5];
|
||||
jst_xh_header = ["JST XH header",2.5, 10, 3.4, 0.64, "gold", grey(90), 7];
|
||||
// p p b p p b s b b p r r
|
||||
// i i e i i a o o o i a a
|
||||
// t n l n n s c x x n
|
||||
// c o e k b h
|
||||
// h l w w c s t y
|
||||
// c h z o
|
||||
// f
|
||||
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, "gold", grey(20), 8.5, [0, 0, 8.7], 2.4, 0, 0, 0 ];
|
||||
jst_xh_header = ["jst_xh_header",2.5, 10, 3.4, 0.64, "gold", grey(90), 0, [4.9, 5.75, 7], 0.8, 0.525, 0.6, 6.1];
|
||||
jst_ph_header = ["jst_ph_header",2.0, 9, 3.4, 0.64, silver, grey(90), 0, [3.9, 4.5, 6], 0.6, 0.55, 0.25, 4.8];
|
||||
|
||||
pin_headers = [ 2p54header ];
|
||||
|
||||
|
@@ -35,7 +35,8 @@ GT2x12_pulley = ["GT2x12_pulley", "GT2RD", 12, 7.15, GT2x6, 6.5,
|
||||
GT2x20_toothed_idler = ["GT2x20_toothed_idler", "GT2", 20, 12.22, GT2x6, 6.5, 18, 0, 4, 18.0, 1.0, 0, 0, false, 0];
|
||||
GT2x20_plain_idler = ["GT2x20_plain_idler", "GT2", 0, 12.0, GT2x6, 6.5, 18, 0, 4, 18.0, 1.0, 0, 0, false, 0];
|
||||
GT2x16_toothed_idler = ["GT2x16_toothed_idler", "GT2", 16, 9.75, GT2x6, 6.5, 14, 0, 3, 14.0, 1.0, 0, 0, false, 0];
|
||||
GT2x16_plain_idler = ["GT2x16_plain_idler", "GT2", 0, 9.63, GT2x6, 7.0, 13, 0, 3, 13.0, 1.0, 0, 0, false, 0];
|
||||
GT2x16_plain_idler = ["GT2x16_plain_idler", "GT2", 0, 9.63, GT2x6, 6.5, 13, 0, 3, 13.0, 1.0, 0, 0, false, 0];
|
||||
GT2x16x7_plain_idler = ["GT2x16x7_plain_idler", "GT2", 0, 9.63, GT2x6, 7.0, 13, 0, 3, 13.0, 1.0, 0, 0, false, 0];
|
||||
|
||||
pulleys = [T5x10_pulley,
|
||||
T2p5x16_pulley,
|
||||
@@ -45,6 +46,7 @@ pulleys = [T5x10_pulley,
|
||||
GT2x20_toothed_idler,
|
||||
GT2x20_plain_idler,
|
||||
GT2x16_toothed_idler,
|
||||
GT2x16_plain_idler];
|
||||
GT2x16_plain_idler,
|
||||
GT2x16x7_plain_idler];
|
||||
|
||||
use <pulley.scad>
|
||||
|
65
vitamins/shaft_coupling.scad
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// 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/>.
|
||||
|
||||
//
|
||||
//! Shaft couplings
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/tube.scad>
|
||||
|
||||
function sc_length(type) = type[1]; //! Coupling length
|
||||
function sc_diameter(type) = type[2]; //! Coupling outer diameter
|
||||
function sc_diameter1(type) = type[3]; //! Diameter of smaller shaft
|
||||
function sc_diameter2(type) = type[4]; //! Diameter of larger shaft
|
||||
|
||||
module shaft_coupling(type, colour = "silver") { //! Draw the shaft coupling
|
||||
vitamin(str("shaft_coupling(", type[0], "): Shaft coupling ", type[0]));
|
||||
|
||||
length = sc_length(type);
|
||||
radius = sc_diameter(type) / 2;
|
||||
r1 = sc_diameter1(type) / 2;
|
||||
r2 = sc_diameter2(type) / 2;
|
||||
|
||||
grub_length = 3;
|
||||
module grub_screw_positions() {
|
||||
grub_offset_z = 5;
|
||||
for(z = [-length / 2 + grub_offset_z, length / 2 - grub_offset_z])
|
||||
translate_z(z)
|
||||
for(a = [0, 90])
|
||||
rotate([-90, 0, a])
|
||||
translate_z(radius + 1)
|
||||
children();
|
||||
}
|
||||
|
||||
color(colour) {
|
||||
render(convexity=2) difference() {
|
||||
union() {
|
||||
translate_z(-length / 2)
|
||||
tube(radius, r1, length / 2, false);
|
||||
|
||||
tube(radius, r2, length / 2, false);
|
||||
}
|
||||
grub_screw_positions()
|
||||
rotate([180, 0, 0])
|
||||
cylinder(r = screw_radius(M3_grub_screw), h = 5);
|
||||
}
|
||||
}
|
||||
|
||||
grub_screw_positions()
|
||||
not_on_bom() screw(M3_grub_screw, grub_length);
|
||||
}
|
29
vitamins/shaft_couplings.scad
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// 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/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Shaft couplings
|
||||
//
|
||||
|
||||
// L D d1 d2
|
||||
SC_5x8_rigid = [ "SC_5x8_rigid", 25, 12.5, 5, 8 ];
|
||||
|
||||
shaft_couplings = [SC_5x8_rigid];
|
||||
|
||||
use <shaft_coupling.scad>
|
@@ -62,9 +62,10 @@ module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified ```col
|
||||
intersection() {
|
||||
square([size.x, size.y], center = true);
|
||||
|
||||
for(end = [-1, 1])
|
||||
translate([end * size.x / 2, 0])
|
||||
ring(or = r, ir = r / 2);
|
||||
union()
|
||||
for(end = [-1, 1])
|
||||
translate([end * size.x / 2, 0])
|
||||
ring(or = r, ir = r / 2);
|
||||
}
|
||||
|
||||
color(colour, 0.9)
|
||||
|
@@ -23,8 +23,10 @@
|
||||
include <../core.scad>
|
||||
include <ring_terminals.scad>
|
||||
|
||||
include <../vitamins/pin_headers.scad>
|
||||
use <../utils/tube.scad>
|
||||
use <../utils/thread.scad>
|
||||
use <../utils/round.scad>
|
||||
use <washer.scad>
|
||||
use <rod.scad>
|
||||
|
||||
@@ -37,9 +39,10 @@ function NEMA_boss_height(type) = type[6]; //! Boss height
|
||||
function NEMA_shaft_dia(type) = type[7]; //! Shaft diameter
|
||||
function NEMA_shaft_length(type)= type[8]; //! Shaft length above the face, if a list then a leadscrew: length, lead, starts
|
||||
function NEMA_hole_pitch(type) = type[9]; //! Screw hole pitch
|
||||
function NEMA_cap_heights(type) = type[10]; //! Height of the end cap at the corner and the side
|
||||
|
||||
function NEMA_holes(type) = [-NEMA_hole_pitch(type) / 2, NEMA_hole_pitch(type) / 2]; //! Screw positions for for loop
|
||||
function NEMA_big_hole(type) = NEMA_boss_radius(type) + 0.2; //! Clearance hole for the big boss
|
||||
|
||||
stepper_body_colour = "black";
|
||||
stepper_cap_colour = grey(50);
|
||||
stepper_machined_colour = grey(90);
|
||||
@@ -52,19 +55,20 @@ module NEMA_outline(type) //! 2D outline
|
||||
circle(NEMA_radius(type));
|
||||
}
|
||||
|
||||
module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
module NEMA(type, shaft_angle = 0, jst_connector = false) { //! Draw specified NEMA stepper motor
|
||||
side = NEMA_width(type);
|
||||
length = NEMA_length(type);
|
||||
body_rad = NEMA_body_radius(type);
|
||||
boss_rad = NEMA_boss_radius(type);
|
||||
boss_height =NEMA_boss_height(type);
|
||||
shaft_rad = NEMA_shaft_dia(type) / 2;
|
||||
cap = 8;
|
||||
cap = NEMA_cap_heights(type)[1];
|
||||
cap2 = NEMA_cap_heights(type)[0];
|
||||
vitamin(str("NEMA(", type[0], "): Stepper motor NEMA", round(NEMA_width(type) / 2.54), " x ", length, "mm"));
|
||||
thread_d = 3; // Is this always the case?
|
||||
thread_d = 3; // Is this always the case?
|
||||
|
||||
module cap_shape(end)
|
||||
difference() {
|
||||
round(0.5, $fn = 32) difference() {
|
||||
intersection() {
|
||||
square([side, side], center = true);
|
||||
|
||||
@@ -92,12 +96,41 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
cap_shape(1);
|
||||
}
|
||||
|
||||
color(stepper_cap_colour) // aluminium end caps
|
||||
for(end = [-1, 1])
|
||||
pcb_thickness = 1.6;
|
||||
header = jst_ph_header;
|
||||
socket_size = hdr_box_size(header);
|
||||
tabSize = [16, 4, cap - hdr_ra_height(header) - pcb_thickness];
|
||||
color(stepper_cap_colour) { // aluminium end caps
|
||||
for(end = [-1, 1]) {
|
||||
translate_z(-length / 2 + end * (length - cap) / 2)
|
||||
linear_extrude(cap, center = true)
|
||||
cap_shape(end);
|
||||
|
||||
translate_z(-length / 2 + end * (length - cap2) / 2)
|
||||
linear_extrude(cap2, center = true)
|
||||
difference() {
|
||||
cap_shape(end);
|
||||
|
||||
circle(body_rad);
|
||||
}
|
||||
}
|
||||
|
||||
if(jst_connector)
|
||||
translate([-tabSize.x / 2, side / 2, -length])
|
||||
cube(tabSize);
|
||||
}
|
||||
|
||||
if(jst_connector)
|
||||
translate([0, side / 2, -length + cap - hdr_ra_height(header)]) {
|
||||
rotate(180)
|
||||
not_on_bom()
|
||||
jst_xh_header(header, 6, true);
|
||||
|
||||
translate_z(-pcb_thickness / 2)
|
||||
color("green")
|
||||
cube([socket_size.x + 5 * 2, tabSize.y * 2, pcb_thickness], true);
|
||||
}
|
||||
|
||||
if(show_threads)
|
||||
for(x = NEMA_holes(type), y = NEMA_holes(type))
|
||||
translate([x, y, -cap / 2])
|
||||
@@ -111,15 +144,16 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
|
||||
cylinder(r = shaft_rad, h = shaft + 5); // shaft
|
||||
else
|
||||
not_on_bom()
|
||||
leadscrew(shaft_rad * 2, shaft.x + 5, shaft.y, shaft.z, center = false)
|
||||
leadscrew(shaft_rad * 2, shaft.x + 5, shaft.y, shaft.z, center = false);
|
||||
|
||||
translate([0, side / 2, -length + cap / 2])
|
||||
rotate([90, 0, 0])
|
||||
for(i = [0 : 3])
|
||||
rotate(225 + i * 90)
|
||||
color(["red", "blue","green","black"][i])
|
||||
translate([1, 0, 0])
|
||||
cylinder(r = 1.5 / 2, h = 12, center = true);
|
||||
if(!jst_connector)
|
||||
translate([0, side / 2, -length + cap / 2])
|
||||
rotate([90, 0, 0])
|
||||
for(i = [0 : 3])
|
||||
rotate(225 + i * 90)
|
||||
color(["red", "blue","green","black"][i])
|
||||
translate([1, 0, 0])
|
||||
cylinder(r = 1.5 / 2, h = 12, center = true);
|
||||
}
|
||||
|
||||
module NEMA_screw_positions(type, n = 4) { //! Positions children at the screw holes
|
||||
|
@@ -22,14 +22,14 @@
|
||||
//
|
||||
|
||||
// corner body boss boss shaft
|
||||
// side, length, radius, radius, radius, depth, shaft, length, holes
|
||||
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31 ];
|
||||
NEMA17M = ["NEMA17M", 42.3, 40, 53.6/2, 25, 11, 2, 5, 20, 31 ];
|
||||
NEMA17M8= ["NEMA17M8", 42.3, 40, 53.6/2, 25, 11, 2, 8, [280, 8, 4], 31 ];
|
||||
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 31 ];
|
||||
NEMA16 = ["NEMA16", 39.5, 19.2, 50.6/2, 50.6/2, 11, 2, 5, 12, 31 ];
|
||||
NEMA14 = ["NEMA14", 35.2, 36, 46.4/2, 21, 11, 2, 5, 21, 26 ];
|
||||
NEMA23 = ["NEMA23", 56.4, 51.2, 75.7/2, 35, 38.1/2, 1.6, 6.35, 24, 47.1 ];
|
||||
// side, length, radius, radius, radius, depth, shaft, length, holes, cap heights
|
||||
NEMA17 = ["NEMA17", 42.3, 47, 53.6/2, 25, 11, 2, 5, 24, 31, [11.5, 9]];
|
||||
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]];
|
||||
NEMA17S = ["NEMA17S", 42.3, 34, 53.6/2, 25, 11, 2, 5, 24, 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]];
|
||||
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];
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
//! Tubing and sleeving. The internal diameter can be forced to stretch it over something.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <../utils/tube.scad>
|
||||
|
||||
function tubing_material(type) = type[1]; //! Material description
|
||||
function tubing_od(type) = type[2]; //! Outside diameter
|
||||
@@ -38,10 +39,15 @@ module tubing(type, length = 15, forced_id = 0, center = true) { //! Draw specif
|
||||
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " ID ", original_id, "mm x ",length, "mm"));
|
||||
else
|
||||
vitamin(str("tubing(", type[0], arg(length, 15), "): ", tubing_material(type), " OD ", original_od, "mm ID ", original_id,"mm x ",length, "mm"));
|
||||
color(tubing_colour(type))
|
||||
linear_extrude(length, center = center, convexity = 4)
|
||||
difference() {
|
||||
circle(d = od);
|
||||
circle(d = id);
|
||||
}
|
||||
|
||||
if(tubing_material(type) == "Carbon fiber")
|
||||
woven_tube(od / 2, id /2, length, colour = tubing_colour(type));
|
||||
else
|
||||
color(tubing_colour(type))
|
||||
linear_extrude(length, center = center, convexity = 4)
|
||||
difference() {
|
||||
circle(d = od);
|
||||
circle(d = id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,22 +19,23 @@
|
||||
|
||||
//
|
||||
// Tubing and sleeving
|
||||
//
|
||||
PVC64 = ["PVC64", "PVC aquarium tubing", 6, 4, [0.8, 0.8, 0.8, 0.75 ]];
|
||||
PVC85 = ["PVC85", "PVC aquarium tubing", 8, 5, [0.8, 0.8, 0.8, 0.75 ]];
|
||||
NEOP85 = ["NEOP85", "Neoprene tubing", 8, 5, [0.2,0.2,0.2]];
|
||||
PTFE07 = ["PTFE07", "PTFE sleeving", 1.2, 0.71, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE20 = ["PTFE20", "PTFE sleeving", 2.6, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE2_4 = ["PTFE2_4", "PTFE tubing", 4, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE2_3 = ["PTFE2_3", "PTFE tubing", 3, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE4_6 = ["PTFE4_6", "PTFE tubing", 6, 4, [0.95, 0.95, 0.95, 0.9]];
|
||||
PF7 = ["PF7", "PTFE tubing", 46/10, 3.84, [0.95, 0.95, 0.95, 0.9]];
|
||||
HSHRNK16 = ["HSHRNK16", "Heatshrink sleeving", 2.0, 1.6, "grey"];
|
||||
HSHRNK24 = ["HSHRNK24", "Heatshrink sleeving", 2.8, 2.4, "grey"];
|
||||
HSHRNK32 = ["HSHRNK32", "Heatshrink sleeving", 3.6, 3.2, "grey"];
|
||||
HSHRNK64 = ["HSHRNK64", "Heatshrink sleeving", 6.8, 6.4, "grey"];
|
||||
HSHRNK100 = ["HSHRNK100", "Heatshrink sleeving",10.4, 10.0, [0.2,0.2,0.2]];
|
||||
// Description OD ID Colour
|
||||
PVC64 = ["PVC64", "PVC aquarium tubing", 6, 4, [0.8, 0.8, 0.8, 0.75 ]];
|
||||
PVC85 = ["PVC85", "PVC aquarium tubing", 8, 5, [0.8, 0.8, 0.8, 0.75 ]];
|
||||
NEOP85 = ["NEOP85", "Neoprene tubing", 8, 5, [0.2,0.2,0.2]];
|
||||
PTFE07 = ["PTFE07", "PTFE sleeving", 1.2, 0.71, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE20 = ["PTFE20", "PTFE sleeving", 2.6, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE2_4 = ["PTFE2_4", "PTFE tubing", 4, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE2_3 = ["PTFE2_3", "PTFE tubing", 3, 2, [0.95, 0.95, 0.95, 0.9]];
|
||||
PTFE4_6 = ["PTFE4_6", "PTFE tubing", 6, 4, [0.95, 0.95, 0.95, 0.9]];
|
||||
PF7 = ["PF7", "PTFE tubing", 46/10, 3.84, [0.95, 0.95, 0.95, 0.9]];
|
||||
HSHRNK16 = ["HSHRNK16", "Heatshrink sleeving", 2.0, 1.6, "grey"];
|
||||
HSHRNK24 = ["HSHRNK24", "Heatshrink sleeving", 2.8, 2.4, "grey"];
|
||||
HSHRNK32 = ["HSHRNK32", "Heatshrink sleeving", 3.6, 3.2, "grey"];
|
||||
HSHRNK64 = ["HSHRNK64", "Heatshrink sleeving", 6.8, 6.4, "grey"];
|
||||
HSHRNK100 = ["HSHRNK100", "Heatshrink sleeving",10.4, 10.0, [0.2,0.2,0.2]];
|
||||
CARBONFIBER10 = ["CBNFIB10", "Carbon fiber", 10.0, 8.0, [0.3,0.3,0.3]];
|
||||
|
||||
tubings = [PVC64, PVC85, NEOP85, PTFE07, PTFE20, PF7, PTFE2_3, PTFE2_4, PTFE4_6, HSHRNK16, HSHRNK24, HSHRNK64, HSHRNK100];
|
||||
tubings = [PVC64, PVC85, NEOP85, PTFE07, PTFE20, PF7, PTFE2_3, PTFE2_4, PTFE4_6, HSHRNK16, HSHRNK24, HSHRNK64, HSHRNK100, CARBONFIBER10];
|
||||
|
||||
use <tubing.scad>
|
||||
|