mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-03 12:22:46 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8583f5472d | ||
|
645ff21d3d | ||
|
4ff12b1d8b | ||
|
847dba544f | ||
|
13c654a10e | ||
|
49ee92db8e | ||
|
be14a52c21 | ||
|
af4c5e2b3e |
@@ -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° flip around the Y axis |
|
||||
| ```right_triangle(width, height, h, center = true)``` | A right angled triangle with the 90° 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° flip around the X axis |
|
||||
|
@@ -20,7 +20,8 @@ include <../global_defs.scad>
|
||||
use <../utils/fillet.scad>
|
||||
|
||||
module fillets() {
|
||||
fillet(3, 25);
|
||||
rotate(180)
|
||||
fillet(3, 10);
|
||||
}
|
||||
|
||||
fillets();
|
||||
|
@@ -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
BIN
tests/png/ldrs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 KiB |
@@ -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° 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>
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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() {
|
||||
|
@@ -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];
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user