1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-04 12:45:30 +02:00

Compare commits

..

34 Commits

Author SHA1 Message Date
Chris Palmer
a2ce3f1278 Updated readme 2020-02-27 09:44:54 +00:00
Chris Palmer
01eb6931d9 Merge branch 'extrusion_center' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_center 2020-02-27 09:41:01 +00:00
Chris Palmer
c09a74b4c9 Added center option to spring and documented the origin of rods, etc. 2020-02-27 09:39:05 +00:00
Martin Budden
aab7f3d683 Added center parameter. Added cornerhole dimensions to E20. 2020-02-27 09:03:23 +00:00
Chris Palmer
ad719dad5a Added copyright boiler plate and description.
Updated images and readme.
2020-02-26 19:43:02 +00:00
Chris Palmer
00690b61d2 Merge branch 'extrusion_corner_brackets' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_corner_brackets 2020-02-26 19:23:39 +00:00
Chris Palmer
1a24e0d87e Added image and updated readme. 2020-02-26 15:55:22 +00:00
Chris Palmer
171c9a6a34 Merge branch 'pcb_additions' of https://github.com/martinbudden/NopSCADlib into martinbudden-pcb_additions 2020-02-26 15:39:12 +00:00
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
e87dffd92c More pcb component examples. Allowed more colour setting. 2020-02-26 07:19:55 +00:00
Martin Budden
c364bf06b2 Code tidy. 2020-02-25 22:34:13 +00:00
Martin Budden
1668f9c54c Naming update. 2020-02-25 22:23:44 +00:00
Martin Budden
e0dd174010 Parameterisation of extrusion brackets. 2020-02-25 22:19:20 +00:00
Martin Budden
f104bd42e5 Added back jst_xh connector to ramps endstop. 2020-02-25 21:38:53 +00:00
Martin Budden
8342ba87e9 Update as per code review. 2020-02-25 21:07:29 +00:00
Martin Budden
0e58e92fbc Allowed parameterised green terminals on PCBs. 2020-02-25 21:01:04 +00:00
Martin Budden
1af2e18594 Added usb_Ax1 and potentiometer. 2020-02-25 20:39:37 +00:00
Martin Budden
598527edbe Added a test pcb. 2020-02-25 20:13:15 +00:00
Martin Budden
9c666f8f47 Merge branch 'pin_header_color' into pcb_additions 2020-02-25 19:07:58 +00:00
Martin Budden
bc1f135e40 Added ability to set socket color. 2020-02-25 17:06:16 +00:00
Martin Budden
ce36729e50 Allow pin header base colour to be set on PCB. 2020-02-25 17:05:48 +00:00
Martin Budden
1dca024e64 Internal and external corner brackets for 20nn extrusion. 2020-02-25 16:53:51 +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
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
50 changed files with 787 additions and 187 deletions

View File

@@ -22,7 +22,7 @@
// //
include <core.scad> include <core.scad>
include <vitamins/fans.scad> include <vitamins/psus.scad>
include <vitamins/inserts.scad> include <vitamins/inserts.scad>
include <vitamins/ring_terminals.scad> include <vitamins/ring_terminals.scad>
include <vitamins/rails.scad> include <vitamins/rails.scad>
@@ -34,14 +34,11 @@ include <vitamins/components.scad>
include <vitamins/hot_ends.scad> include <vitamins/hot_ends.scad>
include <vitamins/tubings.scad> include <vitamins/tubings.scad>
include <vitamins/zipties.scad> include <vitamins/zipties.scad>
include <vitamins/linear_bearings.scad> include <vitamins/scs_bearing_blocks.scad>
include <vitamins/rod.scad> include <vitamins/rod.scad>
include <vitamins/leadnuts.scad> include <vitamins/leadnuts.scad>
include <vitamins/bulldogs.scad> include <vitamins/bulldogs.scad>
include <vitamins/pillars.scad> include <vitamins/pillars.scad>
include <vitamins/psus.scad>
include <vitamins/iecs.scad>
include <vitamins/rockers.scad>
include <vitamins/ssrs.scad> include <vitamins/ssrs.scad>
include <vitamins/d_connectors.scad> include <vitamins/d_connectors.scad>
include <vitamins/buttons.scad> include <vitamins/buttons.scad>
@@ -55,7 +52,6 @@ include <vitamins/transformers.scad>
include <vitamins/variacs.scad> include <vitamins/variacs.scad>
include <vitamins/springs.scad> include <vitamins/springs.scad>
include <vitamins/batteries.scad> include <vitamins/batteries.scad>
include <vitamins/microswitches.scad>
include <vitamins/ball_bearings.scad> include <vitamins/ball_bearings.scad>
include <vitamins/light_strips.scad> include <vitamins/light_strips.scad>
include <vitamins/spools.scad> include <vitamins/spools.scad>
@@ -64,7 +60,6 @@ include <vitamins/ldrs.scad>
include <vitamins/geared_steppers.scad> include <vitamins/geared_steppers.scad>
include <vitamins/extrusions.scad> include <vitamins/extrusions.scad>
include <vitamins/sk_brackets.scad> include <vitamins/sk_brackets.scad>
include <vitamins/scs_bearing_blocks.scad>
use <vitamins/jack.scad> use <vitamins/jack.scad>
use <vitamins/meter.scad> use <vitamins/meter.scad>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

227
readme.md
View File

