1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 20:32:35 +02:00

Compare commits

...

19 Commits

Author SHA1 Message Date
Chris Palmer
8435a350d0 Merge branch 'martinbudden-sk_brackets' 2020-02-23 17:32:54 +00:00
Chris Palmer
3e5d4b1c8e Added to lib.scad. 2020-02-23 17:12:47 +00:00
Chris Palmer
20f830a008 Added image and updated readme. 2020-02-23 16:46:27 +00:00
Chris Palmer
10bd8ff354 Merge branch 'sk_brackets' of https://github.com/martinbudden/NopSCADlib into martinbudden-sk_brackets 2020-02-23 16:22:11 +00:00
Chris Palmer
4459cca3ea Merge branch 'martinbudden-screw_length_formatting' 2020-02-23 16:16:30 +00:00
Chris Palmer
95bbebd42d Updated readme. 2020-02-23 16:16:09 +00:00
Chris Palmer
28c795e9f4 Merge branch 'screw_length_formatting' of https://github.com/martinbudden/NopSCADlib into martinbudden-screw_length_formatting 2020-02-23 15:24:43 +00:00
Chris Palmer
9a0477d16b Merge branch 'martinbudden-pcb_microswitch2' 2020-02-23 15:22:43 +00:00
Chris Palmer
0583da2eb7 Added images 2020-02-23 15:22:25 +00:00
Chris
9a08fe9b5c Merge branch 'master' into pcb_microswitch2 2020-02-23 15:10:13 +00:00
Chris Palmer
8ab7993148 Merge branch 'martinbudden-rocker_color' 2020-02-23 15:03:23 +00:00
Chris Palmer
16dd8d6d17 Added images and readme. 2020-02-23 15:02:39 +00:00
Chris Palmer
08c268145e Merge branch 'rocker_color' of https://github.com/martinbudden/NopSCADlib into martinbudden-rocker_color 2020-02-23 14:52:11 +00:00
Chris Palmer
ba7e64233a Clarified path settings in usage.md. 2020-02-23 14:46:39 +00:00
Martin Budden
c5038db6d9 Added support for tNuts in sk_brackets. 2020-02-23 14:32:40 +00:00
Martin Budden
a08216d0b8 Added SK shaft support brackets. 2020-02-23 13:57:14 +00:00
Martin Budden
a793cb6d43 Added ability to use microswitch on a pcb. 2020-02-17 06:58:09 +00:00
Martin Budden
8f85ac73dc Added space before screw length when length < 10 to ensure correct ordering.
This means 5mm, 6mm etc comes before 10mm in BOM.
2020-02-16 21:15:44 +00:00
Martin Budden
f5fdec613c Allow setting of color of rocker switch. Defaults to current colors. 2020-01-29 17:46:32 +00:00
16 changed files with 286 additions and 50 deletions

View File

@@ -26,7 +26,7 @@ OpenSCAD has to be setup to find libraries by setting the ```OPENSCADPATH``` env
in the directory it points to. This can be done with ```git clone https://github.com/nophead/NopSCADlib.git``` while in that directory or, if you don't want to use GIT,
by downloading https://github.com/nophead/NopSCADlib/archive/master.zip and unzipping it to a directory called NopSCADlib.
The ```NopSCADlib/scripts``` directory needs to be added to the executable search path.
The ```NopSCADlib/scripts``` directory needs to be added to the executable search path, ```PATH``` on Windows and ```path``` on Linux and Mac.
The installation can be tested by opening ```NopSCADlib/libtest.scad``` in the OpenSCAD GUI. It should render all the objects in the library in about 1 minute.

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 KiB

After

Width:  |  Height:  |  Size: 766 KiB

View File

@@ -254,7 +254,7 @@ buttons_y = spades_y + 40;
jacks_y = buttons_y + 40;
microswitches_y = jacks_y + 40;
rockers_y = microswitches_y + 40;
toggles_y = rockers_y + 40;
toggles_y = rockers_y + 60;
components_y = toggles_y + 40;
translate([x2, leds_y])

