diff --git a/readme.md b/readme.md index 669c9c7..74ede50 100644 --- a/readme.md +++ b/readme.md @@ -2940,7 +2940,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_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 | ![screws](tests/png/screws.png) diff --git a/tests/png/mains_sockets.png b/tests/png/mains_sockets.png index 5e1a950..889ab1a 100644 Binary files a/tests/png/mains_sockets.png and b/tests/png/mains_sockets.png differ diff --git a/tests/png/socket_box.png b/tests/png/socket_box.png index 4274a21..53d1296 100644 Binary files a/tests/png/socket_box.png and b/tests/png/socket_box.png differ diff --git a/vitamins/mains_socket.scad b/vitamins/mains_socket.scad index 36ab783..17882ed 100644 --- a/vitamins/mains_socket.scad +++ b/vitamins/mains_socket.scad @@ -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); } } } diff --git a/vitamins/screw.scad b/vitamins/screw.scad index 007b0df..ab8e0a1 100644 --- a/vitamins/screw.scad +++ b/vitamins/screw.scad @@ -247,14 +247,23 @@ 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, 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); + } } 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