@@ -21,22 +21,23 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#Bom">Bom</a> </td></tr> <tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#Bom">Bom</a> </td></tr>
<tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr> <tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr>
<tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Global">Global</a> </td></tr> <tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Global">Global</a> </td></tr>
<tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Pcbs">Pcbs</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr> <tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Pcb">Pcb</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr>
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr> <tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Pcbs">Pcbs</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr> <tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Psus">Psus</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr> <tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr> <tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Psus">Psus</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr> <tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr> <tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#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 = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</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 = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</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 = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</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 = "#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 = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</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 = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Scs_bearing_blocks">Scs_bearing_blocks</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 = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</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 = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</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 = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Sk_brackets">Sk_brackets</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 = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td></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 = "#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 = "#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 = "#Ldrs">Ldrs</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
@@ -589,6 +590,54 @@ LCD dispays.
| 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" | | 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" |
<a href="#top">Top</a>
---
<a name="Extrusion_brackets"></a>
## Extrusion_brackets
Brackets for joining extrusions at a corner.
[vitamins/extrusion_brackets.scad](vitamins/extrusion_brackets.scad) Object definitions.
[vitamins/extrusion_bracket.scad](vitamins/extrusion_bracket.scad) Implementation.
[tests/extrusion_brackets.scad](tests/extrusion_brackets.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```extrusion_corner_bracket_base_thickness(type)``` | Thickness of base of bracket |
| ```extrusion_corner_bracket_hole_offset(type)``` | Hole offset from corner |
| ```extrusion_corner_bracket_side_thickness(type)``` | Thickness of side of bracket |
| ```extrusion_corner_bracket_size(type)``` | Size of bracket |
| ```extrusion_inner_corner_bracket_size(type)``` | Size of inner bracket |
### Modules
| Module | Description |
|:--- |:--- |
| ```extrusion_corner_bracket(type)``` | Corner bracket for extrusion |
| ```extrusion_corner_bracket_assembly(type, part_thickness = 2, screw_type = M4_cap_screw, nut_type = M4_sliding_t_nut, max_screw_depth = 6)``` | Assembly with fasteners in place |
| ```extrusion_corner_bracket_hole_positions(type)``` | Place children at hole positions |
| ```extrusion_inner_corner_bracket(type, grub_screws = true)``` | Inner corner bracket for extrusion |
![extrusion_brackets](tests/png/extrusion_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```extrusion(E2020, 20, false)``` | Extrusion E2020 x 20mm |
| 1 | ```extrusion(E2020, 30, false)``` | Extrusion E2020 x 30mm |
| 1 | ```extrusion(E2020, 40, false)``` | Extrusion E2020 x 40mm |
| 1 | ```extrusion(E2020, 50, false)``` | Extrusion E2020 x 50mm |
| 2 | ```extrusion_corner_bracket(E20_corner_bracket)``` | Extrusion corner bracket 20 |
| 2 | ```extrusion_inner_corner_bracket(E20_inner_corner_bracket, true)``` | Extrusion inner corner bracket 4.5 |
| 1 | ```extrusion_inner_corner_bracket(E20_inner_corner_bracket, false)``` | Extrusion inner corner bracket 4.5 |
| 4 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a> <a href="#top">Top</a>
--- ---
@@ -620,21 +669,21 @@ Aluminium extrusion.
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```extrusion(type, length, cornerHole = false)``` | Draw the specified extrusion | | ```extrusion(type, length, center = false, cornerHole = false)``` | Draw the specified extrusion |
![extrusions](tests/png/extrusions.png) ![extrusions](tests/png/extrusions.png)
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```extrusion(E2020, 80)``` | Extrusion E2020 x 80mm | | 1 | ```extrusion(E2020, 80, false)``` | Extrusion E2020 x 80mm |
| 1 | ```extrusion(E2040, 80)``` | Extrusion E2040 x 80mm | | 1 | ```extrusion(E2040, 80, false)``` | Extrusion E2040 x 80mm |
| 1 | ```extrusion(E2060, 80)``` | Extrusion E2060 x 80mm | | 1 | ```extrusion(E2060, 80, false)``` | Extrusion E2060 x 80mm |
| 1 | ```extrusion(E2080, 80)``` | Extrusion E2080 x 80mm | | 1 | ```extrusion(E2080, 80, false)``` | Extrusion E2080 x 80mm |
| 1 | ```extrusion(E3030, 80)``` | Extrusion E3030 x 80mm | | 1 | ```extrusion(E3030, 80, false)``` | Extrusion E3030 x 80mm |
| 1 | ```extrusion(E3060, 80)``` | Extrusion E3060 x 80mm | | 1 | ```extrusion(E3060, 80, false)``` | Extrusion E3060 x 80mm |
| 1 | ```extrusion(E4040, 80)``` | Extrusion E4040 x 80mm | | 1 | ```extrusion(E4040, 80, false)``` | Extrusion E4040 x 80mm |
| 1 | ```extrusion(E4080, 80)``` | Extrusion E4080 x 80mm | | 1 | ```extrusion(E4080, 80, false)``` | Extrusion E4080 x 80mm |
<a href="#top">Top</a> <a href="#top">Top</a>
@@ -1131,13 +1180,15 @@ KP pillow block bearings
| ---:|:--- |:---| | ---:|:--- |:---|
| 1 | ```kp_pillow_block(KP000)``` | KP000 pillow block | | 1 | ```kp_pillow_block(KP000)``` | KP000 pillow block |
| 1 | ```kp_pillow_block(KP001)``` | KP001 pillow block | | 1 | ```kp_pillow_block(KP001)``` | KP001 pillow block |
| 1 | ```kp_pillow_block(KP08)``` | KP08 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(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T | | 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 2 | ```nut(M5_nut, nyloc = undef)``` | Nut M5 x 4mm | | 2 | ```nut(M5_nut, nyloc = undef)``` | Nut M5 x 4mm |
| 2 | ```screw(M4_cap_screw, 10)``` | Screw M4 cap x 10mm | | 4 | ```screw(M4_cap_screw, 10)``` | Screw M4 cap x 10mm |
| 4 | ```screw(M5_cap_screw, 12)``` | Screw M5 cap x 12mm | | 4 | ```screw(M5_cap_screw, 12)``` | Screw M5 cap x 12mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm | | 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 6 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm | | 6 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
@@ -1763,6 +1814,88 @@ A permanent magnet that can be magnatized and de-magnatized electronically.
| 1 | ```opengrab()``` | OpenGrab V3 electro permanent magnet | | 1 | ```opengrab()``` | OpenGrab V3 electro permanent magnet |
<a href="#top">Top</a>
---
<a name="Pcb"></a>
## Pcb
PCBs and perfboard with optional components. The shape can be a rectangle with optionally rounded corners or a polygon for odd shapes like Arduino.
[vitamins/pcb.scad](vitamins/pcb.scad) Implementation.
[tests/pcb.scad](tests/pcb.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```hdmi_depth(type)``` | Front to back depth |
| ```hdmi_height(type)``` | Outside height above the PCB |
| ```hdmi_height1(type)``` | Inside height at the sides |
| ```hdmi_height2(type)``` | Inside height in the middle |
| ```hdmi_thickness(type)``` | Wall thickness of the metal |
| ```hdmi_width1(type)``` | Inside width at the top |
| ```hdmi_width2(type)``` | Inside width at the bottom |
| ```pcb_accessories(type)``` | List of accessories to go on the BOM, SD cards, USB cables, etc. |
| ```pcb_colour(type)``` | Colour of the subtrate |
| ```pcb_components(type)``` | List of components |
| ```pcb_grid(type)``` | Grid if a perfboard |
| ```pcb_hole_d(type)``` | Mounting hole diameter |
| ```pcb_holes(type)``` | List of hole positions |
| ```pcb_land_d(type)``` | Pad around mounting hole |
| ```pcb_length(type)``` | Length |
| ```pcb_name(type)``` | Description |
| ```pcb_parts_on_bom(type)``` | True if the parts should be separate BOM items |
| ```pcb_polygon(type)``` | Optional outline polygon for odd shaped boards |
| ```pcb_radius(type)``` | Corner radius |
| ```pcb_thickness(type)``` | Thickness |
| ```pcb_width(type)``` | Width |
### Functions
| Function | Description |
|:--- |:--- |
| ```pcb_component_position(type, name, index = 0)``` | Return x y position of specified component |
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
### Modules
| Module | Description |
|:--- |:--- |
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and color |
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
| ```flex(cutout = false)``` | Draw flexistrip connector |
| ```hdmi(type, cutout = false)``` | Draw HDMI socket |
| ```jack(cutout = false)``` | Draw 3.5mm jack |
| ```molex_254(ways)``` | Draw molex header |
| ```pcb(type)``` | Draw specified PCB |
| ```pcb_assembly(type, height, thickness)``` | Draw PCB assembly with spaces and fasteners in place |
| ```pcb_base(type, height, thickness, wall = 2)``` | Generate STL for a base with PCB spacers |
| ```pcb_component(comp, cutouts = false, angle = undef)``` | Draw pcb component from description |
| ```pcb_component_position(type, name)``` | Position child at the specified component position |
| ```pcb_components(type, cutouts = false, angle = undef)``` | Draw list of PCB components on the PCB |
| ```pcb_cutouts(type, angle = undef)``` | Make cut outs to clear components on a PCB |
| ```pcb_grid(type, x, y, z = 0)``` | Positions children at specified grid position |
| ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions |
| ```pcb_spacer(screw, height, wall = 1.8, taper = 0)``` | Generate STL for PCB spacer |
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
| ```uSD(size, cutout = false)``` | Draw uSD socket |
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
| ```usb_B(cutout = false)``` | Draw USB B connector |
| ```usb_uA(cutout = false)``` | Draw USB micro A connector |
![pcb](tests/png/pcb.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```pcb(TestPCB)``` | Test PCB |
<a href="#top">Top</a> <a href="#top">Top</a>
--- ---
@@ -1832,8 +1965,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions | | ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions |
| ```pcb_spacer(screw, height, wall = 1.8, taper = 0)``` | Generate STL for PCB spacer | | ```pcb_spacer(screw, height, wall = 1.8, taper = 0)``` | Generate STL for PCB spacer |
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector | | ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
| ```terminal_35(ways)``` | Draw 3.5mm terminal block | | ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
| ```uSD(size, cutout = false)``` | Draw uSD socket | | ```uSD(size, cutout = false)``` | Draw uSD socket |
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket | | ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
| ```usb_B(cutout = false)``` | Draw USB B connector | | ```usb_B(cutout = false)``` | Draw USB B connector |
| ```usb_uA(cutout = false)``` | Draw USB micro A connector | | ```usb_uA(cutout = false)``` | Draw USB micro A connector |
@@ -1995,8 +2129,8 @@ Pin headers and sockets, etc.
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header | | ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
| ```jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour)``` | Draw JST XH connector | | ```jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour)``` | Draw JST XH connector |
| ```pin(type, length = undef)``` | Draw a header pin | | ```pin(type, length = undef)``` | Draw a header pin |
| ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false)``` | Draw pin header | | ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false)``` | Draw pin socket | | ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket |
![pin_headers](tests/png/pin_headers.png) ![pin_headers](tests/png/pin_headers.png)
@@ -2340,6 +2474,8 @@ Rocker switch. Also used for neon indicator in the same form factor.
## Rod ## Rod
Steel rods and studding with chamfered ends. Steel rods and studding with chamfered ends.
These items are sysmtrical, so by default the origin is in the centre but it can be changed to the bottom.
[vitamins/rod.scad](vitamins/rod.scad) Implementation. [vitamins/rod.scad](vitamins/rod.scad) Implementation.
@@ -2640,7 +2776,7 @@ SK shaft support brackets
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```sk_bracket(type)``` | SK shaft support bracket | | ```sk_bracket(type)``` | SK shaft support bracket |
| ```sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef)``` | Assembly with fasteners in place | | ```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_bracket_hole_positions(type)``` | Place children at hole positions |
![sk_brackets](tests/png/sk_brackets.png) ![sk_brackets](tests/png/sk_brackets.png)
@@ -2648,17 +2784,21 @@ SK shaft support brackets
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 2 | ```extrusion(E2020, 20, false)``` | Extrusion E2020 x 20mm |
| 2 | ```extrusion(E3030, 20, false)``` | 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(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T | | 2 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 4 | ```nut(M5_nut, nyloc = undef)``` | Nut M5 x 4mm | | 2 | ```nut(M5_nut, nyloc = undef)``` | Nut M5 x 4mm |
| 1 | ```sk_bracket(SK10)``` | SK10 shaft support bracket | | 1 | ```sk_bracket(SK10)``` | SK10 shaft support bracket |
| 1 | ```sk_bracket(SK12)``` | SK12 shaft support bracket | | 1 | ```sk_bracket(SK12)``` | SK12 shaft support bracket |
| 1 | ```sk_bracket(SK16)``` | SK16 shaft support bracket | | 1 | ```sk_bracket(SK16)``` | SK16 shaft support bracket |
| 1 | ```sk_bracket(SK8)``` | SK8 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_cap_screw, 12)``` | Screw M4 cap x 12mm |
| 6 | ```screw(M5_cap_screw, 16)``` | Screw M5 cap x 16mm | | 2 | ```screw(M4_dome_screw, 12)``` | Screw M4 dome x 12mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm | | 4 | ```screw(M5_cap_screw, 16)``` | Screw M5 cap x 16mm |
| 10 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm | | 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> <a href="#top">Top</a>
@@ -2747,6 +2887,8 @@ Filament spool models
## Springs ## Springs
Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower. Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower.
By default springs have their origin at the bottom but can be centered.
[vitamins/springs.scad](vitamins/springs.scad) Object definitions. [vitamins/springs.scad](vitamins/springs.scad) Object definitions.
@@ -2775,7 +2917,7 @@ Compression springs. Can be tapered, have open, closed or ground ends. Ground en
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```comp_spring(type, l = 0)``` | Draw specified spring, l can be set to specify the compressed length. | | ```comp_spring(type, l = 0, center = false)``` | Draw specified spring, l can be set to specify the compressed length. |
![springs](tests/png/springs.png) ![springs](tests/png/springs.png)
@@ -5130,11 +5272,12 @@ Small holes can get away without it, but they print better with truncated teardr
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```semi_teardrop(h, r, d = undef, center = true)``` | A semi teardrop in the positive Y domain | | ```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)``` | 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(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_plus(h, r, center = true, truncate = true)``` | Slightly bigger teardrop to allow for the 3D printing staircase effect | | ```teardrop_chamfer(h, center, chamfer)``` | Helper module for adding chamfer to a teardrop |
| ```tearslot(h, r, w, center = true)``` | A horizontal slot that doesn't need support material | | ```teardrop_plus(h, r, center = true, truncate = true, chamfer = 0)``` | Slightly bigger teardrop to allow for the 3D printing staircase effect |
| ```vertical_tearslot(h, r, l, center = true)``` | A vertical slot that doesn't need support material | | ```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) ![teardrops](tests/png/teardrops.png)

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,60 @@
//
// 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>
include <../vitamins/extrusion_brackets.scad>
include <../vitamins/extrusions.scad>
include <../vitamins/washers.scad>
include <../vitamins/nuts.scad>
module extrusion_brackets() {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
translate([30, 0])
extrusion_inner_corner_bracket(E20_inner_corner_bracket, grub_screws = false);
translate([60, 0])
extrusion_corner_bracket_assembly(E20_corner_bracket);
eWidth = extrusion_width(E2020);
translate([0, 60]) {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 20);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 40);
}
translate([60, 60]) {
extrusion_corner_bracket_assembly(E20_corner_bracket);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 30);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 50);
}
}
if($preview)
let($show_threads = true)
extrusion_brackets();

