mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-06 13:20:40 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
73d814d2fe | ||
|
fa658d9eaa | ||
|
6d3f54b7a5 | ||
|
157ff60e19 | ||
|
cbd3cf29af | ||
|
bf618bb482 | ||
|
1e6f0a5c4d | ||
|
53c3cdb598 |
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 852 KiB After Width: | Height: | Size: 854 KiB |
26
readme.md
26
readme.md
@@ -2904,6 +2904,8 @@ These items are sysmtrical, so by default the origin is in the centre but it can
|
|||||||
## Screws
|
## Screws
|
||||||
Machine screws and wood screws with various head styles.
|
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.
|
[vitamins/screws.scad](vitamins/screws.scad) Object definitions.
|
||||||
|
|
||||||
@@ -2933,6 +2935,7 @@ Machine screws and wood screws with various head styles.
|
|||||||
| ```screw_head_depth(type, d = 0)``` | 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_longer_than(x)``` | Returns shortest screw length longer or equal to x |
|
||||||
| ```screw_nut_radius(type)``` | Radius of matching nut |
|
| ```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 |
|
| ```screw_shorter_than(x)``` | Returns longest screw length shorter than or equal to x |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
@@ -2941,6 +2944,7 @@ 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(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_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, drilled = true)``` | 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_cs_screw, 30)``` | Screw No6 cs wood x 30mm |
|
||||||
| 1 | ```screw(No6_screw, 30)``` | Screw No6 pan 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>
|
<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.
|
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.
|
[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 |
|
| ```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_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_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_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 |
|
| ```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.5, 43)``` | Smooth rod 9.5mm x 43mm |
|
||||||
| 1 | ```rod(9, 41)``` | Smooth rod 9mm x 41mm |
|
| 1 | ```rod(9, 41)``` | Smooth rod 9mm x 41mm |
|
||||||
|
|
||||||
|
### Printed
|
||||||
|
| Qty | Filename |
|
||||||
|
| ---:|:--- |
|
||||||
|
| 1 | polyhole.stl |
|
||||||
|
|
||||||
|
|
||||||
<a href="#top">Top</a>
|
<a href="#top">Top</a>
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 136 KiB |
Binary file not shown.
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 148 KiB |
@@ -21,30 +21,60 @@ include <../utils/core/core.scad>
|
|||||||
use <../vitamins/rod.scad>
|
use <../vitamins/rod.scad>
|
||||||
include <../vitamins/sheets.scad>
|
include <../vitamins/sheets.scad>
|
||||||
|
|
||||||
module polyholes() {
|
module positions()
|
||||||
module positions()
|
for(i = [1 : 10]) {
|
||||||
for(i = [1 : 10]) {
|
translate([(i * i + i) / 2 + 3 * i , 8])
|
||||||
translate([(i * i + i) / 2 + 3 * i , 8])
|
let($r = i / 2)
|
||||||
let($r = i / 2)
|
children();
|
||||||
|
|
||||||
|
let(d = i + 0.5)
|
||||||
|
translate([(d * d + d) / 2 + 3 * d, 19])
|
||||||
|
let($r = d / 2)
|
||||||
children();
|
children();
|
||||||
|
}
|
||||||
|
|
||||||
let(d = i + 0.5)
|
module polyhole_stl() {
|
||||||
translate([(d * d + d) / 2 + 3 * d, 19])
|
stl("polyhole");
|
||||||
let($r = d / 2)
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
|
|
||||||
stl_colour(pp1_colour) linear_extrude(3, center = true)
|
linear_extrude(3, center = true)
|
||||||
difference() {
|
difference() {
|
||||||
square([100, 27]);
|
square([100, 27]);
|
||||||
|
|
||||||
positions()
|
positions()
|
||||||
poly_circle(r = $r);
|
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);
|
rod(d = 2 * $r, l = 8 * $r + 5);
|
||||||
//
|
//
|
||||||
|
// Alternating polyholes
|
||||||
|
//
|
||||||
|
translate([30, -40])
|
||||||
|
alt_polyhole_stl();
|
||||||
|
//
|
||||||
// Poly rings
|
// Poly rings
|
||||||
//
|
//
|
||||||
ir = 3 / 2;
|
ir = 3 / 2;
|
||||||
@@ -74,4 +104,11 @@ module polyholes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
polyholes();
|
if($preview)
|
||||||
|
polyholes();
|
||||||
|
else {
|
||||||
|
polyhole_stl();
|
||||||
|
|
||||||
|
translate([50, -20])
|
||||||
|
alt_polyhole_stl();
|
||||||
|
}
|
||||||
|
@@ -18,20 +18,46 @@
|
|||||||
//
|
//
|
||||||
include <../core.scad>
|
include <../core.scad>
|
||||||
|
|
||||||
module screws()
|
module polysink_stl() {
|
||||||
for(y = [0 : len(screw_lists) -1])
|
stl("polysink");
|
||||||
for(x = [0 : len(screw_lists[y]) -1]) {
|
|
||||||
screw = screw_lists[y][x];
|
cs_screws = [for(list = screw_lists, screw = list) if(screw_head_type(screw) == hs_cs_cap) screw];
|
||||||
if(screw) {
|
n = len(cs_screws);
|
||||||
length = screw_head_type(screw) == hs_grub ? 6
|
size = [n * 20, 20, 10];
|
||||||
: screw_radius(screw) <= 1.5 ? 10
|
difference() {
|
||||||
: screw_max_thread(screw) ? screw_longer_than(screw_max_thread(screw) + 5)
|
translate([-size.x / n / 2, $preview ? 0 : -size.y / 2])
|
||||||
: 30;
|
cube($preview ? [size.x, size.y / 2, size.z] : size);
|
||||||
translate([x * 20, y * 20])
|
|
||||||
screw(screw, length);
|
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)
|
if($preview)
|
||||||
let($show_threads = true)
|
let($show_threads = true)
|
||||||
screws();
|
screws();
|
||||||
|
else
|
||||||
|
polysink_stl();
|
||||||
|
@@ -22,6 +22,16 @@
|
|||||||
//! it gets the linear dimensions right. See <https://hydraraptor.blogspot.com/2011/02/polyholes.html>
|
//! 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.
|
//! 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 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
|
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);
|
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
|
module poly_cylinder(r, h, center = false, sides = 0, chamfer = false, twist = 0) {//! Make a cylinder adjusted to print the correct size
|
||||||
extrude_if(h, center)
|
if(twist) {
|
||||||
poly_circle(r, sides);
|
slices = ceil(h / layer_height);
|
||||||
|
twist = min(twist, slices - 1);
|
||||||
|
sides = sides ? sides : sides(r);
|
||||||
|
rot = 360 / sides / (twist + 1) * (1 + 1 / slices);
|
||||||
|
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)
|
if(h && chamfer)
|
||||||
poly_cylinder(r + layer_height, center ? layer_height * 2 : layer_height, center, sides = sides ? sides : sides(r));
|
poly_cylinder(r + layer_height, center ? layer_height * 2 : layer_height, center, sides = sides ? sides : sides(r));
|
||||||
|
@@ -35,7 +35,7 @@ module hanging_hole(z, ir, h = 100, h2 = 100) { //! Hole radius ```ir``` hanging
|
|||||||
poly_cylinder(r - eps, h - layer_height);
|
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;
|
infill_angle = z % (2 * layer_height) ? -45 : 45;
|
||||||
below = min(z + eps, h2);
|
below = min(z + eps, h2);
|
||||||
big = 1000;
|
big = 1000;
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
// n d p r r b i r r i b s p l g
|
// 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
|
// g t t e e s e e t e l
|
||||||
// t h h w d w w t
|
// 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];
|
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];
|
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];
|
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 d h d 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 ];
|
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 ];
|
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 ];
|
F1BM4 = [ "F1BM4", 8.2, 6.3, 5.6, 4, 5.15, 2.3, 6.0, 5.55 ];
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
//! Machine screws and wood screws with various head styles.
|
//! 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>
|
include <../utils/core/core.scad>
|
||||||
|
|
||||||
@@ -258,7 +260,7 @@ module screw_countersink(type, drilled = true) { //! Countersink shape
|
|||||||
if(head_type == hs_cs || head_type == hs_cs_cap)
|
if(head_type == hs_cs || head_type == hs_cs_cap)
|
||||||
translate_z(-head_height)
|
translate_z(-head_height)
|
||||||
if(drilled)
|
if(drilled)
|
||||||
cylinder(h = head_height, r1 = 0, r2 = head_rad + head_t);
|
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||||
else
|
else
|
||||||
intersection() {
|
intersection() {
|
||||||
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||||
@@ -267,6 +269,37 @@ module screw_countersink(type, drilled = true) { //! Countersink shape
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
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
|
||||||
washer = screw_washer(type);
|
washer = screw_washer(type);
|
||||||
head_type = screw_head_type(type);
|
head_type = screw_head_type(type);
|
||||||
|
@@ -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];
|
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 = [
|
screw_lists = [
|
||||||
[ M2_cap_screw, M2p5_cap_screw, M3_cap_screw, M4_cap_screw, M5_cap_screw, M6_cap_screw, M8_cap_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],
|
[ 0, 0, M3_low_cap_screw],
|
||||||
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],
|
[ M2_cs_cap_screw, 0, M3_cs_cap_screw, M4_cs_cap_screw],
|
||||||
[ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw],
|
[ M2_dome_screw, 0, M3_dome_screw, M4_dome_screw],
|
||||||
[ 0, No2_screw, No4_screw, No6_screw, No6_cs_screw],
|
[ 0, 0, M3_hex_screw, M4_hex_screw, M5_hex_screw, M6_hex_screw, M8_hex_screw],
|
||||||
[ 0, M2_cs_cap_screw,M3_cs_cap_screw, M4_cs_cap_screw],
|
[ 0, M2p5_pan_screw, M3_pan_screw, M4_pan_screw, M5_pan_screw, M6_pan_screw, No632_pan_screw],
|
||||||
[ 0, M2_dome_screw, M3_dome_screw, M4_dome_screw],
|
[ No2_screw, 0, No4_screw, No6_screw, No6_cs_screw],
|
||||||
[ 0, 0, M3_grub_screw, M4_grub_screw]
|
[ 0, 0, M3_grub_screw, M4_grub_screw]
|
||||||
];
|
];
|
||||||
|
|
||||||
use <screw.scad>
|
use <screw.scad>
|
||||||
|
Reference in New Issue
Block a user