mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-01-11 10:12:43 -05:00
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
|
### Modules
|
||||||
| Module | Description |
|
| 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_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_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_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 |
|
||||||
| ```slot(r, l, h = 100)``` | Make a horizontal slot suitable for CNC routing, set h = 0 for 2D version |
|
| ```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)
|
extrude_if(h, center)
|
||||||
poly_ring(or, ir);
|
poly_ring(or, ir);
|
||||||
|
|
||||||
module drill(r, h = 100) //! Make a cylinder for drilling holes suitable for CNC routing, set h = 0 for circle
|
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)
|
extrude_if(h, center)
|
||||||
circle(r = corrected_radius(r, r2sides(r)));
|
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
|
// Horizontal slot
|
||||||
//
|
//
|
||||||
|
@ -841,7 +841,7 @@ module trimpot10(vertical, cutout = false) { //! Draw a ten turn trimpot
|
|||||||
rotate([vertical ? -90 : 0, 0, 0]) {
|
rotate([vertical ? -90 : 0, 0, 0]) {
|
||||||
if(cutout)
|
if(cutout)
|
||||||
screw_pos()
|
screw_pos()
|
||||||
cylinder(d = screw_d + 1, h = 100);
|
poly_drill(r = (screw_d + 1) / 2, h = 100, center = false);
|
||||||
else
|
else
|
||||||
color("#2CA1FD") {
|
color("#2CA1FD") {
|
||||||
translate([0, -foot_h / 2, foot_h / 2 + h / 2])
|
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;
|
$fn = 32;
|
||||||
|
|
||||||
if(cutout)
|
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 {
|
else {
|
||||||
color("white")
|
color("white")
|
||||||
linear_extrude(size.z)
|
linear_extrude(size.z)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user