View File

@@ -23,12 +23,12 @@ include <../vitamins/kp_pillow_blocks.scad>
include <../vitamins/nuts.scad> include <../vitamins/nuts.scad>
module kp_pillow_blocks() { module kp_pillow_blocks() {
screws = [M4_cap_screw, M5_cap_screw, M5_cap_screw]; screws = [M4_cap_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw];
nuts = [M4_sliding_t_nut, M5_sliding_t_nut, M5_nut]; 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]]) 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]); kp_pillow_block_assembly(kp_pillow_blocks[$i], screw_type = screws[$i], nut_type = nuts[$i]);
} }
if($preview) if($preview)
kp_pillow_blocks(); kp_pillow_blocks();

109
tests/pcb.scad Normal file
View File

@@ -0,0 +1,109 @@
//
// 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 <../vitamins/pcb.scad>
include <../vitamins/microswitches.scad>
include <../vitamins/d_connectors.scad>
gt_5x17 = ["gt_5x17", 5, 10, 17, 5, 11, 0.4, 9, 2,1.5, 1, 3, 6, 0, 0, 0];
gt_5x11 = ["gt_5x11", 5, 8, 11, 5, 7, 0.4, 7, 1.5,1.5, 1,2.5, 6, 0, 0, 0];
TMC2130HeatSinkColor = "DeepSkyBlue";
TMC2130 = ["TMC2130", "TMC2130",
20, 14, 1.6, 0, 3, 0, "white", false, [],
[
[ 10, 1, 0, "-2p54header", 8, 1 ,undef, "blue" ],
[ 10, 13, 0, "-2p54header", 8, 1],
[ 12, 7, 0, "-chip", 6, 4, 1, grey20 ],
// mock up a heat sink
[ 10, 7, 0, "block", 9, 9, 2, TMC2130HeatSinkColor ],
[ 10, 11, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 9, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 7, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 5, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 3, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
],
[]
];
test_pcb = ["TestPCB", "Test PCB",
50, 500, 1.6, // length, width, thickness
3, // Corner radius
2.75, // Mounting hole diameter
6, // Pad around mounting hole
"green",// Color
false, // True if the parts should be separate BOM items
// hole offsets
[ [3, 3], [3, -3], [-3, 3], [-3, -3] ],
// components
[
[ 10, 10, 0, "2p54header", 4, 1],
[ 25, 10, 0, "2p54header", 5, 1, undef, "blue" ],
[ 10, 20, 0, "2p54boxhdr", 4, 2],
[ 10, 30, 0, "2p54socket", 6, 1],
[ 25, 30, 0, "2p54socket", 4, 1, undef, undef, undef, "red" ],
[ 10, 40, 0, "chip", 10, 5, 1, grey20],
[ 10, 60, 180, "rj45"],
[ 8, 80, 180, "usb_A"],
[ 8, 100, 180, "usb_Ax2"],
[ 3, 120, 180, "usb_uA"],
[ 8, 140, 180, "usb_B"],
[ 10, 160, 0, "buzzer"],
[ 25, 160, 0, "buzzer", 4.5, 8.5],
[ 10, 175, 0, "potentiometer"],
[ 30, 175, 0, "potentiometer", 7, 8],
[ 8, 190, 180, "jack"],
[ 6, 200, 180, "barrel_jack"],
[ 5, 220, 180, "hdmi"],
[ 3, 240, 180, "mini_hdmi"],
[ 10, 250, 0, "flex"],
[ 10, 265, 0, "flat_flex"],
[ 10, 280, 0, "D_plug", DCONN9],
[ 10, 300, 0, "molex_hdr", 2],
[ 10, 310, 0, "jst_xh", 2],
[ 10, 320, 180, "term254", 3],
[ 20, 320, 180, "term254", 3, undef, grey20],
[ 10, 340, 180, "gterm35", 4, [1,2]],
[ 20, 340, 180, "gterm35", 4, [1,2], "red"],
[ 30, 340, 180, "gterm", gt_5x11, 3],
[ 10, 360, 180, "gterm635", 2],
[ 25, 360, 180, "gterm635", 2, undef, "blue"],
[ 40, 360, 180, "gterm", gt_5x17, 2, undef, grey20],
[ 40, 340, 180, "gterm", gt_5x17, 3, [1], "red"],
[ 10, 380, 180, "term35", 4],
[ 20, 380, 180, "term35", 3, "lime"],
[ 10, 400, 0, "transition", 5],
[ 10, 410, 0, "block", 10, 5, 8, "orange"],
[ 10, 420, 0, "button_6mm"],
[ 10, 435, 0, "microswitch", small_microswitch],
[ 12, 450, 0, "pcb", 11, TMC2130 ],
[ 12, 456, 0, "2p54socket", 8, 1 ],
[ 12, 444, 0, "2p54socket", 8, 1, undef, undef, undef, "red" ],
[ 10, 470, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 6, 480, 180, "uSD", [12, 11.5, 1.4]],
],
// accessories
[]
];
if($preview)
let($show_threads = true)
pcb(test_pcb);

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
tests/png/pcb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 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: 38 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -20,12 +20,19 @@ include <../core.scad>
use <../utils/layout.scad> use <../utils/layout.scad>
include <../vitamins/sk_brackets.scad> include <../vitamins/sk_brackets.scad>
include <../vitamins/extrusions.scad>
module sk_brackets() { module sk_brackets() {
screws = [M5_cap_screw, M5_cap_screw, M4_cap_screw, M5_cap_screw]; screws = [M4_dome_screw, M4_cap_screw, M5_cap_screw, M5_cap_screw];
nuts = [undef, M5_nut, M4_sliding_t_nut, M5_sliding_t_nut]; nuts = [M4_hammer_nut, M4_sliding_t_nut, M5_sliding_t_nut, undef];
layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]]) // channel depth = 6 for 2020 extrusion, 9 for 3030 extrusion
sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i]); 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) if($preview)