118
readme.md
View File

@@ -33,20 +33,20 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<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 = "#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 = "#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 = "#Thread">Thread</a> </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> <a href = "#Tube">Tube</a> </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 = "#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 = "#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 = "#Jack">Jack</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</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 = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Transformers">Transformers</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 = "#Light_strips">Light_strips</a> </td><td> <a href = "#Variacs">Variacs</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 = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Washers">Washers</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 = "#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 = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sk_brackets">Sk_brackets</a> </td><td> <a href = "#Screw_knob">Screw_knob</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 = "#Socket_box">Socket_box</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 = "#Ssr_shroud">Ssr_shroud</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 = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></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 = "#Leadnuts">Leadnuts</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 = "#Light_strips">Light_strips</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 = "#Mains_sockets">Mains_sockets</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 = "#Microswitches">Microswitches</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 = "#Modules">Modules</a> </td><td></td><td></td><td></td><td></td></tr>
</table>
@@ -213,7 +213,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
| 2 | ```pulley(GT2x16_plain_idler)``` | Pulley GT2 idler smooth 9.63mm |
| 2 | ```pulley(GT2x20ob_pulley)``` | Pulley GT2OB 20 teeth |
| 1 | ```screw(M3_cs_cap_screw, 20)``` | Screw M3 cs cap x 20mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
<a href="#top">Top</a>
@@ -2027,10 +2027,10 @@ Face order is bottom, top, left, right, front, back.
| 1 | ```psu(PD_150_12)``` | PSU PD-150-12 |
| 1 | ```psu(S_250_48)``` | PSU S-250-48 |
| 1 | ```psu(S_300_12)``` | PSU S-300-12 |
| 4 | ```screw(No632_pan_screw, 8)``` | Screw 6-32 pan x 8mm |
| 4 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 8 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 4 | ```screw(No632_pan_screw, 8)``` | Screw 6-32 pan x 8mm |
| 4 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 8 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 8 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -2096,10 +2096,10 @@ Timing belt pulleys, both toothed and plain with internal bearings for idlers.
| 1 | ```pulley(GT2x20um_pulley)``` | Pulley GT2UM 20 teeth |
| 1 | ```pulley(T2p5x16_pulley)``` | Pulley T2.5 16 teeth |
| 1 | ```pulley(T5x10_pulley)``` | Pulley T5 10 teeth |
| 1 | ```screw(M3_grub_screw, 3)``` | Screw M3 grub x 3mm |
| 2 | ```screw(M3_grub_screw, 4)``` | Screw M3 grub x 4mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M3_grub_screw, 3)``` | Screw M3 grub x 3mm |
| 2 | ```screw(M3_grub_screw, 4)``` | Screw M3 grub x 4mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
<a href="#top">Top</a>
@@ -2259,7 +2259,7 @@ Rocker switch. Also used for neon indicator in the same form factor.
| ```rocker_height(type)``` | Body height |
| ```rocker_part(type)``` | Part description |
| ```rocker_pivot(type)``` | Pivot distance from the back of the flange |
| ```rocker_slot_h(type)``` | Panel slow height |
| ```rocker_slot_h(type)``` | Panel slot height |
| ```rocker_slot_w(type)``` | Panel slot width |
| ```rocker_spades(type)``` | Spade types and positions |
| ```rocker_width(type)``` | Body width |
@@ -2267,7 +2267,7 @@ Rocker switch. Also used for neon indicator in the same form factor.
### Modules
| Module | Description |
|:--- |:--- |
| ```rocker(type)``` | Draw the specified rocker switch |
| ```rocker(type, colour)``` | Draw the specified rocker switch |
| ```rocker_hole(type, h = 0)``` | Make a hole to accept a rocker switch, by default 2D, set h for 3D |
![rockers](tests/png/rockers.png)
@@ -2275,8 +2275,8 @@ Rocker switch. Also used for neon indicator in the same form factor.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```rocker(neon_indicator)``` | Neon Indicator H8630FBNAL |
| 1 | ```rocker(small_rocker)``` | Rocker Switch PRASA1-16F-BB0BW |
| 2 | ```rocker(neon_indicator)``` | Neon Indicator H8630FBNAL |
| 2 | ```rocker(small_rocker)``` | Rocker Switch PRASA1-16F-BB0BW |
<a href="#top">Top</a>
@@ -2384,14 +2384,14 @@ Machine screws and wood screws with various head styles.
| 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 1 | ```screw(M3_cs_cap_screw, 10)``` | Screw M3 cs cap x 10mm |
| 1 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 1 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M3_hex_screw, 10)``` | Screw M3 hex x 10mm |
| 1 | ```screw(M3_low_cap_screw, 10)``` | Screw M3 low cap x 10mm |
| 1 | ```screw(M3_pan_screw, 10)``` | Screw M3 pan x 10mm |
| 1 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 1 | ```screw(M4_cs_cap_screw, 25)``` | Screw M4 cs cap x 25mm |
| 1 | ```screw(M4_dome_screw, 25)``` | Screw M4 dome x 25mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M4_hex_screw, 30)``` | Screw M4 hex x 30mm |
| 1 | ```screw(M4_pan_screw, 30)``` | Screw M4 pan x 30mm |
| 1 | ```screw(M5_cap_screw, 30)``` | Screw M5 cap x 30mm |
@@ -2497,6 +2497,54 @@ Note that modules that drill holes will return a 2D object if ```h``` is set to
| 1 | ```sheet(Steel06, 30, 30, 2)``` | Sheet mild steel 30mm x 30mm x 0.6mm |
<a href="#top">Top</a>
---
<a name="Sk_brackets"></a>
## Sk_brackets
SK shaft support brackets
[vitamins/sk_brackets.scad](vitamins/sk_brackets.scad) Object definitions.
[vitamins/sk_bracket.scad](vitamins/sk_bracket.scad) Implementation.
[tests/sk_brackets.scad](tests/sk_brackets.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```sk_base_height(type)``` | Height of base containing the screws |
| ```sk_diameter(type)``` | Rod hole diameter |
| ```sk_hole_offset(type)``` | Rod hole offset |
| ```sk_screw_separation(type)``` | Separation of screws in the base |
### Functions
| Function | Description |
|:--- |:--- |
| ```sk_size(type)``` | Size of bracket |
### Modules
| Module | Description |
|:--- |:--- |
| ```sk_bracket(type)``` | SK shaft support bracket |
| ```sk_bracket_assembly(type, screw_length = 16, screw_type = M5_cap_screw, nut_type = undef)``` | Assembly with fasteners in place |
![sk_brackets](tests/png/sk_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 4 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```sk_bracket(SK10)``` | SK10 shaft support bracket |
| 1 | ```sk_bracket(SK12)``` | SK12 shaft support bracket |
| 1 | ```sk_bracket(SK16)``` | SK16 shaft support bracket |
| 1 | ```sk_bracket(SK8)``` | SK8 shaft support bracket |
| 8 | ```screw(M5_cap_screw, 16)``` | Screw M5 cap x 16mm |
| 12 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -2713,7 +2761,7 @@ NEMA stepper motor model.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 24 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 24 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 1 | ```NEMA(NEMA14)``` | Stepper motor NEMA14 x 36mm |
| 1 | ```NEMA(NEMA16)``` | Stepper motor NEMA16 x 19.2mm |
| 1 | ```NEMA(NEMA17S)``` | Stepper motor NEMA17 x 34mm |
@@ -3507,7 +3555,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 3 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 3 | ```screw(M4_dome_screw, 12)``` | Screw M4 dome x 12mm |
@@ -3727,7 +3775,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 3 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 3 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
@@ -3871,7 +3919,7 @@ inserts don't grip well in rubber.
| ---:|:--- |:---|
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
| 1 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -4286,7 +4334,7 @@ be fully customised by passing a list of properties.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 2 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 2 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 2 | ```washer(M3_penny_washer)``` | Washer penny M3 x 12mm x 0.8mm |
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
@@ -4758,7 +4806,7 @@ heirachical BOMs are also generated for real projects.
| ---:|:--- |:---|
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```widget(3)``` | Rivit like thing for 3mm sheets |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```sheet(PMMA3, 20, 20, 1)``` | Sheet acrylic 20mm x 20mm x 3mm |
| 1 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 1 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 75 KiB

BIN
tests/png/sk_brackets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -21,9 +21,13 @@ use <../utils/layout.scad>
include <../vitamins/rockers.scad>
module rockers()
layout([for(r = rockers) rocker_flange_w(r)], 5)
module rockers() {
layout([for(r = rockers) rocker_flange_w(r)], 5) {
rocker(rockers[$i]);
translate([0, 25])
rocker(rockers[$i], $i==0 ? "red" : "green");
}
}
if($preview)
rockers();

32
tests/sk_brackets.scad Normal file
View File

@@ -0,0 +1,32 @@
//
// 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>
use <../utils/layout.scad>
include <../vitamins/sk_brackets.scad>
module sk_brackets() {
nuts = [undef, M5_nut, M5_sliding_t_nut, M5_sliding_t_nut];
layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]])
sk_bracket_assembly(sk_brackets[$i], nut_type = nuts[$i]);
}
if($preview)
sk_brackets();

View File

@@ -27,6 +27,7 @@ include <screws.scad>
include <buttons.scad>
include <green_terminals.scad>
include <pin_headers.scad>
include <microswitches.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/dogbones.scad>
@@ -736,6 +737,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
color(comp[7]) if(!cutouts) translate_z(comp[6] / 2) cube([comp[4], comp[5], comp[6]], center = true);
else if(comp[8]) translate([-50, 0, comp[6] / 2 - panel_clearance]) cube([100, comp[5] + 2 * panel_clearance, comp[6] + 2 * panel_clearance], center = true);
if(show(comp, "button_6mm")) square_button(button_6mm);
if(show(comp, "microswitch")) translate_z(microswitch_thickness(comp[4])/2) microswitch(comp[4]);
if(show(comp, "pcb")) if(!cutouts) translate_z(comp[4]) pcb(comp[5]);
if(show(comp, "standoff")) if(!cutouts) standoff(comp[4], comp[5], comp[6], comp[7]);
if(show(comp, "uSD")) uSD(comp[4], cutouts);

View File

@@ -17,6 +17,7 @@
// If not, see <https://www.gnu.org/licenses/>.
//
include <screws.scad>
include <microswitches.scad>
//
// l w t r h l c b h
// e i h a o a o o o
@@ -284,7 +285,6 @@ ArduinoLeonardo = ["ArduinoLeonardo", "Arduino Leonardo", 68.58, 53.34, 1.6, 0,
M2p5_pan_screw
];
Keyes5p1 = ["Keyes5p1", "Keyes5.1 Arduino Uno expansion board", 68.58, 53.34, 1.6, 0, 3.3, 0, "#2140BE", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],
[[30.226, -2.54, 0, "-2p54header", 10, 1],
[54.61, -2.54, 0, "-2p54header", 8, 1],
@@ -339,20 +339,18 @@ PERF74x51 = ["PERF74x51", "Perfboard 74 x 51mm", 74, 51, 1.0, 0, 3.0, 0, "sienna
PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3.5, 3.5], [-3.5, 3.5], [-3.5, -3.5], [3.5, -3.5]], [], []];
include <microswitches.scad>
RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
40.0, 16.0, 1.6, 0, 2.54, 0, "red", false,
[
[2, 2], [2, 13.5], [17, 13.5], [36, 13.5]
],
[
[ 12, 8, -90, "jst_xh", 3, true, "white", "silver"],
[ 26, 13.5, 0, "chip", 12, 4, 5.5],
[ 26, 10.5, 0, "chip", 12, 2, 5.5, "white"],
[ 27.5, 17, 15, "chip", 15, 0.5, 4.5, "silver"],
[ 26.5, 12.75, 0, "microswitch", small_microswitch],
],
[]];
pcbs = [ExtruderPCB, PI_IO, RPI0, EnviroPlus, RPI3, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591, RAMPSEndstop];
use <pcb.scad>

View File

@@ -25,7 +25,7 @@ use <spade.scad>
function rocker_part(type) = type[1]; //! Part description
function rocker_slot_w(type) = type[2]; //! Panel slot width
function rocker_slot_h(type) = type[3]; //! Panel slow height
function rocker_slot_h(type) = type[3]; //! Panel slot height
function rocker_flange_w(type) = type[4]; //! Flange width
function rocker_flange_h(type) = type[5]; //! Flange height
function rocker_flange_t(type) = type[6]; //! Flange thickness
@@ -37,7 +37,7 @@ function rocker_pivot(type) = type[11]; //! Pivot distance from the back of
function rocker_button(type) = type[12]; //! How far the button extends from the bezel
function rocker_spades(type) = type[13]; //! Spade types and positions
module rocker(type) { //! Draw the specified rocker switch
module rocker(type, colour) { //! Draw the specified rocker switch
vitamin(str("rocker(", type[0], "): ", rocker_part(type)));
bezel = rocker_bezel(type);
@@ -65,7 +65,7 @@ module rocker(type) { //! Draw the specified rocker switch
rounded_rectangle([rocker_width(type), rocker_height(type), rocker_depth(type) + eps], 0.5, center = false);
}
if(rocker_pivot(type))
color(grey30)
color(colour ? colour : grey30)
translate_z(rocker_pivot(type))
rotate([90, 0, 90])
linear_extrude(height = rocker_w, center = true)
@@ -78,7 +78,7 @@ module rocker(type) { //! Draw the specified rocker switch
}
else
color("red") cube([rocker_w, rocker_h, 2 * (rocker_flange_t(type) + rocker_button(type))], center = true);
color(colour ? colour : "red") cube([rocker_w, rocker_h, 2 * (rocker_flange_t(type) + rocker_button(type))], center = true);
for(spade = rocker_spades(type))
translate([spade[2], spade[3], -rocker_depth(type)])

View File

@@ -59,7 +59,7 @@ function screw_shorter_than(x) = x >= 20 ? floor(x / 5) * 5 : //! Returns longes
function screw_smaller_than(d) = d >= 2.5 && d < 3 ? 2.5 : floor(d); // Largest diameter screw less than or equal to specified diameter
module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified screw, optionally hobbed or nylon
description = str("Screw ", nylon ? "Nylon " : "", type[1], " x ", length, "mm", hob_point ? str(", hobbed at ", hob_point) : "");
description = str("Screw ", nylon ? "Nylon " : "", type[1], length < 10 ? " x " : " x ", length, "mm", hob_point ? str(", hobbed at ", hob_point) : "");
vitamin(str("screw(", type[0], "_screw, ", length, arg(hob_point, 0, "hob_point"), arg(nylon, false, "nylon"), "): ", description));
head_type = screw_head_type(type);

116
vitamins/sk_bracket.scad Normal file
View File

@@ -0,0 +1,116 @@
//
// 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/>.
//
//! SK shaft support brackets
//
include <../core.scad>
include <../utils/fillet.scad>
include <screws.scad>
use <washer.scad>
sk_bracket_color = grey70;
function sk_diameter(type) = type[1]; //! Rod hole diameter
function sk_hole_offset(type) = type[2]; //! Rod hole offset
function sk_size(type) = [type[4],type[6],type[5]]; //! Size of bracket
function sk_base_height(type) = type[7]; //! Height of base containing the screws
function sk_screw_separation(type) = type[9]; //! Separation of screws in the base
module sk_bracket(type) { //! SK shaft support bracket
vitamin(str("sk_bracket(", type[0], "): SK", sk_diameter(type), " shaft support bracket"));
d = type[1];
h = type[2];
E = type[3];
W = type[4];
L = type[5];
F = type[6];
G = type[7];
P = type[8];
B = type[9];
S = type[10];
bolthole_radius = type[11];
color(sk_bracket_color) {
translate([0 , -h, 0]) {
fillet = 0.5;
rotate([-90, 0, 0])
linear_extrude(G)
difference() {
translate([-(W - 2*fillet) / 2, -L / 2, 0])
square([W - 2 * fillet, L]);
translate([-B / 2, 0])
circle(r = bolthole_radius);
translate([B / 2, 0])
circle(r = bolthole_radius);
}
for(x = [W / 2 - 2 * fillet, -W / 2 + 2 * fillet])
translate([x, G / 2, 0])
rounded_rectangle([4 * fillet, G, L], fillet);
}
translate([0, -h, -L /2])
linear_extrude(L) {
fillet = 0.75;
difference() {
translate([-P / 2, 0])
rounded_square([P, F], fillet, center = false);
cut_width = 1;
translate([-cut_width / 2, h + cut_width])
square([cut_width, F - h]);
translate([0, h])
circle(d = d);
}
translate([P/2,G])
fillet(fillet, 0);
translate([-P/2,G])
rotate(90)
fillet(fillet, 0);
}
}
// Add the retaining bolt. No hole was cut, since it is only for display.
color(grey20)
translate([P / 2 - screw_head_height(M3_cap_screw) / 2, (F - h + d / 2) / 2, 0])
rotate([0,90,0])
not_on_bom() no_explode()
screw(M3_cap_screw, P - screw_head_height(M3_cap_screw) / 2 + eps);
}
module sk_bracket_assembly(type, screw_length = 16, screw_type = M5_cap_screw, nut_type = undef) { //! Assembly with fasteners in place
sk_bracket(type);
nut_type = is_undef(nut_type) ? screw_nut(screw_type) : nut_type;
for (x = [-sk_screw_separation(type), sk_screw_separation(type)])
translate([x / 2, sk_base_height(type) - sk_hole_offset(type), 0])
rotate([-90, 0, 0]) {
screw_and_washer(screw_type, screw_length);
translate_z(-screw_length + 2 * washer_thickness(screw_washer(screw_type)))
if(nut_type == M5_sliding_t_nut)
translate_z(nut_thickness(nut_type))
vflip()
sliding_t_nut(nut_type);
else
nut(nut_type)
washer(nut_washer(nut_type));
}
}

35
vitamins/sk_brackets.scad Normal file
View File

@@ -0,0 +1,35 @@
//
// 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/>.
//
//
// SK shaft support brackets
//
include <../core.scad>
include <../vitamins/screws.scad>
// d h E W L F G P B S bolthole
SK8 = ["SK8", 8, 20, 21, 42, 14, 32.8, 6, 18, 32, 5.5, M5_clearance_radius];
SK10 = ["SK10", 10, 20, 21, 42, 14, 32.8, 6, 18, 32, 5.5, M5_clearance_radius];
SK12 = ["SK12", 12, 23, 21, 42, 14, 37.5, 6, 18, 32, 5.5, M5_clearance_radius];
SK16 = ["SK16", 16, 27, 24, 48, 16, 44.0, 8, 25, 38, 5.5, M5_clearance_radius];
sk_brackets = [SK8, SK10, SK12, SK16];
use <sk_bracket.scad>