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

Compare commits

...

59 Commits

Author SHA1 Message Date
Chris Palmer
8bb4b3881e Fixed test, image and readme updated. 2020-02-26 15:24:33 +00:00
Chris Palmer
79f8bc66e1 Merge branch 'Drachenkaetzchen-patch-1' of https://github.com/Drachenkaetzchen/NopSCADlib into Drachenkaetzchen-Drachenkaetzchen-patch-1 2020-02-26 14:58:27 +00:00
Chris Palmer
33c9d158ef REmoved fans.scad from lib.scad as already included from psus.scad. 2020-02-26 14:03:46 +00:00
Chris Palmer
d2874a0531 Moved washers.scad from screws.scad to nuts.scad.
Moved screw_insert() from inserts.scad to screw.scad.
Changed most includes of inserts.scad to use insert.scad.
Removed linear_bearings, iecs, rockers and microswitches from lib.scad as
already included by other vitamins.
2020-02-26 13:46:11 +00:00
Felicia Hummel
b6fd795a25 Updated readme to reflect the pillow block changes 2020-02-26 13:02:17 +01:00
Felicia Hummel
ad0882db40 Added 15mm and 18mm variants for the KP08 blocks 2020-02-26 12:57:53 +01:00
Chris Palmer
8afb08aaa4 Updated image 2020-02-26 10:23:05 +00:00
Martin Budden
f104bd42e5 Added back jst_xh connector to ramps endstop. 2020-02-25 21:38:53 +00:00
Chris Palmer
c1833f0820 Updated image and readme. 2020-02-25 13:42:31 +00:00
Chris Palmer
6a7f7dcbbf Merge branch 'sk_bracket_screw_length' of https://github.com/martinbudden/NopSCADlib into martinbudden-sk_bracket_screw_length 2020-02-25 12:34:19 +00:00
Chris Palmer
5d3f1115bb Updated readme and images 2020-02-25 11:11:05 +00:00
Chris Palmer
9f9adeb6ca Merge branch 'teardrop_chamfer' of https://github.com/martinbudden/NopSCADlib into martinbudden-teardrop_chamfer 2020-02-25 09:44:38 +00:00
Chris Palmer
f9b06c855c Merge branch 'martinbudden-kp_pillow_block' 2020-02-25 09:32:55 +00:00
Chris Palmer
05bfe9b159 Updated and images. 2020-02-25 09:32:40 +00:00
Martin Budden
f961874ce3 Added kp_pillow_blocks. 2020-02-25 07:55:47 +00:00
Martin Budden
7a6210f442 Add optional chamfer to teardrops. Defaults to no chamfer. 2020-02-25 07:46:57 +00:00
Martin Budden
5bae0aaa51 Better sk_bracket screw length calculation. 2020-02-25 07:33:07 +00:00
Chris Palmer
8649d59e8a Merge branch 'martinbudden-print_search_path' 2020-02-25 00:05:12 +00:00
Chris Palmer
e9bc300b8d Fix for printed directory not present. 2020-02-24 23:58:22 +00:00
Chris Palmer
dcb1e74894 Merge branch 'print_search_path' of https://github.com/martinbudden/NopSCADlib into martinbudden-print_search_path 2020-02-24 19:02:50 +00:00
Chris Palmer
42b9479094 Merge branch 'martinbudden-tnuts_and_hammer_nuts' 2020-02-24 18:37:40 +00:00
Chris Palmer
f46f35e909 Updated readme 2020-02-24 18:37:25 +00:00
Chris Palmer
0513b151b2 Merge branch 'tnuts_and_hammer_nuts' of https://github.com/martinbudden/NopSCADlib into martinbudden-tnuts_and_hammer_nuts 2020-02-24 18:22:05 +00:00
Chris Palmer
dcf258f11a Brass colour now distinct from gold. 2020-02-24 18:15:20 +00:00
Martin Budden
4ff6c7d0a8 Unified tnuts and hammer nuts. 2020-02-24 17:40:39 +00:00
Chris Palmer
2edb6d4df2 Shorter screws when using T-nut but mignt not be a suitable standard size. 2020-02-24 12:01:40 +00:00
Chris Palmer
26e8497018 Merge branch 'martinbudden-sk_brackets_tidy' 2020-02-24 11:42:07 +00:00
Chris Palmer
bfde879ce2 Updated readme and images. 2020-02-24 11:41:39 +00:00
Chris Palmer
4641e3a642 More nut and screw types 2020-02-24 11:40:30 +00:00
Chris Palmer
42cfed8846 Set default part thickness to 2. 2020-02-24 11:38:31 +00:00
Chris Palmer
8c339a18c4 Removed washers from T-nuts and used the lack to detect them. 2020-02-24 11:23:10 +00:00
Chris Palmer
065ec0a430 Corrected nut placement 2020-02-24 11:18:34 +00:00
Chris Palmer
e7eea0520c T nut thickness no longer includes the stem to simplyfy placement and screw
length calculations.
2020-02-24 11:14:30 +00:00
Chris Palmer
5cb994b58b Retabulated nut table 2020-02-24 10:21:37 +00:00
Chris Palmer
573425055a Fixed origin of T-nuts to be consistent with others.
I.e the mating face is at Z = 0.
2020-02-24 09:11:59 +00:00
Chris Palmer
66a7a9bfe0 Used named elements of size. 2020-02-24 08:57:22 +00:00
Chris Palmer
0335545334 Merge branch 'sk_brackets_tidy' of https://github.com/martinbudden/NopSCADlib into martinbudden-sk_brackets_tidy 2020-02-24 08:38:16 +00:00
Chris Palmer
fa91acbaad Merge branch 'martinbudden-scs_bearing_blocks' 2020-02-24 00:03:42 +00:00
Chris Palmer
8bad05e721 Added to lib.scad 2020-02-24 00:00:32 +00:00
Chris Palmer
9d6727d371 Added images and readme 2020-02-23 23:57:18 +00:00
Chris Palmer
8902d83f0a Merge branch 'scs_bearing_blocks' of https://github.com/martinbudden/NopSCADlib into martinbudden-scs_bearing_blocks 2020-02-23 23:40:02 +00:00
Martin Budden
e40b10f5a0 Added comment. 2020-02-23 23:08:34 +00:00
Martin Budden
66a8d1d583 Tidy of sk_brackets as per scs_bearing_blocks code review. 2020-02-23 22:56:47 +00:00
Martin Budden
d066648a76 Renamed sheet_thickness to part_thickness. 2020-02-23 22:34:59 +00:00
Chris Palmer
b8546414c0 Fixed leadscrew when center = false. 2020-02-23 21:54:26 +00:00
Martin Budden
581c2f8a96 Used accessor functions internally. 2020-02-23 21:49:35 +00:00
Martin Budden
e9ee88dfe9 Updates as per code review. 2020-02-23 21:41:47 +00:00
Martin Budden
b07a8ad245 Added SCS bearing blocks, SCSnUU and SCSnLUU variants 2020-02-23 21:06:38 +00:00
Chris Palmer
ab17de3b0b Merge branch 'martinbudden-green_terminals' 2020-02-23 19:53:10 +00:00
Chris Palmer
0b8141844c Updated readme. 2020-02-23 19:52:18 +00:00
Chris Palmer
7d0548b033 Merge branch 'green_terminals' of https://github.com/martinbudden/NopSCADlib into martinbudden-green_terminals 2020-02-23 19:49:16 +00:00
Martin Budden
ad3e8d85af Added scad/printed to stl search path. 2020-02-23 17:54:28 +00:00
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
Martin Budden
cc84a5a536 Added comments and ability to set colour to green terminals. 2020-02-23 15:38:02 +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
73 changed files with 1146 additions and 280 deletions

View File