View File

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

View File

@@ -21,45 +21,106 @@
//! For making horizontal holes that don't need support material. //! For making horizontal holes that don't need support material.
//! Small holes can get away without it, but they print better with truncated teardrops. //! 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 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
render(convexity = 5) module teardrop_2d(r, truncate) {
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)
hull() { hull() {
translate([-w/2,0,0]) teardrop(r = r, h = 0); circle4n(r);
translate([ w/2,0,0]) teardrop(r = r, h = 0); 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) 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() { hull() {
translate([0, l / 2]) teardrop(0, r, true); translate([0, l / 2]) teardrop(0, r, true);
translate([0, -l / 2]) translate([0, -l / 2]) circle4n(r);
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

@@ -43,7 +43,7 @@ module extrusion_cross_section(type, cornerHole) {
fillet = extrusion_fillet(type); fillet = extrusion_fillet(type);
cornerSize = (width-channelWidth)/2; cornerSize = (width-channelWidth)/2;
cornerSquare = (width-extrusion_channel_width_internal(type))/2; cornerSquare = (width-extrusion_channel_width_internal(type))/2;
cornerHoleDiameter =extrusion_corner_hole(type); cornerHoleDiameter = extrusion_corner_hole(type);
translate([-width/2,-width/2]) { translate([-width/2,-width/2]) {
difference() { difference() {
@@ -57,7 +57,7 @@ module extrusion_cross_section(type, cornerHole) {
translate([fillet,fillet]) translate([fillet,fillet])
square([cornerSquare-fillet,cornerSquare-fillet]); square([cornerSquare-fillet,cornerSquare-fillet]);
} }
if(cornerHole) if(cornerHole && cornerHoleDiameter > 0)
translate([cornerSquare/2,cornerSquare/2]) translate([cornerSquare/2,cornerSquare/2])
circle(d=cornerHoleDiameter); circle(d=cornerHoleDiameter);
} }
@@ -117,12 +117,12 @@ module extrusion_cross_section(type, cornerHole) {
extrusion_center_section(type); extrusion_center_section(type);
} }
module extrusion(type, length, cornerHole = false) { //! Draw the specified extrusion module extrusion(type, length, center = false, cornerHole = false) { //! Draw the specified extrusion
vitamin(str("extrusion(", type[0], ", ", length, "): Extrusion ", type[0], " x ", length, "mm")); vitamin(str("extrusion(", type[0], ", ", length, ", ", center, "): Extrusion ", type[0], " x ", length, "mm"));
color(grey90) color(grey90)
linear_extrude(height = length) linear_extrude(length, center = center)
extrusion_cross_section(type, cornerHole); extrusion_cross_section(type, cornerHole);
} }

View File

@@ -0,0 +1,139 @@
//
// 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/>.
//
//! Brackets for joining extrusions at a corner.
include <NopSCADlib/core.scad>
include <screws.scad>
include <nuts.scad>
function extrusion_inner_corner_bracket_size(type) = type[1]; //! Size of inner bracket
module extrusion_inner_corner_bracket(type, grub_screws = true) { //! Inner corner bracket for extrusion
vitamin(str("extrusion_inner_corner_bracket(", type[0], ", ", grub_screws, "): Extrusion inner corner bracket ", type[1].z));
size = extrusion_inner_corner_bracket_size(type);
armLength = size.x;
bottomTabOffset = 4;
topTabOffset = 10;
sizeBottom = [armLength - bottomTabOffset, 6, size.z];
sizeTop = [armLength - topTabOffset, 6, size.z];
tabSizeY1 = 10;
tabSizeY2 = 6;
tabSizeZ = 3.25;
holeRadius = M4_tap_radius;
translate([-size.z - 0.75, -size.z - 0.75, 0])
rotate([-90, 0, 0]) {
color("silver") {
translate([(armLength + bottomTabOffset) / 2, 0, tabSizeZ])
rotate([0, 180, 0])
extrusionSlidingNut(sizeBottom, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, (bottomTabOffset - armLength) / 2 + 5);
translate([tabSizeZ, 0, (armLength + topTabOffset) / 2])
rotate([0, -90, 0])
extrusionSlidingNut(sizeTop, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius,-(topTabOffset - armLength) / 2 - 5);
translate([0, -size.z / 2, 0]) {
cube([bottomTabOffset, size.z, size.z]);
cube([size.z, size.z, topTabOffset]);
}
}
if(grub_screws)
not_on_bom() no_explode() {
grubScrewLength = 6;
for(angle = [[0, 0, 0], [0, -90, 180]])
rotate(angle)
translate([armLength - 5, 0, size.z])
screw(M3_grub_screw, grubScrewLength);
}
}
}
function extrusion_corner_bracket_size(type) = type[1]; //! Size of bracket
function extrusion_corner_bracket_base_thickness(type) = type[2]; //! Thickness of base of bracket
function extrusion_corner_bracket_side_thickness(type) = type[3]; //! Thickness of side of bracket
function extrusion_corner_bracket_hole_offset(type) = type[4]; //! Hole offset from corner
module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
echo(type=type);
vitamin(str("extrusion_corner_bracket(", type[0], "): Extrusion corner bracket ", type[1].z));
eSize = extrusion_corner_bracket_size(type).z;
cbSize = extrusion_corner_bracket_size(type).x;
baseThickness = extrusion_corner_bracket_base_thickness(type);
module base() {
linear_extrude(baseThickness)
difference() {
translate([0, -eSize / 2, 0])
square([cbSize, eSize]);
hull() {
translate([extrusion_corner_bracket_hole_offset(type) + 1.5, 0, 0])
circle(r = M5_clearance_radius);
translate([extrusion_corner_bracket_hole_offset(type) - 1.5, 0, 0])
circle(r = M5_clearance_radius);
}
}
}
color("silver") {
rotate([90, 0, 90])
base();
translate([0, baseThickness, 0])
rotate([90, 0, 0])
base();
sideThickness = extrusion_corner_bracket_side_thickness(type);
for(z = [-eSize / 2, eSize / 2 - sideThickness]) {
translate_z(z) {
right_triangle(cbSize, cbSize, sideThickness, center = false);
cube([5, cbSize, sideThickness]);
cube([cbSize, 5, sideThickness]);
}
}
}
}
module extrusion_corner_bracket_hole_positions(type) { //! Place children at hole positions
for(angle = [ [0, 90, 0], [-90, -90, 0] ])
rotate(angle)
translate([0, extrusion_corner_bracket_hole_offset(type), extrusion_corner_bracket_base_thickness(type)])
children();
}
module extrusion_corner_bracket_assembly(type, part_thickness = 2, screw_type = M4_cap_screw, nut_type = M4_sliding_t_nut, max_screw_depth = 6) { //! Assembly with fasteners in place
extrusion_corner_bracket(type);
screw_washer_thickness = washer_thickness(screw_washer(screw_type));
nut_washer_type = nut_washer(nut_type);
nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
nut_offset = extrusion_corner_bracket_base_thickness(type) + part_thickness;
screw_length = max_screw_depth ? screw_shorter_than(extrusion_corner_bracket_base_thickness(type) + screw_washer_thickness + max_screw_depth)
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type));
extrusion_corner_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
rotate(90)
sliding_t_nut(nut_type);
}
}

