1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 12:22:46 +02:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Chris Palmer
8583f5472d Would help to include the code! 2019-07-29 20:43:03 +01:00
Chris Palmer
645ff21d3d Added right_triangle. 2019-07-29 19:30:07 +01:00
Chris Palmer
4ff12b1d8b LDRs thicker 2019-07-29 16:39:09 +01:00
Chris Palmer
847dba544f Fixed fillet back to front 2019-07-28 22:08:21 +01:00
Chris Palmer
13c654a10e Fixed nut child placement when it is a nyloc 2019-07-27 21:50:04 +01:00
Chris Palmer
49ee92db8e Fixed tapered PCB spacers. 2019-07-25 21:20:41 +01:00
Chris Palmer
be14a52c21 Fixed LDR comment 2019-07-25 19:31:16 +01:00
Chris Palmer
af4c5e2b3e Added missing image 2019-07-25 11:05:58 +01:00
12 changed files with 29 additions and 18 deletions

View File

@@ -989,8 +989,8 @@ Larger ones seem to have both a higher dark resistance and a lower bright light
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```ldr(large_ldr)``` | Light dependent resistor |
| 1 | ```ldr(small_ldr)``` | Light dependent resistor |
| 1 | ```ldr(large_ldr)``` | Light dependent resistor - large |
| 1 | ```ldr(small_ldr)``` | Light dependent resistor - small |
<a href="#top">Top</a>
@@ -4511,6 +4511,7 @@ Global constants, functions and modules. This file is used directly or indirectl
| ```ellipse(xr, yr)``` | Draw an ellipse |
| ```extrude_if(h, center = true)``` | Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D |
| ```hflip()``` | Invert children by doing a 180&deg; flip around the Y axis |
| ```right_triangle(width, height, h, center = true)``` | A right angled triangle with the 90&deg; corner at the origin. 3D when ```h``` is nonzero, otherwise 2D |
| ```semi_circle(r, d = undef)``` | A semi circle in the positive Y domain |
| ```translate_z(z)``` | Shortcut for Z only translations |
| ```vflip()``` | Invert children by doing a 180&deg; flip around the X axis |

View File

@@ -20,7 +20,8 @@ include <../global_defs.scad>
use <../utils/fillet.scad>
module fillets() {
fillet(3, 25);
rotate(180)
fillet(3, 10);
}
fillets();

View File

@@ -25,6 +25,9 @@ module globals() {
translate([30, 0])
ellipse(15, 7);
translate([50, 0])
right_triangle(10, 20, 0);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
tests/png/ldrs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View File

@@ -63,6 +63,10 @@ module semi_circle(r, d = undef) //! A semi circle in the pos
square([2 * sq, sq]);
}
module right_triangle(width, height, h, center = true) //! A right angled triangle with the 90&deg; corner at the origin. 3D when ```h``` is nonzero, otherwise 2D
extrude_if(h, center = center)
polygon(points = [[0,0], [width, 0], [0, height]]);
include <sphere.scad>
include <bom.scad>
include <polyholes.scad>

View File

@@ -28,5 +28,6 @@ module fillet(r, h, center = false) //! Fillet with specified radius and height
translate([-eps, -eps, 0])
square(r + eps);
circle(r + eps);
translate([r, r])
circle(r + eps);
}

View File

@@ -33,7 +33,7 @@ function ldr_active(type) = type[6]; //! The active width
function ldr_lead_d(type) = type[7]; //! The lead diameter
module LDR(type, lead_length = 3) { //! Draw an LDR, can specify the lead length
vitamin(str("ldr(", type[0], "): Light dependent resistor: ", ldr_description(type)));
vitamin(str("ldr(", type[0], "): Light dependent resistor - ", ldr_description(type)));
module shape()
intersection() {

View File

@@ -20,8 +20,8 @@
//
// Light dependent resistors.
//
small_ldr = ["small_ldr", "small", 5, 4.2, 1.8, 3.2, 2.5, 0.4];
large_ldr = ["large_ldr", "large", 9.2, 7.9, 1.8, 6.8, 4.5, 0.5];
small_ldr = ["small_ldr", "small", 5, 4.2, 2.0, 3.2, 2.5, 0.4];
large_ldr = ["large_ldr", "large", 9.2, 7.9, 2.0, 6.8, 4.5, 0.5];
ldrs = [small_ldr, large_ldr];

View File

@@ -58,7 +58,7 @@ module nut(type, nyloc = false, brass = false, nylon = false) { //! Draw specifi
rounded_cylinder(r = outer_rad * cos(30) , h = nyloc_thickness, r2 = (nyloc_thickness - thickness) / 2, ir = hole_rad);
}
if($children)
translate_z(thickness)
translate_z(nut_thickness(type, nyloc))
children();
}

View File

@@ -750,14 +750,19 @@ module pcb(type) { //! Draw specified PCB
}
}
module pcb_spacer(screw, height, wall = 1.8) { //! Generate STL for PCB spacer
stl(str("pcb_spacer", round(screw_radius(screw) * 20), round(height * 10)));
module pcb_spacer(screw, height, wall = 1.8, taper = 0) { //! Generate STL for PCB spacer
stl(str("pcb_spacer", round(screw_radius(screw) * 20), round(height * 10), taper ? str("_", taper) : ""));
ir = screw_clearance_radius(screw);
or = corrected_radius(ir) + wall;
linear_extrude(height = height)
poly_ring(or, ir);
if(height > taper)
linear_extrude(height = height - taper)
poly_ring(or, ir);
if(taper)
linear_extrude(height = height)
poly_ring(ir + 2 * extrusion_width, ir);
}
module pcb_base(type, height, thickness, wall = 2) { //! Generate STL for a base with PCB spacers
@@ -798,12 +803,8 @@ module pcb_assembly(type, height, thickness) { //! Draw PCB assembly with spaces
screw(screw, screw_length);
color(pp1_colour)
if(taper) {
h2 = max(0, height - 2);
if(h2)
pcb_spacer(screw, h2);
pcb_spacer(screw, height, 2 * extrusion_width); // Thin as can be at the top because there is no clearance around the holes.
}
if(taper)
pcb_spacer(screw, height, taper = 2);
else
pcb_spacer(screw, height);