@@ -60,7 +60,8 @@ grey60 = [0.6, 0.6, 0.6];
grey70 = [0.7, 0.7, 0.7];
grey80 = [0.8, 0.8, 0.8];
grey90 = [0.9, 0.9, 0.9];
brass = [255/255, 215/255, 0/255];
gold = [255/255, 215/255, 0/255];
brass = [255/255, 220/255, 100/255];
silver = [0.75, 0.75, 0.75];
/*

View File

@@ -22,7 +22,7 @@
//
include <core.scad>
include <vitamins/fans.scad>
include <vitamins/psus.scad>
include <vitamins/inserts.scad>
include <vitamins/ring_terminals.scad>
include <vitamins/rails.scad>
@@ -34,14 +34,11 @@ include <vitamins/components.scad>
include <vitamins/hot_ends.scad>
include <vitamins/tubings.scad>
include <vitamins/zipties.scad>
include <vitamins/linear_bearings.scad>
include <vitamins/scs_bearing_blocks.scad>
include <vitamins/rod.scad>
include <vitamins/leadnuts.scad>
include <vitamins/bulldogs.scad>
include <vitamins/pillars.scad>
include <vitamins/psus.scad>
include <vitamins/iecs.scad>
include <vitamins/rockers.scad>
include <vitamins/ssrs.scad>
include <vitamins/d_connectors.scad>
include <vitamins/buttons.scad>
@@ -55,7 +52,6 @@ include <vitamins/transformers.scad>
include <vitamins/variacs.scad>
include <vitamins/springs.scad>
include <vitamins/batteries.scad>
include <vitamins/microswitches.scad>
include <vitamins/ball_bearings.scad>
include <vitamins/light_strips.scad>
include <vitamins/spools.scad>
@@ -63,6 +59,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>

View File

@@ -35,8 +35,7 @@ include <../core.scad>
use <../vitamins/sheet.scad>
use <../vitamins/screw.scad>
use <../vitamins/washer.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../utils/quadrant.scad>
bezel_clearance = 0.2;

View File

@@ -32,7 +32,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/maths.scad>

View File

@@ -32,7 +32,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../utils/maths.scad>
def_screw = M3_cap_screw;

View File

@@ -23,7 +23,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
foot = [25, 12, 3, 2, M4_cap_screw, 10];
insert_foot = [20, 10, 0, 2, M3_cap_screw, 10];

View File

@@ -22,7 +22,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
dia = 18;
length = 90; // inside length

View File

@@ -23,7 +23,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../vitamins/wire.scad>
use <../vitamins/psu.scad>

View File

@@ -22,7 +22,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../vitamins/cable_strip.scad>
wall = 2;

View File

@@ -23,7 +23,7 @@
include <../core.scad>
include <../vitamins/mains_sockets.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
include <../vitamins/ring_terminals.scad>
box_height = 19;

View File

@@ -23,7 +23,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../vitamins/wire.scad>
use <../vitamins/ssr.scad>

View File

@@ -23,7 +23,7 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
strap = [18, 2, M3_pan_screw, 3, 25];
function strap() = strap;

221
readme.md
View File

@@ -31,22 +31,23 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#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 = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Scs_bearing_blocks">Scs_bearing_blocks</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 = "#Sealing_strip">Sealing_strip</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 = "#Sheets">Sheets</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 = "#Sk_brackets">Sk_brackets</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 = "#Spades">Spades</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 = "#Spools">Spools</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 = "#Springs">Springs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Kp_pillow_blocks">Kp_pillow_blocks</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>
@@ -93,8 +94,10 @@ Also single bearing balls are modelled as just a silver sphere and a BOM entry.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```ball_bearing(BB608)``` | Ball bearing 608-2RS 8mm x 22mm x 7mm |
| 1 | ```ball_bearing(BB6200)``` | Ball bearing 6200-2RS 10mm x 30mm x 9mm |
| 1 | ```ball_bearing(BB6201)``` | Ball bearing 6201-2RS 12mm x 32mm x 10mm |
| 1 | ```ball_bearing(BB624)``` | Ball bearing 624-2RS 4mm x 13mm x 5mm |
| 2 | ``` bearing_ball(3)``` | Steel ball 3mm |
| 4 | ``` bearing_ball(3)``` | Steel ball 3mm |
<a href="#top">Top</a>
@@ -823,7 +826,7 @@ Parametric green terminal blocks
### Modules
| Module | Description |
|:--- |:--- |
| ```green_terminal(type, ways, skip = [])``` | Draw green terminal blocks, skip can be used to remove pins. |
| ```green_terminal(type, ways, skip = [], colour = "lime")``` | Draw green terminal blocks, skip can be used to remove pins. |
| ```terminal_254(ways, skip = [])``` | Draw 0.1" terminal block |
![green_terminals](tests/png/green_terminals.png)
@@ -1087,6 +1090,59 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
| 1 | ```jack_4mm_shielded("brown", 3, "sienna")``` | 4mm shielded jack socket brown |
<a href="#top">Top</a>
---
<a name="Kp_pillow_blocks"></a>
## Kp_pillow_blocks
KP pillow block bearings
[vitamins/kp_pillow_blocks.scad](vitamins/kp_pillow_blocks.scad) Object definitions.
[vitamins/kp_pillow_block.scad](vitamins/kp_pillow_block.scad) Implementation.
[tests/kp_pillow_blocks.scad](tests/kp_pillow_blocks.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```kp_base_height(type)``` | Height of base containing the bolts |
| ```kp_diameter(type)``` | Rod hole diameter |
| ```kp_hole_offset(type)``` | Rod hole offset |
| ```kp_screw_separation(type)``` | Separation of bolts in the base |
### Functions
| Function | Description |
|:--- |:--- |
| ```kp_size(type)``` | Size of bracket |
### Modules
| Module | Description |
|:--- |:--- |
| ```kp_pillow_block(type)``` | Draw the KP pillow block |
| ```kp_pillow_block_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef)``` | Assembly with fasteners in place |
| ```kp_pillow_block_hole_positions(type)``` | Place children at hole positions |
![kp_pillow_blocks](tests/png/kp_pillow_blocks.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```kp_pillow_block(KP000)``` | KP000 pillow block |
| 1 | ```kp_pillow_block(KP001)``` | KP001 pillow block |
| 1 | ```kp_pillow_block(KP08_15)``` | KP08_15 pillow block |
| 1 | ```kp_pillow_block(KP08_18)``` | KP08_18 pillow block |
| 2 | ```sliding_t_nut(M4_hammer_nut)``` | Nut M4 hammer |
| 2 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 2 | ```nut(M5_nut, nyloc = undef)``` | Nut M5 x 4mm |
| 4 | ```screw(M4_cap_screw, 10)``` | Screw M4 cap x 10mm |
| 4 | ```screw(M5_cap_screw, 12)``` | Screw M5 cap x 12mm |
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 6 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -1623,12 +1679,12 @@ If a nut is given a child then it gets placed on its top surface.
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 x 2.2mm |
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 x 2.2mm nylon |
| 1 | ```hammer_nut(M3_hammer_nut)``` | Nut M3 hammer |
| 1 | ```sliding_t_nut(M3_hammer_nut)``` | Nut M3 hammer |
| 1 | ```sliding_t_nut(M3_sliding_t_nut)``` | Nut M3 sliding T |
| 1 | ```nut(M3_nut)``` | Nut M3 x 2.4mm |
| 1 | ```nut(M3_nut, brass = true)``` | Nut M3 x 2.4mm brass |
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```hammer_nut(M4_hammer_nut)``` | Nut M4 hammer |
| 1 | ```sliding_t_nut(M4_hammer_nut)``` | Nut M4 hammer |
| 1 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 1 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
@@ -2408,6 +2464,64 @@ Machine screws and wood screws with various head styles.
| 1 | ```screw(No6_screw, 30)``` | Screw No6 pan wood x 30mm |
<a href="#top">Top</a>
---
<a name="Scs_bearing_blocks"></a>
## Scs_bearing_blocks
[vitamins/scs_bearing_blocks.scad](vitamins/scs_bearing_blocks.scad) Object definitions.
[vitamins/scs_bearing_block.scad](vitamins/scs_bearing_block.scad) Implementation.
[tests/scs_bearing_blocks.scad](tests/scs_bearing_blocks.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```scs_bearing(type)``` | Linear bearing used |
| ```scs_block_center_height(type)``` | Height of the center of the block |
| ```scs_block_side_height(type)``` | Height of the side of the block, this determines the minimum screw length |
| ```scs_hole_offset(type)``` | Offset of bearing hole from base of block |
| ```scs_screw(type)``` | Screw type |
| ```scs_screw_separation_x(type)``` | Screw separation in X direction |
| ```scs_screw_separation_z(type)``` | Screw separation in Z direction |
### Functions
| Function | Description |
|:--- |:--- |
| ```scs_size(type)``` | Size of scs bracket bounding block |
### Modules
| Module | Description |
|:--- |:--- |
| ```scs_bearing_block(type)``` | Draw the specified SCS bearing block |
| ```scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type)``` | Assembly with screws and nuts in place |
| ```scs_bearing_block_hole_positions(type)``` | Place children at hole positions |
![scs_bearing_blocks](tests/png/scs_bearing_blocks.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 12 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 24 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```scs_bearing_block(SCS10LUU)``` | SCS10LUU bearing block |
| 1 | ```scs_bearing_block(SCS10UU)``` | SCS10UU bearing block |
| 1 | ```scs_bearing_block(SCS12LUU)``` | SCS12LUU bearing block |
| 1 | ```scs_bearing_block(SCS12UU)``` | SCS12UU bearing block |
| 1 | ```scs_bearing_block(SCS16LUU)``` | SCS16LUU bearing block |
| 1 | ```scs_bearing_block(SCS16UU)``` | SCS16UU bearing block |
| 1 | ```scs_bearing_block(SCS6UU)``` | SCS6UU bearing block |
| 1 | ```scs_bearing_block(SCS8LUU)``` | SCS8LUU bearing block |
| 1 | ```scs_bearing_block(SCS8UU)``` | SCS8UU bearing block |
| 4 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 8 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
| 16 | ```screw(M5_cap_screw, 35)``` | Screw M5 cap x 35mm |
| 8 | ```screw(M5_cap_screw, 45)``` | Screw M5 cap x 45mm |
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 24 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -2497,6 +2611,62 @@ 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, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef, max_screw_depth = 6)``` | Assembly with fasteners in place |
| ```sk_bracket_hole_positions(type)``` | Place children at hole positions |
![sk_brackets](tests/png/sk_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | ```extrusion(E2020, 20)``` | Extrusion E2020 x 20mm |
| 2 | ```extrusion(E3030, 20)``` | Extrusion E3030 x 20mm |
| 2 | ```sliding_t_nut(M4_hammer_nut)``` | Nut M4 hammer |
| 2 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 2 | ```nut(M5_nut, nyloc = undef)``` | 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 |
| 2 | ```screw(M4_cap_screw, 12)``` | Screw M4 cap x 12mm |
| 2 | ```screw(M4_dome_screw, 12)``` | Screw M4 dome x 12mm |
| 4 | ```screw(M5_cap_screw, 16)``` | Screw M5 cap x 16mm |
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 6 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -4966,11 +5136,12 @@ Small holes can get away without it, but they print better with truncated teardr
### Modules
| Module | Description |
|:--- |:--- |
| ```semi_teardrop(h, r, d = undef, center = true)``` | A semi teardrop in the positive Y domain |
| ```teardrop(h, r, center = true, truncate = true)``` | For making horizontal holes that don't need support material, set ```truncate = false``` to make traditional RepRap teardrops that don't even need bridging |
| ```teardrop_plus(h, r, center = true, truncate = true)``` | Slightly bigger teardrop to allow for the 3D printing staircase effect |
| ```tearslot(h, r, w, center = true)``` | A horizontal slot that doesn't need support material |
| ```vertical_tearslot(h, r, l, center = true)``` | A vertical slot that doesn't need support material |
| ```semi_teardrop(h, r, d = undef, center = true, chamfer = 0)``` | A semi teardrop in the positive Y domain |
| ```teardrop(h, r, center = true, truncate = true, chamfer = 0)``` | For making horizontal holes that don't need support material, set ```truncate = false``` to make traditional RepRap teardrops that don't even need bridging |
| ```teardrop_chamfer(h, center, chamfer)``` | Helper module for adding chamfer to a teardrop |
| ```teardrop_plus(h, r, center = true, truncate = true, chamfer = 0)``` | Slightly bigger teardrop to allow for the 3D printing staircase effect |
| ```tearslot(h, r, w, center = true, chamfer = 0)``` | A horizontal slot that doesn't need support material |
| ```vertical_tearslot(h, r, l, center = true, chamfer = 0)``` | A vertical slot that doesn't need support material |
![teardrops](tests/png/teardrops.png)

View File

@@ -85,48 +85,49 @@ def make_parts(target, part_type, parts = None):
#
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib/printed'
module_suffix = '_dxf' if part_type == 'svg' else '_' + part_type
for dir in [source_dir, lib_dir]:
for filename in os.listdir(dir):
if filename[-5:] == ".scad":
#
# find any modules ending in _<part_type>
#
with open(dir + "/" + filename, "r") as f:
for line in f.readlines():
words = line.split()
if(len(words) and words[0] == "module"):
module = words[1].split('(')[0]
if module.endswith(module_suffix):
base_name = module[:-4]
part = base_name + '.' + part_type
if part in targets:
#
# make a file to use the module
#
part_maker_name = part_type + ".scad"
with open(part_maker_name, "w") as f:
f.write("use <%s/%s>\n" % (dir, filename))
f.write("%s();\n" % module);
#
# Run openscad on the created file
#
part_file = target_dir + "/" + part
dname = deps_name(deps_dir, filename)
changed = check_deps(part_file, dname)
changed = times.check_have_time(changed, part)
if part_type == 'stl' and not changed and not part in bounds_map:
changed = "No bounds"
if changed:
print(changed)
t = time.time()
openscad.run("-D$bom=1", "-d", dname, "-o", part_file, part_maker_name)
times.add_time(part, t)
if part_type == 'stl':
bounds = c14n_stl.canonicalise(part_file)
bounds_map[part] = bounds
for dir in [source_dir, source_dir + '/printed', lib_dir]:
if os.path.isdir(dir):
for filename in os.listdir(dir):
if filename[-5:] == ".scad":
#
# find any modules ending in _<part_type>
#
with open(dir + "/" + filename, "r") as f:
for line in f.readlines():
words = line.split()
if(len(words) and words[0] == "module"):
module = words[1].split('(')[0]
if module.endswith(module_suffix):
base_name = module[:-4]
part = base_name + '.' + part_type
if part in targets:
#
# make a file to use the module
#
part_maker_name = part_type + ".scad"
with open(part_maker_name, "w") as f:
f.write("use <%s/%s>\n" % (dir, filename))
f.write("%s();\n" % module);
#
# Run openscad on the created file
#
part_file = target_dir + "/" + part
dname = deps_name(deps_dir, filename)
changed = check_deps(part_file, dname)
changed = times.check_have_time(changed, part)
if part_type == 'stl' and not changed and not part in bounds_map:
changed = "No bounds"
if changed:
print(changed)
t = time.time()
openscad.run("-D$bom=1", "-d", dname, "-o", part_file, part_maker_name)
times.add_time(part, t)
if part_type == 'stl':
bounds = c14n_stl.canonicalise(part_file)
bounds_map[part] = bounds
targets.remove(part)
os.remove(part_maker_name)
targets.remove(part)
os.remove(part_maker_name)
#
# Write new bounds file
#

View File

@@ -124,66 +124,67 @@ def views(target, do_assemblies = None):
#
main_blurb = None
lib_dir = os.environ['OPENSCADPATH'] + '/NopSCADlib/printed'
for dir in [source_dir, lib_dir]:
for filename in os.listdir(dir):
if filename.endswith('.scad'):
#
# find any modules with names ending in _assembly
#
with open(dir + "/" + filename, "r") as f:
lines = f.readlines()
line_no = 0
for line in lines:
words = line.split()
if len(words) and words[0] == "module":
module = words[1].split('(')[0]
if is_assembly(module):
if module in assemblies:
#
# Scrape the assembly instructions
#
for ass in flat_bom:
if ass["name"] == module:
if not "blurb" in ass:
ass["blurb"] = blurb.scrape_module_blurb(lines[:line_no])
break
if not do_assemblies or module in do_assemblies:
for dir in [source_dir, source_dir + '/printed', lib_dir]:
if os.path.isdir(dir):
for filename in os.listdir(dir):
if filename.endswith('.scad'):
#
# find any modules with names ending in _assembly
#
with open(dir + "/" + filename, "r") as f:
lines = f.readlines()
line_no = 0
for line in lines:
words = line.split()
if len(words) and words[0] == "module":
module = words[1].split('(')[0]
if is_assembly(module):
if module in assemblies:
#
# make a file to use the module
# Scrape the assembly instructions
#
png_maker_name = 'png.scad'
with open(png_maker_name, "w") as f:
f.write("use <%s/%s>\n" % (dir, filename))
f.write("%s();\n" % module);
#
# Run openscad on the created file
#
dname = deps_name(deps_dir, filename)
for explode in [0, 1]:
png_name = target_dir + '/' + module + '.png'
if not explode:
png_name = png_name.replace('_assembly', '_assembled')
changed = check_deps(png_name, dname)
changed = times.check_have_time(changed, png_name)
changed = options.have_changed(changed, png_name)
tmp_name = 'tmp.png'
if changed:
print(changed)
t = time.time()
openscad.run_list(options.list() + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name]);
times.add_time(png_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)
tn_name = png_name.replace('.png', '_tn.png')
if mtime(png_name) > mtime(tn_name):
do_cmd(("magick "+ png_name + " -trim -resize 280x280 -background " + background + " -gravity Center -extent 280x280 -bordercolor " + background + " -border 10 " + tmp_name).split())
update_image(tmp_name, tn_name)
os.remove(png_maker_name)
done_assemblies.append(module)
else:
if module == 'main_assembly':
main_blurb = blurb.scrape_module_blurb(lines[:line_no])
line_no += 1
for ass in flat_bom:
if ass["name"] == module:
if not "blurb" in ass:
ass["blurb"] = blurb.scrape_module_blurb(lines[:line_no])
break
if not do_assemblies or module in do_assemblies:
#
# make a file to use the module
#
png_maker_name = 'png.scad'
with open(png_maker_name, "w") as f:
f.write("use <%s/%s>\n" % (dir, filename))
f.write("%s();\n" % module);
#
# Run openscad on the created file
#
dname = deps_name(deps_dir, filename)
for explode in [0, 1]:
png_name = target_dir + '/' + module + '.png'
if not explode:
png_name = png_name.replace('_assembly', '_assembled')
changed = check_deps(png_name, dname)
changed = times.check_have_time(changed, png_name)
changed = options.have_changed(changed, png_name)
tmp_name = 'tmp.png'
if changed:
print(changed)
t = time.time()
openscad.run_list(options.list() + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name]);
times.add_time(png_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)
tn_name = png_name.replace('.png', '_tn.png')
if mtime(png_name) > mtime(tn_name):
do_cmd(("magick "+ png_name + " -trim -resize 280x280 -background " + background + " -gravity Center -extent 280x280 -bordercolor " + background + " -border 10 " + tmp_name).split())
update_image(tmp_name, tn_name)
os.remove(png_maker_name)
done_assemblies.append(module)
else:
if module == 'main_assembly':
main_blurb = blurb.scrape_module_blurb(lines[:line_no])
line_no += 1
times.print_times()
#
# Build the document

View File

@@ -20,8 +20,8 @@ include <../core.scad>
include <../vitamins/belts.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
include <../vitamins/pulleys.scad>
use <../vitamins/insert.scad>
use <../utils/layout.scad>
module belt_test() {

View File

@@ -22,8 +22,8 @@
//
include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/inserts.scad>
include <../vitamins/sheets.scad>
use <../vitamins/insert.scad>
$explode = 1; // Normally set on the command line when generating assembly views with views.py
screw = M3_cap_screw;

View File

@@ -20,7 +20,7 @@ include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/sheets.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
use <../printed/box.scad>

View File

@@ -20,7 +20,7 @@ include <../core.scad>
include <../vitamins/screws.scad>
include <../vitamins/sheets.scad>
include <../vitamins/inserts.scad>
use <../vitamins/insert.scad>
include <../printed/butt_box.scad>

View File

@@ -0,0 +1,34 @@
//
// 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/kp_pillow_blocks.scad>
include <../vitamins/nuts.scad>
module kp_pillow_blocks() {
screws = [M4_cap_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw];
nuts = [M4_sliding_t_nut, M4_hammer_nut, M5_sliding_t_nut, M5_nut];
assert(len(screws) == len(kp_pillow_blocks) && len(nuts) == len(kp_pillow_blocks));
layout([for(k = kp_pillow_blocks) 2 * kp_size(k)[1]])
kp_pillow_block_assembly(kp_pillow_blocks[$i], screw_type = screws[$i], nut_type = nuts[$i]);
}
if($preview)
kp_pillow_blocks();

View File

@@ -58,10 +58,10 @@ module nuts() {
translate([0, 80]) {
if(n == M3_nut)
hammer_nut(M3_hammer_nut);
sliding_t_nut(M3_hammer_nut);
if(n == M4_nut)
hammer_nut(M4_hammer_nut);
sliding_t_nut(M4_hammer_nut);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
tests/png/sk_brackets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../utils/layout.scad>
include <../vitamins/scs_bearing_blocks.scad>
module scs_bearing_blocks()
layout([for(s = scs_bearing_blocks) 2 * scs_size(s)[0]]) {
part_thickness = 5;
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);
if($i > 0) // skip $i==0, since no SCS6LUU long variant to match SCS6UU
translate([0, 60])
scs_bearing_block_assembly(scs_bearing_blocks_long[$i - 1], part_thickness);
}
if($preview)
scs_bearing_blocks();

40
tests/sk_brackets.scad Normal file
View File

@@ -0,0 +1,40 @@
//
// 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>
include <../vitamins/extrusions.scad>
module sk_brackets() {
screws = [M4_dome_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw];
nuts = [M4_hammer_nut, M4_sliding_t_nut, M5_sliding_t_nut, undef];
// channel depth = 6 for 2020 extrusion, 9 for 3030 extrusion
depths = [6, 6, 9, 0];
layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]]) {
sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i], max_screw_depth = depths[$i]);
translate([0, -sk_hole_offset(sk_brackets[$i]) - extrusion_width($i < 2 ? E2020 : E3030) / 2, 0])
rotate([0, 90, 0])
extrusion($i < 2 ? E2020 : E3030, 20);
}
}
if($preview)
let($show_threads = true)
sk_brackets();

View File

@@ -22,25 +22,47 @@ include <../core.scad>
module teardrops() {
color(pp1_colour)
rotate([90, 0, -45])
linear_extrude(height = 3)
difference() {
square(40);
difference() {
linear_extrude(height = 3) {
difference() {
square([80, 40]);
translate([10, 10])
teardrop(h = 0, r = 3);
translate([10, 20])
teardrop_plus(h = 0, r = 3);
translate([20, 30])
tearslot(h = 0, r = 3, w = 10);
translate([30, 15])
vertical_tearslot(h = 0, r =3, l = 10);
translate([20, 10])
semi_teardrop(h = 0, r = 3);
}
}
translate([40, 0, 1.5]) {
h = 3 + eps;
chamfer = 0.5;
translate([10, 10])
teardrop(h = 0, r = 3);
teardrop(h = h, r = 3, chamfer = chamfer);
translate([10, 20])
teardrop_plus(h = 0, r = 3);
teardrop_plus(h = h, r = 3, chamfer = chamfer);
translate([20, 30])
tearslot(h = 0, r = 3, w = 10);
tearslot(h = h, r = 3, w = 10, chamfer = chamfer);
translate([30, 15])
vertical_tearslot(h = 0, r =3, l = 10);
vertical_tearslot(h = h, r =3, l = 10, chamfer = chamfer);
translate([20, 10])
semi_teardrop(h = 0, r = 3);
semi_teardrop(h = h, r = 3, chamfer = chamfer);
}
}
}
teardrops();

View File

@@ -21,45 +21,106 @@
//! For making horizontal holes that don't need support material.
//! Small holes can get away without it, but they print better with truncated teardrops.
//
module teardrop(h, r, center = true, truncate = true) //! For making horizontal holes that don't need support material, set ```truncate = false``` to make traditional RepRap teardrops that don't even need bridging
render(convexity = 5)
extrude_if(h, center)
hull() {
circle4n(r);
if(truncate)
translate([0, r / 2])
square([2 * r * (sqrt(2) - 1), r], center = true);
else
polygon([[0, 0], [eps, 0], [0, r * sqrt(2)]]);
}
module semi_teardrop(h, r, d = undef, center = true) //! A semi teardrop in the positive Y domain
render(convexity = 5)
extrude_if(h, center)
intersection() {
R = is_undef(d) ? r : d / 2;
teardrop(r = R, h = 0);
sq = R + 1;
translate([-sq, 0])
square([2 * sq, sq]);
}
module teardrop_plus(h, r, center = true, truncate = true) //! Slightly bigger teardrop to allow for the 3D printing staircase effect
teardrop(h, r + layer_height / 4, center, truncate);
module tearslot(h, r, w, center = true) //! A horizontal slot that doesn't need support material
extrude_if(h, center)
module teardrop(h, r, center = true, truncate = true, chamfer = 0) { //! For making horizontal holes that don't need support material, set ```truncate = false``` to make traditional RepRap teardrops that don't even need bridging
module teardrop_2d(r, truncate) {
hull() {
translate([-w/2,0,0]) teardrop(r = r, h = 0);
translate([ w/2,0,0]) teardrop(r = r, h = 0);
circle4n(r);
if(truncate)
translate([0, r / 2])
square([2 * r * (sqrt(2) - 1), r], center = true);
else
polygon([[0, 0], [eps, 0], [0, r * sqrt(2)]]);
}
}
render(convexity = 5)
extrude_if(h, center)
teardrop_2d(r, truncate);
teardrop_chamfer(h, center, chamfer) {
linear_extrude(eps, center = true)
teardrop_2d(r + chamfer / 2, truncate);
translate_z(-chamfer / 2)
linear_extrude(eps, center = true)
teardrop_2d(r, truncate);
}
}
module semi_teardrop(h, r, d = undef, center = true, chamfer = 0) { //! A semi teardrop in the positive Y domain
module semi_teardrop_2d(r, d) {
intersection() {
R = is_undef(d) ? r : d / 2;
teardrop(r = R, h = 0);
sq = R + 1;
translate([-sq, 0])
square([2 * sq, sq]);
}
}
render(convexity = 5)
extrude_if(h, center)
semi_teardrop_2d(r, d);
teardrop_chamfer(h, center, chamfer) {
linear_extrude(eps, center = true)
semi_teardrop_2d(r + chamfer / 2, d);
translate_z(-chamfer / 2)
linear_extrude(eps, center = true)
semi_teardrop_2d(r, d);
}
}
module teardrop_plus(h, r, center = true, truncate = true, chamfer = 0) //! Slightly bigger teardrop to allow for the 3D printing staircase effect
teardrop(h, r + layer_height / 4, center, truncate, chamfer);
module tearslot(h, r, w, center = true, chamfer = 0) { //! A horizontal slot that doesn't need support material
module tearslot_2d(r, w) {
hull() {
translate([-w / 2, 0]) teardrop(r = r, h = 0);
translate([w / 2, 0]) teardrop(r = r, h = 0);
}
}
module vertical_tearslot(h, r, l, center = true) //! A vertical slot that doesn't need support material
extrude_if(h, center)
tearslot_2d(r, w);
teardrop_chamfer(h, center, chamfer) {
linear_extrude(eps, center = true)
tearslot_2d(r + chamfer / 2, w);
translate_z(-chamfer / 2)
linear_extrude(eps, center = true)
tearslot_2d(r, w);
}
}
module vertical_tearslot(h, r, l, center = true, chamfer = 0) { //! A vertical slot that doesn't need support material
module vertical_tearslot_2d(r, l) {
hull() {
translate([0, l / 2]) teardrop(0, r, true);
translate([0, -l / 2])
circle4n(r);
translate([0, -l / 2]) circle4n(r);
}
}
extrude_if(h, center)
vertical_tearslot_2d(r, l);
teardrop_chamfer(h, center, chamfer) {
linear_extrude(eps, center = true)
vertical_tearslot_2d(r + chamfer / 2, l);
translate_z(-chamfer / 2)
linear_extrude(eps, center = true)
vertical_tearslot_2d(r, l);
}
}
module teardrop_chamfer(h, center, chamfer) { //! Helper module for adding chamfer to a teardrop
if(h && chamfer)
translate_z(center ? 0 : h / 2)
for(m = [0, 1])
mirror([0, 0, m])
translate_z((h - eps ) / 2)
hull()
children();
}

View File

@@ -18,7 +18,9 @@
//
BB624 = ["624", 4, 13, 5, "blue"]; // 624 ball bearing for idlers
BB608 = ["608", 8, 22, 7, "OrangeRed"]; // 608 bearings for wades
BB6200 = ["6200", 10, 30, 9, "black"]; // 6200 bearings for KP pillow blocks
BB6201 = ["6201", 12, 32, 10, "black"]; // 6201 bearings for KP pillow blocks
ball_bearings = [BB624, BB608];
ball_bearings = [BB624, BB608, BB6200, BB6201];
use <ball_bearing.scad>

View File

@@ -39,9 +39,8 @@ function gt_y_offset(type) = type[13]; //! Offset of the pins from centre o
function gt_y_offset2(type) = type[14]; //! Offset of the pins screws from the screws
function gt_tube_h(type) = type[15]; //! Height of optional tubes around the screws
module green_terminal(type, ways, skip = []) { //! Draw green terminal blocks, skip can be used to remove pins.
module green_terminal(type, ways, skip = [], colour = "lime") { //! Draw green terminal blocks, skip can be used to remove pins.
pitch = gt_pitch(type);
imperial = str(pitch / inch(1));
vitamin(str("green_terminal(", type[0], ", ", ways, "): Terminal block ", ways, " way ", len(imperial) < 5 ? str(pitch / inch(1), "\"") : str(pitch, "mm")));
width = ways * pitch;
@@ -79,7 +78,7 @@ module green_terminal(type, ways, skip = []) { //! Draw green terminal blocks, s
}
}
color("lime") {
color(colour) {
rotate([90, 0, 0])
linear_extrude(height = pitch, center = true, convexity = 5)
polygon(points = [ // Vertical section

View File

@@ -18,6 +18,14 @@
//
// Green terminal blocks
//
// f b y y
// h h f h b s f o o
// p d e e d e d c r f f t
// i e i i e i e r o b b f f u
// t p g t g p g p e n o o s s b
// c t h o h t h t w t x x e t e
// h h t p t h t h r t w h t 2 h
gt_2p54 = ["gt_2p54", 2.54, 6.6, 10, 3, 6, 0.4, 6.4, 1, 1, 0.2, 2, 2, 0, 0, 0];
gt_3p5 = ["gt_3p5", 3.5, 7.3, 8.5, 4, 5, 0.4, 4, 0, 1.35, 0.4, 1.8, 2, 0, 0, 0];
gt_6p35 = ["gt_6p35", 6.35, 12.6, 17.4, 6.8, 12, 0.4, 11, 2, 2.7, 0.8, 3.4, 4.2, 1.8, 1.1, 21.4];

View File

@@ -25,7 +25,7 @@ use <screw.scad>
use <nut.scad>
use <washer.scad>
use <spade.scad>
include <inserts.scad>
use <insert.scad>
function iec_part(type) = type[1]; //! Description
function iec_screw(type) = type[2]; //! Screw type

View File

@@ -36,8 +36,4 @@ F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ];
inserts = [ F1BM2, F1BM2p5, F1BM3, F1BM4 ];
function screw_insert(screw, i = 0) = let(d = screw_radius(screw) * 2)
i >= len(inserts) ? undef
: insert_screw_diameter(inserts[i]) == d ? inserts[i]
: screw_insert(screw, i + 1);
use <insert.scad>

View File

@@ -0,0 +1,116 @@
//
// 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/>.
//
//! KP pillow block bearings
//
include <../core.scad>
use <../utils/tube.scad>
include <screws.scad>
use <washer.scad>
use <ball_bearing.scad>
kp_pillow_block_color = grey70;
function kp_diameter(type) = type[1]; //! Rod hole diameter
function kp_hole_offset(type) = type[2]; //! Rod hole offset
function kp_size(type) = [type[3],type[8],type[5]]; //! Size of bracket
function kp_base_height(type) = type[7]; //! Height of base containing the bolts
function kp_screw_separation(type) = type[4]; //! Separation of bolts in the base
module kp_pillow_block(type) { //! Draw the KP pillow block
vitamin(str("kp_pillow_block(", type[0], "): ", type[0], " pillow block"));
d = kp_diameter(type);
H = kp_hole_offset(type);
L = kp_size(type)[0];
J = kp_screw_separation(type);
A = kp_size(type)[2];// sizeZ, includes protruding center
N = type[6];
H1 = kp_base_height(type);
H0 = kp_size(type)[1];
K = type[9];
S = type[10];
b = type[11];
bolthole_radius = type[12];
color(kp_pillow_block_color)
translate([0, -H, 0]) {
fillet = 1;
squareSizeX = (L - H0) / 2 + fillet;
rotate([-90, 0, 0])
linear_extrude(H1)
difference() {
union() {
for(i = [-L / 2, L / 2 - squareSizeX])
translate([i, -A / 2])
rounded_square([squareSizeX, A], fillet, center = false);
}
for(i = [-J / 2, J / 2])
translate([i, 0])
circle(r = bolthole_radius);
}
translate_z(-A / 2) {
for(x = [- L / 2 + squareSizeX - fillet, L / 2 - squareSizeX + fillet - 2])
translate([x, 0, 0])
cube([2, H, A]);
stripLength = J - 2 * bolthole_radius;
stripThickness = 4;
translate([-stripLength / 2, 0, (H1 + stripThickness) / 2])
cube([stripLength, H1, stripThickness]);
translate([0 , H, 0])
tube(H0 / 2, b / 2, A, center = false);
}
}
not_on_bom() no_explode()
ball_bearing(type[13]);
}
module kp_pillow_block_hole_positions(type) { //! Place children at hole positions
for(x = [-kp_screw_separation(type), kp_screw_separation(type)])
translate([x / 2, kp_base_height(type) - kp_hole_offset(type), 0])
rotate([-90,0,0])
children();
}
module kp_pillow_block_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef) { //! Assembly with fasteners in place
kp_pillow_block(type);
screw_washer_thickness = washer_thickness(screw_washer(screw_type));
nut_type = is_undef(nut_type) ? screw_nut(screw_type) : nut_type;
nut_washer_type = nut_washer(nut_type);
nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
nut_offset = kp_base_height(type) + part_thickness;
screw_length = screw_shorter_than(nut_offset + screw_washer_thickness + nut_thickness(nut_type) + nut_washer_thickness);
kp_pillow_block_hole_positions(type) {
screw_and_washer(screw_type, screw_length);
translate_z(-nut_offset)
vflip()
if(nut_washer_type)
nut_and_washer(nut_type);
else
sliding_t_nut(nut_type);
}
}

View File

@@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! KP pillow block bearings
//
include <screws.scad>
include <ball_bearings.scad>
// d H L J A N H1 H0 K S b bolthole bearing
KP08_15 = ["KP08_15", 8, 15, 55, 42, 13, 4.5, 5, 29, 0.0, 0, 22, M4_clearance_radius, BB608];
KP08_18 = ["KP08_18", 8, 18, 55, 42, 13, 4.5, 5, 29, 0.0, 0, 22, M4_clearance_radius, BB608];
KP000 = ["KP000", 10, 18, 67, 53, 16, 7.0, 6, 35, 14.0, 4, 30, M6_clearance_radius, BB6200];
KP001 = ["KP001", 12, 19, 71, 56, 16, 7.0, 6, 38, 14.5, 4, 32, M6_clearance_radius, BB6201];
kp_pillow_blocks = [KP08_15, KP08_18, KP000, KP001];
use <kp_pillow_block.scad>

View File

@@ -23,7 +23,7 @@
include <../core.scad>
include <screws.scad>
include <ring_terminals.scad>
include <inserts.scad>
use <insert.scad>
function mains_socket_width(type) = type[1]; //! Width at the base
function mains_socket_depth(type) = type[2]; //! Depth at the base

View File

@@ -132,75 +132,60 @@ module wingnut(type) { //! Draw a wingnut
}
module sliding_t_nut(type) {
vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), " sliding T"));
hammerNut = type[10];
vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), hammerNut ? " hammer" : " sliding T"));
size = [type[7], type[2], nut_thickness(type)];
size = [type[7], type[2], nut_thickness(type, true)];
tabSizeY1 = type[8];
tabSizeY2 = type[9];
tabSizeZ = type[10];
tabSizeZ = nut_thickness(type);
holeRadius = nut_size(type) / 2;
if($preview)
color(grey80)
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius);
}
module hammer_nut(type) {
vitamin(str("hammer_nut(", type[0], "): Nut M", nut_size(type), " hammer"));
size = [type[7], type[2], nut_thickness(type)];
tabSizeY1 = type[8];
tabSizeY2 = type[9];
tabSizeZ = type[10];
holeRadius = nut_size(type) / 2;
if($preview)
color(grey80)
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut = true);
color(grey80)
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut);
}
module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) {
// center section
linear_extrude(size[2] - tabSizeZ)
difference() {
square([size[0], size[1]], center = true);
if(hammerNut) {
translate([size[0] / 2, size[1] / 2])
rotate(180)
fillet(1);
translate([-size[0] / 2, -size[1] / 2])
fillet(1);
}
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
}
translate_z(size[2] - tabSizeZ)
linear_extrude(tabSizeZ)
stem_h = size.z - tabSizeZ;
translate_z(-stem_h)
linear_extrude(stem_h)
difference() {
square([size[0], tabSizeY2], center = true);
square([size.x, size.y], center = true);
if(hammerNut) {
translate([size.x / 2, size.y / 2])
rotate(180)
fillet(1);
translate([-size.x / 2, -size.y / 2])
fillet(1);
}
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
}
linear_extrude(tabSizeZ)
difference() {
square([size.x, tabSizeY2], center = true);
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
}
thread_d = 2 * holeRadius;
if(show_threads)
translate([holeOffset, 0])
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size[2], center = false);
translate([holeOffset, 0, -stem_h])
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size.z, center = false);
// add the side tabs
for(m = [0, 1])
mirror([0, m, 0])
translate([0, tabSizeY2 / 2, size[2] - tabSizeZ]) {
translate([0, tabSizeY2 / 2]) {
cubeZ = 1;
translate([-size[0] / 2, 0, 0])
cube([size[0], (tabSizeY1 - tabSizeY2) / 2, cubeZ]);
translate([-size.x / 2, 0])
cube([size.x, (tabSizeY1 - tabSizeY2) / 2, cubeZ]);
translate_z(cubeZ)
rotate([0, -90, 0])
right_triangle(tabSizeZ - cubeZ, (tabSizeY1 - tabSizeY2) / 2, size[0], center = true);
right_triangle(tabSizeZ - cubeZ, (tabSizeY1 - tabSizeY2) / 2, size.x, center = true);
}
}

View File

@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <washers.scad>
//
// Nuts
//
@@ -28,35 +28,35 @@ M5_nut_depth = 4;
M6_nut_depth = 5;
M8_nut_depth = 6.5;
// s r t n w t
// c a h y a r
// r d i l s a
// e i c o h p
// w u k c e
// s n r d
// e t e
// s h p
// s k t
// h
// s r t n w t
// c a h y a r
// r d i l s a
// e i c o h p
// w u k c e
// s n r d
// e t e
// s h p
// s k t
// h
//
M2_nut = ["M2_nut", 2, 4.9, 1.6, 2.4, M2_washer, M2_nut_trap_depth];
M2p5_nut = ["M2p5_nut", 2.5, 5.8, 2.2, 3.8, M2p5_washer, M2p5_nut_trap_depth];
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth];
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth];
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth];
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth];
M6_half_nut = ["M6_half_nut", 6, 11.5, 3, 8, M6_washer, 3];
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth];
toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5];
M2_nut = ["M2_nut", 2, 4.9, 1.6, 2.4, M2_washer, M2_nut_trap_depth];
M2p5_nut = ["M2p5_nut", 2.5, 5.8, 2.2, 3.8, M2p5_washer, M2p5_nut_trap_depth];
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth];
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth];
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth];
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth];
M6_half_nut = ["M6_half_nut", 6, 11.5, 3, 8, M6_washer, 3];
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth];
toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5];
M4_wingnut = ["M4_wingnut", 4, 10, 3.75,8, M4_washer, 0, 22, 10, 6, 3];
M4_wingnut = ["M4_wingnut", 4, 10, 3.75,8, M4_washer, 0, 22, 10, 6, 3];
// sx ty1 ty2 tz
M3_sliding_t_nut = ["M3_sliding_t_nut", 3, 6, 4.0, 0, M3_washer, 0, 10, 10, 6, 3];
M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 4.5, 0, M4_washer, 0, 11, 10, 6, 3.25];
M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 4.5, 0, M5_washer, 0, 11, 10, 7, 3.25];
M3_hammer_nut = ["M3_hammer_nut", 3, 6, 4.0, 0, M3_washer, 0, 5.5, 10, 6, 2.75];
M4_hammer_nut = ["M4_hammer_nut", 4, 6, 4.5, 0, M4_washer, 0, 5.5, 10, 6, 3.25];
// sx ty1 ty2 hammer
M3_sliding_t_nut = ["M3_sliding_t_nut", 3, 6, 3.0, 4.0, false, 0, 10, 10, 6, false];
M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 3.25,4.5, false, 0, 11, 10, 6, false];
M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 3.25,4.5, false, 0, 11, 10, 7, false];
M3_hammer_nut = ["M3_hammer_nut", 3, 6, 2.75,4.0, false, 0, 5.5, 10, 6, true];
M4_hammer_nut = ["M4_hammer_nut", 4, 6, 3.25,4.5, false, 0, 5.5, 10, 6, true];
nuts = [M2_nut, M2p5_nut, M3_nut, M4_nut, M5_nut, M6_nut, M8_nut];

View File

@@ -339,18 +339,19 @@ 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,
40.0, 16.0, 1.6, 0.5, 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.5, 12.75, 0, "microswitch", small_microswitch],
[ 27.5, 17.5, 15, "chip", 15, 0.5, 4.5, "silver"],
],
[]];
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

@@ -66,7 +66,7 @@ module leadscrew(d , l, lead, starts, center = true) { //! Draw a leadscrew with
translate_z(center ? 0 : l / 2)
if(show_threads && pitch)
thread(d - pitch, lead, l, thread_profile(pitch / 2, pitch * 0.366, 30), top = 45, bot = 45, starts = starts, center = center, colour = rod_colour);
thread(d - pitch, lead, l, thread_profile(pitch / 2, pitch * 0.366, 30), top = 45, bot = 45, starts = starts, colour = rod_colour);
else
color(leadscrew_colour)
hull() {

View File

@@ -25,6 +25,7 @@ include <../core.scad>
use <washer.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/thread.scad>
include <inserts.scad>
function screw_head_type(type) = type[2]; //! Head style hs_cap, hs_pan, hs_cs, hs_hex, hs_grub, hs_cs_cap, hs_dome
function screw_radius(type) = type[3] / 2; //! Nominal radius
@@ -58,6 +59,11 @@ 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
function screw_insert(screw, i = 0) = let(d = screw_radius(screw) * 2)
i >= len(inserts) ? undef
: insert_screw_diameter(inserts[i]) == d ? inserts[i]
: screw_insert(screw, i + 1);
module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified screw, optionally hobbed or nylon
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));

View File

@@ -20,7 +20,6 @@
//
// Screws
//
include <washers.scad>
include <nuts.scad>
No2_pilot_radius = 1.7 / 2; // self tapper into ABS
@@ -119,7 +118,7 @@ screw_lists = [
use <screw.scad>
screws = [for(list = screw_lists) for(screw = list) screw];
screws = [for(list = screw_lists) each list];
function find_screw(type, size, i = 0) =
i >= len(screws) ? undef

View File

@@ -0,0 +1,157 @@
//
// 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/>.
//
//
// SCSnUU and SCSnLUU bearing blocks
//
include <../core.scad>
use <screw.scad>
use <nut.scad>
use <washer.scad>
use <linear_bearing.scad>
function scs_size(type) = [type[4],type[6],type[5]]; //! Size of scs bracket bounding block
function scs_hole_offset(type) = type[2]; //! Offset of bearing hole from base of block
function scs_block_center_height(type) = type[6]; //! Height of the center of the block
function scs_block_side_height(type) = type[7]; //! Height of the side of the block, this determines the minimum screw length
function scs_screw(type) = type[11]; //! Screw type
function scs_screw_separation_x(type) = type[8]; //! Screw separation in X direction
function scs_screw_separation_z(type) = type[9]; //! Screw separation in Z direction
function scs_bearing(type) = type[14]; //! Linear bearing used
sks_bearing_block_color = grey90;
module scs_bearing_block(type) { //! Draw the specified SCS bearing block
vitamin(str("scs_bearing_block(", type[0], "): ", type[0], " bearing block"));
T = type[1];
h = scs_hole_offset(type);
E = type[3];
W = scs_size(type)[0];
assert(W == 2 * E, str("W or E wrong for scs_bearing_block", type[0]));
L = scs_size(type)[2];
F = scs_block_center_height(type);
G = scs_block_side_height(type);
B = scs_screw_separation_x(type);
C = scs_screw_separation_z(type);
K = type[10];
S1 = scs_screw(type);
S2 = type[12];
L1 = type[13];
module right_trapezoid(base, top, height, h = 0, center = true) {//! A right angled trapezoid with the 90&deg; corner at the origin. 3D when ```h``` is nonzero, otherwise 2D
extrude_if(h, center = center)
polygon(points = [ [0,0], [base, 0], [top, height], [0, height] ]);
}
boltHoleRadius = screw_clearance_radius(S1);
footHeight = min(0.75, (G - bearing_dia(scs_bearing(type)) - 1.5) / 2); // estimate, not specified on drawings
color(sks_bearing_block_color) {
linear_extrude(L, center = true) {
bearingRadius = bearing_dia(scs_bearing(type)) / 2;
// center section with bearing hole
difference() {
union() {
translate([-(B - 2 * boltHoleRadius) / 2, -h + footHeight])
square([B - 2 * boltHoleRadius, G - footHeight]);
for(m = [0, 1])
mirror([m, 0, 0])
translate([0 , G - h])
right_trapezoid(bearingRadius, bearingRadius -F + G, F - G);
}
circle(r = bearingRadius);
}
// add the sides
for(m = [0, 1])
mirror([m, 0, 0]) {
trapezoidX = boltHoleRadius - 0.5; // estimate, not specified on drawings
sideX = 2 * (K - boltHoleRadius - trapezoidX);
chamfer = 0.5;
assert(sideX > chamfer, "trapezoidX too large in scs_bearing_block");
translate([B / 2 + boltHoleRadius, -h]) {
square([sideX - chamfer, G]);
translate([sideX, 0])
rotate(90)
right_trapezoid(G - chamfer, G, chamfer);
translate([sideX, 0]) {
right_trapezoid(trapezoidX - footHeight, trapezoidX, footHeight);
translate([trapezoidX, footHeight])
rotate(90)
right_trapezoid(T - footHeight, L1 - footHeight, trapezoidX);
}
}
translate([B / 2 - boltHoleRadius, -h])
mirror([1, 0, 0])
right_trapezoid(boltHoleRadius, boltHoleRadius + footHeight, footHeight);
}
}
// side blocks with bolt holes
for(x = [-B / 2, B / 2])
translate([x, G / 2 - h, 0])
rotate([90, 0, 0])
linear_extrude(G, center = true)
difference() {
square([boltHoleRadius * 2, L], center = true);
for (y = [-C / 2, C / 2])
translate([0, y])
circle(r = boltHoleRadius);
}
}
not_on_bom() no_explode()
linear_bearing(scs_bearing(type));
}
module scs_bearing_block_hole_positions(type) { //! Place children at hole positions
screw_separation_x = scs_screw_separation_x(type);
screw_separation_z = scs_screw_separation_z(type);
G = scs_block_side_height(type);
h = scs_hole_offset(type);
for(x = [-screw_separation_x, screw_separation_x], z = [-screw_separation_z, screw_separation_z])
translate([x / 2, G - h, z / 2])
rotate([-90, 0, 0])
children();
}
module scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type) { //! Assembly with screws and nuts in place
scs_bearing_block(type);
screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type;
nut_type = is_undef(nut_type) ? screw_nut(screw_type) : nut_type;
washer_type = nut_washer(nut_type);
washer_thickness = washer_type ? washer_thickness(washer_type) : 0;
G = scs_block_side_height(type);
nut_offset = G + part_thickness + nut_thickness(nut_type) + washer_thickness;
screw_length = screw_longer_than(nut_offset);
scs_bearing_block_hole_positions(type) {
screw(screw_type, screw_length);
translate_z(-nut_offset)
nut(nut_type)
if (washer_type)
washer(washer_type);
}
}

View File

@@ -0,0 +1,43 @@
//
// 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/>.
//
//
// SCS bearing blocks
//
include <screws.scad>
include <linear_bearings.scad>
// T h E W L F G B C K S1 S2 L1 LB
SCS6UU = ["SCS6UU", 6, 9, 15, 30, 25, 18, 15, 20, 15, 5, M4_cap_screw, 3.4, 8, LM6UU];
SCS8UU = ["SCS8UU", 6, 11, 17, 34, 30, 22, 18, 24, 18, 5, M4_cap_screw, 3.4, 8, LM8UU];
SCS10UU = ["SCS10UU", 8, 13, 20, 40, 35, 26, 21, 28, 21, 6, M5_cap_screw, 4.3, 12, LM10UU];
SCS12UU = ["SCS12UU", 8, 15, 21, 42, 36, 28, 24, 30.5, 26, 5.75, M5_cap_screw, 4.3, 12, LM12UU];
SCS16UU = ["SCS16UU", 9, 19, 25, 50, 44, 38.5, 32.5, 36, 34, 7, M5_cap_screw, 4.3, 12, LM16UU];
SCS8LUU = ["SCS8LUU", 6, 11, 17, 34, 58, 22, 18, 24, 42, 5, M4_cap_screw, 3.4, 8, LM8LUU];
SCS10LUU = ["SCS10LUU", 8, 13, 20, 40, 68, 26, 21, 28, 45, 6, M5_cap_screw, 4.3, 12, LM10LUU];
SCS12LUU = ["SCS12LUU", 8, 15, 21, 42, 70, 28, 24, 30.5, 50, 5.75, M5_cap_screw, 4.3, 12, LM12LUU];
SCS16LUU = ["SCS16LUU", 9, 19, 25, 50, 85, 38.5, 32.5, 36, 60, 7, M5_cap_screw, 4.3, 12, LM16LUU];
scs_bearing_blocks = [SCS6UU, SCS8UU, SCS10UU, SCS12UU, SCS16UU];
scs_bearing_blocks_long = [SCS8LUU, SCS10LUU, SCS12LUU, SCS16LUU];
use <scs_bearing_block.scad>

124
vitamins/sk_bracket.scad Normal file
View File

@@ -0,0 +1,124 @@
//
// 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/>.
//
//! 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 = sk_diameter(type);
h = sk_hole_offset(type);
E = type[3];
W = sk_size(type)[0];
L = sk_size(type)[2];
F = sk_size(type)[1];
G = sk_base_height(type);
P = type[8];
B = sk_screw_separation(type);
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_hole_positions(type) { //! Place children at hole positions
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])
children();
}
module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef, max_screw_depth = 6) { //! Assembly with fasteners in place
sk_bracket(type);
screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type;
screw_washer_thickness = washer_thickness(screw_washer(screw_type));
nut_type = is_undef(nut_type) ? screw_nut(screw_type) : nut_type;
nut_washer_type = nut_washer(nut_type);
nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
nut_offset = sk_base_height(type) + part_thickness;
screw_length = max_screw_depth ? screw_shorter_than(sk_base_height(type) + screw_washer_thickness + max_screw_depth)
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type));
sk_bracket_hole_positions(type) {
screw_and_washer(screw_type, screw_length);
translate_z(-nut_offset)
vflip()
if(nut_washer_type)
nut_and_washer(nut_type);
else
sliding_t_nut(nut_type);
}
}

33
vitamins/sk_brackets.scad Normal file
View File

@@ -0,0 +1,33 @@
//
// 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/>.
//
//
// SK shaft support brackets
//
include <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>

View File

@@ -22,7 +22,7 @@
//
include <../core.scad>
use <pcb.scad>
include <../vitamins/screws.scad>
include <screws.scad>
function vero_assembly(type) = type[1]; //! Name of the assembly
function vero_holes(type) = type[2]; //! Number of holes in each strip