View File

@@ -0,0 +1,29 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// Extrusion brackets
//
E20_inner_corner_bracket = [ "E20_inner_corner_bracket", [25, 25, 4.5] ];
E20_corner_bracket = [ "E20_corner_bracket", [28, 28, 20], 2, 3, 19.5];
use <extrusion_bracket.scad>

View File

@@ -20,10 +20,10 @@
// Extrusion // Extrusion
// //
// W H d1 d2 s cw cwi t st f // W H d1 d2 s cw cwi t st f
E2020 = [ "E2020", 20, 20, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ]; E2020 = [ "E2020", 20, 20, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E2040 = [ "E2040", 20, 40, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ]; E2040 = [ "E2040", 20, 40, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E2060 = [ "E2060", 20, 60, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ]; E2060 = [ "E2060", 20, 60, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E2080 = [ "E2080", 20, 80, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ]; E2080 = [ "E2080", 20, 80, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E3030 = [ "E3030", 30, 30, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ]; E3030 = [ "E3030", 30, 30, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E3060 = [ "E3060", 30, 60, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ]; E3060 = [ "E3060", 30, 60, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E4040 = [ "E4040", 40, 40, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ]; E4040 = [ "E4040", 40, 40, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];

View File

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

View File

@@ -1,5 +1,5 @@
// //
// NopSCADlib Copyright Chris Palmer 2018 // NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com // nop.head@gmail.com
// hydraraptor.blogspot.com // hydraraptor.blogspot.com
// //
@@ -114,4 +114,3 @@ module kp_pillow_block_assembly(type, part_thickness = 2, screw_type = M5_cap_sc
sliding_t_nut(nut_type); sliding_t_nut(nut_type);
} }
} }

View File

@@ -1,5 +1,5 @@
// //
// NopSCADlib Copyright Chris Palmer 2018 // NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com // nop.head@gmail.com
// hydraraptor.blogspot.com // hydraraptor.blogspot.com
// //
@@ -21,15 +21,15 @@
//! KP pillow block bearings //! KP pillow block bearings
// //
include <../core.scad>
include <screws.scad> include <screws.scad>
include <ball_bearings.scad> include <ball_bearings.scad>
// d H L J A N H1 H0 K S b bolthole bearing // d H L J A N H1 H0 K S b bolthole bearing
KP08 = ["KP08", 8, 18, 55, 42, 13, 4.5, 5, 29, 0.0, 0, 22, M4_clearance_radius, BB608]; KP08_15 = ["KP08_15", 8, 15, 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]; KP08_18 = ["KP08_18", 8, 18, 55, 42, 13, 4.5, 5, 29, 0.0, 0, 22, M4_clearance_radius, BB608];
KP001 = ["KP001", 12, 19, 71, 56, 16, 7.0, 6, 38, 14.5, 4, 32, M6_clearance_radius, BB6201]; 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, KP000, KP001]; kp_pillow_blocks = [KP08_15, KP08_18, KP000, KP001];
use <kp_pillow_block.scad> use <kp_pillow_block.scad>

View File

@@ -23,7 +23,7 @@
include <../core.scad> include <../core.scad>
include <screws.scad> include <screws.scad>
include <ring_terminals.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_width(type) = type[1]; //! Width at the base
function mains_socket_depth(type) = type[2]; //! Depth at the base function mains_socket_depth(type) = type[2]; //! Depth at the base

View File

@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib. // You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>. // If not, see <https://www.gnu.org/licenses/>.
// //
include <washers.scad>
// //
// Nuts // Nuts
// //

View File

@@ -31,6 +31,7 @@ include <microswitches.scad>
use <../utils/rounded_cylinder.scad> use <../utils/rounded_cylinder.scad>
use <../utils/dogbones.scad> use <../utils/dogbones.scad>
use <../utils/thread.scad>
use <../utils/tube.scad> use <../utils/tube.scad>
use <d_connector.scad> use <d_connector.scad>
@@ -79,16 +80,21 @@ module chip(length, width, thickness, colour, cutout = false) //! Draw a coloure
color(colour) color(colour)
translate_z(thickness / 2) cube([length, width, thickness], center = true); translate_z(thickness / 2) cube([length, width, thickness], center = true);
module usb_Ax1(cutout = false) { //! Draw USB type A single socket
usb_A(h = 6.5, v_flange_l = 4.5, bar = 0, cutout = cutout);
}
module usb_Ax2(cutout = false) { //! Draw USB type A dual socket module usb_Ax2(cutout = false) { //! Draw USB type A dual socket
usb_A(h = 15.6, v_flange_l = 12.15, bar = 3.4, cutout = cutout);
}
module usb_A(h, v_flange_l, bar, cutout) {
l = 17; l = 17;
w = 13.25; w = 13.25;
h = 15.6;
flange_t = 0.4; flange_t = 0.4;
h_flange_h = 0.8; h_flange_h = 0.8;
h_flange_l = 11; h_flange_l = 11;
v_flange_h = 1; v_flange_h = 1;
v_flange_l = 12.15;
bar = 3.4;
socket_h = (h - 2 * flange_t - bar) / 2; socket_h = (h - 2 * flange_t - bar) / 2;
translate_z(h / 2) translate_z(h / 2)
@@ -203,11 +209,32 @@ module jack(cutout = false) { //! Draw 3.5mm jack
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color
color (colour) color (colour)
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height); tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height, center = false);
color("white") color("white")
cylinder(d = 2, h = max(height - 3 , 0.5)); cylinder(d = 2, h = max(height - 3 , 0.5));
} }
module potentiometer(h1, h2) {
color("silver") {
baseSize = [12, 11, 6];
translate_z(baseSize.z / 2)
cube(baseSize, center = true);
translate_z(baseSize.z) {
cylinder(d = 5, h = h1 - 0.5);
if (show_threads)
male_metric_thread(6, metric_coarse_pitch(5), length = h1 - 0.5, center = false);
}
translate_z(baseSize.z + h1 - 0.5)
cylinder(d = 3, h = 0.5);
translate_z(baseSize.z + h1)
linear_extrude(h2)
difference() {
circle(d=5);
square([0.75,5], center = true);
}
}
}
function hdmi_depth(type) = type[2]; //! Front to back depth function hdmi_depth(type) = type[2]; //! Front to back depth
function hdmi_width1(type) = type[3]; //! Inside width at the top function hdmi_width1(type) = type[3]; //! Inside width at the top
function hdmi_width2(type) = type[4]; //! Inside width at the bottom function hdmi_width2(type) = type[4]; //! Inside width at the bottom
@@ -574,7 +601,7 @@ module flat_flex(cutout = false) { //! Draw flat flexistrip connector as used on
} }
} }
module terminal_35(ways) { //! Draw 3.5mm terminal block module terminal_35(ways, colour = "blue") { //! Draw 3.5mm terminal block
vitamin(str("terminal_35(", ways, "): Terminal block ", ways, " way 3.5mm")); vitamin(str("terminal_35(", ways, "): Terminal block ", ways, " way 3.5mm"));
pitch = 3.5; pitch = 3.5;
width = ways * pitch; width = ways * pitch;
@@ -592,7 +619,7 @@ module terminal_35(ways) { //! Draw 3.5mm terminal block
module single() { module single() {
screw_r = 1; screw_r = 1;
color("blue") { color(colour) {
rotate([90, 0, 0]) rotate([90, 0, 0])
linear_extrude(height = pitch, center = true) linear_extrude(height = pitch, center = true)
polygon(points = [ polygon(points = [
@@ -710,15 +737,17 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z); function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z);
function param(n, default = 0) = len(comp) > n ? comp[n] : default; function param(n, default = 0) = len(comp) > n ? comp[n] : default;
rotate(comp.z) { rotate(comp.z) {
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6), cutouts); if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6), cutouts, colour = param(7, undef));
if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6), cutouts); if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6), cutouts);
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7), param(8, false), cutouts); if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7), param(8, false), cutouts, param(9, undef));
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey30), cutouts); if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey30), cutouts);
if(show(comp, "rj45")) rj45(cutouts); if(show(comp, "rj45")) rj45(cutouts);
if(show(comp, "usb_A")) usb_Ax1(cutouts);
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts); if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
if(show(comp, "usb_uA")) usb_uA(cutouts); if(show(comp, "usb_uA")) usb_uA(cutouts);
if(show(comp, "usb_B")) usb_B(cutouts); if(show(comp, "usb_B")) usb_B(cutouts);
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20)); if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20));
if(show(comp, "potentiometer")) potentiometer(param(4, 5), param(5, 9));
if(show(comp, "jack")) jack(cutouts); if(show(comp, "jack")) jack(cutouts);
if(show(comp, "barrel_jack")) barrel_jack(cutouts); if(show(comp, "barrel_jack")) barrel_jack(cutouts);
if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts); if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts);
@@ -728,10 +757,11 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "D_plug")) if(!cutouts) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true); if(show(comp, "D_plug")) if(!cutouts) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
if(show(comp, "molex_hdr")) if(!cutouts) molex_254(comp[4]); if(show(comp, "molex_hdr")) if(!cutouts) molex_254(comp[4]);
if(show(comp, "jst_xh")) if(!cutouts) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef)); if(show(comp, "jst_xh")) if(!cutouts) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5]); if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5], param(6,"lime"));
if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5]); if(show(comp, "gterm")) if(!cutouts) green_terminal(comp[4], comp[5], comp[6], param(7,"lime"));
if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5]); if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5], param(6,"lime"));
if(show(comp, "term35")) if(!cutouts) terminal_35(comp[4]); if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5], param(6,"lime"));
if(show(comp, "term35")) if(!cutouts) terminal_35(comp[4], param(5,"blue"));
if(show(comp, "transition")) if(!cutouts) idc_transition(2p54header, comp[4], comp[5]); if(show(comp, "transition")) if(!cutouts) idc_transition(2p54header, comp[4], comp[5]);
if(show(comp, "block")) if(show(comp, "block"))
color(comp[7]) if(!cutouts) translate_z(comp[6] / 2) cube([comp[4], comp[5], comp[6]], center = true); color(comp[7]) if(!cutouts) translate_z(comp[6] / 2) cube([comp[4], comp[5], comp[6]], center = true);

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]], [], []]; 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", 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] [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], [ 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]; 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> use <pcb.scad>

