Added poly_drill() and used it for LED and trimpot cutouts.
Uses drill if cnc_bit_r is non-zero else poly_cylinder.
This commit is contained in:
parent
48293b9abd
commit
bb7dd51270
|
@ -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 |
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue