diff --git a/readme.md b/readme.md index 5385fc5..aaa293f 100644 --- a/readme.md +++ b/readme.md @@ -5554,9 +5554,10 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is ### Modules | Module | Description | |:--- |:--- | -| ```drill(r, h = 100)``` | 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_cylinder(r, h, center = false, sides = 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 | | ```slot(r, l, h = 100)``` | Make a horizontal slot suitable for CNC routing, set h = 0 for 2D version | diff --git a/utils/core/polyholes.scad b/utils/core/polyholes.scad index a115cb9..dcf5d53 100644 --- a/utils/core/polyholes.scad +++ b/utils/core/polyholes.scad @@ -66,9 +66,16 @@ module poly_tube(or, ir, h, center = false) //! Make a tube adjusted to have the extrude_if(h, center) poly_ring(or, ir); -module drill(r, h = 100) //! Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle - extrude_if(h) +module drill(r, h = 100, center = true) //! Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle + extrude_if(h, center) circle(r = corrected_radius(r, r2sides(r))); + +module 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. + if(cnc_bit_r) + drill(r, h, center = true); + else + poly_cylinder(r, h, center); + // // Horizontal slot // diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index 53020ec..1aac27c 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -841,7 +841,7 @@ module trimpot10(vertical, cutout = false) { //! Draw a ten turn trimpot rotate([vertical ? -90 : 0, 0, 0]) { if(cutout) screw_pos() - cylinder(d = screw_d + 1, h = 100); + poly_drill(r = (screw_d + 1) / 2, h = 100, center = false); else color("#2CA1FD") { translate([0, -foot_h / 2, foot_h / 2 + h / 2]) diff --git a/vitamins/smd.scad b/vitamins/smd.scad index 4a7299c..3a73ae7 100644 --- a/vitamins/smd.scad +++ b/vitamins/smd.scad @@ -45,7 +45,7 @@ module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified ```col $fn = 32; if(cutout) - cylinder(d = 2.85, h = 100); // For lightguide made from transparent PLA filament + poly_drill(r = 2.85 / 2, h = 100, center = false); // For lightguide made from transparent PLA filament else { color("white") linear_extrude(size.z)