1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-08 06:01:16 +02:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Chris Palmer
2166a9be6a extrusion_corner_bracket_assembly() and extrusion_inner_corner_bracket() can now be passed the extrusion type.
E2020t and E4040t thinner extrusions added to work with the brackets.
Extrusions can now have recessed channels, round or square centre sections and holes.
Fixed the shape of extrusion centre section spars.
T-nuts now have 45 degree chamfers instead of a fixed 1mm minimum thickness.
2021-09-05 10:24:42 +01:00
Chris Palmer
511729008d Added missing documentation for sliding_t_nut(). 2021-09-03 15:47:15 +01:00
Chris Palmer
5111ec04bc E40_corner_bracket, E40_corner_bracket and M8_sliding_ball_t_nut added.
Inner corner brackets now show the long arm with chamfered ridges rather
than a normal T-nut and the grub screws are inserted to meet the extrusion.
2021-09-03 09:23:24 +01:00
Chris Palmer
cef3a620a6 Updated changelog 2021-08-31 23:41:34 +01:00
Chris Palmer
da5191e52c Merge branch 'martinbudden-M2p5_dome_screw' 2021-08-31 23:40:51 +01:00
17 changed files with 379 additions and 181 deletions

View File

@@ -3,6 +3,11 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v15.24.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.24.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.23.0...v15.24.0 "diff with v15.23.0")
* 2021-08-31 [`d9af5b7`](https://github.com/nophead/NopSCADlib/commit/d9af5b7f705791ca8ef230ecd1b831c042587002 "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2021-08-31 [`9d65f69`](https://github.com/nophead/NopSCADlib/commit/9d65f69bf3e7cd325d24bc5410a4763bb7164b8f "show commit") [M.B.](# "Martin Budden") Added `M2p5_dome_screw`.
### [v15.23.0](https://github.com/nophead/NopSCADlib/releases/tag/v15.23.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v15.22.0...v15.23.0 "diff with v15.22.0")
* 2021-08-31 [`00c5c90`](https://github.com/nophead/NopSCADlib/commit/00c5c90a5e74f47f0e6f5e3a7996f70fa34f0833 "show commit") [C.P.](# "Chris Palmer") Updated big picture

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 KiB

After

Width:  |  Height:  |  Size: 931 KiB

View File

@@ -963,34 +963,47 @@ Brackets for joining extrusions at a corner.
| Function | Description |
|:--- |:--- |
| `extrusion_corner_bracket_base_thickness(type)` | Thickness of base of bracket |
| `extrusion_corner_bracket_extrusion(type)` | Default extrusion this bracket is for |
| `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_corner_bracket_tnut(type)` | The sliding t-nut to use in the assembly |
| `extrusion_inner_corner_bracket_extrusion(type)` | Default extrusion this bracket is for |
| `extrusion_inner_corner_bracket_screw_offsets(type)` | Screw offsets from the ends |
| `extrusion_inner_corner_bracket_size(type)` | Size of inner bracket |
| `extrusion_inner_corner_bracket_tnut(type)` | The sliding t-nut it is based on |
### 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_assembly(type, part_thickness = undef, screw_type = undef, nut_type = undef, max_screw_depth = undef, extrusion = undef)` | 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_inner_corner_bracket(type, grub_screws = true, backwards = false, extrusion = undef)` | Inner corner bracket for extrusion |
![extrusion_brackets](tests/png/extrusion_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `extrusion(E2020, 20)` | Extrusion E2020 x 20mm |
| 1 | `extrusion(E2020, 30)` | Extrusion E2020 x 30mm |
| 1 | `extrusion(E2020, 40)` | Extrusion E2020 x 40mm |
| 1 | `extrusion(E2020, 50)` | 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 |
| 2 | `extrusion(E2020t, 20.5)` | Extrusion E2020t x 20.5mm |
| 1 | `extrusion(E2020t, 28)` | Extrusion E2020t x 28mm |
| 2 | `extrusion(E2020t, 39.5)` | Extrusion E2020t x 39.5mm |
| 1 | `extrusion(E2020t, 48)` | Extrusion E2020t x 48mm |
| 1 | `extrusion(E4040t, 27.4, cornerHole = true)` | Extrusion E4040t x 27.4mm |
| 1 | `extrusion(E4040t, 40, cornerHole = true)` | Extrusion E4040t x 40mm |
| 1 | `extrusion(E4040t, 60.4, cornerHole = true)` | Extrusion E4040t x 60.4mm |
| 1 | `extrusion(E4040t, 80, cornerHole = true)` | Extrusion E4040t x 80mm |
| 2 | `extrusion_corner_bracket(E20_corner_bracket)` | Extrusion corner bracket 20mm for E2020t |
| 2 | `extrusion_corner_bracket(E40_corner_bracket)` | Extrusion corner bracket 35mm for E4040t |
| 4 | `extrusion_inner_corner_bracket(E20_inner_corner_bracket)` | Extrusion inner corner bracket for E2020t |
| 2 | `extrusion_inner_corner_bracket(E40_inner_corner_bracket)` | Extrusion inner corner bracket for E4040t |
| 4 | `sliding_t_nut(M4_sliding_t_nut)` | Nut M4 sliding T |
| 4 | `sliding_t_nut(M8_sliding_ball_t_nut)` | Nut M8 sliding T with spring loaded ball |
| 4 | `screw(M4_cap_screw, 8)` | Screw M4 cap x 8mm |
| 4 | `screw(M8_cap_screw, 12)` | Screw M8 cap x 12mm |
| 4 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 4 | `washer(M8_washer)` | Washer M8 x 17mm x 1.6mm |
<a href="#top">Top</a>
@@ -1009,17 +1022,25 @@ Aluminium extrusion.
### Properties
| Function | Description |
|:--- |:--- |
| `extrusion_center_hole(type)` | Diameter of center hole |
| `extrusion_center_square(type)` | Size of center square |
| `extrusion_center_hole_wd(type)` | Diameter of center hole if -ve or square side if +ve |
| `extrusion_center_square_wd(type)` | Size of center square if +ve or tube diameter if -ve |
| `extrusion_channel_recess(type)` | Channel recess width and depth or false in none |
| `extrusion_channel_width(type)` | Channel width |
| `extrusion_channel_width_internal(type)` | Internal channel width |
| `extrusion_corner_hole(type)` | Diameter of corner hole |
| `extrusion_corner_hole_wd(type)` | Diameter of corner hole if -ve or square side if +ve |
| `extrusion_fillet(type)` | Radius of corner fillet |
| `extrusion_height(type)` | Height of extrusion |
| `extrusion_spar_thickness(type)` | Spar thickness |
| `extrusion_tab_thickness(type)` | Tab thickness |
| `extrusion_width(type)` | Width of extrusion |
### Functions
| Function | Description |
|:--- |:--- |
| `extrusion_center_hole(type)` | Diameter of center hole or side if square |
| `extrusion_center_square(type)` | Size of center square or tube |
| `extrusion_corner_hole(type)` | Diameter of corner hole or side if square |
### Modules
| Module | Description |
|:--- |:--- |
@@ -1032,12 +1053,14 @@ Aluminium extrusion.
| ---:|:--- |:---|
| 1 | `extrusion(E1515, 80)` | Extrusion E1515 x 80mm |
| 1 | `extrusion(E2020, 80)` | Extrusion E2020 x 80mm |
| 1 | `extrusion(E2020t, 80)` | Extrusion E2020t x 80mm |
| 1 | `extrusion(E2040, 80)` | Extrusion E2040 x 80mm |
| 1 | `extrusion(E2060, 80)` | Extrusion E2060 x 80mm |
| 1 | `extrusion(E2080, 80)` | Extrusion E2080 x 80mm |
| 1 | `extrusion(E3030, 80, cornerHole = true)` | Extrusion E3030 x 80mm |
| 1 | `extrusion(E3060, 80, cornerHole = true)` | Extrusion E3060 x 80mm |
| 1 | `extrusion(E4040, 80, cornerHole = true)` | Extrusion E4040 x 80mm |
| 1 | `extrusion(E4040t, 80, cornerHole = true)` | Extrusion E4040t x 80mm |
| 1 | `extrusion(E4080, 80, cornerHole = true)` | Extrusion E4080 x 80mm |
@@ -2048,6 +2071,7 @@ If a nut is given a child then it gets placed on its top surface.
| `nut_thickness(type, nyloc = false)` | Thickness of plain or nyloc version |
| `nut_trap_flat_radius(nut, horizontal = false)` | Radius across the flats of a nut trap |
| `nut_trap_radius(nut, horizontal = false)` | Radius across the corners of a nut trap |
| `t_nut_tab(type)` | Sliding t-nut T dimensions |
### Modules
| Module | Description |
@@ -2056,6 +2080,7 @@ If a nut is given a child then it gets placed on its top surface.
| `nut_and_washer(type, nyloc)` | Draw nut with corresponding washer |
| `nut_square(type, brass = false, nylon = false)` | Draw specified square nut |
| `nut_trap(screw, nut, depth = 0, horizontal = false, supported = false, h = 200)` | Make a nut trap |
| `sliding_t_nut(type)` | Draw a sliding T nut, T nut with a spring loaded ball or a hammer nut. |
| `wingnut(type)` | Draw a wingnut |
![nuts](tests/png/nuts.png)
@@ -2083,10 +2108,12 @@ If a nut is given a child then it gets placed on its top surface.
| 1 | `nut(M5_nut)` | Nut M5 x 4mm |
| 1 | `nut(M5_nut, nyloc = true)` | Nut M5 x 4mm nyloc |
| 1 | `nut(M5nS_thin_nut)` | Nut M5nS 8 x 2.7mm |
| 1 | `sliding_t_nut(M6_sliding_t_nut)` | Nut M6 hammer |
| 1 | `nut(M6_half_nut)` | Nut M6 x 3mm |
| 1 | `nut(M6_nut)` | Nut M6 x 5mm |
| 1 | `nut(M6_nut, nyloc = true)` | Nut M6 x 5mm nyloc |
| 1 | `nut(M6nS_thin_nut)` | Nut M6nS 10 x 3.2mm |
| 1 | `sliding_t_nut(M8_sliding_ball_t_nut)` | Nut M8 sliding T with spring loaded ball |
| 1 | `nut(M8_nut)` | Nut M8 x 6.5mm |
| 1 | `nut(M8_nut, nyloc = true)` | Nut M8 x 6.5mm nyloc |
| 1 | `nut(M8nS_thin_nut)` | Nut M8nS 13 x 4mm |

View File

@@ -16,13 +16,51 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../utils/core/core.scad>
include <../core.scad>
include <../vitamins/extrusion_brackets.scad>
include <../vitamins/extrusions.scad>
include <../vitamins/extrusion_brackets.scad>
include <../vitamins/washers.scad>
include <../vitamins/nuts.scad>
module inner_bracket_test(bracket, backwards = false)
rotate([90, 0, 180]) {
extrusion = extrusion_inner_corner_bracket_extrusion(bracket);
eWidth = extrusion_width(extrusion);
size = extrusion_inner_corner_bracket_size(bracket);
tnut = extrusion_inner_corner_bracket_tnut(bracket);
translate([backwards ? -eWidth : 0, 0])
extrusion_inner_corner_bracket(bracket, backwards = backwards);
translate([-eWidth / 2, 0])
rotate([-90, 0, 0])
extrusion(extrusion, size.x - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole = eWidth > 20);
translate([-eWidth, -eWidth / 2])
rotate([0, 90, 0])
extrusion(extrusion, eWidth + size.y - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole = eWidth > 20);
}
module bracket_test(bracket)
rotate([90, 0, 180]) {
extrusion = extrusion_corner_bracket_extrusion(bracket);
eWidth = extrusion_width(extrusion);
size = extrusion_corner_bracket_size(bracket);
extrusion_corner_bracket_assembly(bracket);
translate([-eWidth / 2, 0])
rotate([-90, 0, 0])
extrusion(extrusion, size.y, false, cornerHole = eWidth > 20);
translate([-eWidth, -eWidth / 2])
rotate([0, 90, 0])
extrusion(extrusion, eWidth + size.x, false, cornerHole = eWidth > 20);
}
module extrusion_brackets(examples = false) {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
@@ -32,34 +70,30 @@ module extrusion_brackets(examples = false) {
translate([60, 0])
extrusion_corner_bracket_assembly(E20_corner_bracket);
eWidth = extrusion_width(E2020);
translate([110, 0])
extrusion_inner_corner_bracket(E40_inner_corner_bracket);
translate([140, 0])
extrusion_corner_bracket_assembly(E40_corner_bracket);
if(examples) {
translate([20, 60, 10]) rotate([90, 0, 180]) {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
translate([20, 50, 10])
inner_bracket_test(E20_inner_corner_bracket, true);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 20, false);
translate([20, 80, 10])
inner_bracket_test(E20_inner_corner_bracket);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 40, false);
}
translate([20, 120, 10])
bracket_test(E20_corner_bracket);
translate([100, 60, 10]) rotate([90, 0, 180]) {
extrusion_corner_bracket_assembly(E20_corner_bracket);
translate([100, 70, 10])
inner_bracket_test(E40_inner_corner_bracket);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 30, false);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 50, false);
}
translate([100, 130, 10])
bracket_test(E40_corner_bracket);
}
}
if($preview)
extrusion_brackets(true);
let($show_threads = true)
extrusion_brackets(true);

