Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d9cb604f92 | ||
|
52d2a49e1c | ||
|
cd4447a2e6 | ||
|
9699a70cf5 | ||
|
6d79e587aa | ||
|
15b3b3a8c2 | ||
|
ec891c8013 | ||
|
c7811f21e0 | ||
|
782deccf6b | ||
|
69da4c1c23 | ||
|
dad2bccbaa | ||
|
0a00f244e4 | ||
|
76ea28e88e | ||
|
44cf9e910b | ||
|
0261362794 | ||
|
2e6b55bcbc | ||
|
20901f0356 | ||
|
77ffdcb1ac | ||
|
6ab4bad97a | ||
|
14c6219733 | ||
|
b21b7b9de0 | ||
|
73d814d2fe | ||
|
fa658d9eaa | ||
|
6d3f54b7a5 | ||
|
157ff60e19 | ||
|
cbd3cf29af | ||
|
bf618bb482 | ||
|
1e6f0a5c4d | ||
|
53c3cdb598 | ||
|
f4857f6862 | ||
|
1acc8d01c0 | ||
|
344e8d1583 | ||
|
dd757a1461 | ||
|
b4f8892b1a | ||
|
4b033d9945 | ||
|
d5a711f4cc | ||
|
42b76ab8d3 | ||
|
f18044915d | ||
|
17b12c7f31 | ||
|
18ff4c6d46 | ||
|
2eecce819c | ||
|
f7d81738bb | ||
|
6d44124bab | ||
|
9bb9f09dca | ||
|
773a53829f | ||
|
07766d8cf0 |
@@ -35,8 +35,8 @@ extrusion_width = is_undef($extrusion_width) ? 0.5 : $extrusion_width; // fil
|
||||
nozzle = is_undef($nozzle) ? 0.45 : $nozzle; // 3D printer nozzle
|
||||
cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // minimum tool radius when milling 2D objects
|
||||
pp1_colour = is_undef($pp1_colour) ? [0, 146/255, 0] : $pp1_colour; // printed part colour 1, RepRap logo colour
|
||||
pp2_colour = is_undef($pp2_colour) ? "red" : $pp2_colour; // printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "blue" : $pp3_colour; // printed part colour 3
|
||||
pp2_colour = is_undef($pp2_colour) ? "Crimson" : $pp2_colour; // printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour; // printed part colour 3
|
||||
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
||||
show_rays = is_undef($show_rays) ? false : $show_rays; // show camera sight lines and light direction
|
||||
show_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads
|
||||
|
1
lib.scad
@@ -90,6 +90,7 @@ use <utils/gears.scad>
|
||||
use <utils/hanging_hole.scad>
|
||||
use <utils/fillet.scad>
|
||||
use <utils/rounded_polygon.scad>
|
||||
use <utils/rounded_right_triangle.scad>
|
||||
use <utils/layout.scad>
|
||||
use <utils/round.scad>
|
||||
use <utils/offset.scad>
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 848 KiB After Width: | Height: | Size: 854 KiB |
@@ -78,6 +78,7 @@ use <tests/opengrab.scad>
|
||||
use <tests/panel_meters.scad>
|
||||
use <tests/PCBs.scad>
|
||||
use <tests/pillars.scad>
|
||||
use <tests/press_fit.scad>
|
||||
use <tests/PSUs.scad>
|
||||
use <tests/pulleys.scad>
|
||||
use <tests/rails.scad>
|
||||
@@ -137,9 +138,12 @@ cable_grommets_y = 0;
|
||||
translate([x5, cable_grommets_y])
|
||||
cable_grommets();
|
||||
|
||||
translate([x5 + 80, cable_grommets_y])
|
||||
translate([x5 + 50, cable_grommets_y])
|
||||
ribbon_clamps();
|
||||
|
||||
translate([x5 + 95, cable_grommets_y])
|
||||
press_fits();
|
||||
|
||||
translate([x5, cable_grommets_y + 60])
|
||||
fixing_blocks();
|
||||
|
||||
@@ -427,7 +431,7 @@ translate([x4 + 175, belts_y, -20])
|
||||
translate([x4, rails_y + 130])
|
||||
rails();
|
||||
|
||||
translate([800, fans_y + 50])
|
||||
translate([770, fans_y + 50])
|
||||
cable_strips();
|
||||
|
||||
translate([x4, kp_pillow_blocks_y])
|
||||
|
@@ -121,11 +121,12 @@ module grill(width, height, r = 1000, poly = false, h = 0) { //! A staggered arr
|
||||
|
||||
module box_corner_profile_2D(type) { //! The 2D shape of the corner profile.
|
||||
t = box_sheet_slot(type);
|
||||
inset = box_corner_gap(type) + box_profile_overlap(type);
|
||||
difference() {
|
||||
union() {
|
||||
quadrant(box_hole_inset(type) + box_boss_r(type), box_boss_r(type)); // inside corner
|
||||
|
||||
translate([box_corner_gap(type) + box_profile_overlap(type), box_corner_gap(type) + box_profile_overlap(type)])
|
||||
translate([inset, inset])
|
||||
rotate(180)
|
||||
quadrant(box_profile_overlap(type) + box_corner_rad(type), box_corner_rad(type)); // outside corner
|
||||
}
|
||||
@@ -212,33 +213,39 @@ module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
||||
feet = bottom && box_feet(type);
|
||||
t = box_sheet_slot(type);
|
||||
outset = box_outset(type);
|
||||
inset = box_inset(type);
|
||||
inner_r = box_sheet_r(type);
|
||||
foot_height = box_corner_gap(type) + sheet_thickness(box_base_sheet(type)) + washer_thickness(box_washer(type)) + screw_head_height(box_screw(type)) + box_profile_overlap(type) + 2;
|
||||
cgap = box_corner_gap(type);
|
||||
foot_height = cgap + sheet_thickness(box_base_sheet(type)) + washer_thickness(box_washer(type)) + screw_head_height(box_screw(type)) + box_profile_overlap(type) + 2;
|
||||
foot_length = box_corner_rad(type) * 2;
|
||||
height = box_bezel_height(type, bottom);
|
||||
foot_extension = foot_height - height;
|
||||
|
||||
difference() {
|
||||
w = box_width(type);
|
||||
d = box_depth(type);
|
||||
translate_z(-box_profile_overlap(type)) difference() {
|
||||
rounded_rectangle([box_width(type) + 2 * outset, box_depth(type) + 2 * outset, feet ? foot_height : height], box_corner_rad(type), false);
|
||||
tw = w + 2 * outset;
|
||||
td = d + 2 * outset;
|
||||
rounded_rectangle([tw, td, feet ? foot_height : height], box_corner_rad(type), false);
|
||||
//
|
||||
// Remove edges between the feet
|
||||
//
|
||||
if(feet)
|
||||
hull() {
|
||||
translate_z(height + 0.5)
|
||||
cube([box_width(type) - 2 * foot_length, box_depth(type) + 2 * outset + 1, 1], center = true);
|
||||
cube([w - 2 * foot_length, td + 1, 1], center = true);
|
||||
|
||||
translate_z(foot_height + 1)
|
||||
cube([box_width(type) - 2 * (foot_length - foot_extension), box_depth(type) + 2 * outset + 1, 1], center = true);
|
||||
cube([w - 2 * (foot_length - foot_extension), td + 1, 1], center = true);
|
||||
}
|
||||
if(feet)
|
||||
hull() {
|
||||
translate_z(height + 0.5)
|
||||
cube([box_width(type) + 2 * outset + 1, box_depth(type) - 2 * foot_length, 1], center = true);
|
||||
cube([tw + 1, d - 2 * foot_length, 1], center = true);
|
||||
|
||||
translate_z(foot_height + 1)
|
||||
cube([box_width(type) + 2 * outset + 1, box_depth(type) - 2 * (foot_length - foot_extension), 1], center = true);
|
||||
cube([tw + 1, d - 2 * (foot_length - foot_extension), 1], center = true);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -247,28 +254,28 @@ module box_bezel(type, bottom) { //! Generates top and bottom bezel STLs
|
||||
translate_z(-box_profile_overlap(type))
|
||||
linear_extrude(2 * box_profile_overlap(type), center = true)
|
||||
for(i = [-1, 1]) {
|
||||
translate([i * (box_width(type) / 2 + t / 2 - sheet_slot_clearance / 2), 0])
|
||||
square([t, box_depth(type) - 2 * box_corner_gap(type)], center = true);
|
||||
translate([i * (w + t - sheet_slot_clearance) / 2, 0])
|
||||
square([t, d - 2 * cgap], center = true);
|
||||
|
||||
translate([0, i * (box_depth(type) / 2 + t / 2 - sheet_slot_clearance / 2)])
|
||||
square([box_width(type) - 2 * box_corner_gap(type), t], center = true);
|
||||
translate([0, i * (d + t - sheet_slot_clearance) / 2])
|
||||
square([w - 2 * cgap, t], center = true);
|
||||
}
|
||||
//
|
||||
// recess for top / bottom panel
|
||||
//
|
||||
translate_z(box_corner_gap(type))
|
||||
rounded_rectangle([box_width(type) + bezel_clearance, box_depth(type) + bezel_clearance, height], inner_r + bezel_clearance / 2, false);
|
||||
translate_z(cgap)
|
||||
rounded_rectangle([w + bezel_clearance, d + bezel_clearance, height], inner_r + bezel_clearance / 2, false);
|
||||
//
|
||||
// leave plastic over the corner profiles
|
||||
//
|
||||
translate_z(-box_profile_overlap(type) - 1)
|
||||
linear_extrude(box_profile_overlap(type) + box_corner_gap(type) + 2)
|
||||
linear_extrude(box_profile_overlap(type) + cgap + 2)
|
||||
union() {
|
||||
difference() {
|
||||
square([box_width(type) - 2 * box_inset(type),
|
||||
box_depth(type) - 2 * box_inset(type)], center = true);
|
||||
square([w - 2 * inset,
|
||||
d - 2 * inset], center = true);
|
||||
|
||||
box_corner_quadrants(type, box_width(type), box_depth(type));
|
||||
box_corner_quadrants(type, w, d);
|
||||
}
|
||||
box_screw_hole_positions(type)
|
||||
poly_circle(screw_clearance_radius(box_screw(type)));
|
||||
@@ -291,7 +298,9 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
dw = bw - 2 * dowel_wall;
|
||||
dh = box_bezel_height(type, bottom) - dowel_h_wall;
|
||||
|
||||
dh2 = box_profile_overlap(type) + box_corner_gap(type) - dowel_h_wall;
|
||||
profile_overlap = box_profile_overlap(type);
|
||||
|
||||
dh2 = profile_overlap + box_corner_gap(type) - dowel_h_wall;
|
||||
|
||||
end_clearance = 0.5;
|
||||
module male() {
|
||||
@@ -299,14 +308,14 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
linear_extrude(dowel_length - 2 * end_clearance, center = true)
|
||||
difference() {
|
||||
union() {
|
||||
h = dh - layer_height;
|
||||
h1 = dh - layer_height;
|
||||
h2 = dh2 - layer_height;
|
||||
hull() {
|
||||
translate([bw / 2, h / 2])
|
||||
square([dw - 1, h], center = true);
|
||||
translate([bw / 2, h1 / 2])
|
||||
square([dw - 1, h1], center = true);
|
||||
|
||||
translate([bw / 2, (h - 1) / 2])
|
||||
square([dw, h - 1], center = true);
|
||||
translate([bw / 2, (h1 - 1) / 2])
|
||||
square([dw, h1 - 1], center = true);
|
||||
}
|
||||
|
||||
hull() {
|
||||
@@ -318,7 +327,7 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
}
|
||||
}
|
||||
translate([bw2 / 2, 0])
|
||||
square([box_sheet_slot(type), 2 * box_profile_overlap(type)], center = true);
|
||||
square([box_sheet_slot(type), 2 * profile_overlap], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +368,7 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
render() difference() {
|
||||
union() {
|
||||
clip(xmin = 0, xmax = w, ymin = 0, ymax = h)
|
||||
translate([tw / 2 - x * w, th / 2 - y * h, box_profile_overlap(type)])
|
||||
translate([tw / 2 - x * w, th / 2 - y * h, profile_overlap])
|
||||
box_bezel(type, bottom);
|
||||
|
||||
if(x < cols - 1 && y == 0)
|
||||
@@ -419,10 +428,14 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
}
|
||||
}
|
||||
|
||||
module box_screw_hole_positions(type)
|
||||
module box_screw_hole_positions(type) {
|
||||
inset = box_hole_inset(type);
|
||||
w = box_width(type) / 2 - inset;
|
||||
d = box_depth(type) / 2 - inset;
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate([x * (box_width(type) / 2 - box_hole_inset(type)), y * (box_depth(type) / 2 - box_hole_inset(type))])
|
||||
translate([x * w, y * d])
|
||||
children();
|
||||
}
|
||||
|
||||
module box_base_blank(type) { //! Generates a 2D template for the base sheet
|
||||
dxf("box_base");
|
||||
|
@@ -59,11 +59,11 @@ function drag_chain_z(type) = //! Outside dimension of a 180 bend
|
||||
function drag_chain(name, size, travel, wall = 1.6, bwall = 1.5, twall = 1.5, screw = M2_cap_screw, screw_lists = [[1,0,0,1],[1,0,0,1]]) = //! Constructor
|
||||
[name, size, travel, wall, bwall, twall, screw, screw_lists];
|
||||
|
||||
function drag_chain_outer_size(type) = //! Link outer dimensions
|
||||
function drag_chain_outer_size(type) = //! Link outer dimensions
|
||||
let(s = drag_chain_size(type), z = s.z + drag_chain_bwall(type) + drag_chain_twall(type))
|
||||
[s.x + z, s.y + 4 * drag_chain_wall(type) + 2 * clearance, z];
|
||||
|
||||
function screw_lug_radius(screw) = //! Radius if a screw lug
|
||||
function screw_lug_radius(screw) = //! Radius of a screw lug
|
||||
corrected_radius(screw_clearance_radius(screw)) + 3.1 * extrusion_width;
|
||||
|
||||
module screw_lug(screw, h = 0) //! Create a D shaped lug for a screw
|
||||
@@ -81,23 +81,18 @@ module screw_lug(screw, h = 0) //! Create a D shaped lug for a screw
|
||||
|
||||
function bool2int(b) = b ? 1 : 0;
|
||||
|
||||
module drag_chain_screw_positions(type, end) {//! Place children at the screw positions, end = 0 for the start, 1 for the end
|
||||
module drag_chain_screw_positions(type, end) { //! Place children at the screw positions, end = 0 for the start, 1 for the end
|
||||
r = screw_lug_radius(drag_chain_screw(type));
|
||||
s = drag_chain_size(type);
|
||||
os = drag_chain_outer_size(type);
|
||||
R = os.z / 2;
|
||||
x0 = end ? R + norm([drag_chain_cam_x(type), R - drag_chain_twall(type)]) + clearance + r : r;
|
||||
x1 = end ? os.x - r : os.x - 2 * R - clearance - r;
|
||||
for(i = [0 : 3]) {
|
||||
x = i % 2;
|
||||
y = bool2int(i > 1);
|
||||
for(i = [0 : 3], x = [x0, x1, x0, x1][i], y = [-1, -1, 1, 1][i])
|
||||
if(drag_chain_screw_lists(type)[bool2int(end)][i])
|
||||
translate([(x0 + x1) / 2, 0])
|
||||
mirror([x, 0])
|
||||
mirror([0, y])
|
||||
translate([(x1 - x0) / 2, s.y / 2 + r])
|
||||
children();
|
||||
}
|
||||
translate([x, y * (s.y / 2 + r)])
|
||||
let($a = [180, 0, 180, 0][i])
|
||||
children();
|
||||
}
|
||||
|
||||
function drag_chain_cam_x(type) = // how far the cam sticks out
|
||||
@@ -108,8 +103,7 @@ function drag_chain_cam_x(type) = // how far the cam sticks out
|
||||
twall = drag_chain_twall(type)
|
||||
) min(sqrt(max(sqr(cam_r) - sqr(r - twall), 0)), r);
|
||||
|
||||
|
||||
module drag_chain_link(type, start = false, end = false) { //! One link of the chain, special case for start and end
|
||||
module drag_chain_link(type, start = false, end = false, check_kids = true) { //! One link of the chain, special case for start and end
|
||||
stl(str(drag_chain_name(type), "_drag_chain_link", start ? "_start" : end ? "_end" : ""));
|
||||
|
||||
s = drag_chain_size(type);
|
||||
@@ -220,15 +214,21 @@ module drag_chain_link(type, start = false, end = false) { //! One link of the c
|
||||
|
||||
if(start || end) {
|
||||
drag_chain_screw_positions(type, end)
|
||||
screw_lug(drag_chain_screw(type), os.z);
|
||||
rotate($a)
|
||||
screw_lug(drag_chain_screw(type), os.z);
|
||||
|
||||
if(check_kids) {
|
||||
custom = drag_chain_screw_lists(type)[bool2int(end)] == [0, 0, 0, 0];
|
||||
assert($children == bool2int(custom), str("wrong number of children for ", end ? "end" : "start", " STL customisation: ", $children));
|
||||
}
|
||||
children();
|
||||
}
|
||||
}
|
||||
if(start || end)
|
||||
translate_z(-eps)
|
||||
drag_chain_screw_positions(type, end)
|
||||
poly_cylinder(r = screw_clearance_radius(drag_chain_screw(type)), h = os.z + 2 * eps, center = false);
|
||||
rotate($a)
|
||||
poly_cylinder(r = screw_clearance_radius(drag_chain_screw(type)), h = os.z + 2 * eps, center = false);
|
||||
|
||||
}
|
||||
|
||||
@@ -250,9 +250,8 @@ module drag_chain_link(type, start = false, end = false) { //! One link of the c
|
||||
}
|
||||
}
|
||||
|
||||
//! 1. Remove the support material from the links with side cutters.
|
||||
//! 1. Clip the links together with the special ones at the ends.
|
||||
module drag_chain_assembly(type, pos = 0) { //! Drag chain assembly
|
||||
// Need to use a wrapper because can't define nested modules in an assembly
|
||||
module _drag_chain_assembly(type, pos = 0) {
|
||||
s = drag_chain_size(type);
|
||||
x = (1 + exploded()) * s.x;
|
||||
r = drag_chain_radius(type) * x / s.x;
|
||||
@@ -279,7 +278,7 @@ module drag_chain_assembly(type, pos = 0) { //! Drag chain assembly
|
||||
module link(n) // Position and colour link with origin at the hinge hole
|
||||
translate([-z / 2, 0, -z / 2]) {
|
||||
stl_colour(n < 0 || n == npoints - 1 ? pp3_colour : n % 2 ? pp1_colour : pp2_colour)
|
||||
drag_chain_link(type, start = n == -1, end = n == npoints - 1)
|
||||
drag_chain_link(type, start = n == -1, end = n == npoints - 1, check_kids = false)
|
||||
let($fasteners = 0) children();
|
||||
let($fasteners = 1) children();
|
||||
}
|
||||
@@ -287,22 +286,36 @@ module drag_chain_assembly(type, pos = 0) { //! Drag chain assembly
|
||||
screws = drag_chain_screw_lists(type);
|
||||
custom_start = screws[0] == [0, 0, 0, 0];
|
||||
custom_end = screws[1] == [0, 0, 0, 0];
|
||||
assert($children == bool2int(custom_start) + bool2int(custom_end), "wrong number of children for end customisation");
|
||||
assembly(str(drag_chain_name(type), "_drag_chain")) {
|
||||
for(i = [0 : npoints - 2]) let(v = points[i+1] - points[i])
|
||||
translate(points[i])
|
||||
rotate([0, -atan2(v.z, v.x), 0])
|
||||
link(i);
|
||||
assert($children == bool2int(custom_start) + bool2int(custom_end), str("wrong number of children for end customisation: ", $children));
|
||||
|
||||
translate(points[0] - [x, 0, 0])
|
||||
link(-1)
|
||||
if(custom_start)
|
||||
children(0);
|
||||
for(i = [0 : npoints - 2]) let(v = points[i + 1] - points[i])
|
||||
translate(points[i])
|
||||
rotate([0, -atan2(v.z, v.x), 0])
|
||||
link(i);
|
||||
|
||||
translate(points[npoints - 1])
|
||||
hflip()
|
||||
link(npoints - 1)
|
||||
if(custom_end)
|
||||
children(custom_start ? 1 : 0);
|
||||
}
|
||||
translate(points[0] - [x, 0, 0])
|
||||
link(-1)
|
||||
if(custom_start)
|
||||
children(0);
|
||||
|
||||
translate(points[npoints - 1])
|
||||
hflip()
|
||||
link(npoints - 1)
|
||||
if(custom_end)
|
||||
children(custom_start ? 1 : 0);
|
||||
}
|
||||
|
||||
//! 1. Remove the support material from the links with side cutters.
|
||||
//! 1. Clip the links together with the special ones at the ends.
|
||||
module drag_chain_assembly(type, pos = 0) //! Drag chain assembly
|
||||
assembly(str(drag_chain_name(type), "_drag_chain"), big = true)
|
||||
if($children == 2)
|
||||
_drag_chain_assembly(type, pos) {
|
||||
children(0);
|
||||
children(1);
|
||||
}
|
||||
else if($children == 1)
|
||||
_drag_chain_assembly(type, pos)
|
||||
children(0);
|
||||
else
|
||||
_drag_chain_assembly(type, pos);
|
||||
|
50
printed/press_fit.scad
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// 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/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Utility for making printed press fit connectors to join printed parts.
|
||||
//!
|
||||
//! Add solvent or glue to make a permanent fixture.
|
||||
//
|
||||
include <../core.scad>
|
||||
|
||||
interference = 0.0;
|
||||
|
||||
bridge_droop = layer_height; //sqrt(4 * layer_height * filament_width / PI) - layer_height;
|
||||
|
||||
module press_fit_socket(w = 5, h = 50, horizontal = false) { //! Make a square hole to accept a peg
|
||||
h = horizontal ? h : h + bridge_droop;
|
||||
|
||||
cube([w, w, 2 * h], center = true);
|
||||
}
|
||||
|
||||
module press_fit_peg(h, w = 5, horizontal = false) { //! Make a rounded chamfered peg for easy insertion
|
||||
module chamfered_square(w, horizontal) {
|
||||
h = horizontal ? w - bridge_droop : w;
|
||||
rounded_square([w, h], 1);
|
||||
}
|
||||
|
||||
translate_z(-eps)
|
||||
linear_extrude(height = h + eps - layer_height)
|
||||
chamfered_square(w + interference, horizontal);
|
||||
|
||||
translate_z(h - layer_height - eps)
|
||||
linear_extrude(height = layer_height + eps)
|
||||
chamfered_square(w - layer_height, horizontal);
|
||||
}
|
105
readme.md
@@ -35,14 +35,14 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Handle">Handle</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 = "#O_ring">O_ring</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#PCB_mount">PCB_mount</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 = "#Opengrab">Opengrab</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</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 = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</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 = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</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 = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_right_triangle">Rounded_right_triangle</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Transformers">Transformers</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 = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</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 = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</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></td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td></td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
@@ -2707,6 +2707,7 @@ Linear rails with carriages.
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```carriage_screw_depth(type)``` | Carriage thread depth |
|
||||
| ```carriage_size(type)``` | Size of carriage |
|
||||
| ```rail_holes(type, length)``` | Number of holes in a rail given its ```length``` |
|
||||
| ```rail_screw_height(type, screw)``` | Position screw taking into account countersink into counterbored hole |
|
||||
| ```rail_travel(type, length)``` | How far the carriage can travel |
|
||||
@@ -2904,6 +2905,8 @@ These items are sysmtrical, so by default the origin is in the centre but it can
|
||||
## Screws
|
||||
Machine screws and wood screws with various head styles.
|
||||
|
||||
For an explanation of ```screw_polysink()``` see <https://hydraraptor.blogspot.com/2020/12/sinkholes.html>.
|
||||
|
||||
|
||||
[vitamins/screws.scad](vitamins/screws.scad) Object definitions.
|
||||
|
||||
@@ -2930,9 +2933,10 @@ Machine screws and wood screws with various head styles.
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```screw_boss_diameter(type)``` | Boss big enough for nut trap and washer |
|
||||
| ```screw_head_depth(type, d)``` | How far a counter sink head will go into a straight hole diameter d |
|
||||
| ```screw_head_depth(type, d = 0)``` | How far a counter sink head will go into a straight hole diameter d |
|
||||
| ```screw_longer_than(x)``` | Returns shortest screw length longer or equal to x |
|
||||
| ```screw_nut_radius(type)``` | Radius of matching nut |
|
||||
| ```screw_polysink_r(type, z)``` | Countersink hole profile corrected for rounded staircase extrusions. |
|
||||
| ```screw_shorter_than(x)``` | Returns longest screw length shorter than or equal to x |
|
||||
|
||||
### Modules
|
||||
@@ -2940,7 +2944,8 @@ Machine screws and wood screws with various head styles.
|
||||
|:--- |:--- |
|
||||
| ```screw(type, length, hob_point = 0, nylon = false)``` | Draw specified screw, optionally hobbed or nylon |
|
||||
| ```screw_and_washer(type, length, star = false, penny = false)``` | Screw with a washer which can be standard or penny and an optional star washer on top |
|
||||
| ```screw_countersink(type)``` | Countersink shape |
|
||||
| ```screw_countersink(type, drilled = true)``` | Countersink shape |
|
||||
| ```screw_polysink(type, h = 100, alt = false)``` | A countersink hole made from stacked polyholes for printed parts |
|
||||
|
||||

|
||||
|
||||
@@ -2979,6 +2984,11 @@ Machine screws and wood screws with various head styles.
|
||||
| 1 | ```screw(No6_cs_screw, 30)``` | Screw No6 cs wood x 30mm |
|
||||
| 1 | ```screw(No6_screw, 30)``` | Screw No6 pan wood x 30mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | polysink.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
@@ -4592,13 +4602,13 @@ to the assembly, for example to add inserts.
|
||||
| ```drag_chain_outer_size(type)``` | Link outer dimensions |
|
||||
| ```drag_chain_radius(type)``` | The bend radius at the pivot centres |
|
||||
| ```drag_chain_z(type)``` | Outside dimension of a 180 bend |
|
||||
| ```screw_lug_radius(screw)``` | Radius if a screw lug |
|
||||
| ```screw_lug_radius(screw)``` | Radius of a screw lug |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```drag_chain_assembly(type, pos = 0)``` | Drag chain assembly |
|
||||
| ```drag_chain_link(type, start = false, end = false)``` | One link of the chain, special case for start and end |
|
||||
| ```drag_chain_link(type, start = false, end = false, check_kids = true)``` | One link of the chain, special case for start and end |
|
||||
| ```drag_chain_screw_positions(type, end)``` | Place children at the screw positions, end = 0 for the start, 1 for the end |
|
||||
| ```screw_lug(screw, h = 0)``` | Create a D shaped lug for a screw |
|
||||
|
||||
@@ -4978,6 +4988,29 @@ The stl must be given a parameterless wrapper in the project that uses it.
|
||||
| 1 | pcb_mount_PI_IO_5.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Press_fit"></a>
|
||||
## Press_fit
|
||||
Utility for making printed press fit connectors to join printed parts.
|
||||
|
||||
Add solvent or glue to make a permanent fixture.
|
||||
|
||||
|
||||
[printed/press_fit.scad](printed/press_fit.scad) Implementation.
|
||||
|
||||
[tests/press_fit.scad](tests/press_fit.scad) Code for this example.
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```press_fit_peg(h, w = 5, horizontal = false)``` | Make a rounded chamfered peg for easy insertion |
|
||||
| ```press_fit_socket(w = 5, h = 50, horizontal = false)``` | Make a square hole to accept a peg |
|
||||
|
||||

|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -5479,8 +5512,10 @@ a square cornered part fits in the hole then circles are placed in the corners m
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```dogbone_rectangle(size, r = cnc_bit_r, center = true, xy_center = true)``` | Rectangle with cylinders at the corners |
|
||||
| ```dogbone_square(size, r = cnc_bit_r, center = true)``` | Square with circles at the corners |
|
||||
| ```dogbone_rectangle(size, r = cnc_bit_r, center = true, xy_center = true, x_offset, y_offset)``` | Rectangle with cylinders at the corners |
|
||||
| ```dogbone_rectangle_x(size, r = cnc_bit_r, center = true, xy_center = true)``` | Rectangle with cylinders at the corners, offset in the x direction |
|
||||
| ```dogbone_rectangle_y(size, r = cnc_bit_r, center = true, xy_center = true)``` | Rectangle with cylinders at the corners, offset in the y direction |
|
||||
| ```dogbone_square(size, r = cnc_bit_r, center = true, x_offset, y_offset)``` | Square with circles at the corners, with optional offsets |
|
||||
|
||||

|
||||
|
||||
@@ -5801,6 +5836,26 @@ Because the tangents need to be calculated to find the length these can be calcu
|
||||

|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Rounded_right_triangle"></a>
|
||||
## Rounded_right_triangle
|
||||
Draw a 3D right triangle with rounded edges. Intended to be embedded in other parts. Can be optionally offset by the filleted amount.
|
||||
|
||||
|
||||
[utils/rounded_right_triangle.scad](utils/rounded_right_triangle.scad) Implementation.
|
||||
|
||||
[tests/rounded_right_triangle.scad](tests/rounded_right_triangle.scad) Code for this example.
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```rounded_right_triangle(x, y, z, fillet, center = true, offset = false)``` | Draw a 3D right triangle with rounded edges. |
|
||||
|
||||

|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -5829,7 +5884,7 @@ A sector of a circle between two angles.
|
||||
Utility to generate a polhedron by sweeping a 2D profile along a 3D path and utilities for generating paths.
|
||||
|
||||
The initial orientation is the Y axis of the profile points towards the initial center of curvature, Frenet-Serret style.
|
||||
This means the first three points must not be colinear. Subsequent rotations use the minimum rotation method.
|
||||
Subsequent rotations use the minimum rotation method.
|
||||
|
||||
The path can be open or closed. If closed sweep ensures that the start and end have the same rotation to line up.
|
||||
An additional twist around the path can be specified. If the path is closed this should be a multiple of 360.
|
||||
@@ -6066,6 +6121,7 @@ Global constants, functions and modules. This file is used directly or indirectl
|
||||
| ```ellipse(xr, yr)``` | Draw an ellipse |
|
||||
| ```extrude_if(h, center = true)``` | Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D |
|
||||
| ```hflip(flip=true)``` | Invert children by doing a 180° flip around the Y axis |
|
||||
| ```render_if(render = true, convexity = 2)``` | Renders an object if ```render``` is true, otherwise leaves it unrendered |
|
||||
| ```right_triangle(width, height, h, center = true)``` | A right angled triangle with the 90° corner at the origin. 3D when ```h``` is nonzero, otherwise 2D |
|
||||
| ```semi_circle(r, d = undef)``` | A semi circle in the positive Y domain |
|
||||
| ```translate_z(z)``` | Shortcut for Z only translations |
|
||||
@@ -6084,6 +6140,16 @@ it gets the linear dimensions right. See <https://hydraraptor.blogspot.com/2011/
|
||||
|
||||
The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is useful for making printed washers and pillars.
|
||||
|
||||
`poly_cylinder()` has a `twist` parameter which can be set to make the polygon rotate each layer.
|
||||
This can be used to mitigate the number of sides being small and make small holes stronger and more round, but is quite slow due to the
|
||||
large increase in the number of facets.
|
||||
When set to 1 the polygons alternate each layer, when set higher the rotation takes `twist + 1` layers to repeat.
|
||||
A small additional rotation is added to make the polygon rotate one more side over the length of the hole to make it appear round when
|
||||
veiwed end on.
|
||||
|
||||
When `twist` is set the resulting cylinder is extended by `eps` at each end so that the exact length of the hole can be used without
|
||||
leaving a scar on either surface.
|
||||
|
||||
|
||||
[utils/core/polyholes.scad](utils/core/polyholes.scad) Implementation.
|
||||
|
||||
@@ -6101,7 +6167,7 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is
|
||||
|:--- |:--- |
|
||||
| ```drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle |
|
||||
| ```poly_circle(r, sides = 0)``` | Make a circle adjusted to print the correct size |
|
||||
| ```poly_cylinder(r, h, center = false, sides = 0, chamfer = false)``` | Make a cylinder adjusted to print the correct size |
|
||||
| ```poly_cylinder(r, h, center = false, sides = 0, chamfer = false, twist = 0)``` | Make a cylinder adjusted to print the correct size |
|
||||
| ```poly_drill(r, h = 100, center = true)``` | Make a cylinder for drilling holes suitable for CNC routing if cnc_bit_r is non zero, otherwise a poly_cylinder. |
|
||||
| ```poly_ring(or, ir, sides = 0)``` | Make a 2D ring adjusted to have the correct internal radius |
|
||||
| ```poly_tube(or, ir, h, center = false)``` | Make a tube adjusted to have the correct internal radius |
|
||||
@@ -6135,6 +6201,11 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is
|
||||
| 1 | ```rod(9.5, 43)``` | Smooth rod 9.5mm x 43mm |
|
||||
| 1 | ```rod(9, 41)``` | Smooth rod 9mm x 41mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | polyhole.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
@@ -6152,6 +6223,8 @@ Rectangle with rounded corners.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```rounded_rectangle(size, r, center = true, xy_center = true)``` | Like ```cube()``` but corners rounded in XY plane and separate centre options for xy and z. |
|
||||
| ```rounded_rectangle_xz(size, r, center = true, xy_center = true)``` | Like ```cube()``` but corners rounded in XZ plane and separate centre options for xy and z. |
|
||||
| ```rounded_rectangle_yz(size, r, center = true, xy_center = true)``` | Like ```cube()``` but corners rounded in YX plane and separate centre options for xy and z. |
|
||||
| ```rounded_square(size, r, center = true)``` | Like ```square()``` but with with rounded corners |
|
||||
|
||||

|
||||
|
@@ -308,8 +308,7 @@ def views(target, do_assemblies = None):
|
||||
if printed:
|
||||
print('### 3D Printed parts', file = doc_file)
|
||||
keys = sorted(list(printed.keys()))
|
||||
for i in range(len(keys)):
|
||||
p = keys[i]
|
||||
for i, p in enumerate(keys):
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', printed[p]["count"], p), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(printed) - 1:
|
||||
n = (i % 3) + 1
|
||||
@@ -324,8 +323,7 @@ def views(target, do_assemblies = None):
|
||||
if routed:
|
||||
print("### CNC Routed parts", file = doc_file)
|
||||
keys = sorted(list(routed.keys()))
|
||||
for i in range(len(keys)):
|
||||
r = keys[i]
|
||||
for i, r in enumerate(keys):
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', routed[r]["count"], r), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(routed) - 1:
|
||||
n = (i % 3) + 1
|
||||
@@ -340,8 +338,7 @@ def views(target, do_assemblies = None):
|
||||
if sub_assemblies:
|
||||
print("### Sub-assemblies", file = doc_file)
|
||||
keys = sorted(list(sub_assemblies.keys()))
|
||||
for i in range(len(keys)):
|
||||
a = keys[i]
|
||||
for i, a in enumerate(keys):
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', sub_assemblies[a], a), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(keys) - 1:
|
||||
n = (i % 3) + 1
|
||||
|
@@ -26,6 +26,12 @@ module dogbones() {
|
||||
#translate([15, 0])
|
||||
dogbone_rectangle([10, 20, 5], center = false);
|
||||
|
||||
#translate([30, 0])
|
||||
dogbone_rectangle_x([10, 20, 5], center = false);
|
||||
|
||||
#translate([45, 0])
|
||||
dogbone_rectangle_y([10, 20, 5], center = false);
|
||||
|
||||
sq = 3;
|
||||
translate([-5 + sq / 2 + eps, -10 + sq / 2 + eps])
|
||||
%cube([sq, sq, 1], center = true);
|
||||
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 136 KiB |
BIN
tests/png/press_fit.png
Normal file
After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 43 KiB |
BIN
tests/png/rounded_right_triangle.png
Normal file
After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 181 KiB |
@@ -21,30 +21,60 @@ include <../utils/core/core.scad>
|
||||
use <../vitamins/rod.scad>
|
||||
include <../vitamins/sheets.scad>
|
||||
|
||||
module polyholes() {
|
||||
module positions()
|
||||
for(i = [1 : 10]) {
|
||||
translate([(i * i + i) / 2 + 3 * i , 8])
|
||||
let($r = i / 2)
|
||||
module positions()
|
||||
for(i = [1 : 10]) {
|
||||
translate([(i * i + i) / 2 + 3 * i , 8])
|
||||
let($r = i / 2)
|
||||
children();
|
||||
|
||||
let(d = i + 0.5)
|
||||
translate([(d * d + d) / 2 + 3 * d, 19])
|
||||
let($r = d / 2)
|
||||
children();
|
||||
}
|
||||
|
||||
let(d = i + 0.5)
|
||||
translate([(d * d + d) / 2 + 3 * d, 19])
|
||||
let($r = d / 2)
|
||||
children();
|
||||
}
|
||||
module polyhole_stl() {
|
||||
stl("polyhole");
|
||||
|
||||
stl_colour(pp1_colour) linear_extrude(3, center = true)
|
||||
linear_extrude(3, center = true)
|
||||
difference() {
|
||||
square([100, 27]);
|
||||
|
||||
positions()
|
||||
poly_circle(r = $r);
|
||||
}
|
||||
}
|
||||
|
||||
positions()
|
||||
module alt_polyhole_stl() {
|
||||
holes = [2.5, 2, 1.5];
|
||||
n = len(holes);
|
||||
size = [n * 10, 10, 10];
|
||||
difference() {
|
||||
translate([-size.x / n / 2, $preview ? 0 : -size.y / 2])
|
||||
cube($preview ? [size.x, size.y / 2, size.z] : size);
|
||||
|
||||
for(i = [0 : n - 1])
|
||||
translate([i * 10, 0])
|
||||
if(i % 2)
|
||||
translate_z(size.z)
|
||||
poly_cylinder(r = holes[i] / 2, h = 2 * size.z, center = true, twist = i + 1);
|
||||
else
|
||||
poly_cylinder(r = holes[i] / 2, h = size.z, center = false, twist = i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
module polyholes() {
|
||||
stl_colour(pp1_colour)
|
||||
polyhole_stl();
|
||||
|
||||
positions()
|
||||
rod(d = 2 * $r, l = 8 * $r + 5);
|
||||
//
|
||||
// Alternating polyholes
|
||||
//
|
||||
translate([30, -40])
|
||||
alt_polyhole_stl();
|
||||
//
|
||||
// Poly rings
|
||||
//
|
||||
ir = 3 / 2;
|
||||
@@ -74,4 +104,11 @@ module polyholes() {
|
||||
}
|
||||
}
|
||||
|
||||
polyholes();
|
||||
if($preview)
|
||||
polyholes();
|
||||
else {
|
||||
polyhole_stl();
|
||||
|
||||
translate([50, -20])
|
||||
alt_polyhole_stl();
|
||||
}
|
||||
|
71
tests/press_fit.scad
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// 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 <../printed/press_fit.scad>
|
||||
|
||||
module press_fits()
|
||||
{
|
||||
thickness = 2;
|
||||
width = 20;
|
||||
vthickness = 4;
|
||||
|
||||
translate([0, width + 2])
|
||||
difference() {
|
||||
cube([width, width, thickness]);
|
||||
|
||||
for(x = [0.25, 0.75])
|
||||
for(y = [0.25, 0.75])
|
||||
translate([x * width, y * width])
|
||||
press_fit_socket();
|
||||
}
|
||||
|
||||
union() {
|
||||
cube([width, width, thickness]);
|
||||
|
||||
for(x = [0.25, 0.75])
|
||||
for(y = [0.25, 0.75])
|
||||
translate([x * width, y * width, thickness])
|
||||
press_fit_peg(h = thickness);
|
||||
}
|
||||
|
||||
translate([width + 2, width + 2])
|
||||
difference() {
|
||||
cube([width, vthickness, width]);
|
||||
|
||||
for(x = [0.25, 0.75])
|
||||
for(y = [0.25, 0.75])
|
||||
translate([x, 0, y] * width)
|
||||
rotate([90, 0, 0])
|
||||
press_fit_socket();
|
||||
}
|
||||
|
||||
translate([width + 2, 0])
|
||||
union() {
|
||||
cube([width, width, thickness]);
|
||||
|
||||
for(x = [0.25, 0.75])
|
||||
for(y = [0.25, 0.75])
|
||||
translate([x * width, y * width, thickness])
|
||||
press_fit_peg(h = vthickness, horizontal = true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
press_fits();
|
@@ -25,6 +25,12 @@ module rounded_rectangles() {
|
||||
|
||||
translate([40, 0])
|
||||
rounded_rectangle([30, 20, 10], 3);
|
||||
|
||||
translate([80, 0])
|
||||
rounded_rectangle_xz([30, 20, 10], 3);
|
||||
|
||||
translate([120, 0])
|
||||
rounded_rectangle_yz([30, 20, 10], 3);
|
||||
}
|
||||
|
||||
rounded_rectangles();
|
||||
|
31
tests/rounded_right_triangle.scad
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
include <../global_defs.scad>
|
||||
use <../utils/rounded_right_triangle.scad>
|
||||
|
||||
|
||||
module rounded_right_triangles() {
|
||||
rounded_right_triangle(10, 20, 5, 0.5);
|
||||
|
||||
translate([20, 0])
|
||||
rounded_right_triangle(10, 20, 5, 0.5, offset = true);
|
||||
}
|
||||
|
||||
rounded_right_triangles();
|
@@ -18,20 +18,46 @@
|
||||
//
|
||||
include <../core.scad>
|
||||
|
||||
module screws()
|
||||
for(y = [0 : len(screw_lists) -1])
|
||||
for(x = [0 : len(screw_lists[y]) -1]) {
|
||||
screw = screw_lists[y][x];
|
||||
if(screw) {
|
||||
length = screw_head_type(screw) == hs_grub ? 6
|
||||
: screw_radius(screw) <= 1.5 ? 10
|
||||
: screw_max_thread(screw) ? screw_longer_than(screw_max_thread(screw) + 5)
|
||||
: 30;
|
||||
translate([x * 20, y * 20])
|
||||
screw(screw, length);
|
||||
}
|
||||
module polysink_stl() {
|
||||
stl("polysink");
|
||||
|
||||
cs_screws = [for(list = screw_lists, screw = list) if(screw_head_type(screw) == hs_cs_cap) screw];
|
||||
n = len(cs_screws);
|
||||
size = [n * 20, 20, 10];
|
||||
difference() {
|
||||
translate([-size.x / n / 2, $preview ? 0 : -size.y / 2])
|
||||
cube($preview ? [size.x, size.y / 2, size.z] : size);
|
||||
|
||||
for(i = [0 : n - 1])
|
||||
let(s = cs_screws[i])
|
||||
translate([i * 20, 0]) {
|
||||
translate_z(size.z)
|
||||
screw_polysink(s, 2 * size.z + 1);
|
||||
|
||||
screw_polysink(s, 2 * size.z + 1, alt = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module screws() {
|
||||
for(y = [0 : len(screw_lists) -1])
|
||||
for(x = [0 : len(screw_lists[y]) -1]) {
|
||||
screw = screw_lists[y][x];
|
||||
if(screw) {
|
||||
length = screw_head_type(screw) == hs_grub ? 6
|
||||
: screw_radius(screw) <= 1.5 ? 10
|
||||
: screw_max_thread(screw) ? screw_longer_than(screw_max_thread(screw) + 5)
|
||||
: 30;
|
||||
translate([x * 20, y * 20])
|
||||
screw(screw, length);
|
||||
}
|
||||
}
|
||||
translate([80, 20])
|
||||
polysink_stl();
|
||||
}
|
||||
|
||||
if($preview)
|
||||
let($show_threads = true)
|
||||
screws();
|
||||
else
|
||||
polysink_stl();
|
||||
|
@@ -52,6 +52,13 @@ function slice(list, start = 0, end = undef) = let( //! Slice a list or string w
|
||||
) is_string(list) ? slice_str(list, start, end) : [for(i = [start : 1 : end - 1]) list[i]];
|
||||
|
||||
|
||||
module render_if(render = true, convexity = 2) //! Renders an object if ```render``` is true, otherwise leaves it unrendered
|
||||
if (render)
|
||||
render(convexity = convexity)
|
||||
children();
|
||||
else
|
||||
children();
|
||||
|
||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
|
||||
if(h)
|
||||
linear_extrude(h, center = center, convexity = 2) // 3D
|
||||
|
@@ -22,6 +22,16 @@
|
||||
//! it gets the linear dimensions right. See <https://hydraraptor.blogspot.com/2011/02/polyholes.html>
|
||||
//!
|
||||
//! The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is useful for making printed washers and pillars.
|
||||
//!
|
||||
//! `poly_cylinder()` has a `twist` parameter which can be set to make the polygon rotate each layer.
|
||||
//! This can be used to mitigate the number of sides being small and make small holes stronger and more round, but is quite slow due to the
|
||||
//! large increase in the number of facets.
|
||||
//! When set to 1 the polygons alternate each layer, when set higher the rotation takes `twist + 1` layers to repeat.
|
||||
//! A small additional rotation is added to make the polygon rotate one more side over the length of the hole to make it appear round when
|
||||
//! veiwed end on.
|
||||
//!
|
||||
//! When `twist` is set the resulting cylinder is extended by `eps` at each end so that the exact length of the hole can be used without
|
||||
//! leaving a scar on either surface.
|
||||
//
|
||||
function sides(r) = max(round(4 * r), 3); //! Optimium number of sides for specified radius
|
||||
function corrected_radius(r, n = 0) = r / cos(180 / (n ? n : sides(r))); //! Adjusted radius to make flats lie on the circle
|
||||
@@ -32,9 +42,26 @@ module poly_circle(r, sides = 0) { //! Make a circle adjusted to print the corre
|
||||
circle(r = corrected_radius(r,n), $fn = n);
|
||||
}
|
||||
|
||||
module poly_cylinder(r, h, center = false, sides = 0, chamfer = false) {//! Make a cylinder adjusted to print the correct size
|
||||
extrude_if(h, center)
|
||||
poly_circle(r, sides);
|
||||
module poly_cylinder(r, h, center = false, sides = 0, chamfer = false, twist = 0) {//! Make a cylinder adjusted to print the correct size
|
||||
if(twist) {
|
||||
slices = ceil(h / layer_height);
|
||||
twists = min(twist + 1, slices);
|
||||
sides = sides ? sides : sides(r);
|
||||
rot = 360 / sides / twists * (twists < slices ? (1 + 1 / slices) : 1);
|
||||
if(center)
|
||||
for(side = [0, 1])
|
||||
mirror([0, 0, side])
|
||||
poly_cylinder(r = r, h = h / 2, sides = sides, twist = twist);
|
||||
else
|
||||
render(convexity = 5)
|
||||
for(i = [0 : slices - 1])
|
||||
translate_z(i * layer_height - eps)
|
||||
rotate(rot * i)
|
||||
poly_cylinder(r = r, h = layer_height + 2 * eps, sides = sides);
|
||||
}
|
||||
else
|
||||
extrude_if(h, center)
|
||||
poly_circle(r, sides);
|
||||
|
||||
if(h && chamfer)
|
||||
poly_cylinder(r + layer_height, center ? layer_height * 2 : layer_height, center, sides = sides ? sides : sides(r));
|
||||
|
@@ -28,6 +28,21 @@ module rounded_square(size, r, center = true) //! Like ```square()``` but with w
|
||||
|
||||
module rounded_rectangle(size, r, center = true, xy_center = true) //! Like ```cube()``` but corners rounded in XY plane and separate centre options for xy and z.
|
||||
{
|
||||
linear_extrude(size[2], center = center)
|
||||
rounded_square([size[0], size[1]], r, xy_center);
|
||||
linear_extrude(size.z, center = center)
|
||||
rounded_square([size.x, size.y], r, xy_center);
|
||||
}
|
||||
|
||||
module rounded_rectangle_xz(size, r, center = true, xy_center = true) //! Like ```cube()``` but corners rounded in XZ plane and separate centre options for xy and z.
|
||||
{
|
||||
translate([xy_center ? 0 : size.x / 2, xy_center ? 0 : size.y / 2, center ? 0 : size.z / 2])
|
||||
rotate([90, 0, 0])
|
||||
rounded_rectangle([size.x, size.z, size.y], r, center = true, xy_center = true);
|
||||
}
|
||||
|
||||
module rounded_rectangle_yz(size, r, center = true, xy_center = true) //! Like ```cube()``` but corners rounded in YX plane and separate centre options for xy and z.
|
||||
{
|
||||
translate([xy_center ? 0 : size.x / 2, xy_center ? 0 : size.y / 2, center ? 0 : size.z / 2])
|
||||
rotate([90, 0, 90])
|
||||
rounded_rectangle([size.y, size.z, size.x], r, center = true, xy_center = true);
|
||||
}
|
||||
|
||||
|
@@ -23,24 +23,36 @@
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
module dogbone_square(size, r = cnc_bit_r, center = true) //! Square with circles at the corners
|
||||
module dogbone_square(size, r = cnc_bit_r, center = true, x_offset, y_offset) //! Square with circles at the corners, with optional offsets
|
||||
{
|
||||
x_offset = is_undef(x_offset) ? r / sqrt(2) : x_offset;
|
||||
y_offset = is_undef(y_offset) ? r / sqrt(2) : y_offset;
|
||||
|
||||
union() {
|
||||
square(size, center = center);
|
||||
|
||||
if(r > 0) {
|
||||
origin = center ? [0, 0] : size / 2;
|
||||
offset = r / sqrt(2);
|
||||
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate(origin + [x * (size.x / 2 - offset), y * (size.y / 2 - offset)])
|
||||
translate(origin + [x * (size.x / 2 - x_offset), y * (size.y / 2 - y_offset)])
|
||||
drill(r, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module dogbone_rectangle(size, r = cnc_bit_r, center = true, xy_center = true) //! Rectangle with cylinders at the corners
|
||||
module dogbone_rectangle(size, r = cnc_bit_r, center = true, xy_center = true, x_offset, y_offset) //! Rectangle with cylinders at the corners
|
||||
{
|
||||
extrude_if(h = size.z, center = center)
|
||||
dogbone_square([size.x, size.y], r, xy_center);
|
||||
dogbone_square([size.x, size.y], r, xy_center, x_offset, y_offset);
|
||||
}
|
||||
|
||||
module dogbone_rectangle_x(size, r = cnc_bit_r, center = true, xy_center = true) //! Rectangle with cylinders at the corners, offset in the x direction
|
||||
{
|
||||
dogbone_rectangle(size = size, r = r, center = center, x_offset = 0, y_offset = r);
|
||||
}
|
||||
|
||||
module dogbone_rectangle_y(size, r = cnc_bit_r, center = true, xy_center = true) //! Rectangle with cylinders at the corners, offset in the y direction
|
||||
{
|
||||
dogbone_rectangle(size = size, r = r, center = center, x_offset = r, y_offset = 0);
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ module hanging_hole(z, ir, h = 100, h2 = 100) { //! Hole radius ```ir``` hanging
|
||||
poly_cylinder(r - eps, h - layer_height);
|
||||
}
|
||||
}
|
||||
assert(z % layer_height == 0, str(z));
|
||||
assert(z - layer_height * floor(z / layer_height) < eps, str(z));
|
||||
infill_angle = z % (2 * layer_height) ? -45 : 45;
|
||||
below = min(z + eps, h2);
|
||||
big = 1000;
|
||||
|
@@ -60,7 +60,7 @@ function rounded_polygon_length(points, tangents) = //! Calculate the length giv
|
||||
v1 = p1 - c,
|
||||
v2 = p2 - c,
|
||||
r = abs(corner.z),
|
||||
a = acos((v1 * v2) / sqr(r))) PI * (cross(v1,v2) <= 0 ? a : 360 - a) * r / 180]
|
||||
a = acos((v1 * v2) / sqr(r))) r ? PI * (cross(v1, v2) <= 0 ? a : 360 - a) * r / 180 : 0]
|
||||
)
|
||||
sumv(concat(straights, arcs));
|
||||
|
||||
|
46
utils/rounded_right_triangle.scad
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Draw a 3D right triangle with rounded edges. Intended to be embedded in other parts. Can be optionally offset by the filleted amount.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <NopSCADlib/utils/core/rounded_rectangle.scad>
|
||||
|
||||
module rounded_right_triangle(x, y, z, fillet, center = true, offset = false) { //! Draw a 3D right triangle with rounded edges.
|
||||
fillet = max(fillet, eps);
|
||||
size = [x + (offset ? 2 * fillet : 0), y + (offset ? 2 * fillet : 0), z];
|
||||
|
||||
translate([offset ? -2 * fillet : 0, offset ? -2 * fillet : 0, center ? 0 : size.z / 2])
|
||||
hull() {
|
||||
translate([0, fillet, size.z / 2])
|
||||
rotate([90, 90, 0])
|
||||
rounded_rectangle([size.z, 2 * fillet, eps], fillet - eps, center = false, xy_center = false);
|
||||
translate([0, size.y, size.z / 2])
|
||||
rotate([90, 90, 0])
|
||||
rounded_rectangle([size.z, 2 * fillet, eps], fillet - eps, center = false, xy_center = false);
|
||||
translate([fillet, 0, size.z / 2])
|
||||
rotate([0, 90, 0])
|
||||
rounded_rectangle([size.z, 2 * fillet, eps], fillet - eps, center = false, xy_center = false);
|
||||
translate([size.x, 0, size.z / 2])
|
||||
rotate([0, 90, 0])
|
||||
rounded_rectangle([size.z, 2 * fillet, eps], fillet - eps, center = false, xy_center = false);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@
|
||||
//! Utility to generate a polhedron by sweeping a 2D profile along a 3D path and utilities for generating paths.
|
||||
//!
|
||||
//! The initial orientation is the Y axis of the profile points towards the initial center of curvature, Frenet-Serret style.
|
||||
//! This means the first three points must not be colinear. Subsequent rotations use the minimum rotation method.
|
||||
//! Subsequent rotations use the minimum rotation method.
|
||||
//!
|
||||
//! The path can be open or closed. If closed sweep ensures that the start and end have the same rotation to line up.
|
||||
//! An additional twist around the path can be specified. If the path is closed this should be a multiple of 360.
|
||||
|
@@ -21,7 +21,7 @@
|
||||
// n d p r r b i r r i b s p l g
|
||||
// g t t e e s e e t e l
|
||||
// t h h w d w w t
|
||||
// h h s t t
|
||||
// h h s t t
|
||||
RB5015 = ["RB5015", "Blower Runda RB5015", 51.3, 51, 15, 31.5, M4_cap_screw, 26, [27.3, 25.4], 4.5, [[4.3, 45.4], [47.3,7.4]], 20, 14, 1.5, 1.3, 1.2, 15];
|
||||
PE4020 = ["PE4020", "Blower Pengda Technology 4020", 40, 40, 20, 27.5, M3_cap_screw, 22, [21.5, 20 ], 3.2, [[37,3],[3,37],[37,37]], 29.3, 17, 1.7, 1.2, 1.3, 13];
|
||||
BL40x10 =["BL40x10","Square radial 4010", 40, 40,9.5, 27, M2_cap_screw, 16, [24, 20 ], 2.4, [[2,2],[38,2],[2,38],[38,38]], 30 , 9.5, 1.5, 1.5, 1.1, 1.5];
|
||||
|
@@ -29,7 +29,7 @@
|
||||
// d d h d d
|
||||
// d
|
||||
//
|
||||
F1BM2 = [ "F1BM2", 4.0, 3.6, 3.2, 2, 3.0, 1.0, 3.4, 3.1 ];
|
||||
F1BM2 = [ "F1BM2", 4.0, 3.6, 3.2, 2, 3.0, 1.0, 3.4, 3.1 ];
|
||||
F1BM2p5 = [ "F1BM2p5", 5.8, 4.6, 4.0, 2.5, 3.65, 1.6, 4.4, 3.9 ];
|
||||
F1BM3 = [ "F1BM3", 5.8, 4.6, 4.0, 3, 3.65, 1.6, 4.4, 3.9 ];
|
||||
F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ];
|
||||
|
@@ -116,7 +116,7 @@ module mains_socket(type) { //! Draw specified 13A socket
|
||||
cylinder(r = screw_clearance_radius(screw), h = 100, center = true);
|
||||
|
||||
translate_z(height)
|
||||
screw_countersink(screw);
|
||||
screw_countersink(screw, drilled = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@ function carriage_length(type) = type[0]; //! Overall length
|
||||
function carriage_block_length(type) = type[1]; //! Length of the metal part
|
||||
function carriage_width(type) = type[2]; //! Width of carriage
|
||||
function carriage_height(type) = type[3]; //! Height of carriage
|
||||
function carriage_size(type) = [ type[1], type[2], type[3] ]; //! Size of carriage
|
||||
function carriage_clearance(type) = type[4]; //! Gap under the carriage
|
||||
function carriage_pitch_x(type) = type[5]; //! Screw hole x pitch
|
||||
function carriage_pitch_y(type) = type[6]; //! Screw hole y pitch
|
||||
|
@@ -33,11 +33,11 @@ SSR15_carriage = [ 40.3, 23.3, 34, 24, 4.5, 0, 26, M4_cap_screw ];
|
||||
//
|
||||
//
|
||||
// Wr Hr E P D d h
|
||||
MGN5 = [ "MGN5", 5, 3.6, 5, 15, 3.5, 2.4, 0.8, M2_cs_cap_screw, MGN5_carriage, M2_cs_cap_screw ]; // Screw holes too small for M2 heads
|
||||
MGN5 = [ "MGN5", 5, 3.6, 5, 15, 3.6, 2.4, 0.8, M2_cs_cap_screw, MGN5_carriage, M2_cs_cap_screw ]; // Screw holes too small for M2 heads
|
||||
MGN7 = [ "MGN7", 7, 5, 5, 15, 4.3, 2.4, 2.6, M2_cap_screw, MGN7_carriage, M2_cs_cap_screw ];
|
||||
MGN9 = [ "MGN9", 9, 6, 7.5, 20, 6.0, 3.5, 3.5, M3_cap_screw, MGN9_carriage, M3_cs_cap_screw ];
|
||||
MGN12= [ "MGN12", 12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12_carriage, M3_cs_cap_screw ];
|
||||
MGN12H=[ "MGN12H",12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12H_carriage,M3_cs_cap_screw ];
|
||||
MGN12H=[ "MGN12H",12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12H_carriage,M3_cs_cap_screw ];
|
||||
MGN15= [ "MGN15", 15, 10, 10, 40, 6.0, 3.5, 5.0, M3_cap_screw, MGN15_carriage, M3_cs_cap_screw ];
|
||||
SSR15= [ "SSR15", 15, 12.5,10, 60, 7.5, 4.5, 5.3, M4_cap_screw, SSR15_carriage, M4_cs_cap_screw ];
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
|
||||
//
|
||||
//! Machine screws and wood screws with various head styles.
|
||||
//!
|
||||
//! For an explanation of ```screw_polysink()``` see <https://hydraraptor.blogspot.com/2020/12/sinkholes.html>.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
|
||||
@@ -41,9 +43,13 @@ function screw_pilot_hole(type) = type[11]; //! Pilot hole radius for w
|
||||
function screw_clearance_radius(type) = type[12]; //! Clearance hole radius
|
||||
function screw_nut_radius(type) = screw_nut(type) ? nut_radius(screw_nut(type)) : 0; //! Radius of matching nut
|
||||
function screw_boss_diameter(type) = max(washer_diameter(screw_washer(type)) + 1, 2 * (screw_nut_radius(type) + 3 * extrusion_width)); //! Boss big enough for nut trap and washer
|
||||
function screw_head_depth(type, d) = screw_head_height(type) ? 0 : screw_head_radius(type) - d / 2; //! How far a counter sink head will go into a straight hole diameter d
|
||||
function screw_head_depth(type, d = 0) = //! How far a counter sink head will go into a straight hole diameter d
|
||||
screw_head_height(type)
|
||||
? 0
|
||||
: let(r = screw_radius(type)) screw_head_radius(type) - max(r, d / 2) + r / 5;
|
||||
|
||||
function screw_longer_than(x) = x <= 5 ? 5 : //! Returns shortest screw length longer or equal to x
|
||||
x <= 6 ? 6 :
|
||||
x <= 8 ? 8 :
|
||||
x <= 10 ? 10 :
|
||||
x <= 12 ? 12 :
|
||||
@@ -109,6 +115,27 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
cylinder(r = rad + eps, h = shank);
|
||||
}
|
||||
|
||||
module cs_head(socket_rad, socket_depth) {
|
||||
head_t = rad / 5;
|
||||
head_height = head_rad + head_t;
|
||||
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
polygon([[0, 0], [head_rad, 0], [head_rad, -head_t], [0, -head_height]]);
|
||||
|
||||
translate([0, -socket_depth + eps])
|
||||
square([socket_rad, 10]);
|
||||
}
|
||||
|
||||
translate_z(-socket_depth)
|
||||
linear_extrude(socket_depth)
|
||||
difference() {
|
||||
circle(socket_rad + 0.1);
|
||||
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
explode(length + 10) {
|
||||
if(head_type == hs_cap) {
|
||||
color(colour) {
|
||||
@@ -201,63 +228,76 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
}
|
||||
|
||||
if(head_type == hs_cs) {
|
||||
head_height = head_rad;
|
||||
socket_rad = 0.6 * head_rad;
|
||||
socket_depth = 0.3 * head_rad;
|
||||
socket_width = 1;
|
||||
color(colour) {
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
polygon([[0, 0], [head_rad, 0], [0, -head_height]]);
|
||||
color(colour)
|
||||
cs_head(socket_rad, socket_depth) {
|
||||
square([2 * socket_rad, socket_width], center = true);
|
||||
square([socket_width, 2 * socket_rad], center = true);
|
||||
}
|
||||
|
||||
translate([0, -socket_depth + eps])
|
||||
square([socket_rad + 0.1, 10]);
|
||||
}
|
||||
|
||||
translate_z(-socket_depth)
|
||||
linear_extrude(socket_depth)
|
||||
difference() {
|
||||
circle(socket_rad + 0.1);
|
||||
|
||||
square([2 * socket_rad, socket_width], center = true);
|
||||
square([socket_width, 2 * socket_rad], center = true);
|
||||
}
|
||||
}
|
||||
shaft(socket_depth);
|
||||
}
|
||||
|
||||
if(head_type == hs_cs_cap) {
|
||||
head_height = head_rad;
|
||||
color(colour) {
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
polygon([[0, 0], [head_rad, 0], [0, -head_height]]);
|
||||
color(colour)
|
||||
cs_head(socket_rad, socket_depth)
|
||||
circle(socket_rad, $fn = 6);
|
||||
|
||||
translate([0, -socket_depth + eps])
|
||||
square([socket_rad, 10]);
|
||||
}
|
||||
|
||||
translate_z(-socket_depth)
|
||||
linear_extrude(socket_depth)
|
||||
difference() {
|
||||
circle(socket_rad + 0.1);
|
||||
|
||||
circle(socket_rad, $fn = 6);
|
||||
}
|
||||
}
|
||||
shaft(socket_depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module screw_countersink(type) { //! Countersink shape
|
||||
module screw_countersink(type, drilled = true) { //! Countersink shape
|
||||
head_type = screw_head_type(type);
|
||||
head_rad = screw_head_radius(type);
|
||||
head_height = head_rad;
|
||||
rad = screw_radius(type);
|
||||
head_t = rad / 5;
|
||||
head_height = head_rad + head_t;
|
||||
|
||||
if(head_type == hs_cs || head_type == hs_cs_cap)
|
||||
translate_z(-head_height)
|
||||
cylinder(h = head_height, r1 = 0, r2 = head_rad);
|
||||
if(drilled)
|
||||
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||
else
|
||||
intersection() {
|
||||
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||
|
||||
cylinder(h = head_height + eps, r = head_rad + eps);
|
||||
}
|
||||
}
|
||||
|
||||
function screw_polysink_r(type, z) = //! Countersink hole profile corrected for rounded staircase extrusions.
|
||||
let(rad = screw_radius(type),
|
||||
head_t = rad / 5,
|
||||
head_rad = screw_head_radius(type)
|
||||
)
|
||||
limit(head_rad + head_t - z + (sqrt(2) - 1) * layer_height / 2, screw_clearance_radius(type), head_rad);
|
||||
|
||||
module screw_polysink(type, h = 100, alt = false) { //! A countersink hole made from stacked polyholes for printed parts
|
||||
head_depth = screw_head_depth(type);
|
||||
assert(head_depth, "Not a countersunk screw");
|
||||
layers = ceil(head_depth / layer_height);
|
||||
rmin = screw_clearance_radius(type);
|
||||
sides = sides(rmin);
|
||||
lh = layer_height + eps;
|
||||
render(convexity = 5)
|
||||
for(side = [0, 1]) mirror([0, 0, side]) {
|
||||
for(i = [0 : layers - 1])
|
||||
translate_z(i * layer_height) {
|
||||
r = screw_polysink_r(type, i * layer_height + layer_height / 2);
|
||||
if(alt)
|
||||
rotate(i % 2 == layers % 2 ? 180 / sides : 0)
|
||||
poly_cylinder(r = r, h = lh, center = false, sides = sides);
|
||||
else
|
||||
poly_cylinder(r = r, h = lh, center = false);
|
||||
}
|
||||
|
||||
translate_z(layers * layer_height)
|
||||
poly_cylinder(r = rmin, h = h / 2 - layers * layer_height, center = false);
|
||||
}
|
||||
}
|
||||
|
||||
module screw_and_washer(type, length, star = false, penny = false) { //! Screw with a washer which can be standard or penny and an optional star washer on top
|
||||
|
@@ -107,14 +107,14 @@ No6_screw = ["No6", "No6 pan wood", hs_pan, 3.5, 6.7, 2.2, 0, 0
|
||||
No6_cs_screw = ["No6_cs", "No6 cs wood", hs_cs, 3.5, 7.0, 0, 0, 0, 0, M4_washer, false, No6_pilot_radius, No6_clearance_radius];
|
||||
|
||||
screw_lists = [
|
||||
[ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_screw],
|
||||
[ 0, 0, M3_low_cap_screw],
|
||||
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],
|
||||
[ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw],
|
||||
[ 0, No2_screw, No4_screw, No6_screw, No6_cs_screw],
|
||||
[ 0, M2_cs_cap_screw,M3_cs_cap_screw, M4_cs_cap_screw],
|
||||
[ 0, M2_dome_screw, M3_dome_screw, M4_dome_screw],
|
||||
[ 0, 0, M3_grub_screw, M4_grub_screw]
|
||||
[ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_screw],
|
||||
[ 0, 0, M3_low_cap_screw],
|
||||
[ M2_cs_cap_screw, 0, M3_cs_cap_screw, M4_cs_cap_screw],
|
||||
[ M2_dome_screw, 0, M3_dome_screw, M4_dome_screw],
|
||||
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],
|
||||
[ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw],
|
||||
[ No2_screw, 0, No4_screw, No6_screw, No6_cs_screw],
|
||||
[ 0, 0, M3_grub_screw, M4_grub_screw]
|
||||
];
|
||||
|
||||
use <screw.scad>
|
||||
|
@@ -38,7 +38,7 @@ PMMA8 = [ "PMMA8", "Sheet acrylic", 8, [1, 1, 1, 0.5 ],
|
||||
PMMA10 = [ "PMMA10", "Sheet acrylic", 10, [1, 1, 1, 0.5 ], false]; // ~3/8"
|
||||
glass2 = [ "glass2", "Sheet glass", 2, [1, 1, 1, 0.25 ], false];
|
||||
DiBond = [ "DiBond", "Sheet DiBond", 3, [0.2, 0.2, 0.2, 1 ], false];
|
||||
DiBond6 = [ "DiBond6", "Sheet DiBond", 6, "RoyalBlue", false];
|
||||
DiBond6 = [ "DiBond6", "Sheet DiBond", 6, [0.2, 0.2, 0.2, 1 ], false];
|
||||
Cardboard = [ "Cardboard", "Corrugated cardboard", 5, [0.8, 0.6, 0.3, 1 ], false];
|
||||
FoilTape = [ "FoilTape", "Aluminium foil tape", 0.05,[0.9, 0.9, 0.9, 1 ], false];
|
||||
Foam20 = [ "Foam20", "Foam sponge", 20,[0.3, 0.3, 0.3, 1 ], true];
|
||||
|