mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-08 16:36:29 +02:00
moved the corner_3d_connector over to the extrusion brackets
This commit is contained in:
@@ -1,55 +0,0 @@
|
|||||||
//
|
|
||||||
// NopSCADlib Copyright Chris Palmer 2021
|
|
||||||
// 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 <../vitamins/corner_3d_connectors.scad>
|
|
||||||
include <../vitamins/extrusions.scad>
|
|
||||||
|
|
||||||
module corner_connector(with_profiles = false, corner_connector_type, extrusion_type) {
|
|
||||||
extrusion_length = 40;
|
|
||||||
corner_3d_connector(corner_connector_type, grub_screws=true);
|
|
||||||
if(with_profiles){
|
|
||||||
translate([0,0,extrusion_length/2])
|
|
||||||
extrusion(extrusion_type, extrusion_length);
|
|
||||||
translate(corner_3d_connector_get_y_offset(corner_connector_type))
|
|
||||||
rotate(corner_3d_connector_get_y_rot(corner_connector_type))
|
|
||||||
translate([0,0,extrusion_length/2])
|
|
||||||
extrusion(extrusion_type, extrusion_length);
|
|
||||||
translate(corner_3d_connector_get_x_offset(corner_connector_type))
|
|
||||||
rotate(corner_3d_connector_get_x_rot(corner_connector_type))
|
|
||||||
translate([0,0,extrusion_length/2])
|
|
||||||
extrusion(extrusion_type, extrusion_length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module corner_connectors(with_profiles = false) {
|
|
||||||
corner_connector(with_profiles, corner_3d_connector_2020, E2020);
|
|
||||||
|
|
||||||
|
|
||||||
translate([100,0,0])
|
|
||||||
corner_connector(with_profiles, corner_3d_connector_3030, E3030);
|
|
||||||
|
|
||||||
|
|
||||||
translate([220,0,0])
|
|
||||||
corner_connector(with_profiles, corner_3d_connector_4040, E4040);
|
|
||||||
}
|
|
||||||
|
|
||||||
$show_threads=false;
|
|
||||||
corner_connectors();
|
|
||||||
translate ([0,100,0])
|
|
||||||
corner_connectors(true);
|
|
||||||
|
|
@@ -31,17 +31,43 @@ module inner_bracket_test(bracket, backwards = false)
|
|||||||
tnut = extrusion_inner_corner_bracket_tnut(bracket);
|
tnut = extrusion_inner_corner_bracket_tnut(bracket);
|
||||||
|
|
||||||
translate([backwards ? -eWidth : 0, 0])
|
translate([backwards ? -eWidth : 0, 0])
|
||||||
extrusion_inner_corner_bracket(bracket, backwards = backwards);
|
extrusion_inner_corner_bracket(bracket, backwards=backwards);
|
||||||
|
|
||||||
translate([-eWidth / 2, 0])
|
translate([-eWidth / 2, 0])
|
||||||
rotate([-90, 0, 0])
|
rotate([-90, 0, 0])
|
||||||
extrusion(extrusion, size.x - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole = eWidth > 20);
|
extrusion(extrusion, size.x - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole=eWidth > 20);
|
||||||
|
|
||||||
translate([-eWidth, -eWidth / 2])
|
translate([-eWidth, -eWidth / 2])
|
||||||
rotate([0, 90, 0])
|
rotate([0, 90, 0])
|
||||||
extrusion(extrusion, eWidth + size.y - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole = eWidth > 20);
|
extrusion(extrusion, eWidth + size.y - nut_thickness(tnut) - extrusion_tab_thickness(extrusion), false, cornerHole=eWidth > 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module corner_3d_connector(with_profiles = false, corner_connector_type, extrusion_type) {
|
||||||
|
extrusion_length = 40;
|
||||||
|
extrusion_corner_bracket_3D(corner_connector_type, grub_screws=true);
|
||||||
|
if (with_profiles) {
|
||||||
|
translate([0, 0, extrusion_length / 2])
|
||||||
|
extrusion(extrusion_type, extrusion_length);
|
||||||
|
translate(extrusion_corner_bracket_3D_get_y_offset(corner_connector_type))
|
||||||
|
rotate(extrusion_corner_bracket_3D_get_y_rot(corner_connector_type))
|
||||||
|
translate([0, 0, extrusion_length / 2])
|
||||||
|
extrusion(extrusion_type, extrusion_length);
|
||||||
|
translate(extrusion_corner_bracket_3D_get_x_offset(corner_connector_type))
|
||||||
|
rotate(extrusion_corner_bracket_3D_get_x_rot(corner_connector_type))
|
||||||
|
translate([0, 0, extrusion_length / 2])
|
||||||
|
extrusion(extrusion_type, extrusion_length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module corner_3d_connectors(with_profiles = false) {
|
||||||
|
corner_3d_connector(with_profiles, extrusion_corner_bracket_3D_2020, E2020);
|
||||||
|
|
||||||
|
translate([80, 0, 0])
|
||||||
|
corner_3d_connector(with_profiles, extrusion_corner_bracket_3D_3030, E3030);
|
||||||
|
|
||||||
|
translate([180, 0, 0])
|
||||||
|
corner_3d_connector(with_profiles, extrusion_corner_bracket_3D_4040, E4040);
|
||||||
|
}
|
||||||
|
|
||||||
module bracket_test(bracket)
|
module bracket_test(bracket)
|
||||||
rotate([90, 0, 180]) {
|
rotate([90, 0, 180]) {
|
||||||
@@ -53,19 +79,18 @@ module bracket_test(bracket)
|
|||||||
|
|
||||||
translate([-eWidth / 2, 0])
|
translate([-eWidth / 2, 0])
|
||||||
rotate([-90, 0, 0])
|
rotate([-90, 0, 0])
|
||||||
extrusion(extrusion, size.y, false, cornerHole = eWidth > 20);
|
extrusion(extrusion, size.y, false, cornerHole=eWidth > 20);
|
||||||
|
|
||||||
translate([-eWidth, -eWidth / 2])
|
translate([-eWidth, -eWidth / 2])
|
||||||
rotate([0, 90, 0])
|
rotate([0, 90, 0])
|
||||||
extrusion(extrusion, eWidth + size.x, false, cornerHole = eWidth > 20);
|
extrusion(extrusion, eWidth + size.x, false, cornerHole=eWidth > 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module extrusion_brackets(examples = false) {
|
module extrusion_brackets(examples = false) {
|
||||||
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
|
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
|
||||||
|
|
||||||
translate([30, 0])
|
translate([30, 0])
|
||||||
extrusion_inner_corner_bracket(E20_inner_corner_bracket, grub_screws = false);
|
extrusion_inner_corner_bracket(E20_inner_corner_bracket, grub_screws=false);
|
||||||
|
|
||||||
translate([60, 0])
|
translate([60, 0])
|
||||||
extrusion_corner_bracket_assembly(E20_corner_bracket);
|
extrusion_corner_bracket_assembly(E20_corner_bracket);
|
||||||
@@ -76,7 +101,7 @@ module extrusion_brackets(examples = false) {
|
|||||||
translate([140, 0])
|
translate([140, 0])
|
||||||
extrusion_corner_bracket_assembly(E40_corner_bracket);
|
extrusion_corner_bracket_assembly(E40_corner_bracket);
|
||||||
|
|
||||||
if(examples) {
|
if (examples) {
|
||||||
translate([20, 50, 10])
|
translate([20, 50, 10])
|
||||||
inner_bracket_test(E20_inner_corner_bracket, true);
|
inner_bracket_test(E20_inner_corner_bracket, true);
|
||||||
|
|
||||||
@@ -92,8 +117,16 @@ module extrusion_brackets(examples = false) {
|
|||||||
translate([100, 130, 10])
|
translate([100, 130, 10])
|
||||||
bracket_test(E40_corner_bracket);
|
bracket_test(E40_corner_bracket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//the 3d connectors
|
||||||
|
translate([0, -30, 0])
|
||||||
|
corner_3d_connectors();
|
||||||
|
if (examples) {
|
||||||
|
translate([0, -110, 0])
|
||||||
|
corner_3d_connectors(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if ($preview)
|
||||||
let($show_threads = true)
|
let ($show_threads = true)
|
||||||
extrusion_brackets(true);
|
extrusion_brackets(true);
|
||||||
|
@@ -1,187 +0,0 @@
|
|||||||
//
|
|
||||||
// NopSCADlib Copyright Chris Palmer 2021
|
|
||||||
// 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/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
//! Default is steel but can be drawn as brass or nylon. A utility for making nut traps included.
|
|
||||||
//!
|
|
||||||
//! 3D corner connector with t-nut
|
|
||||||
//!
|
|
||||||
//! The following diagram shows you the parameters for the nut parameters:
|
|
||||||
//!
|
|
||||||
//! 
|
|
||||||
//
|
|
||||||
|
|
||||||
include <NopSCADlib/core.scad>
|
|
||||||
include <../utils/thread.scad>
|
|
||||||
//include <NopSCADlib/vitamins/screws.scad>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function corner_3d_connector_outer_side_length(type) = type[1]; //! The length of the base cuboid sides
|
|
||||||
function corner_3d_connector_outer_height(type) = type[2]; //! The height of the cuboid
|
|
||||||
function corner_3d_connector_inner_side_length(type)= type[3]; //! The length of the dip in the cuboid sides
|
|
||||||
function corner_3d_connector_inner_height(type) = type[4]; //! The depth offset of the dip in the cuboid
|
|
||||||
|
|
||||||
function corner_3d_connector_nut_screw(type) = type[5]; //! The screw (most likely Mx_grub_screw from <NopSCADlib/vitamins/screws.scad>)
|
|
||||||
function corner_3d_connector_nut_dia(type) = type[6]; //! The width of bottom part of the nut
|
|
||||||
function corner_3d_connector_nut_thickness(type) = type[7]; //! The thickness of the top part of the nut
|
|
||||||
function corner_3d_connector_nut_nyloc_thickness(type) = type[8]; //! The total thickness of the nut
|
|
||||||
function corner_3d_connector_nut_sx(type) = type[9]; //! The length of the nuts
|
|
||||||
function corner_3d_connector_nut_ty1(type) = type[10]; //! The total width of the nut
|
|
||||||
function corner_3d_connector_nut_ty2(type) = type[11]; //! The width of the top edge of the nut
|
|
||||||
function corner_3d_connector_nut_screws_hor(type) = type[12]; //! The positions of the screw holes on the horizontal arms, expressed in %/100 of the nut arm
|
|
||||||
function corner_3d_connector_nut_screws_ver(type) = type[13]; //! The positions of the screw holes on the vertical arms, expressed in %/100 of the nut arm
|
|
||||||
|
|
||||||
|
|
||||||
function corner_3d_connector_get_y_offset(type) = [0,-corner_3d_connector_outer_side_length(type)/2,corner_3d_connector_nut_nyloc_thickness(type)]; //! helper function to position the y beam
|
|
||||||
function corner_3d_connector_get_y_rot(type) = [90,0,0]; //! helper function to rotate the y beam
|
|
||||||
function corner_3d_connector_get_x_offset(type) = [corner_3d_connector_outer_side_length(type)/2,0,corner_3d_connector_nut_nyloc_thickness(type)]; //! helper function to position the x beam
|
|
||||||
function corner_3d_connector_get_x_rot(type) = [0,90,0]; //! helper function to rotate the y beam
|
|
||||||
|
|
||||||
|
|
||||||
module corner_3d_connector (type, grub_screws = true) { //! draw the specified corner_3d_connector
|
|
||||||
|
|
||||||
nut_screw_dia = screw_radius(corner_3d_connector_nut_screw(type)*2);
|
|
||||||
nut_dia = corner_3d_connector_nut_dia(type);
|
|
||||||
nut_thickness = corner_3d_connector_nut_thickness(type);
|
|
||||||
nut_nyloc_thickness = corner_3d_connector_nut_nyloc_thickness(type);
|
|
||||||
nut_sx = corner_3d_connector_nut_sx(type);
|
|
||||||
nut_ty1 = corner_3d_connector_nut_ty1(type);
|
|
||||||
nut_ty2= corner_3d_connector_nut_ty2(type);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
nut_profile = [
|
|
||||||
[0, nut_dia/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness, nut_dia/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness, nut_ty1/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness + (nut_ty1-nut_ty2)/2, nut_ty1/2],
|
|
||||||
[nut_nyloc_thickness, nut_ty2/2],
|
|
||||||
[nut_nyloc_thickness, -nut_ty2/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness + (nut_ty1-nut_ty2)/2, -nut_ty1/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness, -nut_ty1/2],
|
|
||||||
[nut_nyloc_thickness-nut_thickness, -nut_dia/2],
|
|
||||||
[0, -nut_dia/2]
|
|
||||||
];
|
|
||||||
|
|
||||||
grub_screw = corner_3d_connector_nut_screw(type);
|
|
||||||
|
|
||||||
outer_side_length = corner_3d_connector_outer_side_length(type);
|
|
||||||
outer_height = corner_3d_connector_outer_height(type);
|
|
||||||
inner_side_length= corner_3d_connector_inner_side_length(type);
|
|
||||||
inner_height = corner_3d_connector_inner_height(type);
|
|
||||||
inner_offset_z = outer_height-inner_height+0.01;
|
|
||||||
|
|
||||||
//position the nuts on the base
|
|
||||||
positions_horizontal = [
|
|
||||||
[outer_side_length/2,0.001,0,0,270,90],
|
|
||||||
[outer_side_length-0.001,outer_side_length/2,0, 0,270,180]
|
|
||||||
];
|
|
||||||
positions_vertical = [
|
|
||||||
[0,outer_side_length/2,inner_offset_z,0,0,0],
|
|
||||||
[outer_side_length/2,outer_side_length,inner_offset_z,0,0,270],
|
|
||||||
];
|
|
||||||
|
|
||||||
//the radius of the base corners
|
|
||||||
r=1;
|
|
||||||
|
|
||||||
//offset so everything is centered for easy attachment to extrusion
|
|
||||||
translate([-outer_side_length/2,-outer_side_length/2, -outer_height]){
|
|
||||||
|
|
||||||
color("silver")
|
|
||||||
union() {
|
|
||||||
//create the base
|
|
||||||
difference () {
|
|
||||||
rounded_cube_xy([outer_side_length, outer_side_length, outer_height], r=r);
|
|
||||||
translate([(outer_side_length-inner_side_length)/2,(outer_side_length-inner_side_length)/2,inner_offset_z])
|
|
||||||
rounded_cube_xy([inner_side_length, inner_side_length, inner_height], r=r);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (pos = positions_horizontal) {
|
|
||||||
translate([pos[0],pos[1],pos[2]])
|
|
||||||
rotate([pos[3],pos[4],pos[5]])
|
|
||||||
difference() {
|
|
||||||
linear_extrude(nut_sx, convexity =3 )
|
|
||||||
polygon(nut_profile);
|
|
||||||
//create the screw holes
|
|
||||||
for ( dist = corner_3d_connector_nut_screws_hor(type) ){
|
|
||||||
translate([-0.01,0,nut_sx*dist])
|
|
||||||
rotate([0,90,0])
|
|
||||||
difference() {
|
|
||||||
cylinder(h = nut_nyloc_thickness+0.02, d=nut_screw_dia, center = false);
|
|
||||||
if(show_threads ) {
|
|
||||||
female_metric_thread(nut_screw_dia, metric_coarse_pitch(nut_screw_dia), nut_nyloc_thickness, center = false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(grub_screws) {
|
|
||||||
screw(grub_screw, nut_nyloc_thickness);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (pos = positions_vertical) {
|
|
||||||
translate([pos[0],pos[1],pos[2]])
|
|
||||||
rotate([pos[3],pos[4],pos[5]]){
|
|
||||||
difference() {
|
|
||||||
linear_extrude(nut_sx, convexity =3)
|
|
||||||
polygon(nut_profile);
|
|
||||||
//create the screw holes
|
|
||||||
for ( dist = corner_3d_connector_nut_screws_ver(type) ){
|
|
||||||
translate([-0.01,0,nut_sx*dist])
|
|
||||||
rotate([0,90,0])
|
|
||||||
difference() {
|
|
||||||
cylinder(h = nut_nyloc_thickness+0.02, d=nut_screw_dia, center = false);
|
|
||||||
if(show_threads ) {
|
|
||||||
female_metric_thread(nut_screw_dia, metric_coarse_pitch(nut_screw_dia), nut_nyloc_thickness, center = false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(grub_screws) {
|
|
||||||
for (pos = positions_horizontal) {
|
|
||||||
translate([pos[0],pos[1],pos[2]])
|
|
||||||
rotate([pos[3],pos[4],pos[5]]){
|
|
||||||
for ( dist = corner_3d_connector_nut_screws_hor(type) ){
|
|
||||||
translate([-0.01,0,nut_sx*dist])
|
|
||||||
rotate([180,90,0])
|
|
||||||
|
|
||||||
screw(grub_screw, nut_nyloc_thickness);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (pos = positions_vertical) {
|
|
||||||
translate([pos[0],pos[1],pos[2]])
|
|
||||||
rotate([pos[3],pos[4],pos[5]]){
|
|
||||||
for ( dist = corner_3d_connector_nut_screws_ver(type) ){
|
|
||||||
translate([-0.01,0,nut_sx*dist])
|
|
||||||
rotate([180,90,0])
|
|
||||||
screw(grub_screw, nut_nyloc_thickness);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,33 +0,0 @@
|
|||||||
//
|
|
||||||
// NopSCADlib Copyright Chris Palmer 2021
|
|
||||||
// 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 <screws.scad>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//sh is horizontal positions of the screw holes, expressed in %/100 of the nut arm
|
|
||||||
//sv is vertical positions of the screw holes, expressed in %/100 of the nut arm
|
|
||||||
// screw nd nt nnt nsx nty1 nty2 sh sv
|
|
||||||
corner_3d_connector_2020 = ["corner_3d_connector_2020", 20, 5, 13, 2.5, M4_grub_screw, 6, 3.5,5, 15.5,10, 6, [0.5], [0.5]];
|
|
||||||
corner_3d_connector_3030 = ["corner_3d_connector_3030", 29.6,6.2, 22, 2.5, M6_grub_screw, 8, 4.2,6.2,24.9,16, 11, [0.25,0.75], [0.65]];
|
|
||||||
corner_3d_connector_4040 = ["corner_3d_connector_4040", 40,9.5, 25, 2.5, M6_grub_screw, 8, 5, 9.5,34.0,19.5, 14, [0.25,0.75], [0.65]];
|
|
||||||
|
|
||||||
corner_3d_connectors = [corner_3d_connector_2020,corner_3d_connector_3030,corner_3d_connector_4040];
|
|
||||||
|
|
||||||
use <corner_3d_connector.scad>
|
|
@@ -20,6 +20,8 @@
|
|||||||
//! Brackets for joining extrusions at a corner.
|
//! Brackets for joining extrusions at a corner.
|
||||||
|
|
||||||
include <../core.scad>
|
include <../core.scad>
|
||||||
|
include <../utils/thread.scad>
|
||||||
|
|
||||||
use <extrusion.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
|
||||||
@@ -62,14 +64,13 @@ module extrusion_inner_corner_bracket(type, grub_screws = true, backwards = fals
|
|||||||
cube([size.z, tab[1], topTabOffset]);
|
cube([size.z, tab[1], topTabOffset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(grub_screws)
|
if (grub_screws)
|
||||||
not_on_bom() no_explode() {
|
not_on_bom() no_explode() {
|
||||||
screw_len = screw_shorter_than(depth);
|
screw_len = screw_shorter_than(depth);
|
||||||
gap = depth - screw_len;
|
gap = depth - screw_len;
|
||||||
screw_z = offset - gap;
|
screw_z = offset - gap;
|
||||||
|
|
||||||
rotate([0, -90, 180])
|
rotate([0, -90, 180]) if (backwards)
|
||||||
if(backwards)
|
|
||||||
translate([size.x - screw_offsets.x, 0, -offset2 + gap])
|
translate([size.x - screw_offsets.x, 0, -offset2 + gap])
|
||||||
vflip()
|
vflip()
|
||||||
screw(screw, screw_len);
|
screw(screw, screw_len);
|
||||||
@@ -123,9 +124,9 @@ module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
|
|||||||
base();
|
base();
|
||||||
|
|
||||||
sideThickness = extrusion_corner_bracket_side_thickness(type);
|
sideThickness = extrusion_corner_bracket_side_thickness(type);
|
||||||
for(z = [-eSize / 2, eSize / 2 - sideThickness]) {
|
for (z = [-eSize / 2, eSize / 2 - sideThickness]) {
|
||||||
translate_z(z) {
|
translate_z(z) {
|
||||||
right_triangle(cbSize, cbSize, sideThickness, center = false);
|
right_triangle(cbSize, cbSize, sideThickness, center=false);
|
||||||
cube([5, cbSize, sideThickness]);
|
cube([5, cbSize, sideThickness]);
|
||||||
cube([cbSize, 5, sideThickness]);
|
cube([cbSize, 5, sideThickness]);
|
||||||
}
|
}
|
||||||
@@ -133,8 +134,9 @@ module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module extrusion_corner_bracket_hole_positions(type) { //! Place children at hole positions
|
module extrusion_corner_bracket_hole_positions(type) {
|
||||||
for(angle = [ [0, 90, 0], [-90, -90, 0] ])
|
//! Place children at hole positions
|
||||||
|
for (angle = [[0, 90, 0], [-90, -90, 0]])
|
||||||
rotate(angle)
|
rotate(angle)
|
||||||
translate([0, extrusion_corner_bracket_hole_offset(type), extrusion_corner_bracket_base_thickness(type)])
|
translate([0, extrusion_corner_bracket_hole_offset(type), extrusion_corner_bracket_base_thickness(type)])
|
||||||
children();
|
children();
|
||||||
@@ -154,17 +156,165 @@ module extrusion_corner_bracket_assembly(type, part_thickness = undef, screw_typ
|
|||||||
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 = extrusion_corner_bracket_base_thickness(type) + thickness;
|
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_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));
|
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut));
|
||||||
|
|
||||||
extrusion_corner_bracket_hole_positions(type) {
|
extrusion_corner_bracket_hole_positions(type) {
|
||||||
screw_and_washer(screw, screw_length);
|
screw_and_washer(screw, screw_length);
|
||||||
translate_z(-nut_offset)
|
translate_z(-nut_offset)
|
||||||
vflip()
|
vflip() if (nut_washer_type)
|
||||||
if(nut_washer_type)
|
|
||||||
nut_and_washer(nut);
|
nut_and_washer(nut);
|
||||||
else
|
else
|
||||||
rotate(90)
|
rotate(90)
|
||||||
sliding_t_nut(nut);
|
sliding_t_nut(nut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function extrusion_corner_bracket_3D_outer_side_length(type) = type[1]; //! The length of the base cuboid sides
|
||||||
|
function extrusion_corner_bracket_3D_outer_height(type) = type[2]; //! The height of the cuboid
|
||||||
|
function extrusion_corner_bracket_3D_inner_side_length(type) = type[3]; //! The length of the dip in the cuboid sides
|
||||||
|
function extrusion_corner_bracket_3D_inner_height(type) = type[4]; //! The depth offset of the dip in the cuboid
|
||||||
|
|
||||||
|
function extrusion_corner_bracket_3D_nut_screw(type) = type[5]; //! The screw (most likely Mx_grub_screw from <NopSCADlib/vitamins/screws.scad>)
|
||||||
|
function extrusion_corner_bracket_3D_nut_dia(type) = type[6]; //! The width of bottom part of the nut
|
||||||
|
function extrusion_corner_bracket_3D_nut_thickness(type) = type[7]; //! The thickness of the top part of the nut
|
||||||
|
function extrusion_corner_bracket_3D_nut_nyloc_thickness(type) = type[8]; //! The total thickness of the nut
|
||||||
|
function extrusion_corner_bracket_3D_nut_sx(type) = type[9]; //! The length of the nuts
|
||||||
|
function extrusion_corner_bracket_3D_nut_ty1(type) = type[10]; //! The total width of the nut
|
||||||
|
function extrusion_corner_bracket_3D_nut_ty2(type) = type[11]; //! The width of the top edge of the nut
|
||||||
|
function extrusion_corner_bracket_3D_nut_screws_hor(type) = type[12]; //! The positions of the screw holes on the horizontal arms, expressed in %/100 of the nut arm
|
||||||
|
function extrusion_corner_bracket_3D_nut_screws_ver(type) = type[13]; //! The positions of the screw holes on the vertical arms, expressed in %/100 of the nut arm
|
||||||
|
|
||||||
|
function extrusion_corner_bracket_3D_get_y_offset(type) = [0, -extrusion_corner_bracket_3D_outer_side_length(type) / 2, extrusion_corner_bracket_3D_nut_nyloc_thickness(type)]; //! helper function to position the y beam
|
||||||
|
function extrusion_corner_bracket_3D_get_y_rot(type) = [90, 0, 0]; //! helper function to rotate the y beam
|
||||||
|
function extrusion_corner_bracket_3D_get_x_offset(type) = [extrusion_corner_bracket_3D_outer_side_length(type) / 2, 0, extrusion_corner_bracket_3D_nut_nyloc_thickness(type)]; //! helper function to position the x beam
|
||||||
|
function extrusion_corner_bracket_3D_get_x_rot(type) = [0, 90, 0]; //! helper function to rotate the y beam
|
||||||
|
|
||||||
|
module extrusion_corner_bracket_3D(type, grub_screws = true) { //! draw the specified extrusion_corner_bracket_3D
|
||||||
|
vitamin(str("extrusion_corner_bracket_3D(", type[0], "): Extrusion corner bracket 3D mm for ", extrusion_corner_bracket_extrusion(type)[0]));
|
||||||
|
|
||||||
|
|
||||||
|
nut_screw_dia = screw_radius(extrusion_corner_bracket_3D_nut_screw(type) * 2);
|
||||||
|
nut_dia = extrusion_corner_bracket_3D_nut_dia(type);
|
||||||
|
nut_thickness = extrusion_corner_bracket_3D_nut_thickness(type);
|
||||||
|
nut_nyloc_thickness = extrusion_corner_bracket_3D_nut_nyloc_thickness(type);
|
||||||
|
nut_sx = extrusion_corner_bracket_3D_nut_sx(type);
|
||||||
|
nut_ty1 = extrusion_corner_bracket_3D_nut_ty1(type);
|
||||||
|
nut_ty2 = extrusion_corner_bracket_3D_nut_ty2(type);
|
||||||
|
|
||||||
|
nut_profile = [
|
||||||
|
[0, nut_dia / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness, nut_dia / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness, nut_ty1 / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness + (nut_ty1 - nut_ty2) / 2, nut_ty1 / 2],
|
||||||
|
[nut_nyloc_thickness, nut_ty2 / 2],
|
||||||
|
[nut_nyloc_thickness, -nut_ty2 / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness + (nut_ty1 - nut_ty2) / 2, -nut_ty1 / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness, -nut_ty1 / 2],
|
||||||
|
[nut_nyloc_thickness - nut_thickness, -nut_dia / 2],
|
||||||
|
[0, -nut_dia / 2],
|
||||||
|
];
|
||||||
|
|
||||||
|
grub_screw = extrusion_corner_bracket_3D_nut_screw(type);
|
||||||
|
|
||||||
|
outer_side_length = extrusion_corner_bracket_3D_outer_side_length(type);
|
||||||
|
outer_height = extrusion_corner_bracket_3D_outer_height(type);
|
||||||
|
inner_side_length = extrusion_corner_bracket_3D_inner_side_length(type);
|
||||||
|
inner_height = extrusion_corner_bracket_3D_inner_height(type);
|
||||||
|
inner_offset_z = outer_height - inner_height + 0.01;
|
||||||
|
|
||||||
|
//position the nuts on the base
|
||||||
|
positions_horizontal = [
|
||||||
|
[outer_side_length / 2, 0.001, 0, 0, 270, 90],
|
||||||
|
[outer_side_length - 0.001, outer_side_length / 2, 0, 0, 270, 180],
|
||||||
|
];
|
||||||
|
positions_vertical = [
|
||||||
|
[0, outer_side_length / 2, inner_offset_z, 0, 0, 0],
|
||||||
|
[outer_side_length / 2, outer_side_length, inner_offset_z, 0, 0, 270],
|
||||||
|
];
|
||||||
|
|
||||||
|
//the radius of the base corners
|
||||||
|
r = 1;
|
||||||
|
|
||||||
|
//offset so everything is centered for easy attachment to extrusion
|
||||||
|
translate([-outer_side_length / 2, -outer_side_length / 2, -outer_height]) {
|
||||||
|
|
||||||
|
color("silver")
|
||||||
|
union() {
|
||||||
|
//create the base
|
||||||
|
difference() {
|
||||||
|
rounded_cube_xy([outer_side_length, outer_side_length, outer_height], r=r);
|
||||||
|
translate([(outer_side_length - inner_side_length) / 2, (outer_side_length - inner_side_length) / 2, inner_offset_z])
|
||||||
|
rounded_cube_xy([inner_side_length, inner_side_length, inner_height], r=r);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (pos = positions_horizontal) {
|
||||||
|
translate([pos[0], pos[1], pos[2]])
|
||||||
|
rotate([pos[3], pos[4], pos[5]])
|
||||||
|
difference() {
|
||||||
|
linear_extrude(nut_sx, convexity=3)
|
||||||
|
polygon(nut_profile);
|
||||||
|
//create the screw holes
|
||||||
|
for (dist = extrusion_corner_bracket_3D_nut_screws_hor(type)) {
|
||||||
|
translate([-0.01, 0, nut_sx * dist])
|
||||||
|
rotate([0, 90, 0])
|
||||||
|
difference() {
|
||||||
|
cylinder(h=nut_nyloc_thickness + 0.02, d=nut_screw_dia, center=false);
|
||||||
|
if (show_threads) {
|
||||||
|
female_metric_thread(nut_screw_dia, metric_coarse_pitch(nut_screw_dia), nut_nyloc_thickness, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (grub_screws) {
|
||||||
|
screw(grub_screw, nut_nyloc_thickness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (pos = positions_vertical) {
|
||||||
|
translate([pos[0], pos[1], pos[2]])
|
||||||
|
rotate([pos[3], pos[4], pos[5]]) {
|
||||||
|
difference() {
|
||||||
|
linear_extrude(nut_sx, convexity=3)
|
||||||
|
polygon(nut_profile);
|
||||||
|
//create the screw holes
|
||||||
|
for (dist = extrusion_corner_bracket_3D_nut_screws_ver(type)) {
|
||||||
|
translate([-0.01, 0, nut_sx * dist])
|
||||||
|
rotate([0, 90, 0])
|
||||||
|
difference() {
|
||||||
|
cylinder(h=nut_nyloc_thickness + 0.02, d=nut_screw_dia, center=false);
|
||||||
|
if (show_threads) {
|
||||||
|
female_metric_thread(nut_screw_dia, metric_coarse_pitch(nut_screw_dia), nut_nyloc_thickness, center=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grub_screws) {
|
||||||
|
for (pos = positions_horizontal) {
|
||||||
|
translate([pos[0], pos[1], pos[2]])
|
||||||
|
rotate([pos[3], pos[4], pos[5]]) {
|
||||||
|
for (dist = extrusion_corner_bracket_3D_nut_screws_hor(type)) {
|
||||||
|
translate([-0.01, 0, nut_sx * dist])
|
||||||
|
rotate([180, 90, 0])
|
||||||
|
|
||||||
|
screw(grub_screw, nut_nyloc_thickness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (pos = positions_vertical) {
|
||||||
|
translate([pos[0], pos[1], pos[2]])
|
||||||
|
rotate([pos[3], pos[4], pos[5]]) {
|
||||||
|
for (dist = extrusion_corner_bracket_3D_nut_screws_ver(type)) {
|
||||||
|
translate([-0.01, 0, nut_sx * dist])
|
||||||
|
rotate([180, 90, 0])
|
||||||
|
screw(grub_screw, nut_nyloc_thickness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -19,12 +19,22 @@
|
|||||||
//
|
//
|
||||||
// Extrusion brackets
|
// Extrusion brackets
|
||||||
//
|
//
|
||||||
|
include <../core.scad>
|
||||||
|
include <screws.scad>
|
||||||
|
|
||||||
E20_inner_corner_bracket = [ "E20_inner_corner_bracket", [26, 25, 4.7], M4_sliding_t_nut, E2020t, [7, 6]];
|
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]];
|
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, M4_sliding_t_nut, E2020t];
|
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];
|
E40_corner_bracket = ["E40_corner_bracket", [40, 40, 35], 2, 3, 19.5, M8_sliding_ball_t_nut, E4040t];
|
||||||
|
|
||||||
|
//sh is horizontal positions of the screw holes, expressed in %/100 of the nut arm
|
||||||
|
//sv is vertical positions of the screw holes, expressed in %/100 of the nut arm
|
||||||
|
// screw nd nt nnt nsx nty1 nty2 sh sv
|
||||||
|
extrusion_corner_bracket_3D_2020 = ["extrusion_corner_bracket_3D_2020", 20, 5, 13, 2.5, M4_grub_screw, 6, 3.5, 5, 15.5, 10, 6, [0.5], [0.5]];
|
||||||
|
extrusion_corner_bracket_3D_3030 = ["extrusion_corner_bracket_3D_3030", 29.6, 6.2, 22, 2.5, M6_grub_screw, 8, 4.2, 6.2, 24.9, 16, 11, [0.25, 0.75], [0.65]];
|
||||||
|
extrusion_corner_bracket_3D_4040 = ["extrusion_corner_bracket_3D_4040", 40, 9.5, 25, 2.5, M6_grub_screw, 8, 5, 9.5, 34.0, 19.5, 14, [0.25, 0.75], [0.65]];
|
||||||
|
|
||||||
|
extrusion_corner_bracket_3Ds = [extrusion_corner_bracket_3D_2020, extrusion_corner_bracket_3D_3030, extrusion_corner_bracket_3D_4040];
|
||||||
|
|
||||||
use <extrusion_bracket.scad>
|
use <extrusion_bracket.scad>
|
||||||
|
Reference in New Issue
Block a user