View File

@@ -21,9 +21,24 @@ use <../utils/layout.scad>
include <../vitamins/extrusions.scad>
gap = 10;
module extrusions()
layout([for(e = extrusions) extrusion_width(e)], 10)
extrusion(extrusions[$i], 80, cornerHole = extrusion_width(extrusions[$i]) > 20);
layout([for(e = extrusions) is_list(e[0]) ? extrusion_width(e[0]) : extrusion_width(e)], gap)
let(e = extrusions[$i])
if(is_list(e[0])) {
list = e;
heights = [for(e = list) extrusion_height(e)];
l = len(heights) - 1;
offset = (heights * [for(i = [0 : l]) 1] + l * gap) / 2;
translate([0, -offset])
rotate(90)
layout(heights, gap)
rotate(-90)
extrusion(list[$i], 80, cornerHole = extrusion_width(list[$i]) > 20);
}
else
extrusion(e, 80, cornerHole = extrusion_width(e) > 20);
if ($preview)
extrusions();

View File

@@ -52,6 +52,12 @@ module nuts() {
if(n == M5_nut)
sliding_t_nut(M5_sliding_t_nut);
if(n == M6_nut)
sliding_t_nut(M6_sliding_t_nut);
if(n == M8_nut)
sliding_t_nut(M8_sliding_ball_t_nut);
}
translate([0, 80]) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -21,101 +21,116 @@
//
include <../utils/core/core.scad>
function extrusion_width(type) = type[1]; //! Width of extrusion
function extrusion_height(type) = type[2]; //! Height of extrusion
function extrusion_center_hole(type) = type[3]; //! Diameter of center hole
function extrusion_corner_hole(type) = type[4]; //! Diameter of corner hole
function extrusion_center_square(type) = type[5]; //! Size of center square
function extrusion_channel_width(type) = type[6]; //! Channel width
function extrusion_channel_width_internal(type) = type[7]; //! Internal channel width
function extrusion_tab_thickness(type) = type[8]; //! Tab thickness
function extrusion_spar_thickness(type) = type[9]; //! Spar thickness
function extrusion_fillet(type) = type[10]; //! Radius of corner fillet
function extrusion_width(type) = type[1]; //! Width of extrusion
function extrusion_height(type) = type[2]; //! Height of extrusion
function extrusion_center_hole_wd(type) = type[3]; //! Diameter of center hole if -ve or square side if +ve
function extrusion_corner_hole_wd(type) = type[4]; //! Diameter of corner hole if -ve or square side if +ve
function extrusion_center_square_wd(type) = type[5]; //! Size of center square if +ve or tube diameter if -ve
function extrusion_channel_width(type) = type[6]; //! Channel width
function extrusion_channel_width_internal(type) = type[7]; //! Internal channel width
function extrusion_tab_thickness(type) = type[8]; //! Tab thickness
function extrusion_spar_thickness(type) = type[9]; //! Spar thickness
function extrusion_fillet(type) = type[10]; //! Radius of corner fillet
function extrusion_channel_recess(type) = type[11]; //! Channel recess width and depth or false in none
function extrusion_center_hole(type) = abs(extrusion_center_hole_wd(type)); //! Diameter of center hole or side if square
function extrusion_corner_hole(type) = abs(extrusion_corner_hole_wd(type)); //! Diameter of corner hole or side if square
function extrusion_center_square(type) = abs(extrusion_center_square_wd(type)); //! Size of center square or tube
module extrusion_cross_section(type, cornerHole) {
width = extrusion_width(type);
height = extrusion_height(type);
centerSquare = extrusion_center_square(type);
tabThickness = extrusion_tab_thickness(type);
sparThickness = extrusion_spar_thickness(type);
channelWidth = extrusion_channel_width(type);
recess = extrusion_channel_recess(type);
cornerSquare = (width - extrusion_channel_width_internal(type)) / 2;
module squircle(d) // Draw a square if positive else a circle
if(d > 0)
square([d, d], center = true);
else
if(d < 0)
circle(d = -d);
module extrusion_corner(type, cornerHole) {
width = extrusion_width(type);
tabThickness = extrusion_tab_thickness(type);
sparThickness = extrusion_spar_thickness(type);
centerSquare = extrusion_center_square(type);
channelWidth = extrusion_channel_width(type);
fillet = extrusion_fillet(type);
cornerSize = (width-channelWidth)/2;
cornerSquare = (width-extrusion_channel_width_internal(type))/2;
cornerHoleDiameter = extrusion_corner_hole(type);
cornerSize = (width - channelWidth) / 2;
cornerHoleDiameter = abs(extrusion_corner_hole(type));
translate([-width/2,-width/2]) {
translate([-width / 2, -width / 2]) {
difference() {
union() {
translate([fillet,0])
square([cornerSize-fillet,tabThickness]);
translate([0,fillet])
square([tabThickness,cornerSize-fillet]);
translate([fillet,fillet])
translate([fillet, 0])
square([cornerSize - fillet, tabThickness]);
translate([0, fillet])
square([tabThickness, cornerSize - fillet]);
translate([fillet, fillet])
circle(fillet);
translate([fillet,fillet])
square([cornerSquare-fillet,cornerSquare-fillet]);
translate([fillet, fillet])
square([cornerSquare - fillet, cornerSquare - fillet]);
}
if(cornerHole && cornerHoleDiameter > 0)
translate([cornerSquare/2,cornerSquare/2])
circle(d=cornerHoleDiameter);
}
if(cornerHole)
translate([cornerSquare / 2, cornerSquare / 2])
squircle(extrusion_corner_hole_wd(type));
}
}
rotate(-135) translate([centerSquare/2,-sparThickness/2]) square([sqrt(2)*(width-centerSquare-cornerSquare)/2,sparThickness]);
}
module extrusion_center_section(type) {
width = extrusion_width(type);
tabThickness = extrusion_tab_thickness(type);
sparThickness = extrusion_spar_thickness(type);
centerSquare = extrusion_center_square(type);
channelWidth = extrusion_channel_width(type);
for(side = [-1, 1]) {
translate([side * (width / 2 - tabThickness / 2), 0])
square([tabThickness, width - channelWidth], center = true);
translate([0,width/2])
for(angle=[225,315])
rotate(angle)
translate([centerSquare/2,-sparThickness/2])
square([sqrt(2)*(width-centerSquare)/2,sparThickness]);
translate([0,-width/2])
for(angle=[45,135])
rotate(angle)
translate([centerSquare/2,-sparThickness/2])
square([sqrt(2)*(width-centerSquare)/2,sparThickness]);
centerHeight = width-channelWidth;
translate([-width/2,-centerHeight/2])
square([tabThickness,centerHeight]);
translate([width/2-tabThickness,-centerHeight/2])
square([tabThickness,centerHeight]);
l = cornerSquare + sparThickness * tan(22.5) - sparThickness / sqrt(2);
for(end = [-1, 1])
translate([side * (width / 2 - l / 2), end * (cornerSquare - sparThickness / 2)])
square([l, sparThickness], center = true);
}
}
centerSquare = extrusion_center_square(type);
count = height / width - 1;
width = extrusion_width(type);
height = extrusion_height(type);
count = (height-width)/width;
difference() {
union() {
for(i = [0 : count])
translate([0, i * width + (width - height) / 2]) {
difference() {
union() {
squircle(extrusion_center_square_wd(type));
for(i=[0:count])
translate([0,i*width+(width-height)/2])
difference() {
square([centerSquare,centerSquare],center=true);
if(extrusion_center_hole(type)>0)
circle(d=extrusion_center_hole(type));
}
translate([0,(width-height)/2])
for(angle=[0,90])
rotate(angle)
extrusion_corner(type, cornerHole);
translate([0,-(width-height)/2])
for(angle=[180,270])
rotate(angle)
extrusion_corner(type, cornerHole);
if(count>=1)
for(i=[1:count])
translate([0,i*width-height/2])
extrusion_center_section(type);
for(j = [0 : 3])
rotate(45 + 90 * j)
translate([centerSquare / 2 - sparThickness / 2, -sparThickness / 2])
square([width / sqrt(2) - cornerSquare * sqrt(2) - centerSquare / 2 + sparThickness *(1 + tan(22.5)), sparThickness]);
}
squircle(d = extrusion_center_hole_wd(type));
}
}
for(side = [-1, 1])
translate([0, side * (width - height) / 2])
for(angle = [0, 90])
rotate(angle + (side < 0 ? 180 : 0))
extrusion_corner(type, cornerHole);
if(count >= 1)
for(i = [1 : count])
translate([0, i * width - height / 2])
extrusion_center_section(type);
}
if(recess)
for(i = [0 : count], j = [0 : 3])
translate([0, i * width + (width - height) / 2])
rotate(j * 90)
translate([width / 2, 0])
square([recess.y * 2, recess.x], center = true);
}
}
module extrusion(type, length, center = true, cornerHole = false) { //! Draw the specified extrusion

View File

@@ -20,44 +20,65 @@
//! Brackets for joining extrusions at a corner.
include <../core.scad>
use <extrusion.scad>
function extrusion_inner_corner_bracket_size(type) = type[1]; //! Size of inner bracket
function extrusion_inner_corner_bracket_size(type) = type[1]; //! Size of inner bracket
function extrusion_inner_corner_bracket_tnut(type) = type[2]; //! The sliding t-nut it is based on
function extrusion_inner_corner_bracket_extrusion(type) = type[3]; //! Default extrusion this bracket is for
function extrusion_inner_corner_bracket_screw_offsets(type) = type[4]; //! Screw offsets from the ends
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));
module extrusion_inner_corner_bracket(type, grub_screws = true, backwards = false, extrusion = undef) { //! Inner corner bracket for extrusion
extrusion = is_undef(extrusion) ? extrusion_inner_corner_bracket_extrusion(type) : extrusion;
vitamin(str("extrusion_inner_corner_bracket(", type[0], "): Extrusion inner corner bracket for ", extrusion[0]));
size = extrusion_inner_corner_bracket_size(type);
armLength = size.x;
tnut = extrusion_inner_corner_bracket_tnut(type);
screw_offsets = extrusion_inner_corner_bracket_screw_offsets(type);
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;
sizeBottom = [size.y - bottomTabOffset, nut_square_width(tnut), size.z];
sizeTop = [size.x - topTabOffset, nut_square_width(tnut), size.z];
tab = t_nut_tab(tnut);
tabSizeZ = nut_thickness(tnut);
screw = find_screw(hs_grub, nut_size(tnut));
holeRadius = screw_pilot_hole(screw);
depth = (extrusion_width(extrusion) - extrusion_center_square(extrusion)) / 2;
translate([-size.z - 0.75, -size.z - 0.75, 0])
offset = extrusion_tab_thickness(extrusion) + tabSizeZ;
offset2 = extrusion_tab_thickness(extrusion) - nut_thickness(tnut, true) + nut_thickness(tnut);
translate([backwards ? offset2 : -offset, -offset])
rotate([-90, 0, 0]) {
color("silver") {
translate([(armLength + bottomTabOffset) / 2, 0, tabSizeZ])
translate([(size.y + bottomTabOffset) / 2, 0, tabSizeZ])
rotate([0, 180, 0])
extrusionSlidingNut(sizeBottom, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, (bottomTabOffset - armLength) / 2 + 5);
translate([tabSizeZ, 0, (armLength + topTabOffset) / 2])
extrusionSlidingNut(sizeBottom, tab[0], tab[1], tabSizeZ, holeRadius, (bottomTabOffset - size.y) / 2 + screw_offsets.y);
translate([tabSizeZ, 0, (size.x + 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]);
extrusionSlidingNut(sizeTop, tab[0], tab[0], tabSizeZ, holeRadius, -(topTabOffset - size.x) / 2 - screw_offsets.x);
translate([0, -tab[1] / 2]) {
cube([bottomTabOffset, tab[1], size.z]);
cube([size.z, tab[1], 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);
screw_len = screw_shorter_than(depth);
gap = depth - screw_len;
screw_z = offset - gap;
rotate([0, -90, 180])
if(backwards)
translate([size.x - screw_offsets.x, 0, -offset2 + gap])
vflip()
screw(screw, screw_len);
else
translate([size.x - screw_offsets.x, 0, screw_z])
screw(screw, screw_len);
translate([size.y - screw_offsets.y, 0, screw_z])
screw(screw, screw_len);
}
}
}
@@ -66,24 +87,29 @@ function extrusion_corner_bracket_size(type) = type[1]; //! Size of
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
function extrusion_corner_bracket_tnut(type) = type[5]; //! The sliding t-nut to use in the assembly
function extrusion_corner_bracket_extrusion(type) = type[6]; //! Default extrusion this bracket is for
module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
vitamin(str("extrusion_corner_bracket(", type[0], "): Extrusion corner bracket ", type[1].z));
vitamin(str("extrusion_corner_bracket(", type[0], "): Extrusion corner bracket ", type[1].z, "mm for ", extrusion_corner_bracket_extrusion(type)[0]));
eSize = extrusion_corner_bracket_size(type).z;
cbSize = extrusion_corner_bracket_size(type).x;
baseThickness = extrusion_corner_bracket_base_thickness(type);
hole_r = screw_clearance_radius(find_screw(hs_cap, nut_size(extrusion_corner_bracket_tnut(type))));
module base() {
linear_extrude(baseThickness)
difference() {
translate([0, -eSize / 2, 0])
translate([0, -eSize / 2])
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);
translate([extrusion_corner_bracket_hole_offset(type) + 1.5, 0])
circle(hole_r);
translate([extrusion_corner_bracket_hole_offset(type) - 1.5, 0])
circle(hole_r);
}
}
}
@@ -91,9 +117,11 @@ module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
color("silver") {
rotate([90, 0, 90])
base();
translate([0, baseThickness, 0])
translate([0, baseThickness])
rotate([90, 0, 0])
base();
sideThickness = extrusion_corner_bracket_side_thickness(type);
for(z = [-eSize / 2, eSize / 2 - sideThickness]) {
translate_z(z) {
@@ -112,25 +140,31 @@ module extrusion_corner_bracket_hole_positions(type) { //! Place children at hol
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
module extrusion_corner_bracket_assembly(type, part_thickness = undef, screw_type = undef, nut_type = undef, max_screw_depth = undef, extrusion = undef) { //! Assembly with fasteners in place
extrusion_corner_bracket(type);
extrusion = is_undef(extrusion) ? extrusion_corner_bracket_extrusion(type) : extrusion;
screw_washer_thickness = washer_thickness(screw_washer(screw_type));
nut_washer_type = nut_washer(nut_type);
nut = is_undef(nut_type) ? extrusion_corner_bracket_tnut(type) : nut_type;
screw = is_undef(screw_type) ? find_screw(hs_cap, nut_size(nut)) : screw_type;
thickness = is_undef(part_thickness) ? extrusion_tab_thickness(extrusion) : part_thickness;
depth = is_undef(max_screw_depth) ? (extrusion_width(extrusion) - extrusion_center_square(extrusion)) / 2 - eps : max_screw_depth;
screw_washer_thickness = washer_thickness(screw_washer(screw));
nut_washer_type = nut_washer(nut);
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));
nut_offset = extrusion_corner_bracket_base_thickness(type) + thickness;
screw_length = depth ? screw_shorter_than(extrusion_corner_bracket_base_thickness(type) + screw_washer_thickness + depth)
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut));
extrusion_corner_bracket_hole_positions(type) {
screw_and_washer(screw_type, screw_length);
screw_and_washer(screw, screw_length);
translate_z(-nut_offset)
vflip()
if(nut_washer_type)
nut_and_washer(nut_type);
nut_and_washer(nut);
else
rotate(90)
sliding_t_nut(nut_type);
sliding_t_nut(nut);
}
}

View File

@@ -20,10 +20,11 @@
// Extrusion brackets
//
E20_inner_corner_bracket = [ "E20_inner_corner_bracket", [25, 25, 4.5] ];
E20_inner_corner_bracket = [ "E20_inner_corner_bracket", [26, 25, 4.7], M4_sliding_t_nut, E2020t, [7, 6]];
E40_inner_corner_bracket = [ "E40_inner_corner_bracket", [38, 31, 8.5], M6_sliding_t_nut, E4040t, [13, 10]];
E20_corner_bracket = [ "E20_corner_bracket", [28, 28, 20], 2, 3, 19.5];
E20_corner_bracket = [ "E20_corner_bracket", [28, 28, 20], 2, 3, 19.5, M4_sliding_t_nut, E2020t];
E40_corner_bracket = [ "E40_corner_bracket", [40, 40, 35], 2, 3, 19.5, M8_sliding_ball_t_nut, E4040t];
use <extrusion_bracket.scad>

View File

@@ -19,18 +19,19 @@
//
// Extrusion
//
// W H d1 d2 s cw cwi t st f
E1515 = [ "E1515", 15, 15, 2.5, 0,5.7,3.4, 5.7, 1.1,1.1, 0.5 ];
E2020 = [ "E2020", 20, 20, 4.2, 3, 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, 3, 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 ];
E3060 = [ "E3060", 30, 60, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E4040 = [ "E4040", 40, 40, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
E4080 = [ "E4080", 40, 80, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
// W H d1 d2 sq cw cwi t st f recess
E1515 = [ "E1515", 15, 15, -2.5, 0, 5.7, 3.4, 5.7, 1.1, 1.1, 0.5, false ];
E2020 = [ "E2020", 20, 20, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
E2020t = [ "E2020t",20, 20, -5.0, -3, 7.8, 6.2, 11.0, 1.8, 1.5, 1.5, [7.2, 0.5] ];
E2040 = [ "E2040", 20, 40, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
E2060 = [ "E2060", 20, 60, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
E2080 = [ "E2080", 20, 80, -4.2, -3, 8, 6, 12.0, 2, 2, 1, false ];
E3030 = [ "E3030", 30, 30, -6.8, -4.2, 12, 8, 16.5, 2, 2, 1, false ];
E3060 = [ "E3060", 30, 60, -6.8, -4.2, 12, 8, 16.5, 2, 2, 1, false ];
E4040 = [ "E4040", 40, 40, -10.5, -6.0, 15, 10, 20.0, 5.5, 3, 1, false ];
E4040t = [ "E4040t",40, 40, -10, 6.8, -16, 10, 20.0, 4.0, 2.4, 1.5, [12, 1] ];
E4080 = [ "E4080", 40, 80, -10.5, -6.0, 15, 10, 20.0, 5.5, 3, 1, false ];
extrusions = [E1515,E2020,E2040,E2060,E2080,E3030,E3060,E4040,E4080];
extrusions = [E1515, [E2020t, E2020], E2040, E2060, E2080, E3030, E3060, [E4040t, E4040], E4080];
use <extrusion.scad>

View File

@@ -137,18 +137,61 @@ module wingnut(type) { //! Draw a wingnut
}
}
module sliding_t_nut(type) {
hammerNut = type[10];
vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), hammerNut ? " hammer" : " sliding T"));
function t_nut_tab(type) = [type[8], type[9]]; //! Sliding t-nut T dimensions
size = [type[7], type[2], nut_thickness(type, true)];
tabSizeY1 = type[8];
tabSizeY2 = type[9];
module sliding_ball_t_nut(size, w, h, r) {
rad = 0.5;
stem = size.z - h;
ball_d = 4;
offset = 12;
module shape()
rotate([90, 0, 90])
translate_z(-offset)
linear_extrude(size.x) {
hull() {
translate([0, h - size.y / 2])
semi_circle(d = size.y);
for(side = [-1, 1])
translate([side * (w / 2 - rad), rad])
circle(rad);
}
rounded_square([size.y, stem * 2], rad / 2, true);
}
render() difference() {
shape();
cylinder(r = r, h = 100, center = true);
}
translate([-offset + ball_d, 0, h - 0.4])
sphere(d = ball_d);
if(show_threads)
render() intersection() {
translate_z(-stem)
female_metric_thread(2 * r, metric_coarse_pitch(2 * r), size.z - 2, center = false);
shape();
}
}
module sliding_t_nut(type) { //! Draw a sliding T nut, T nut with a spring loaded ball or a hammer nut.
hammerNut = type[10];
size = [type[7], nut_square_width(type), nut_thickness(type, true)];
tab = t_nut_tab(type);
tabSizeZ = nut_thickness(type);
holeRadius = nut_size(type) / 2;
vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), hammerNut ? " hammer" : " sliding T", !tab[1] ? " with spring loaded ball" : ""));
color(grey(80))
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut);
if(!tab[1])
sliding_ball_t_nut(size, tab[0], tabSizeZ, holeRadius);
else
extrusionSlidingNut(size, tab[0], tab[1], tabSizeZ, holeRadius, 0, hammerNut);
}
module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) {
@@ -171,7 +214,7 @@ module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, hol
}
linear_extrude(tabSizeZ)
difference() {
square([size.x, tabSizeY2], center = true);
square([size.x, tabSizeY1 == tabSizeY2 ? size.y : tabSizeY2], center = true);
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
@@ -183,15 +226,28 @@ module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, hol
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size.z, center = false);
// add the side tabs
tab_h = size.z - 2 * stem_h;
chamfer =tab_h / 4;
for(m = [0, 1])
mirror([0, m, 0])
translate([0, tabSizeY2 / 2]) {
cubeZ = 1;
translate([-size.x / 2, 0])
if(tabSizeY1 == tabSizeY2)
translate([-size.x / 2, size.y / 2])
hull() {
cube([size.x, (tabSizeY1 - size.y) / 2 - chamfer, tab_h]);
translate_z(chamfer)
cube([size.x, (tabSizeY1 - size.y) / 2,tab_h - 2 * chamfer]);
}
else {
dy = (tabSizeY1 - tabSizeY2) / 2;
cubeZ = tabSizeZ - dy;
translate([-size.x / 2, tabSizeY2 / 2])
cube([size.x, (tabSizeY1 - tabSizeY2) / 2, cubeZ]);
translate_z(cubeZ)
translate([0, tabSizeY2 / 2, cubeZ])
rotate([0, -90, 0])
right_triangle(tabSizeZ - cubeZ, (tabSizeY1 - tabSizeY2) / 2, size.x, center = true);
right_triangle(tabSizeZ - cubeZ, dy, size.x, center = true);
}
}

View File

@@ -52,8 +52,12 @@ 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];
// 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];
M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 3.7, 4.7, false, 0, 11, 10, 6, false];
M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 3.7, 4.7, false, 0, 11, 10, 7, false];
M6_sliding_t_nut = ["M6_sliding_t_nut", 6, 8, 6.6, 8.5, false, 0, 16, 18.6,8,2, false];
M8_sliding_ball_t_nut = ["M8_sliding_ball_t_nut",
8, 8, 6.7, 7.6, false, 0, 22, 13.5, 0, 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];