Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2e6b55bcbc | ||
|
20901f0356 | ||
|
77ffdcb1ac | ||
|
6ab4bad97a | ||
|
14c6219733 | ||
|
73d814d2fe | ||
|
fa658d9eaa | ||
|
6d3f54b7a5 | ||
|
157ff60e19 | ||
|
cbd3cf29af | ||
|
bf618bb482 | ||
|
1e6f0a5c4d | ||
|
53c3cdb598 | ||
|
f4857f6862 | ||
|
1acc8d01c0 | ||
|
344e8d1583 | ||
|
dd757a1461 |
BIN
libtest.png
Before Width: | Height: | Size: 852 KiB After Width: | Height: | Size: 854 KiB |
32
readme.md
@@ -2904,6 +2904,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 +2932,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 +2943,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 +2983,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>
|
||||
|
||||
@@ -6107,6 +6116,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.
|
||||
|
||||
@@ -6124,7 +6143,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 |
|
||||
@@ -6158,6 +6177,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>
|
||||
|
||||
@@ -6175,6 +6199,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 |
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 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();
|
||||
}
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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 + screw_radius(type) / 5; //! 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 :
|
||||
@@ -244,14 +250,54 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
|