Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
186dbbfd08 | ||
|
60659a43f8 | ||
|
f412cb1736 | ||
|
2b878556fc |
BIN
libtest.png
Before Width: | Height: | Size: 798 KiB After Width: | Height: | Size: 799 KiB |
21
readme.md
@@ -1554,9 +1554,10 @@ The `light_strip_clip()` module makes a clip to go around the light that can be
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```light_strip_clip_depth(light)``` | Depth of the clip |
|
||||
| ```light_strip_clip_length(light)``` | Outside length |
|
||||
| ```light_strip_clip_length(light)``` | Outside length of clip |
|
||||
| ```light_strip_clip_slot(light)``` | Clip slot size |
|
||||
| ```light_strip_clip_width(light)``` | Outside width |
|
||||
| ```light_strip_clip_wall()``` | Clip wall thickness |
|
||||
| ```light_strip_clip_width(light)``` | Outside width of clip |
|
||||
| ```light_strip_cut_length(type, segs)``` | Calculate cut length given segments |
|
||||
| ```light_strip_segments(type, max_length)``` | Calculate the maximum number of segments that fit in max_length |
|
||||
|
||||
@@ -2125,7 +2126,11 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | ```ax_res(res1_4, 10000)``` | Resistor 10000 Ohms 5% 0.25W |
|
||||
| 1 | ```ax_res(res1_2, 100000)``` | Resistor 100000 Ohms 5% 0.5W |
|
||||
| 1 | ```ax_res(res1_8, 1e+6, tol = 1)``` | Resistor 1e+6 Ohms 1% 0.125W |
|
||||
| 1 | ```smd_led(LED0603, orange)``` | SMD LED 0603 orange |
|
||||
| 1 | ```smd_led(LED0805, red)``` | SMD LED 0805 red |
|
||||
| 1 | ```smd_resistor(RES0603, 1K)``` | SMD resistor 0603 1K 0.1W |
|
||||
| 1 | ```smd_resistor(RES0805, 1K)``` | SMD resistor 0805 1K 0.125W |
|
||||
| 1 | ```smd_resistor(RES1206, 1K)``` | SMD resistor 1206 1K 0.25W |
|
||||
| 1 | ```square_button(button_6mm)``` | Square button 6mm |
|
||||
| 1 | ```pcb(TMC2130)``` | TMC2130 |
|
||||
| 1 | ```green_terminal(gt_5p08, 2)``` | Terminal block 2 way 0.2" |
|
||||
@@ -3080,11 +3085,14 @@ Surface mount components for PCBs.
|
||||
|:--- |:--- |
|
||||
| ```smd_led_lens(type)``` | Lens length width and height |
|
||||
| ```smd_led_size(type)``` | Body length, width and height |
|
||||
| ```smd_res_end_cap(type)``` | End cap width |
|
||||
| ```smd_res_power(type)``` | Power rating in Watts |
|
||||
| ```smd_res_size(type)``` | Body length, width and height |
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```smd_100th(x)``` | Convert dimesion to 1/100" notation |
|
||||
| ```smd_100th(x)``` | Convert dimension to 1/100" notation |
|
||||
| ```smd_led_height(type)``` | Total height |
|
||||
| ```smd_size(size)``` | Convert size to 1/100" notation |
|
||||
|
||||
@@ -3092,13 +3100,18 @@ Surface mount components for PCBs.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```smd_led(type, colour, cutout)``` | Draw an SMD LED with specified ```colour``` |
|
||||
| ```smd_resistor(type, value)``` | Draw an SMD resistor with specified value |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```smd_led(LED0805, green)``` | SMD LED 0805 green |
|
||||
| 1 | ```smd_led(LED0603, green)``` | SMD LED 0603 green |
|
||||
| 1 | ```smd_led(LED0805, blue)``` | SMD LED 0805 blue |
|
||||
| 1 | ```smd_resistor(RES0603, 1R0)``` | SMD resistor 0603 1R0 0.1W |
|
||||
| 1 | ```smd_resistor(RES0805, 10M)``` | SMD resistor 0805 10M 0.125W |
|
||||
| 1 | ```smd_resistor(RES1206, 100K)``` | SMD resistor 1206 100K 0.25W |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
@@ -45,6 +45,7 @@ def plateup(target, part_type, usage = None):
|
||||
# Loop through source directories
|
||||
#
|
||||
used = []
|
||||
all_sources = []
|
||||
for dir in [source_dir1, source_dir2]:
|
||||
if not os.path.isdir(dir):
|
||||
continue
|
||||
@@ -60,6 +61,7 @@ def plateup(target, part_type, usage = None):
|
||||
# Decide which files to make
|
||||
#
|
||||
sources = [file for file in os.listdir(dir) if file.endswith('.scad')]
|
||||
all_sources += sources
|
||||
#
|
||||
# Run OpenSCAD on the source files to make the targets
|
||||
#
|
||||
@@ -100,7 +102,7 @@ def plateup(target, part_type, usage = None):
|
||||
#
|
||||
# Remove any cruft
|
||||
#
|
||||
targets = [file[:-4] + part_type for file in sources]
|
||||
targets = [file[:-4] + part_type for file in all_sources]
|
||||
for file in os.listdir(target_dir):
|
||||
if file.endswith('.' + part_type):
|
||||
if not file in targets and not file in copied:
|
||||
|
@@ -58,8 +58,12 @@ test_pcb = ["TestPCB", "Test PCB",
|
||||
// components
|
||||
[
|
||||
[ 20, -5, 180, "trimpot10"],
|
||||
[ 20, -15, 0, "trimpot10", true],
|
||||
[ 10, 2, 0, "smd_led", LED0805, "red"],
|
||||
[ 20, -15, 90, "trimpot10", true],
|
||||
[ 10, 2, 90, "smd_led", LED0805, "red"],
|
||||
[ 13, 2, 90, "smd_led", LED0603, "orange"],
|
||||
[ 16, 2, 90, "smd_res", RES1206, "1K"],
|
||||
[ 19, 2, 90, "smd_res", RES0805, "1K"],
|
||||
[ 22, 2, 90, "smd_res", RES0603, "1K"],
|
||||
[ 10, 10, 0, "2p54header", 4, 1],
|
||||
[ 25, 10, 0, "2p54header", 5, 1, false, "blue" ],
|
||||
[ 10, 20, 0, "2p54boxhdr", 4, 2],
|
||||
|
@@ -21,9 +21,14 @@ use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/smds.scad>
|
||||
|
||||
module smds()
|
||||
layout([for(l = smd_leds) smd_led_size(l).x], 1)
|
||||
smd_led(smd_leds[$i], ["green", "blue", "red"][$i % 3]);
|
||||
module smds() {
|
||||
layout([for(r = smd_resistors) smd_res_size(r).x], 1)
|
||||
smd_resistor(smd_resistors[$i], ["1R0", "10M", "100K"][$i % 3]);
|
||||
|
||||
translate([0, 3])
|
||||
layout([for(l = smd_leds) smd_led_size(l).x], 1)
|
||||
smd_led(smd_leds[$i], ["green", "blue", "red"][$i % 3]);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
smds();
|
||||
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 78 KiB |
@@ -137,7 +137,6 @@ module light_strip(type, segs = undef) { //! Draw specified light strip, segs ca
|
||||
linear_extrude(0.55 + eps)
|
||||
resistor_positions()
|
||||
square([2.1, 1.5 + 2 * eps], center = true);
|
||||
|
||||
}
|
||||
|
||||
if(show_rays)
|
||||
@@ -148,8 +147,9 @@ wall = 1.8;
|
||||
clearance = 0.2;
|
||||
function light_strip_clip_slot(light) = light_strip_width(light) + clearance; //! Clip slot size
|
||||
function light_strip_clip_depth(light) = 10; //! Depth of the clip
|
||||
function light_strip_clip_length(light) = light_strip_clip_slot(light) + 2 * wall; //! Outside length
|
||||
function light_strip_clip_width(light) = light_strip_depth(light) + 2 * wall; //! Outside width
|
||||
function light_strip_clip_length(light) = light_strip_clip_slot(light) + 2 * wall; //! Outside length of clip
|
||||
function light_strip_clip_width(light) = light_strip_depth(light) + 2 * wall; //! Outside width of clip
|
||||
function light_strip_clip_wall() = wall; //! Clip wall thickness
|
||||
|
||||
module light_strip_clip(light) { //! Make a clip to go over the strip to be incorporated into a bracket
|
||||
linear_extrude(light_strip_clip_depth(light), convexity = 2)
|
||||
|
@@ -26,7 +26,7 @@
|
||||
// e s c
|
||||
// s k
|
||||
Rigid5050 = ["Rigid5050", "rigid SMD5050 low profile", 500, 36, 3, 14.4, 7, 10.4, 0.9, 1.2];
|
||||
RIGID5050 = ["RIGID5050", "rigid SMD5050" , 500, 36, 3, 14.4, 8.6, 10.4, 0.9, 1.6];
|
||||
RIGID5050 = ["RIGID5050", "rigid SMD5050" , 500, 36, 3, 14.4, 8.6, 9.8, 0.8, 1.6];
|
||||
|
||||
light_strips = [Rigid5050, RIGID5050,];
|
||||
|
||||
|
@@ -924,6 +924,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
if(show(comp, "jst_xh")) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
|
||||
if(show(comp, "potentiometer")) potentiometer(param(4, 5), param(5, 9));
|
||||
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey(20)));
|
||||
if(show(comp, "smd_res")) smd_resistor(comp[4], comp[5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ function smd_led_lens(type) = type[2]; //! Lens length width and height
|
||||
function smd_led_height(type) = //! Total height
|
||||
smd_led_size(type).z + smd_led_lens(type).z;
|
||||
|
||||
function smd_100th(x) = //! Convert dimesion to 1/100" notation
|
||||
function smd_100th(x) = //! Convert dimension to 1/100" notation
|
||||
let(s = str(round(x / inch(0.01))))
|
||||
len(s) < 2 ? str("0", s) : s;
|
||||
|
||||
@@ -78,3 +78,33 @@ module smd_led(type, colour, cutout) { //! Draw an SMD LED with specified ```col
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function smd_res_size(type) = type[1]; //! Body length, width and height
|
||||
function smd_res_end_cap(type) = type[2]; //! End cap width
|
||||
function smd_res_power(type) = type[3]; //! Power rating in Watts
|
||||
|
||||
module smd_resistor(type, value) { //! Draw an SMD resistor with specified value
|
||||
size = smd_res_size(type);
|
||||
vitamin(str("smd_resistor(", type[0], ", ", value, "): SMD resistor ", smd_size(size), " ", value, " ", smd_res_power(type), "W"));
|
||||
|
||||
t = 0.04;
|
||||
cap = smd_res_end_cap(type);
|
||||
color("white")
|
||||
translate_z(size.z / 2)
|
||||
cube([size.x - 2 * t, size.y, size.z - 2 * t], center = true);
|
||||
|
||||
color(grey(20))
|
||||
translate_z(size.z - t)
|
||||
cube([size.x - 2 * cap, size.y, eps], center = true);
|
||||
|
||||
color(silver)
|
||||
for(end = [-1, 1])
|
||||
translate([end * (size.x / 2 - cap / 2), 0, size.z / 2])
|
||||
cube([cap, size.y - 2 * eps, size.z], center = true);
|
||||
|
||||
color("white")
|
||||
translate([0, 0, size.z])
|
||||
linear_extrude(eps)
|
||||
resize([(size.x - 2 * cap) * 0.75, size.y / 2])
|
||||
text(value, halign = "center", valign = "center");
|
||||
}
|
||||
|
@@ -18,11 +18,18 @@
|
||||
//
|
||||
|
||||
//
|
||||
//! Axial components
|
||||
//! SMD components
|
||||
//
|
||||
|
||||
LED0805 = ["LED0805", [2, 1.25, 0.46], [1.4, 1.25, 0.54]];
|
||||
LED0603 = ["LED0603", [1.6, 0.8, 0.18], [1.0, 0.8, 0.42]];
|
||||
LED0805 = ["LED0805", [2.0, 1.25, 0.46], [1.4, 1.25, 0.54]];
|
||||
|
||||
smd_leds = [LED0805];
|
||||
smd_leds = [LED0603, LED0805];
|
||||
|
||||
RES0603 = ["RES0603", [1.6, 0.8, 0.45], 0.3, 1/10];
|
||||
RES0805 = ["RES0805", [2.0, 1.2, 0.45], 0.4, 1/8];
|
||||
RES1206 = ["RES1206", [3.1, 1.6, 0.6], 0.5, 1/4];
|
||||
|
||||
smd_resistors = [RES0603, RES0805, RES1206];
|
||||
|
||||
use <smd.scad>
|
||||
|