diff --git a/readme.md b/readme.md index c09a385..0daef17 100644 --- a/readme.md +++ b/readme.md @@ -4499,6 +4499,7 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is | ```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_ring(or, ir)``` | 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 | ![polyholes](tests/png/polyholes.png) diff --git a/tests/png/flat_hinge.png b/tests/png/flat_hinge.png new file mode 100644 index 0000000..fa0cdac Binary files /dev/null and b/tests/png/flat_hinge.png differ diff --git a/tests/polyholes.scad b/tests/polyholes.scad index fa61b2b..e58d6e4 100644 --- a/tests/polyholes.scad +++ b/tests/polyholes.scad @@ -52,8 +52,8 @@ module polyholes() { sizes = [1.5, 2, 3, 4]; for(i = [0 : len(sizes) - 1]) translate([i * 10, -10]) { - color(pp1_colour) linear_extrude(height = 1) - poly_ring(ir = ir, or = cir + sizes[i] * extrusion_width); + color(pp1_colour) + poly_tube(ir = ir, or = cir + sizes[i] * extrusion_width, h = 1); rod(2 * ir, 3); } diff --git a/utils/core/polyholes.scad b/utils/core/polyholes.scad index b10f6dc..7a16609 100644 --- a/utils/core/polyholes.scad +++ b/utils/core/polyholes.scad @@ -62,6 +62,10 @@ module poly_ring(or, ir) { //! Make a 2D ring adjusted to have the correct inter } } +module poly_tube(or, ir, h, center = false) //! Make a tube adjusted to have the correct internal radius + 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) circle(r = corrected_radius(r, r2sides(r)));