View File

@@ -43,8 +43,9 @@ module pin(type, length = undef) { //! Draw a header pin
} }
} }
module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false) { //! Draw pin header module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour) { //! Draw pin header
pitch = hdr_pitch(type); pitch = hdr_pitch(type);
base_colour = colour ? colour : hdr_base_colour(type);
h = pitch; h = pitch;
ra_offset = 2.4; ra_offset = 2.4;
width = pitch * rows; width = pitch * rows;
@@ -79,7 +80,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
} }
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0]) translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0]) rotate([right_angle ? 90 : 0, 0, 0])
color(hdr_base_colour(type)) color(base_colour)
linear_extrude(height = h) linear_extrude(height = h)
for(x = [0 : cols - 1], y = [0 : rows - 1]) for(x = [0 : cols - 1], y = [0 : rows - 1])
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), pitch / 2]) translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), pitch / 2])
@@ -160,18 +161,19 @@ module idc_transition(type, cols = 5, skip = [], cutout = false) { //! Draw IDC
} }
} }
module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false) { //! Draw pin socket module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour) { //! Draw pin socket
pitch = hdr_pitch(type); pitch = hdr_pitch(type);
length = pitch * cols + 0.5; length = pitch * cols + 0.5;
width = pitch * rows - 0.08; width = pitch * rows - 0.08;
depth = height ? height : hdr_socket_depth(type); depth = height ? height : hdr_socket_depth(type);
base_colour = colour ? colour : hdr_base_colour(type);
ra_offset = 1.5; ra_offset = 1.5;
if(cutout) if(cutout)
; ;
else { else {
vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"), arg(smt, false, "smt"), vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"), arg(smt, false, "smt"),
"): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : "")); "): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : ""));
color(hdr_base_colour(type)) color(base_colour)
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0]) translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0]) rotate([right_angle ? 90 : 0, 0, 0])
translate_z(depth / 2) translate_z(depth / 2)

View File

@@ -19,6 +19,8 @@
// //
//! Steel rods and studding with chamfered ends. //! Steel rods and studding with chamfered ends.
//!
//! These items are sysmtrical, so by default the origin is in the centre but it can be changed to the bottom.
// //
include <../core.scad> include <../core.scad>
use <../utils/thread.scad> use <../utils/thread.scad>

View File

@@ -25,6 +25,7 @@ include <../core.scad>
use <washer.scad> use <washer.scad>
use <../utils/rounded_cylinder.scad> use <../utils/rounded_cylinder.scad>
use <../utils/thread.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_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 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_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 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) : ""); 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)); 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 // Screws
// //
include <washers.scad>
include <nuts.scad> include <nuts.scad>
No2_pilot_radius = 1.7 / 2; // self tapper into ABS No2_pilot_radius = 1.7 / 2; // self tapper into ABS
@@ -119,7 +118,7 @@ screw_lists = [
use <screw.scad> 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) = function find_screw(type, size, i = 0) =
i >= len(screws) ? undef i >= len(screws) ? undef

View File

@@ -22,11 +22,11 @@
// //
include <NopSCADlib/core.scad> include <../core.scad>
use <NopSCADlib/vitamins/screw.scad> use <screw.scad>
use <NopSCADlib/vitamins/nut.scad> use <nut.scad>
use <NopSCADlib/vitamins/washer.scad> use <washer.scad>
use <NopSCADlib/vitamins/linear_bearing.scad> use <linear_bearing.scad>
function scs_size(type) = [type[4],type[6],type[5]]; //! Size of scs bracket bounding block 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_hole_offset(type) = type[2]; //! Offset of bearing hole from base of block

View File

@@ -21,9 +21,8 @@
// SCS bearing blocks // SCS bearing blocks
// //
include <NopSCADlib/core.scad> include <screws.scad>
include <NopSCADlib/vitamins/screws.scad> include <linear_bearings.scad>
include <NopSCADlib/vitamins/linear_bearings.scad>
// T h E W L F G B C K S1 S2 L1 LB // 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]; SCS6UU = ["SCS6UU", 6, 9, 15, 30, 25, 18, 15, 20, 15, 5, M4_cap_screw, 3.4, 8, LM6UU];

View File

@@ -1,5 +1,5 @@
// //
// NopSCADlib Copyright Chris Palmer 2018 // NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com // nop.head@gmail.com
// hydraraptor.blogspot.com // hydraraptor.blogspot.com
// //
@@ -100,7 +100,7 @@ module sk_bracket_hole_positions(type) { //! Place children at hole positions
children(); children();
} }
module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, nut_type = undef) { //! Assembly with fasteners in place 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); sk_bracket(type);
screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type; screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type;
@@ -110,9 +110,8 @@ module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw,
nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0; nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
nut_offset = sk_base_height(type) + part_thickness; nut_offset = sk_base_height(type) + part_thickness;
screw_length = nut_washer_type ? screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type)) screw_length = max_screw_depth ? screw_shorter_than(sk_base_height(type) + screw_washer_thickness + max_screw_depth)
: screw_shorter_than(nut_offset + screw_washer_thickness + nut_thickness(nut_type) + 2); : screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type));
sk_bracket_hole_positions(type) { sk_bracket_hole_positions(type) {
screw_and_washer(screw_type, screw_length); screw_and_washer(screw_type, screw_length);
translate_z(-nut_offset) translate_z(-nut_offset)

View File

@@ -1,5 +1,5 @@
// //
// NopSCADlib Copyright Chris Palmer 2018 // NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com // nop.head@gmail.com
// hydraraptor.blogspot.com // hydraraptor.blogspot.com
// //
@@ -21,8 +21,7 @@
// SK shaft support brackets // SK shaft support brackets
// //
include <../core.scad> include <screws.scad>
include <../vitamins/screws.scad>
// d h E W L F G P B S bolthole // 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]; SK8 = ["SK8", 8, 20, 21, 42, 14, 32.8, 6, 18, 32, 5.5, M5_clearance_radius];
@@ -32,4 +31,3 @@ SK16 = ["SK16", 16, 27, 24, 48, 16, 44.0, 8, 25, 38, 5.5, M5_clearance_radius];
sk_brackets = [SK8, SK10, SK12, SK16]; sk_brackets = [SK8, SK10, SK12, SK16];
use <sk_bracket.scad> use <sk_bracket.scad>

View File

@@ -19,6 +19,8 @@
// //
//! Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower. //! Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower.
//!
//! By default springs have their origin at the bottom but can be centered.
// //
include <../core.scad> include <../core.scad>
@@ -64,7 +66,7 @@ function comp_spring(type, l = 0) = //! Calculate the mesh for spring
profile = circle_points(wire_d / 2 - eps, $fn = 16) profile = circle_points(wire_d / 2 - eps, $fn = 16)
) concat(type, [concat(sweep(path, profile), [l])]); ) concat(type, [concat(sweep(path, profile), [l])]);
module comp_spring(type, l = 0) { //! Draw specified spring, l can be set to specify the compressed length. module comp_spring(type, l = 0, center = false) { //! Draw specified spring, l can be set to specify the compressed length.
length = spring_length(type); length = spring_length(type);
closed = spring_closed(type); closed = spring_closed(type);
od = spring_od(type); od = spring_od(type);
@@ -79,14 +81,17 @@ module comp_spring(type, l = 0) { //! Draw specified spring, l can be set to spe
mesh = len(type) > 9 ? spring_mesh(type) : spring_mesh(comp_spring(type, l)); mesh = len(type) > 9 ? spring_mesh(type) : spring_mesh(comp_spring(type, l));
assert(l == mesh[2], "can't change the length of a pre-generated spring"); assert(l == mesh[2], "can't change the length of a pre-generated spring");
color(spring_colour(type)) len = l ? l : length;
if(ground) translate_z(center ? - len / 2 : 0) {
clip(zmin = 0, zmax = h) color(spring_colour(type))
if(ground)
clip(zmin = 0, zmax = h)
polyhedron(mesh[0], mesh[1]);
else
polyhedron(mesh[0], mesh[1]); polyhedron(mesh[0], mesh[1]);
else
polyhedron(mesh[0], mesh[1]);
if($children) if($children)
translate_z(l) translate_z(len)
children(); children();
}
} }

View File

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