Compare commits
38 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b40c076d23 | ||
|
5ae040079e | ||
|
881a032aa3 | ||
|
4b1d6298e4 | ||
|
b4cc6f6c37 | ||
|
6238f82bf0 | ||
|
fbc688c81f | ||
|
7b2b239a8b | ||
|
de8eb594a7 | ||
|
f061b0a2f8 | ||
|
43b17c6f0b | ||
|
886319a6e4 | ||
|
723be7ac64 | ||
|
3a5e027bbb | ||
|
d068b972ff | ||
|
0fb0432b39 | ||
|
107951aad0 | ||
|
55fd552c8f | ||
|
8014aadd1d | ||
|
a3e51d2607 | ||
|
8ea7d92997 | ||
|
e386ce7927 | ||
|
fbc0b1d27d | ||
|
5f287ef8ad | ||
|
0ccda3378e | ||
|
c155e95599 | ||
|
9cb0b78bb7 | ||
|
13624eb9bd | ||
|
9ccdf3c075 | ||
|
bb6af0233d | ||
|
774bdbe2cd | ||
|
8d49f2b564 | ||
|
ad8d7ae311 | ||
|
23e6925091 | ||
|
ab6c529905 | ||
|
757e88ed0c | ||
|
7eaace0194 | ||
|
7c9c6805f7 |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
@@ -1,64 +1,69 @@
|
||||
{
|
||||
"name": "main_assembly",
|
||||
"count": 1,
|
||||
"assemblies": [
|
||||
{
|
||||
"name": "mains_in_assembly",
|
||||
"count": 1,
|
||||
"assemblies": [
|
||||
{
|
||||
"name": "feet_assembly",
|
||||
"count": 1,
|
||||
"assemblies": [
|
||||
{
|
||||
"name": "base_assembly",
|
||||
"count": 1,
|
||||
"assemblies": [],
|
||||
"vitamins": {
|
||||
"insert(F1BM3): Heatfit insert M3": 2
|
||||
},
|
||||
"printed": {
|
||||
"socket_box.stl": 1
|
||||
},
|
||||
"routed": {}
|
||||
}
|
||||
],
|
||||
"vitamins": {
|
||||
"washer(M3_washer): Washer M3 x 7mm x 0.5mm": 8,
|
||||
"screw(M3_dome_screw, 10): Screw M3 dome x 10mm": 4,
|
||||
"nut(M3_nut, nyloc = true): Nut M3 nyloc": 4
|
||||
},
|
||||
"printed": {
|
||||
"foot.stl": 4
|
||||
},
|
||||
"routed": {}
|
||||
}
|
||||
],
|
||||
"vitamins": {
|
||||
": Wire green & yellow 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire blue 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire brown 30/0.25mm strands, length 150mm - not shown": 2,
|
||||
"tubing(HSHRNK32): Heatshrink sleeving ID 3.2mm x 15mm - not shown": 3,
|
||||
"iec(IEC_inlet_atx): IEC inlet for ATX": 1,
|
||||
"screw(M3_cs_cap_screw, 12): Screw M3 cs cap x 12mm": 2,
|
||||
"washer(M3_washer): Washer M3 x 7mm x 0.5mm": 2,
|
||||
"nut(M3_nut, nyloc = true): Nut M3 nyloc": 2
|
||||
},
|
||||
"printed": {},
|
||||
"routed": {}
|
||||
}
|
||||
],
|
||||
"vitamins": {
|
||||
": Wire green & yellow 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire blue 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
"tubing(HSHRNK32): Heatshrink sleeving ID 3.2mm x 15mm - not shown": 5,
|
||||
": Ferrule for 1.5mm^2 wire - not shown": 3,
|
||||
"mains_socket(Contactum): Mains socket 13A": 1,
|
||||
"screw(M3_cs_cap_screw, 20): Screw M3 cs cap x 20mm": 2,
|
||||
"jack_4mm_shielded(\"blue\", 3, \"royalblue\"): 4mm shielded jack socket blue": 2,
|
||||
"jack_4mm_shielded(\"brown\", 3, \"sienna\"): 4mm shielded jack socket brown": 1,
|
||||
"jack_4mm_shielded(\"green\", 3): 4mm shielded jack socket green": 2
|
||||
[
|
||||
{
|
||||
"name": "base_assembly",
|
||||
"count": 1,
|
||||
"assemblies": {},
|
||||
"vitamins": {
|
||||
"insert(F1BM3): Heatfit insert M3": 2
|
||||
},
|
||||
"printed": {
|
||||
"socket_box.stl": 1
|
||||
},
|
||||
"routed": {}
|
||||
},
|
||||
"printed": {},
|
||||
"routed": {}
|
||||
}
|
||||
{
|
||||
"name": "feet_assembly",
|
||||
"count": 1,
|
||||
"assemblies": {
|
||||
"base_assembly": 1
|
||||
},
|
||||
"vitamins": {
|
||||
"washer(M3_washer): Washer M3 x 7mm x 0.5mm": 8,
|
||||
"screw(M3_dome_screw, 10): Screw M3 dome x 10mm": 4,
|
||||
"nut(M3_nut, nyloc = true): Nut M3 x 2.4mm nyloc": 4
|
||||
},
|
||||
"printed": {
|
||||
"foot.stl": 4
|
||||
},
|
||||
"routed": {}
|
||||
},
|
||||
{
|
||||
"name": "mains_in_assembly",
|
||||
"count": 1,
|
||||
"assemblies": {
|
||||
"feet_assembly": 1
|
||||
},
|
||||
"vitamins": {
|
||||
": Wire green & yellow 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire blue 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire brown 30/0.25mm strands, length 150mm - not shown": 2,
|
||||
"tubing(HSHRNK32): Heatshrink sleeving ID 3.2mm x 15mm - not shown": 3,
|
||||
"iec(IEC_inlet_atx): IEC inlet for ATX": 1,
|
||||
"screw(M3_cs_cap_screw, 12): Screw M3 cs cap x 12mm": 2,
|
||||
"washer(M3_washer): Washer M3 x 7mm x 0.5mm": 2,
|
||||
"nut(M3_nut, nyloc = true): Nut M3 x 2.4mm nyloc": 2
|
||||
},
|
||||
"printed": {},
|
||||
"routed": {}
|
||||
},
|
||||
{
|
||||
"name": "main_assembly",
|
||||
"count": 1,
|
||||
"assemblies": {
|
||||
"mains_in_assembly": 1
|
||||
},
|
||||
"vitamins": {
|
||||
": Wire green & yellow 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
": Wire blue 30/0.25mm strands, length 150mm - not shown": 1,
|
||||
"tubing(HSHRNK32): Heatshrink sleeving ID 3.2mm x 15mm - not shown": 5,
|
||||
": Ferrule for 1.5mm^2 wire - not shown": 3,
|
||||
"mains_socket(Contactum): Mains socket 13A": 1,
|
||||
"screw(M3_cs_cap_screw, 20): Screw M3 cs cap x 20mm": 2,
|
||||
"jack_4mm_shielded(\"blue\", 3, \"royalblue\"): 4mm shielded jack socket blue": 2,
|
||||
"jack_4mm_shielded(\"brown\", 3, \"sienna\"): 4mm shielded jack socket brown": 1,
|
||||
"jack_4mm_shielded(\"green\", 3): 4mm shielded jack socket green": 2
|
||||
},
|
||||
"printed": {},
|
||||
"routed": {}
|
||||
}
|
||||
]
|
@@ -17,7 +17,7 @@ Vitamins:
|
||||
| | 1| | 1 4mm shielded jack socket brown
|
||||
| | 2| | 2 4mm shielded jack socket green
|
||||
| | 1| | 1 Mains socket 13A
|
||||
| 4| | 2| 6 Nut M3 nyloc
|
||||
| 4| | 2| 6 Nut M3 x 2.4mm nyloc
|
||||
| | | 2| 2 Screw M3 cs cap x 12mm
|
||||
| | 2| | 2 Screw M3 cs cap x 20mm
|
||||
| 4| | | 4 Screw M3 dome x 10mm
|
||||
|
@@ -1,6 +1,6 @@
|
||||
feet_assembly:
|
||||
Vitamins:
|
||||
4 Nut M3 nyloc
|
||||
4 Nut M3 x 2.4mm nyloc
|
||||
4 Screw M3 dome x 10mm
|
||||
8 Washer M3 x 7mm x 0.5mm
|
||||
|
||||
|
@@ -4,7 +4,7 @@ Vitamins:
|
||||
2 Wire brown 30/0.25mm strands, length 150mm - not shown
|
||||
1 Wire green & yellow 30/0.25mm strands, length 150mm - not shown
|
||||
1 IEC inlet for ATX
|
||||
2 Nut M3 nyloc
|
||||
2 Nut M3 x 2.4mm nyloc
|
||||
2 Screw M3 cs cap x 12mm
|
||||
3 Heatshrink sleeving ID 3.2mm x 15mm - not shown
|
||||
2 Washer M3 x 7mm x 0.5mm
|
||||
|
@@ -31,6 +31,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
## Parts list
|
||||
| <span style="writing-mode: vertical-rl; text-orientation: mixed;">Base</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Feet</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Mains In</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Main</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">TOTALS</span> | |
|
||||
|--:|--:|--:|--:|--:|:--|
|
||||
| | | | | | **Vitamins** |
|
||||
| . | . | . | 2 | 2 | 4mm shielded jack socket blue |
|
||||
| . | . | . | 1 | 1 | 4mm shielded jack socket brown |
|
||||
| . | . | . | 2 | 2 | 4mm shielded jack socket green |
|
||||
@@ -39,7 +40,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
| . | . | 3 | 5 | 8 | Heatshrink sleeving ID 3.2mm x 15mm - not shown |
|
||||
| . | . | 1 | . | 1 | IEC inlet for ATX |
|
||||
| . | . | . | 1 | 1 | Mains socket 13A |
|
||||
| . | 4 | 2 | . | 6 | Nut M3 nyloc |
|
||||
| . | 4 | 2 | . | 6 | Nut M3 x 2.4mm nyloc |
|
||||
| . | . | 2 | . | 2 | Screw M3 cs cap x 12mm |
|
||||
| . | . | . | 2 | 2 | Screw M3 cs cap x 20mm |
|
||||
| . | 4 | . | . | 4 | Screw M3 dome x 10mm |
|
||||
@@ -47,9 +48,11 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
| . | . | 1 | 1 | 2 | Wire blue 30/0.25mm strands, length 150mm - not shown |
|
||||
| . | . | 2 | . | 2 | Wire brown 30/0.25mm strands, length 150mm - not shown |
|
||||
| . | . | 1 | 1 | 2 | Wire green & yellow 30/0.25mm strands, length 150mm - not shown |
|
||||
| | | | | | **3D Printed parts** |
|
||||
| . | 4 | . | . | 4 | foot.stl |
|
||||
| 1 | . | . | . | 1 | socket_box.stl |
|
||||
| 2 | 16 | 14 | 18 | 50 | Total vitamins count |
|
||||
| | | | | | **3D printed parts** |
|
||||
| . | 4 | . | . | 4 | foot.stl |
|
||||
| 1 | . | . | . | 1 | socket_box.stl |
|
||||
| 1 | 4 | . | . | 5 | Total 3D printed parts count |
|
||||
|
||||
[Top](#TOP)
|
||||
|
||||
@@ -86,9 +89,9 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
### Vitamins
|
||||
|Qty|Description|
|
||||
|--:|:----------|
|
||||
|8| Washer M3 x 7mm x 0.5mm|
|
||||
|4| Nut M3 x 2.4mm nyloc|
|
||||
|4| Screw M3 dome x 10mm|
|
||||
|4| Nut M3 nyloc|
|
||||
|8| Washer M3 x 7mm x 0.5mm|
|
||||
|
||||
|
||||
### 3D Printed parts
|
||||
@@ -122,14 +125,14 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
### Vitamins
|
||||
|Qty|Description|
|
||||
|--:|:----------|
|
||||
|1| Wire green & yellow 30/0.25mm strands, length 150mm - not shown|
|
||||
|1| Wire blue 30/0.25mm strands, length 150mm - not shown|
|
||||
|2| Wire brown 30/0.25mm strands, length 150mm - not shown|
|
||||
|3| Heatshrink sleeving ID 3.2mm x 15mm - not shown|
|
||||
|1| IEC inlet for ATX|
|
||||
|2| Nut M3 x 2.4mm nyloc|
|
||||
|2| Screw M3 cs cap x 12mm|
|
||||
|2| Washer M3 x 7mm x 0.5mm|
|
||||
|2| Nut M3 nyloc|
|
||||
|1| Wire blue 30/0.25mm strands, length 150mm - not shown|
|
||||
|2| Wire brown 30/0.25mm strands, length 150mm - not shown|
|
||||
|1| Wire green & yellow 30/0.25mm strands, length 150mm - not shown|
|
||||
|
||||
|
||||
### Sub-assemblies
|
||||
@@ -161,15 +164,15 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
|
||||
### Vitamins
|
||||
|Qty|Description|
|
||||
|--:|:----------|
|
||||
|1| Wire green & yellow 30/0.25mm strands, length 150mm - not shown|
|
||||
|1| Wire blue 30/0.25mm strands, length 150mm - not shown|
|
||||
|5| Heatshrink sleeving ID 3.2mm x 15mm - not shown|
|
||||
|3| Ferrule for 1.5mm^2 wire - not shown|
|
||||
|1| Mains socket 13A|
|
||||
|2| Screw M3 cs cap x 20mm|
|
||||
|2| 4mm shielded jack socket blue|
|
||||
|1| 4mm shielded jack socket brown|
|
||||
|2| 4mm shielded jack socket green|
|
||||
|3| Ferrule for 1.5mm^2 wire - not shown|
|
||||
|5| Heatshrink sleeving ID 3.2mm x 15mm - not shown|
|
||||
|1| Mains socket 13A|
|
||||
|2| Screw M3 cs cap x 20mm|
|
||||
|1| Wire blue 30/0.25mm strands, length 150mm - not shown|
|
||||
|1| Wire green & yellow 30/0.25mm strands, length 150mm - not shown|
|
||||
|
||||
|
||||
### Sub-assemblies
|
||||
|
@@ -60,7 +60,7 @@ insert_length = insert_length(insert);
|
||||
insert_boss = mains_socket_insert_boss(socket);
|
||||
screw_length = screw_longer_than(mains_socket_height(socket) + insert_length(insert));
|
||||
|
||||
iec_h = iec_slot_h(iec) + 1;
|
||||
iec_h = iec_body_h(iec) + 1;
|
||||
|
||||
box_height = socket_depth + iec_h;
|
||||
base_thickness = wall;
|
||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
BIN
libtest.png
Before Width: | Height: | Size: 657 KiB After Width: | Height: | Size: 703 KiB |
17
libtest.scad
@@ -86,6 +86,9 @@ use <tests/ribbon_clamp.scad>
|
||||
use <tests/screw_knob.scad>
|
||||
use <tests/socket_box.scad>
|
||||
use <tests/strap_handle.scad>
|
||||
use <tests/ssr_shroud.scad>
|
||||
use <tests/psu_shroud.scad>
|
||||
use <tests/flat_hinge.scad>
|
||||
|
||||
x5 = 800;
|
||||
|
||||
@@ -112,6 +115,9 @@ translate([x5 + 70, cable_grommets_y + 150])
|
||||
translate([x5, cable_grommets_y + 470]) {
|
||||
door_hinges()
|
||||
door_latches();
|
||||
|
||||
translate([120, 0])
|
||||
flat_hinges();
|
||||
}
|
||||
|
||||
translate([x5, cable_grommets_y + 370])
|
||||
@@ -150,7 +156,7 @@ fans_y = displays_y + 100;
|
||||
transformers_y = fans_y + 120;
|
||||
psus_y = transformers_y + 190;
|
||||
|
||||
translate([x0 + 20, inserts_y])
|
||||
translate([x0 + 30, inserts_y])
|
||||
inserts();
|
||||
|
||||
translate([x0, inserts_y])
|
||||
@@ -216,9 +222,11 @@ translate([x0, fans_y]) {
|
||||
translate([x0, transformers_y])
|
||||
variacs();
|
||||
|
||||
translate([x0, psus_y])
|
||||
translate([x0, psus_y]) {
|
||||
psus();
|
||||
|
||||
psu_shrouds();
|
||||
}
|
||||
|
||||
x1 = x0 + 100;
|
||||
zipties_y = 0;
|
||||
@@ -300,9 +308,12 @@ translate([x3 + 15, modules_y])
|
||||
translate([x3 + 40, modules_y])
|
||||
modules();
|
||||
|
||||
translate([x3, ssrs_y])
|
||||
translate([x3, ssrs_y]) {
|
||||
ssrs();
|
||||
|
||||
ssr_shrouds();
|
||||
}
|
||||
|
||||
translate([x3, blowers_y])
|
||||
blowers();
|
||||
|
||||
|
@@ -397,16 +397,6 @@ module box_bezel_section(type, bottom, rows, cols, x, y) { //! Generates interlo
|
||||
}
|
||||
}
|
||||
|
||||
module box_shelf_blank(type) { //! Generates a 2D template for a shelf sheet
|
||||
dxf("box_shelf");
|
||||
|
||||
difference() {
|
||||
sheet_2D(box_sheets(type), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1);
|
||||
|
||||
offset(bezel_clearance / 2)
|
||||
box_corner_quadrants(type, box_width(type), box_depth(type));
|
||||
}
|
||||
}
|
||||
|
||||
module box_screw_hole_positions(type)
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
@@ -439,6 +429,17 @@ function subst_sheet(type, sheet) =
|
||||
let(s = box_sheets(type))
|
||||
sheet ? assert(sheet_thickness(sheet) == sheet_thickness(s)) sheet : s;
|
||||
|
||||
module box_shelf_blank(type, sheet = false) { //! Generates a 2D template for a shelf sheet
|
||||
dxf("box_shelf");
|
||||
|
||||
difference() {
|
||||
sheet_2D(subst_sheet(type, sheet), box_width(type) - bezel_clearance, box_depth(type) - bezel_clearance, 1);
|
||||
|
||||
offset(bezel_clearance / 2)
|
||||
box_corner_quadrants(type, box_width(type), box_depth(type));
|
||||
}
|
||||
}
|
||||
|
||||
module box_left_blank(type, sheet = false) { //! Generates a 2D template for the left sheet, ```sheet``` can be set to override the type
|
||||
dxf("box_left");
|
||||
|
||||
|
@@ -97,7 +97,7 @@ function fixing_block_positions(type) = let(
|
||||
|
||||
for(i = [0 : 1 : hspans - 1], x = [-1, 1], y = [-1, 1])
|
||||
translate([x * width / 2, y * depth / 2, (i - (hspans - 1) / 2) * hspan]) *
|
||||
rotate([y > 0 ? 180 : 0, x * y * 90]),
|
||||
rotate([y > 0 ? 180 : 0, x * y * 90, 0]),
|
||||
|
||||
];
|
||||
|
||||
|
@@ -130,7 +130,7 @@ module round_grommet_bottom(diameter, od = undef) { //! Generate the STL for a r
|
||||
}
|
||||
|
||||
module round_grommet_hole(diameter, h = 100) //! Make a hole for a round grommet
|
||||
drill(diameter / 2 + wall + clearance, h);
|
||||
drill(corrected_radius(diameter / 2) + wall + clearance, h);
|
||||
|
||||
module round_grommet_assembly(diameter, thickness, od = undef) {
|
||||
color(pp1_colour)
|
||||
@@ -149,12 +149,17 @@ module mouse_grommet_hole(r, h = 50, z = undef, expand = wall + clearance) //! M
|
||||
hull(){
|
||||
R = r + expand;
|
||||
translate([0, z == undef ? R : z])
|
||||
semi_circle(R);
|
||||
if(expand)
|
||||
semi_circle(R);
|
||||
else
|
||||
semi_teardrop(r = R, h = 0);
|
||||
|
||||
translate([-R, 0])
|
||||
square([2 * R, eps]);
|
||||
}
|
||||
|
||||
function mouse_grommet_offset(r) = r + wall;
|
||||
|
||||
module mouse_grommet(r, thickness) { //! Make the STL for a mouse grommet
|
||||
stl(str("mouse_grommet_", r * 10, "_", thickness));
|
||||
|
||||
@@ -167,7 +172,7 @@ module mouse_grommet(r, thickness) { //! Make the STL for a mouse grommet
|
||||
translate_z(side * (width - wall) / 2)
|
||||
linear_extrude(height = wall, center = true)
|
||||
difference() {
|
||||
mouse_grommet_hole(r + wall + overlap, z = r + wall, h = 0, expand = 0);
|
||||
mouse_grommet_hole(r, z = r + wall, h = 0, expand = wall + overlap);
|
||||
|
||||
translate([0, wall])
|
||||
mouse_grommet_hole(r, h = 0, expand = 0);
|
||||
@@ -182,6 +187,20 @@ module mouse_grommet(r, thickness) { //! Make the STL for a mouse grommet
|
||||
}
|
||||
}
|
||||
|
||||
module mouse_grommet_assembly(r, thickness)
|
||||
color(pp1_colour)
|
||||
rotate([-90, 0, 0])
|
||||
mouse_grommet(r, thickness);
|
||||
|
||||
module ribbon_grommet_20_3_stl() ribbon_grommet(20, 3);
|
||||
module mouse_grommet_20_3_stl() mouse_grommet(2,3);
|
||||
module mouse_grommet_30_3_stl() mouse_grommet(3,3);
|
||||
module mouse_grommet_15_3_stl() mouse_grommet(1.5, 3);
|
||||
module mouse_grommet_20_3_stl() mouse_grommet(2, 3);
|
||||
module mouse_grommet_30_3_stl() mouse_grommet(3, 3);
|
||||
|
||||
module round_grommet_bottom_30_stl() round_grommet_bottom(3);
|
||||
module round_grommet_bottom_40_stl() round_grommet_bottom(4);
|
||||
module round_grommet_bottom_60_stl() round_grommet_bottom(6);
|
||||
|
||||
module round_grommet_top_30_3_stl() round_grommet_top(3, 3);
|
||||
module round_grommet_top_40_3_stl() round_grommet_top(4, 3);
|
||||
module round_grommet_top_60_3_stl() round_grommet_top(6, 3);
|
||||
|
180
printed/flat_hinge.scad
Normal file
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! A parametric flat hinge. A piece of filament can be used for the hinge pin.
|
||||
//!
|
||||
//! The width, depth, thickness, number and type of screws, number of knuckles, knuckle diameter, pin diameter and clearance can all be varied.
|
||||
//! A margin between the screws and the knuckle edge can be enforced to allow the hinge to bend all the way back to 270° from closed.
|
||||
//!
|
||||
//! Opening the test in OpenSCAD with its customiser enabled allows these parameters to be played with.
|
||||
//!
|
||||
//! Note setting ```thickness1``` or ```thickness2``` to zero in the ```hinge_fastened_assembly()``` removes the screws from one side or the other and
|
||||
//! setting ```show_hinge``` to false removes the hinge.
|
||||
//! This allows the hinges and one set of screws to belong to one assembly and the other set of screws to another assembly.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
|
||||
function hinge_width(type) = type[1]; //! Width
|
||||
function hinge_depth(type) = type[2]; //! Depth of each leaf
|
||||
function hinge_thickness(type) = type[3]; //! Thickness of the leaves
|
||||
function hinge_pin_dia(type) = type[4]; //! The pin diameter
|
||||
function hinge_knuckle_dia(type) = type[5]; //! The knuckle diameter
|
||||
function hinge_knuckles(type) = type[6]; //! How many knuckles
|
||||
function hinge_screw(type) = type[7]; //! Screw type to mount it
|
||||
function hinge_screws(type) = type[8]; //! How many screws
|
||||
function hinge_clearance(type) = type[9]; //! Clearance between knuckles
|
||||
function hinge_margin(type) = type[10]; //! How far to keep the screws from the knuckes
|
||||
|
||||
function hinge_radius(type) = washer_radius(screw_washer(hinge_screw(type))) + 1;
|
||||
|
||||
module hinge_screw_positions(type) { //! Place children at the screw positions
|
||||
screws = hinge_screws(type);
|
||||
w = hinge_width(type);
|
||||
d = hinge_depth(type);
|
||||
r = hinge_radius(type);
|
||||
m = hinge_margin(type);
|
||||
assert(screws > 1, "must be at least two screws");
|
||||
w_pitch = (w - 2 * r) / (screws - 1);
|
||||
d_pitch = d - 2 * r - m;
|
||||
wr = washer_radius(screw_washer(hinge_screw(type)));
|
||||
assert(w_pitch >= wr && norm([w_pitch, d_pitch]) >= 2 * wr && d_pitch >= 0, "not enough room for screws");
|
||||
|
||||
for(i = [0 : screws - 1])
|
||||
translate([-w / 2 + r + i * w_pitch, r + m + (i % 2) * d_pitch])
|
||||
children();
|
||||
}
|
||||
|
||||
module hinge_male(type, female = false) { //! The half with the stationary pin
|
||||
stl(str("hinge_", female ? "fe": "", "male_", type[0]));
|
||||
|
||||
r = hinge_radius(type);
|
||||
w = hinge_width(type);
|
||||
t = hinge_thickness(type);
|
||||
kr = hinge_knuckle_dia(type) / 2;
|
||||
pr = hinge_pin_dia(type) / 2;
|
||||
assert(kr > pr, "knuckle diameter must be bigger than the pin diameter");
|
||||
|
||||
n = hinge_knuckles(type);
|
||||
assert(n >= 3, "must be at least three knuckes");
|
||||
mn = ceil(n / 2); // Male knuckles
|
||||
fn = floor(n / 2); // Female knuckles
|
||||
gap = hinge_clearance(type);
|
||||
mw = (w - (n - 1) * gap) / 2 / mn; // Male knuckle width
|
||||
fw = (w - (n - 1) * gap) / 2 / fn; // Female knuckle width
|
||||
|
||||
teardrop_r = kr / cos(22.5); // The corner on the teardrop
|
||||
inset = sqrt(sqr(teardrop_r + gap) - sqr(kr - t)) - kr;
|
||||
|
||||
linear_extrude(height =t)
|
||||
difference() {
|
||||
hull() {
|
||||
for(side = [-1, 1])
|
||||
translate([side * (w / 2 - r), hinge_depth(type) - r])
|
||||
circle4n(r);
|
||||
|
||||
translate([-w / 2, inset])
|
||||
square([w, eps]);
|
||||
}
|
||||
hinge_screw_positions(type)
|
||||
poly_circle(screw_clearance_radius(hinge_screw(type)));
|
||||
}
|
||||
|
||||
pitch = mw + gap + fw + gap;
|
||||
dir = female ? -1 : 1;
|
||||
translate([0, -kr, kr])
|
||||
rotate([90, 0, -90])
|
||||
for(z = [0 : (female ? fn : mn) - 1])
|
||||
translate_z(-dir * w / 2 + z * dir * pitch + (female ? -fw - mw - gap : 0))
|
||||
linear_extrude(height = female ? fw : mw)
|
||||
difference() {
|
||||
hull() {
|
||||
rotate(180)
|
||||
teardrop(r = kr, h = 0);
|
||||
|
||||
translate([-kr - 1, -kr])
|
||||
square(1);
|
||||
}
|
||||
teardrop_plus(r = pr + (female ? gap : 0), h = 0);
|
||||
}
|
||||
}
|
||||
|
||||
module hinge_female(type) hinge_male(type, true);
|
||||
|
||||
module hinge_both(type) { //! Both parts together for printing
|
||||
hinge_male(type);
|
||||
|
||||
translate([0, -hinge_knuckle_dia(type)])
|
||||
rotate(180)
|
||||
hinge_female(type);
|
||||
}
|
||||
|
||||
module hinge_assembly(type, angle = 0)
|
||||
assembly(str("hinge_", type[0])) { //! Assembled hinge
|
||||
kr = hinge_knuckle_dia(type) / 2;
|
||||
hr = hinge_pin_dia(type) / 2;
|
||||
w = hinge_width(type);
|
||||
|
||||
vitamin(str(": Hinge pin ", w, " x ", 2 * hr, "mm"));
|
||||
|
||||
color(pp1_colour) hinge_male(type);
|
||||
|
||||
translate([0, -kr, kr]) {
|
||||
rotate([0, 90, 0])
|
||||
explode(w + 10)
|
||||
color("silver") cylinder(r = hr , h = w, center = true);
|
||||
|
||||
rotate([-angle, 0, 0])
|
||||
translate([0, -kr, -kr])
|
||||
rotate(180)
|
||||
color(pp2_colour) hinge_female(type);
|
||||
}
|
||||
}
|
||||
|
||||
module hinge_fastened_assembly(type, thickness1, thickness2, angle, show_hinge = true) { //! Assembled hinge with its fasteners
|
||||
if(show_hinge)
|
||||
hinge_assembly(type, angle);
|
||||
|
||||
screw = hinge_screw(type);
|
||||
washer_t = 2 * washer_thickness(screw_washer(screw));
|
||||
nut = screw_nut(screw);
|
||||
nut_t = nut_thickness(nut, true);
|
||||
t = hinge_thickness(type);
|
||||
kr = hinge_knuckle_dia(type) / 2;
|
||||
|
||||
module fasteners(thickness)
|
||||
if(thickness)
|
||||
hinge_screw_positions(type) {
|
||||
translate_z(t)
|
||||
screw_and_washer(screw, screw_longer_than(t + thickness + washer_t + nut_t));
|
||||
|
||||
translate_z(-thickness)
|
||||
vflip()
|
||||
nut_and_washer(nut, true);
|
||||
}
|
||||
|
||||
fasteners(thickness1);
|
||||
|
||||
translate([0, -kr, kr])
|
||||
rotate([-angle, 0, 0])
|
||||
translate([0, -kr, - kr])
|
||||
rotate(180)
|
||||
fasteners(thickness2);
|
||||
}
|
@@ -28,7 +28,6 @@ include <../vitamins/inserts.scad>
|
||||
foot = [25, 12, 3, 2, M4_cap_screw, 10];
|
||||
insert_foot = [20, 10, 0, 2, M3_cap_screw, 10];
|
||||
|
||||
function foot() = foot; //! Default foot used unless a list of parameters is passed
|
||||
function insert_foot() = insert_foot; //! Default foot with insert
|
||||
|
||||
function foot_diameter(type = foot) = type[0]; //! Outside maximum diameter
|
||||
|
210
printed/psu_shroud.scad
Normal file
@@ -0,0 +1,210 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! A cover to go over the mains end of a PSU terminal strip to make it safe.
|
||||
//! The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
include <../vitamins/inserts.scad>
|
||||
|
||||
use <../vitamins/wire.scad>
|
||||
use <../vitamins/psu.scad>
|
||||
use <../utils/round.scad>
|
||||
|
||||
wall = 1.8;
|
||||
top = 1.5;
|
||||
screw = M3_cap_screw;
|
||||
insert = screw_insert(screw);
|
||||
boss_r = wall + corrected_radius(insert_hole_radius(insert));
|
||||
boss_h = insert_hole_length(insert);
|
||||
counter_bore = 2;
|
||||
boss_h2 = boss_h + counter_bore;
|
||||
rad = 2;
|
||||
clearance = layer_height;
|
||||
overlap = 6;
|
||||
|
||||
cable_tie_inset = wall + 4;
|
||||
|
||||
function psu_shroud_extent(type) = 15 + wall; //! How far it extends beyond the PSU to clear the connections
|
||||
function psu_shroud_depth(type) = //! Outside depth of the shroud
|
||||
psu_left_bay(type) + overlap + psu_shroud_extent(type);
|
||||
|
||||
function psu_shroud_width(type) = //! Outside width of the shroud
|
||||
let(terminals = psu_terminals(type))
|
||||
terminals ?
|
||||
let(y = terminals.y, tb = terminals.z)
|
||||
wall + clearance / 2 + y + 3 * terminal_block_pitch(tb) + terminal_block_divider(tb) / 2 + wall / 2
|
||||
: psu_width(type) + 2 * wall + clearance;
|
||||
|
||||
function psu_shroud_height(type) = psu_height(type) + top + clearance; //! Outside height
|
||||
function psu_shroud_centre_y(type) = //! Shroud centre relative to PSU centre
|
||||
psu_width(type) / 2 + clearance / 2 + wall - psu_shroud_width(type) / 2;
|
||||
|
||||
function psu_shroud_pitch(type) = psu_shroud_width(type) - 2 * boss_r - eps;
|
||||
function psu_shroud_screw(type) = screw; //! Screw used to fasten
|
||||
function psu_shroud_cable_pitch(cable_d) = cable_d + 5; //! Pitch between cable entries
|
||||
|
||||
module psu_shroud_hole_positions(type) //! Place children at the screw hole positions
|
||||
for($side = [-1, 1])
|
||||
translate([-psu_length(type) / 2 - boss_r - 1, psu_shroud_centre_y(type) + $side * psu_shroud_pitch(type) / 2])
|
||||
children();
|
||||
|
||||
module psu_shroud_cable_positions(type, cable_d, cables = 1) //! Place children at the cable tie positions
|
||||
for(i = [0 : 1 : cables - 1])
|
||||
translate([-psu_length(type) / 2 - psu_shroud_extent(type) + cable_tie_inset,
|
||||
psu_shroud_centre_y(type) + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d)])
|
||||
children();
|
||||
|
||||
module psu_shroud_holes(type, cable_d, cables = 1) { //! Drill the screw and ziptie holes
|
||||
psu_shroud_hole_positions(type)
|
||||
drill(screw_clearance_radius(screw), 0);
|
||||
|
||||
psu_shroud_cable_positions(type, cable_d, cables)
|
||||
cable_tie_holes(cable_d / 2, h = 0);
|
||||
}
|
||||
|
||||
module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file for a specified ssr and cable
|
||||
stl(str("psu_shroud_", name));
|
||||
|
||||
extent = psu_shroud_extent(type);
|
||||
depth = psu_shroud_depth(type);
|
||||
width = psu_shroud_width(type);
|
||||
height = psu_shroud_height(type);
|
||||
centre_x = -psu_length(type) / 2 - psu_shroud_extent(type) + psu_shroud_depth(type) / 2;
|
||||
centre_y = psu_shroud_centre_y(type);
|
||||
terminal_clearance = 0.5;
|
||||
tb = psu_terminals(type).z;
|
||||
|
||||
module shape() {
|
||||
difference() {
|
||||
round(or = wall / 2 - eps, ir = 0) difference() {
|
||||
rounded_square([depth, width], rad);
|
||||
|
||||
rounded_square([depth - 2 * wall, width - 2 * wall], rad - wall);
|
||||
|
||||
translate([depth / 2, 0])
|
||||
square([2 * rad, width], center = true);
|
||||
|
||||
translate([depth / 2, width / 2 - 5])
|
||||
square([2 * (overlap + terminal_clearance), 10], center = true);
|
||||
}
|
||||
for(i = [0 : 1 : cables - 1])
|
||||
translate([0, (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d)])
|
||||
square([depth + 1, cable_d], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
// base and sides
|
||||
translate([centre_x, -centre_y]) {
|
||||
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
||||
|
||||
linear_extrude(height = height)
|
||||
difference() {
|
||||
shape();
|
||||
|
||||
translate([depth / 2, width / 2 - 5])
|
||||
square([2 * (depth - extent + terminal_clearance), 10], center = true);
|
||||
}
|
||||
linear_extrude(height = height - terminal_block_height(tb) - psu_terminal_block_z(type) - terminal_clearance)
|
||||
shape();
|
||||
}
|
||||
// cable slots
|
||||
for(i = [0 : 1 : cables - 1])
|
||||
translate([centre_x - depth / 2 + wall / 2, -centre_y + (i - cables / 2 + 0.5) * psu_shroud_cable_pitch(cable_d), height / 2])
|
||||
rotate([90, 0, 90])
|
||||
linear_extrude(height = wall, center = true)
|
||||
difference() {
|
||||
square([cable_d + eps, height], center = true);
|
||||
|
||||
translate([0, height / 2])
|
||||
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
||||
}
|
||||
|
||||
mirror([0, 1, 0]) {
|
||||
// insert boss
|
||||
translate_z(height - boss_h)
|
||||
linear_extrude(height = boss_h)
|
||||
psu_shroud_hole_positions(type)
|
||||
difference() {
|
||||
hull() {
|
||||
circle(boss_r);
|
||||
|
||||
translate([0, $side * (boss_r - 1)])
|
||||
square([2 * boss_r, eps], center = true);
|
||||
}
|
||||
poly_circle(insert_hole_radius(insert));
|
||||
}
|
||||
|
||||
// insert boss counter_bore
|
||||
translate_z(height - boss_h2)
|
||||
linear_extrude(height = counter_bore + eps)
|
||||
psu_shroud_hole_positions(type)
|
||||
difference() {
|
||||
hull() {
|
||||
circle(boss_r);
|
||||
|
||||
translate([0, $side * (boss_r - 1)])
|
||||
square([2 * boss_r, eps], center = true);
|
||||
}
|
||||
poly_circle(insert_screw_diameter(insert) / 2 + 0.1);
|
||||
}
|
||||
// support cones
|
||||
translate_z(height - boss_h2)
|
||||
psu_shroud_hole_positions(type)
|
||||
hull() {
|
||||
cylinder(h = eps, r = boss_r - eps);
|
||||
|
||||
translate([0, $side * (boss_r - 1)])
|
||||
cube([2 * boss_r, eps, eps], center = true);
|
||||
|
||||
translate([0, $side * (boss_r - wall), - (2 * boss_r - wall)])
|
||||
cube(eps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
|
||||
assembly(str("psu_shroud_", name)) {
|
||||
|
||||
translate_z(psu_shroud_height(type))
|
||||
vflip()
|
||||
color(pp1_colour) psu_shroud(type, cable_d, name, cables);
|
||||
|
||||
psu_shroud_hole_positions(type)
|
||||
vflip()
|
||||
insert(insert);
|
||||
}
|
||||
|
||||
module psu_shroud_fastened_assembly(type, cable_d, thickness, name, cables = 1) //! Assembly with screws in place
|
||||
{
|
||||
washer = screw_washer(screw);
|
||||
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + insert_length(insert) + counter_bore);
|
||||
|
||||
psu_shroud_assembly(type, cable_d, name, cables);
|
||||
|
||||
translate_z(-thickness)
|
||||
psu_shroud_hole_positions(type)
|
||||
vflip()
|
||||
screw_and_washer(screw, screw_length, true);
|
||||
|
||||
psu_shroud_cable_positions(type, cable_d, cables)
|
||||
cable_tie(cable_d / 2, thickness);
|
||||
}
|
@@ -30,7 +30,7 @@ knob_stem_h = 6;
|
||||
knob_thickness = 4;
|
||||
knob_r = 8;
|
||||
knob_wave = 1;
|
||||
knob_waves = 9;
|
||||
knob_waves = 5;
|
||||
knob_height = knob_stem_h + knob_thickness;
|
||||
function knob_height() = knob_height;
|
||||
|
||||
@@ -73,5 +73,8 @@ assembly(str("screw_knob_M", 20 * screw_radius(screw), "_", length)) {
|
||||
module screw_knob_M30_stl() screw_knob(M3_hex_screw);
|
||||
module screw_knob_M40_stl() screw_knob(M4_hex_screw);
|
||||
|
||||
//! * Press the M3 x 16 hex screw into the knob
|
||||
module screw_knob_M30_16_assembly() screw_knob_assembly(M3_hex_screw, 16);
|
||||
|
||||
//! * Press the M4 x 16 hex screw into the knob
|
||||
module screw_knob_M40_16_assembly() screw_knob_assembly(M4_hex_screw, 16);
|
||||
|
182
printed/ssr_shroud.scad
Normal file
@@ -0,0 +1,182 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! A cover to go over the mains end of an SSR to make it safe to be touched.
|
||||
//! The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
include <../vitamins/inserts.scad>
|
||||
|
||||
use <../vitamins/wire.scad>
|
||||
use <../vitamins/ssr.scad>
|
||||
use <../utils/round.scad>
|
||||
|
||||
wall = 1.8;
|
||||
top = 1.5;
|
||||
screw = M3_cap_screw;
|
||||
insert = screw_insert(screw);
|
||||
boss_r = wall + corrected_radius(insert_hole_radius(insert));
|
||||
boss_h = insert_hole_length(insert);
|
||||
counter_bore = 2;
|
||||
boss_h2 = boss_h + counter_bore;
|
||||
rad = 3;
|
||||
clearance = layer_height;
|
||||
|
||||
function ssr_shroud_pitch(type) = ssr_width(type) + 2 * wall - 2 * boss_r - eps;
|
||||
function ssr_shroud_screw(type) = screw; //! Screw used to fasten
|
||||
function ssr_shroud_extent(type, cable_d) = 2 * boss_r + 1 + cable_d + rad; //! How far it extends beyond the SSR
|
||||
function ssr_shroud_width(type) = ssr_width(type) + 2 * wall + clearance; //! Outside width of shroud
|
||||
function ssr_shroud_height(type) = ssr_height(type) + top + clearance; //! Outside height
|
||||
function ssr_shroud_cable_x(type, cable_d) = -ssr_length(type) / 2 - 2 * boss_r - 1 - cable_d / 2; //! Position of cable entry holes
|
||||
|
||||
module ssr_shroud_hole_positions(type) //! Place children at the screw hole positions
|
||||
for($side = [-1, 1])
|
||||
translate([-ssr_length(type) / 2 -boss_r, $side * ssr_shroud_pitch(type) / 2])
|
||||
vflip()
|
||||
children();
|
||||
|
||||
module ssr_shroud_holes(type, cable_d) { //! Drill the screw and ziptie holes
|
||||
ssr_shroud_hole_positions(type)
|
||||
drill(screw_clearance_radius(screw), 0);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([ssr_shroud_cable_x(type, cable_d), side * (ssr_width(type) / 2 - 2 * boss_r)])
|
||||
rotate(-90)
|
||||
cable_tie_holes(cable_d / 2, h = 0);
|
||||
|
||||
}
|
||||
|
||||
module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a specified ssr and cable
|
||||
stl(str("ssr_shroud_", name));
|
||||
|
||||
width = ssr_shroud_width(type);
|
||||
depth = ssr_length(type) / 3 + ssr_shroud_extent(type, cable_d);
|
||||
height = ssr_shroud_height(type);
|
||||
cable_x = ssr_shroud_cable_x(type, cable_d);
|
||||
center_x = -ssr_length(type) / 6 - depth / 2;
|
||||
|
||||
// base and sides
|
||||
translate([center_x, 0]) {
|
||||
rounded_rectangle([depth - eps, width - eps, top], rad, center = false);
|
||||
|
||||
linear_extrude(height = height) difference() {
|
||||
round(or = wall / 2 - eps, ir = 0) difference() {
|
||||
rounded_square([depth, width], rad);
|
||||
|
||||
rounded_square([depth - 2 * wall, width - 2 * wall], rad - wall);
|
||||
|
||||
translate([depth / 2, 0])
|
||||
square([2 * rad, width], center = true);
|
||||
|
||||
}
|
||||
translate([cable_x - center_x, 0])
|
||||
square([cable_d, width + 1], center = true);
|
||||
}
|
||||
}
|
||||
// cable slots
|
||||
for(side = [-1, 1])
|
||||
translate([cable_x, side * (width / 2 - wall / 2), height / 2])
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(height = wall, center = true)
|
||||
difference() {
|
||||
square([cable_d + eps, height], center = true);
|
||||
|
||||
translate([0, height / 2])
|
||||
vertical_tearslot(h = 0, r = cable_d / 2, l = cable_d);
|
||||
}
|
||||
// insert boss
|
||||
translate_z(height - boss_h)
|
||||
linear_extrude(height = boss_h)
|
||||
ssr_shroud_hole_positions(type)
|
||||
difference() {
|
||||
hull() {
|
||||
circle(boss_r);
|
||||
|
||||
translate([0, -$side * (boss_r - 1)])
|
||||
square([2 * boss_r, eps], center = true);
|
||||
}
|
||||
poly_circle(insert_hole_radius(insert));
|
||||
}
|
||||
|
||||
// insert boss counter_bore
|
||||
translate_z(height - boss_h2)
|
||||
linear_extrude(height = counter_bore + eps)
|
||||
ssr_shroud_hole_positions(type)
|
||||
difference() {
|
||||
hull() {
|
||||
circle(boss_r);
|
||||
|
||||
translate([0, -$side * (boss_r - 1)])
|
||||
square([2 * boss_r, eps], center = true);
|
||||
}
|
||||
poly_circle(insert_screw_diameter(insert) / 2 + 0.1);
|
||||
}
|
||||
// support cones
|
||||
ssr_shroud_hole_positions(type)
|
||||
hull() {
|
||||
translate_z(-height + boss_h2) {
|
||||
cylinder(h = eps, r = boss_r - eps);
|
||||
|
||||
translate([0, -$side * (boss_r - 1)])
|
||||
cube([2 * boss_r, eps, eps], center = true);
|
||||
}
|
||||
translate([0, -$side * (boss_r - wall), -height + boss_h2 + (2 * boss_r - wall)])
|
||||
cube(eps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
||||
assembly(str("ssr_shroud_", name)) {
|
||||
|
||||
translate_z(ssr_shroud_height(type))
|
||||
vflip()
|
||||
color(pp1_colour) ssr_shroud(type, cable_d, name);
|
||||
|
||||
ssr_shroud_hole_positions(type)
|
||||
insert(insert);
|
||||
|
||||
}
|
||||
|
||||
module ssr_shroud_fastened_assembly(type, cable_d, thickness, name) //! Assembly with screws in place
|
||||
{
|
||||
washer = screw_washer(screw);
|
||||
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + insert_length(insert) + counter_bore);
|
||||
|
||||
ssr_shroud_assembly(type, cable_d, name);
|
||||
|
||||
translate_z(-thickness)
|
||||
ssr_shroud_hole_positions(type)
|
||||
screw_and_washer(screw, screw_length, true);
|
||||
|
||||
for(side = [-1, 1])
|
||||
translate([ssr_shroud_cable_x(type, cable_d), side * (ssr_width(type) / 2 - 2 * boss_r)]) {
|
||||
rotate(-90)
|
||||
cable_tie(cable_d / 2, thickness);
|
||||
|
||||
*translate_z(cable_d / 2)
|
||||
rotate([90, 0, 0])
|
||||
color(grey20)
|
||||
cylinder(d = cable_d, h = 20, center = true);
|
||||
}
|
||||
|
||||
|
||||
}
|
454
readme.md
@@ -22,19 +22,20 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
<tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr>
|
||||
<tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Pcbs">Pcbs</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Global">Global</a> </td></tr>
|
||||
<tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr>
|
||||
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Psus">Psus</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
|
||||
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
|
||||
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
|
||||
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
|
||||
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Psus">Psus</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
|
||||
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
|
||||
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
|
||||
@@ -42,8 +43,8 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Nuts">Nuts</a> </td><td></td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
@@ -520,6 +521,7 @@ LCD dispays.
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```display(HDMI5)``` | HDMI display 5" |
|
||||
| 1 | ```display(LCD1602A)``` | LCD display 1602A |
|
||||
| 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -618,7 +620,7 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```fan(type)``` | Draw specified fan, origin in the centre |
|
||||
| ```fan_assembly(type, thickness, include_fan = true)``` | Fan with its fasteners |
|
||||
| ```fan_assembly(type, thickness, include_fan = true, screw = false)``` | Fan with its fasteners |
|
||||
| ```fan_hole_positions(type, z = undef)``` | Position children at the screw hole positions |
|
||||
| ```fan_holes(type, poly = false, screws = true, h = 100)``` | Make all the holes for the fan, or just the aperture if ```screws``` is false. Set ```poly``` true for poly_holes. |
|
||||
|
||||
@@ -681,6 +683,55 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
|
||||
| 1 | ```fuseholder(6)``` | Fuse holder 20mm |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Green_terminals"></a>
|
||||
## Green_terminals
|
||||
Parametric green terminal blocks
|
||||
|
||||
|
||||
[vitamins/green_terminals.scad](vitamins/green_terminals.scad) Object definitions.
|
||||
|
||||
[vitamins/green_terminal.scad](vitamins/green_terminal.scad) Implementation.
|
||||
|
||||
[tests/green_terminals.scad](tests/green_terminals.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```gt_back_depth(type)``` | Back ledge depth |
|
||||
| ```gt_back_height(type)``` | Height at the back |
|
||||
| ```gt_box_h(type)``` | Height of the cable entry box |
|
||||
| ```gt_box_w(type)``` | Width inside the cable entry box |
|
||||
| ```gt_depth(type)``` | Total front to back depth |
|
||||
| ```gt_front_depth(type)``` | Front ledge depth |
|
||||
| ```gt_front_height(type)``` | Height at the front |
|
||||
| ```gt_front_t(type)``` | Thickness of frame around the front aperture |
|
||||
| ```gt_height(type)``` | Height of the flat top |
|
||||
| ```gt_pitch(type)``` | Pitch between terminals |
|
||||
| ```gt_screw_r(type)``` | Screw head radius |
|
||||
| ```gt_top(type)``` | Depth at the top |
|
||||
| ```gt_tube_h(type)``` | Height of optional tubes around the screws |
|
||||
| ```gt_y_offset(type)``` | Offset of the pins from centre of the depth |
|
||||
| ```gt_y_offset2(type)``` | Offset of the pins screws from the screws |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```green_terminal(type, ways, skip = [])``` | Draw green terminal blocks, skip can be used to remove pins. |
|
||||
| ```terminal_254(ways, skip = [])``` | Draw 0.1" terminal block |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```green_terminal(gt_6p35, 2)``` | Terminal block 2 way 0.25" |
|
||||
| 1 | ```green_terminal(gt_3p5, 3)``` | Terminal block 3 way 3.5mm |
|
||||
| 1 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -766,6 +817,10 @@ IEC mains inlets and outlet.
|
||||
| ```iec_bezel_r(type)``` | Bezel corner radius |
|
||||
| ```iec_bezel_t(type)``` | Bezel thickness |
|
||||
| ```iec_bezel_w(type)``` | Bezel width |
|
||||
| ```iec_body_h(type)``` | Body height |
|
||||
| ```iec_body_r(type)``` | Body corner radius |
|
||||
| ```iec_body_w(type)``` | Body width |
|
||||
| ```iec_body_w2(type)``` | Body width at the narrow part |
|
||||
| ```iec_depth(type)``` | Depth of the body below the flange |
|
||||
| ```iec_flange_h(type)``` | Flange height |
|
||||
| ```iec_flange_r(type)``` | Flange corner radius |
|
||||
@@ -775,18 +830,21 @@ IEC mains inlets and outlet.
|
||||
| ```iec_part(type)``` | Description |
|
||||
| ```iec_pitch(type)``` | Screw hole pitch |
|
||||
| ```iec_screw(type)``` | Screw type |
|
||||
| ```iec_slot_h(type)``` | Body height |
|
||||
| ```iec_slot_r(type)``` | Body corner radius |
|
||||
| ```iec_slot_w(type)``` | Body width |
|
||||
| ```iec_spades(type)``` | Spade type |
|
||||
| ```iec_width(type)``` | Widest part including the lugs |
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```iec_insert_screw_length()``` | Screw length used for inserts |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```iec(type)``` | Draw specified IEC connector |
|
||||
| ```iec_assembly(type, thickness)``` | Assembly with fasteners given panel thickness |
|
||||
| ```iec_holes(type, h = 100, poly = false, horizontal = false, insert = false)``` | Drill the required panel holes |
|
||||
| ```iec_inserts(type)``` | Place the inserts |
|
||||
| ```iec_screw_positions(type)``` | Position children at the screw holes |
|
||||
|
||||

|
||||
@@ -794,14 +852,15 @@ IEC mains inlets and outlet.
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```iec(IEC_fused_inlet)``` | IEC fused inlet |
|
||||
| 1 | ```iec(IEC_fused_inlet)``` | IEC fused inlet JR-101-1F |
|
||||
| 1 | ```iec(IEC_fused_inlet2)``` | IEC fused inlet old |
|
||||
| 1 | ```iec(IEC_inlet)``` | IEC inlet |
|
||||
| 1 | ```iec(IEC_inlet_atx)``` | IEC inlet for ATX |
|
||||
| 1 | ```iec(IEC_outlet)``` | IEC outlet |
|
||||
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 1 | ```iec(IEC_outlet)``` | IEC outlet RS 811-7193 |
|
||||
| 10 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | ```screw(M3_cs_cap_screw, 10)``` | Screw M3 cs cap x 10mm |
|
||||
| 4 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
|
||||
| 8 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 6 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
|
||||
| 10 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -1465,13 +1524,6 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```hdr_base_colour(type)``` | Header insulator colour |
|
||||
| ```hdr_pin_below(type)``` | Header pin length underneath |
|
||||
| ```hdr_pin_colour(type)``` | Header pin colour |
|
||||
| ```hdr_pin_length(type)``` | Header pin length |
|
||||
| ```hdr_pin_width(type)``` | Header pin size |
|
||||
| ```hdr_pitch(type)``` | Header pitch |
|
||||
| ```hdr_socket_depth(type)``` | Socket depth for female housing |
|
||||
| ```pcb_accessories(type)``` | List of accessories to go on the BOM, SD cards, USB cables, etc. |
|
||||
| ```pcb_colour(type)``` | Colour of the subtrate |
|
||||
| ```pcb_components(type)``` | List of components |
|
||||
@@ -1497,10 +1549,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
|
||||
| ```chip(length, width, thickness, cutout = false)``` | Draw a black cube to represent a chip |
|
||||
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
|
||||
| ```flex(cutout = false)``` | Draw flexistrip connector |
|
||||
| ```hdmi(cutout = false)``` | Draw HDMI socket |
|
||||
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
|
||||
| ```jack(cutout = false)``` | Draw 3.5mm jack |
|
||||
| ```molex_254(ways)``` | Draw molex header |
|
||||
| ```pcb(type)``` | Draw specified PCB |
|
||||
@@ -1512,12 +1563,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| ```pcb_grid(type, x, y, z = 0)``` | Positions children at specified grid positions |
|
||||
| ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions |
|
||||
| ```pcb_spacer(screw, height, wall = 1.8)``` | Generate STL for PCB spacer |
|
||||
| ```pin(type = 2p54header, length = undef)``` | Draw a header pin |
|
||||
| ```pin_header(type = 2p54header, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw pin header |
|
||||
| ```pin_socket(type = 2p54header, cols = 1, rows = 1, right_angle = false, height = 0, cutout = false)``` | Draw pin socket |
|
||||
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
|
||||
| ```terminal_254(ways, skip = [])``` | Draw 0.1" terminal block |
|
||||
| ```terminal_35(ways)``` | Draw 3.5mm terminal block |
|
||||
| ```uSD(size, cutout = false)``` | Draw uSD socket |
|
||||
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
|
||||
| ```usb_B(cutout = false)``` | Draw USB B connector |
|
||||
| ```usb_uA(cutout = false)``` | Draw USB micro A connector |
|
||||
@@ -1528,18 +1576,21 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```pcb(ArduinoUno3)``` | Arduino Uno R3 |
|
||||
| 1 | | Cat 5 patch cable 300mm |
|
||||
| 1 | ```d_plug(DCONN15, pcb = true)``` | D-type 15 way PCB mount plug |
|
||||
| 1 | ```pcb(DuetW)``` | Duet WiFi electronics |
|
||||
| 1 | ```pcb(DuetE)``` | Duet 2 Ethernet electronics |
|
||||
| 1 | ```pcb(Duex2)``` | Duex2 expansion board |
|
||||
| 1 | ```pcb(Duex5)``` | Duex5 expasnion board |
|
||||
| 1 | ```pcb(ExtruderPCB)``` | Extruder connection PCB |
|
||||
| 1 | ```pcb(Keyes5p1)``` | Keyes5.1 Arduino Uno expansion board |
|
||||
| 1 | ```pcb(Melzi)``` | Melzi electronics |
|
||||
| 2 | | Micro SD card |
|
||||
| 3 | | Micro SD card |
|
||||
| 1 | ```molex_254(2)``` | Molex KK header 2 way |
|
||||
| 1 | ```molex_254(3)``` | Molex KK header 3 way |
|
||||
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
|
||||
| 12 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
|
||||
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||
| 12 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
|
||||
| 1 | ```pcb(PSU12V1A)``` | PSU 12V 1A |
|
||||
| 1 | ```pcb(PERF60x40)``` | Perfboard 60 x 40mm |
|
||||
@@ -1555,14 +1606,14 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 8 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
|
||||
| 8 | ```screw(M3_cap_screw, 25)``` | Screw M3 cap x 25mm |
|
||||
| 4 | ```screw(M3_cap_screw, 30)``` | Screw M3 cap x 30mm |
|
||||
| 4 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
|
||||
| 12 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
|
||||
| 3 | ```terminal_35(2)``` | Terminal block 2 way 3.5mm |
|
||||
| 2 | ```terminal_254(4)``` | Terminal block 4 way 0.1" |
|
||||
| 2 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
|
||||
| 1 | | USB A to Mini B lead |
|
||||
| 16 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
|
||||
| 12 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
|
||||
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
|
||||
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
@@ -1577,8 +1628,10 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 4 | pcb_spacer2590.stl |
|
||||
| 4 | pcb_spacer30140.stl |
|
||||
| 4 | pcb_spacer30150.stl |
|
||||
| 4 | pcb_spacer30170.stl |
|
||||
| 4 | pcb_spacer30190.stl |
|
||||
| 4 | pcb_spacer40160.stl |
|
||||
| 4 | pcb_spacer40170.stl |
|
||||
| 4 | pcb_spacer40180.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -1629,6 +1682,52 @@ Threaded pillars. Each end can be male or female.
|
||||
| 1 | ```pillar(M4x17_nylon_pillar)``` | Pillar nylon M/F M4x20 |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Pin_headers"></a>
|
||||
## Pin_headers
|
||||
Pin headers and sockets, etc.
|
||||
|
||||
|
||||
[vitamins/pin_headers.scad](vitamins/pin_headers.scad) Object definitions.
|
||||
|
||||
[vitamins/pin_header.scad](vitamins/pin_header.scad) Implementation.
|
||||
|
||||
[tests/pin_headers.scad](tests/pin_headers.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```hdr_base_colour(type)``` | Header insulator colour |
|
||||
| ```hdr_pin_below(type)``` | Header pin length underneath |
|
||||
| ```hdr_pin_colour(type)``` | Header pin colour |
|
||||
| ```hdr_pin_length(type)``` | Header pin length |
|
||||
| ```hdr_pin_width(type)``` | Header pin size |
|
||||
| ```hdr_pitch(type)``` | Header pitch |
|
||||
| ```hdr_socket_depth(type)``` | Socket depth for female housing |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header |
|
||||
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
|
||||
| ```pin(type, length = undef)``` | Draw a header pin |
|
||||
| ```pin_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw pin header |
|
||||
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, cutout = false)``` | Draw pin socket |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 |
|
||||
| 1 | ```pin_header(2p54header102)``` | Pin header 10 x 2 |
|
||||
| 1 | ```box_header(2p54header102)``` | Pin header 10 x 2 |
|
||||
| 1 | ```pin_socket(2p54header, 10, 2)``` | Pin socket 10 x 2 |
|
||||
| 1 | ```pin_socket(2p54header, 10, 2, right_angle = true)``` | Pin socket 10 x 2 right_angle |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -1895,10 +1994,12 @@ Ring terminals and earth assemblies for DiBond panels.
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 2 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 1 | ```ring_terminal(M3_ringterm)``` | Ring terminal 3mm |
|
||||
| 1 | ```ring_terminal(M3_ringterm_cs)``` | Ring terminal 3mm |
|
||||
| 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
|
||||
| 1 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
|
||||
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
|
||||
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -2116,7 +2217,7 @@ Note that modules that drill holes will return a 2D object if ```h``` is set to
|
||||
|:--- |:--- |
|
||||
| ```render_2D_sheet(type, color = false)``` | Extrude a 2D sheet template and give it the correct colour |
|
||||
| ```render_sheet(type, color = false)``` | Render a sheet in the correct colour after holes have been subtracted |
|
||||
| ```sheet(type, w, d, corners = [0, 0, 0, 0])``` | Draw speified sheet |
|
||||
| ```sheet(type, w, d, corners = [0, 0, 0, 0])``` | Draw specified sheet |
|
||||
| ```sheet_2D(type, w, d, corners = [0, 0, 0, 0])``` | 2D sheet template with specified size and optionally rounded corners |
|
||||
|
||||

|
||||
@@ -2204,6 +2305,7 @@ Filament spool models
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```spool_height(type)``` | Outside width |
|
||||
| ```spool_pitch(type)``` | Spacing of the rims |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
@@ -2217,6 +2319,7 @@ Filament spool models
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```spool(spool_200x55)``` | Filament spool 200 x 55 |
|
||||
| 1 | ```spool(spool_300x85)``` | Filament spool 300 x 85 |
|
||||
| 1 | ```spool(spool_300x88)``` | Filament spool 300 x 88 |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
@@ -2633,7 +2736,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
||||
| 2 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 |
|
||||
| 4 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | ```screw(M3_dome_screw, 25)``` | Screw M3 dome x 25mm |
|
||||
| 2 | ```terminal_254(10)``` | Terminal block 10 way 0.1" |
|
||||
| 2 | ```green_terminal(gt_2p54, 10)``` | Terminal block 10 way 0.1" |
|
||||
| 2 | ```veroboard(z_vb)``` | Veroboard 5 holes x 22strips |
|
||||
| 8 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
@@ -2742,6 +2845,53 @@ If a washer is given a child, usually a screw or a nut, then it is placed on its
|
||||
| 1 | M80_washer.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Wire"></a>
|
||||
## Wire
|
||||
Just a BOM entry at the moment and cable bundle size functions for holes, plus cable ties.
|
||||
|
||||
|
||||
[vitamins/wire.scad](vitamins/wire.scad) Implementation.
|
||||
|
||||
[tests/wire.scad](tests/wire.scad) Code for this example.
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```cable_bundle(cable)``` | Arrangement of a bundle in a flat cable clip |
|
||||
| ```cable_height(cable)``` | Height in flat clip |
|
||||
| ```cable_radius(cable)``` | Radius of a bundle of wires, see <http://mathworld.wolfram.com/CirclePacking.html>. |
|
||||
| ```cable_width(cable)``` | Width in flat clip |
|
||||
| ```cable_wire_size(cable)``` | Size of each wire in a bundle |
|
||||
| ```cable_wires(cable)``` | Number of wires in a bindle |
|
||||
| ```wire_hole_radius(cable)``` | Radius of a hole to accept a bundle of wires |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```cable_tie(cable_r, thickness)``` | A ziptie threaded around cable radius ```cable_r``` and through a panel with specified ```thickness```. |
|
||||
| ```cable_tie_holes(cable_r, h = 100)``` | Holes to thread a ziptie through a panel to make a cable tie. |
|
||||
| ```mouse_hole(cable, h = 100)``` | A mouse hole to allow a panel to go over a wire bundle. |
|
||||
| ```ribbon_cable(ways, length)``` | Add ribbon cable to the BOM |
|
||||
| ```wire(color, strands, length, strand = 0.2)``` | Add stranded wire to the BOM |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | | Wire black 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire blue 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire brown 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire green 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire orange 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire red 7/0.2mm strands, length 90mm |
|
||||
| 1 | | Wire yellow 7/0.2mm strands, length 90mm |
|
||||
| 1 | ```ziptie(small_ziptie, 2.1)``` | Ziptie 100mm min length |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -2765,6 +2915,11 @@ Cable zipties.
|
||||
| ```ziptie_thickness(type)``` | Thickness |
|
||||
| ```ziptie_width(type)``` | Width |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```ziptie(type, r, t = 0)``` | Draw specified ziptie wrapped around radius ```r``` and optionally through panel thickness ```t``` |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
@@ -2839,7 +2994,7 @@ Normally the side sheets are the same type but they can be overridden individual
|
||||
| ```box_left_blank(type, sheet = false)``` | Generates a 2D template for the left sheet, ```sheet``` can be set to override the type |
|
||||
| ```box_right(type)``` | Default right side, can be overridden to customise |
|
||||
| ```box_right_blank(type, sheet = false)``` | Generates a 2D template for the right sheet, ```sheet``` can be set to override the type |
|
||||
| ```box_shelf_blank(type)``` | Generates a 2D template for a shelf sheet |
|
||||
| ```box_shelf_blank(type, sheet = false)``` | Generates a 2D template for a shelf sheet |
|
||||
| ```box_top(type)``` | Default top, can be overridden to customise |
|
||||
| ```box_top_blank(type)``` | Generates a 2D template for the top sheet |
|
||||
| ```grill(width, height, r = 1000, poly = false, h = 0)``` | A staggered array of 5mm holes to make grills in sheets. Can be constrained to be circular. Set ```poly``` ```true``` for printing, ```false``` for milling. |
|
||||
@@ -3324,6 +3479,76 @@ Note that the block with its inserts is defined as a sub assembly, but its faste
|
||||
| 1 | fixing_block_M40_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Flat_hinge"></a>
|
||||
## Flat_hinge
|
||||
A parametric flat hinge. A piece of filament can be used for the hinge pin.
|
||||
|
||||
The width, depth, thickness, number and type of screws, number of knuckles, knuckle diameter, pin diameter and clearance can all be varied.
|
||||
A margin between the screws and the knuckle edge can be enforced to allow the hinge to bend all the way back to 270° from closed.
|
||||
|
||||
Opening the test in OpenSCAD with its customiser enabled allows these parameters to be played with.
|
||||
|
||||
Note setting ```thickness1``` or ```thickness2``` to zero in the ```hinge_fastened_assembly()``` removes the screws from one side or the other and
|
||||
setting ```show_hinge``` to false removes the hinge.
|
||||
This allows the hinges and one set of screws to belong to one assembly and the other set of screws to another assembly.
|
||||
|
||||
|
||||
[printed/flat_hinge.scad](printed/flat_hinge.scad) Implementation.
|
||||
|
||||
[tests/flat_hinge.scad](tests/flat_hinge.scad) Code for this example.
|
||||
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```hinge_clearance(type)``` | Clearance between knuckles |
|
||||
| ```hinge_depth(type)``` | Depth of each leaf |
|
||||
| ```hinge_knuckle_dia(type)``` | The knuckle diameter |
|
||||
| ```hinge_knuckles(type)``` | How many knuckles |
|
||||
| ```hinge_margin(type)``` | How far to keep the screws from the knuckes |
|
||||
| ```hinge_pin_dia(type)``` | The pin diameter |
|
||||
| ```hinge_screw(type)``` | Screw type to mount it |
|
||||
| ```hinge_screws(type)``` | How many screws |
|
||||
| ```hinge_thickness(type)``` | Thickness of the leaves |
|
||||
| ```hinge_width(type)``` | Width |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```hinge_both(type)``` | Both parts together for printing |
|
||||
| ```hinge_fastened_assembly(type, thickness1, thickness2, angle, show_hinge = true)``` | Assembled hinge with its fasteners |
|
||||
| ```hinge_male(type, female = false)``` | The half with the stationary pin |
|
||||
| ```hinge_screw_positions(type)``` | Place children at the screw positions |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | | Hinge pin 20 x 2.85mm |
|
||||
| 1 | | Hinge pin 50 x 4mm |
|
||||
| 14 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 4 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
|
||||
| 10 | ```screw(M3_dome_screw, 12)``` | Screw M3 dome x 12mm |
|
||||
| 28 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | hinge_female_big.stl |
|
||||
| 1 | hinge_female_small.stl |
|
||||
| 1 | hinge_male_big.stl |
|
||||
| 1 | hinge_male_small.stl |
|
||||
|
||||
### Assemblies
|
||||
| Qty | Name |
|
||||
| ---:|:--- |
|
||||
| 1 | hinge_big_assembly |
|
||||
| 1 | hinge_small_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -3350,7 +3575,6 @@ inserts don't grip well in rubber.
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```foot()``` | Default foot used unless a list of parameters is passed |
|
||||
| ```insert_foot()``` | Default foot with insert |
|
||||
|
||||
### Modules
|
||||
@@ -3437,6 +3661,64 @@ Printed handle that can be printed without needing support material due to its t
|
||||
| 1 | handle_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Psu_shroud"></a>
|
||||
## Psu_shroud
|
||||
A cover to go over the mains end of a PSU terminal strip to make it safe.
|
||||
The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
|
||||
|
||||
|
||||
[printed/psu_shroud.scad](printed/psu_shroud.scad) Implementation.
|
||||
|
||||
[tests/psu_shroud.scad](tests/psu_shroud.scad) Code for this example.
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```psu_shroud_cable_pitch(cable_d)``` | Pitch between cable entries |
|
||||
| ```psu_shroud_centre_y(type)``` | Shroud centre relative to PSU centre |
|
||||
| ```psu_shroud_depth(type)``` | Outside depth of the shroud |
|
||||
| ```psu_shroud_extent(type)``` | How far it extends beyond the PSU to clear the connections |
|
||||
| ```psu_shroud_height(type)``` | Outside height |
|
||||
| ```psu_shroud_screw(type)``` | Screw used to fasten |
|
||||
| ```psu_shroud_width(type)``` | Outside width of the shroud |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```psu_shroud(type, cable_d, name, cables = 1)``` | Generate the STL file for a specified ssr and cable |
|
||||
| ```psu_shroud_assembly(type, cable_d, name, cables = 1)``` | The printed parts with inserts fitted |
|
||||
| ```psu_shroud_cable_positions(type, cable_d, cables = 1)``` | Place children at the cable tie positions |
|
||||
| ```psu_shroud_fastened_assembly(type, cable_d, thickness, name, cables = 1)``` | Assembly with screws in place |
|
||||
| ```psu_shroud_hole_positions(type)``` | Place children at the screw hole positions |
|
||||
| ```psu_shroud_holes(type, cable_d, cables = 1)``` | Drill the screw and ziptie holes |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
|
||||
| 4 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
|
||||
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
|
||||
| 2 | ```ziptie(small_ziptie, 3)``` | Ziptie 100mm min length |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | psu_shroud_PD_150_12.stl |
|
||||
| 1 | psu_shroud_S_250_48.stl |
|
||||
|
||||
### Assemblies
|
||||
| Qty | Name |
|
||||
| ---:|:--- |
|
||||
| 1 | psu_shroud_PD_150_12_assembly |
|
||||
| 1 | psu_shroud_S_250_48_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -3579,6 +3861,61 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte
|
||||
| 1 | socket_box_MKLOGIC_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Ssr_shroud"></a>
|
||||
## Ssr_shroud
|
||||
A cover to go over the mains end of an SSR to make it safe to be touched.
|
||||
The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
|
||||
|
||||
|
||||
[printed/ssr_shroud.scad](printed/ssr_shroud.scad) Implementation.
|
||||
|
||||
[tests/ssr_shroud.scad](tests/ssr_shroud.scad) Code for this example.
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```ssr_shroud_cable_x(type, cable_d)``` | Position of cable entry holes |
|
||||
| ```ssr_shroud_extent(type, cable_d)``` | How far it extends beyond the SSR |
|
||||
| ```ssr_shroud_height(type)``` | Outside height |
|
||||
| ```ssr_shroud_screw(type)``` | Screw used to fasten |
|
||||
| ```ssr_shroud_width(type)``` | Outside width of shroud |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```ssr_shroud(type, cable_d, name)``` | Generate the STL file for a specified ssr and cable |
|
||||
| ```ssr_shroud_assembly(type, cable_d, name)``` | The printed parts with inserts fitted |
|
||||
| ```ssr_shroud_fastened_assembly(type, cable_d, thickness, name)``` | Assembly with screws in place |
|
||||
| ```ssr_shroud_hole_positions(type)``` | Place children at the screw hole positions |
|
||||
| ```ssr_shroud_holes(type, cable_d)``` | Drill the screw and ziptie holes |
|
||||
|
||||

|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
|
||||
| 4 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
|
||||
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
|
||||
| 4 | ```ziptie(small_ziptie, 3)``` | Ziptie 100mm min length |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | ssr_shroud_SSR10DA.stl |
|
||||
| 1 | ssr_shroud_SSR25DA.stl |
|
||||
|
||||
### Assemblies
|
||||
| Qty | Name |
|
||||
| ---:|:--- |
|
||||
| 1 | ssr_shroud_SSR10DA_assembly |
|
||||
| 1 | ssr_shroud_SSR25DA_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
@@ -3850,7 +4187,7 @@ Square with one rounded corner.
|
||||
---
|
||||
<a name="Round"></a>
|
||||
## Round
|
||||
Round 2D shapes uisng `offset()`, which is fast and 3D shapes with [`offset_3D()`](#offset), which is very slow.
|
||||
Round 2D shapes using `offset()`, which is fast and 3D shapes with [`offset_3D()`](#offset), which is very slow.
|
||||
|
||||
A single radius can be specified or separate internal and external radii.
|
||||
If `chamfer_base` is `true` for `round_3D()` then the bottom edge is made suitable for 3D printing by chamfering once the
|
||||
@@ -4033,6 +4370,8 @@ heirachical BOMs are also generated for real projects.
|
||||
| ```no_pose()``` | Force children not to be posed even if parent is |
|
||||
| ```not_on_bom(on = false)``` | Specify the following child parts are not on the BOM, for example when they are on a PCB that comes assembled |
|
||||
| ```pose(a = [55, 0, 25], t = [0, 0, 0], exploded = undef)``` | Pose an STL or assembly for rendering to png by specifying rotation ```a``` and translation ```t```, ```exploded = true for``` just the exploded view or ```false``` for unexploded only. |
|
||||
| ```pose_hflip(exploded = undef)``` | Pose an STL or assembly for rendering to png by flipping around the Y axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only. |
|
||||
| ```pose_vflip(exploded = undef)``` | Pose an STL or assembly for rendering to png by flipping around the X axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only. |
|
||||
| ```stl(name)``` | Name an stl that will appear on the BOM, there needs to a module named ```<name>_stl``` to make it |
|
||||
| ```vitamin(description)``` | Describe a vitamin for the BOM entry and precede it with a module call that creates it, eg. "wigit(42): Type 42 widget" |
|
||||
|
||||
@@ -4105,12 +4444,17 @@ Global constants, functions and modules. This file is used directly or indirectl
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```Len(x)``` | Returns the length of a list or 0 if ```x``` is not a list |
|
||||
| ```cm(x)``` | cm to mm conversion |
|
||||
| ```echoit(x)``` | Echo expression and return it, useful for debugging |
|
||||
| ```foot(x)``` | Foot to mm conversion |
|
||||
| ```in(list, x)``` | Returns true if ```x``` is an element in the ```list``` |
|
||||
| ```inch(x)``` | Inch to mm conversion |
|
||||
| ```inch(x)``` | Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.) |
|
||||
| ```m(x)``` | m to mm conversion |
|
||||
| ```mm(x)``` | Explicit mm specified |
|
||||
| ```r2sides(r)``` | Replicates the OpenSCAD logic to calculate the number of sides from the radius |
|
||||
| ```r2sides4n(r)``` | Round up the number of sides to a multiple of 4 to ensure points land on all axes |
|
||||
| ```sqr(x)``` | Returns the square of ```x``` |
|
||||
| ```yard(x)``` | Yard to mm conversion |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
@@ -4118,10 +4462,10 @@ Global constants, functions and modules. This file is used directly or indirectl
|
||||
| ```circle4n(r, d = undef)``` | Circle with multiple of 4 vertices |
|
||||
| ```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 glip around the Y axis |
|
||||
| ```hflip()``` | Invert children by doing a 180° flip around the Y axis |
|
||||
| ```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 |
|
||||
| ```vflip()``` | Invert children by doing a 180° flip around the X axis |
|
||||
|
||||

|
||||
|
||||
@@ -4155,6 +4499,7 @@ The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is
|
||||
| ```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_ring(or, ir)``` | 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 |
|
||||
|
||||

|
||||
@@ -4244,6 +4589,7 @@ Small holes can get away without it, but they print better with truncated teardr
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```semi_teardrop(h, r, d = undef, center = true)``` | A semi teardrop in the positive Y domain |
|
||||
| ```teardrop(h, r, center = true, truncate = true)``` | For making horizontal holes that don't need support material, set ```truncate = false``` to make traditional RepRap teardrops that don't even need bridging |
|
||||
| ```teardrop_plus(h, r, center = true, truncate = true)``` | Slightly bigger teardrop to allow for the 3D printing staircase effect |
|
||||
| ```tearslot(h, r, w, center = true)``` | A horizontal slot that doesn't need support material |
|
||||
|
@@ -54,21 +54,13 @@ class BOM:
|
||||
self.routed = {}
|
||||
self.assemblies = {}
|
||||
|
||||
def data(self, main):
|
||||
return {
|
||||
"name" : self.name,
|
||||
"count" : self.count,
|
||||
"assemblies" : [main.assemblies[ass].data(main) for ass in self.assemblies],
|
||||
"vitamins" : self.vitamins,
|
||||
"printed" : self.printed,
|
||||
"routed" : self.routed
|
||||
}
|
||||
|
||||
def flat_data(self):
|
||||
assemblies = {}
|
||||
for ass in self.assemblies:
|
||||
assemblies[ass] = self.assemblies[ass].count
|
||||
return {
|
||||
"name" : self.name,
|
||||
"count" : self.count,
|
||||
"assemblies" : assemblies,
|
||||
"vitamins" : self.vitamins,
|
||||
"printed" : self.printed,
|
||||
@@ -167,6 +159,7 @@ class BOM:
|
||||
|
||||
def parse_bom(file = "openscad.log", name = None):
|
||||
main = BOM(name)
|
||||
main.ordered_assemblies = []
|
||||
stack = []
|
||||
|
||||
for line in open(file):
|
||||
@@ -179,6 +172,9 @@ def parse_bom(file = "openscad.log", name = None):
|
||||
main.assemblies[stack[-1]].add_assembly(ass) #add to nested BOM
|
||||
stack.append(ass)
|
||||
main.add_assembly(ass) #add to flat BOM
|
||||
if ass in main.ordered_assemblies:
|
||||
main.ordered_assemblies.remove(ass)
|
||||
main.ordered_assemblies.insert(0, ass)
|
||||
else:
|
||||
if s[0] == '}':
|
||||
if s[1:] != stack[-1]:
|
||||
@@ -227,14 +223,15 @@ def boms(target = None, assembly = None):
|
||||
if assembly == "main_assembly":
|
||||
main.print_bom(True, open(bom_dir + "/bom.txt","wt"))
|
||||
|
||||
for ass in sorted(main.assemblies):
|
||||
for ass in main.assemblies:
|
||||
with open(bom_dir + "/" + ass + ".txt", "wt") as f:
|
||||
bom = main.assemblies[ass]
|
||||
print(bom.make_name(ass) + ":", file=f)
|
||||
bom.print_bom(False, f)
|
||||
|
||||
data = [main.assemblies[ass].flat_data() for ass in main.ordered_assemblies]
|
||||
with open(bom_dir + "/bom.json", 'w') as outfile:
|
||||
json.dump(main.assemblies[assembly].data(main), outfile, indent = 4)
|
||||
json.dump(data, outfile, indent = 4)
|
||||
|
||||
print("done")
|
||||
|
||||
|
@@ -33,7 +33,7 @@ def read_deps(dname):
|
||||
for line in lines:
|
||||
if line.startswith('\t'):
|
||||
dep = line[1 : -1].rstrip(' \\')
|
||||
if not dep in ['stl.scad', 'dxf.scad', 'svf.scad', 'png.scad']:
|
||||
if not os.path.basename(dep) in ['stl.scad', 'dxf.scad', 'svf.scad', 'png.scad', 'target.scad']:
|
||||
deps.append(dep)
|
||||
return deps
|
||||
|
||||
|
@@ -28,6 +28,7 @@ import os
|
||||
import openscad
|
||||
from tests import do_cmd, update_image, colour_scheme, background
|
||||
from deps import mtime
|
||||
from colorama import init
|
||||
|
||||
def render(target, type):
|
||||
#
|
||||
@@ -69,6 +70,7 @@ def render(target, type):
|
||||
os.remove(png_maker_name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
target = sys.argv[1] if len(sys.argv) > 1 else None
|
||||
render(target, 'stl')
|
||||
render(target, 'dxf')
|
||||
|
126
scripts/views.py
@@ -39,13 +39,25 @@ from colorama import Fore
|
||||
def is_assembly(s):
|
||||
return s[-9:] == '_assembly' or s[-11:] == '_assemblies'
|
||||
|
||||
def add_assembly(flat_bom, bom, bounds_map):
|
||||
if not bom in flat_bom:
|
||||
def bom_to_assemblies(bom_dir, bounds_map):
|
||||
global flat_bom
|
||||
#
|
||||
# Make a list of all the parts in the BOM
|
||||
#
|
||||
bom_file = bom_dir + "/bom.json"
|
||||
with open(bom_file) as json_file:
|
||||
flat_bom = json.load(json_file)
|
||||
#
|
||||
# Decide if we need big or small assembly pictures
|
||||
#
|
||||
for bom in flat_bom:
|
||||
big = False
|
||||
for ass in bom["assemblies"]:
|
||||
add_assembly(flat_bom, ass, bounds_map)
|
||||
if ass["big"]:
|
||||
big = True
|
||||
for b in flat_bom:
|
||||
if b["name"] == ass:
|
||||
if b["big"]:
|
||||
big = True
|
||||
break
|
||||
if not big:
|
||||
for stl in bom["printed"]:
|
||||
bounds = bounds_map[stl]
|
||||
@@ -54,21 +66,10 @@ def add_assembly(flat_bom, bom, bounds_map):
|
||||
if max(width, depth) > 80:
|
||||
big = True
|
||||
break
|
||||
|
||||
bom["big"] = big or bom["routed"]
|
||||
flat_bom.append(bom)
|
||||
|
||||
def bom_to_assemblies(bom_dir, bounds_map):
|
||||
global flat_bom
|
||||
#
|
||||
# Make a list of all the parts in the BOM
|
||||
# Remove the main assembly if it is a shell
|
||||
#
|
||||
bom = {}
|
||||
bom_file = bom_dir + "/bom.json"
|
||||
with open(bom_file) as json_file:
|
||||
bom = json.load(json_file)
|
||||
flat_bom = []
|
||||
add_assembly(flat_bom, bom, bounds_map)
|
||||
ass = flat_bom[-1]
|
||||
if len(ass["assemblies"]) < 2 and not ass["vitamins"] and not ass["printed"] and not ass["routed"]:
|
||||
flat_bom = flat_bom[:-1]
|
||||
@@ -218,36 +219,49 @@ def views(target, do_assemblies = None):
|
||||
# Global BOM
|
||||
#
|
||||
print('<a name="Parts_list"></a>\n## Parts list', file = doc_file)
|
||||
vitamins = {}
|
||||
printed = {}
|
||||
routed = {}
|
||||
types = ["vitamins", "printed", "routed"]
|
||||
headings = {"vitamins" : "vitamins", "printed" : "3D printed parts", "routed" : "CNC routed parts"}
|
||||
things = {}
|
||||
for t in types:
|
||||
things[t] = {}
|
||||
for ass in flat_bom:
|
||||
for v in ass["vitamins"]:
|
||||
if v in vitamins:
|
||||
vitamins[v] += ass["vitamins"][v]
|
||||
else:
|
||||
vitamins[v] = ass["vitamins"][v]
|
||||
for p in ass["printed"]:
|
||||
if p in printed:
|
||||
printed[p] += ass["printed"][p]
|
||||
else:
|
||||
printed[p] = ass["printed"][p]
|
||||
for t in types:
|
||||
for thing in ass[t]:
|
||||
if thing in things[t]:
|
||||
things[t][thing] += ass[t][thing]
|
||||
else:
|
||||
things[t][thing] = ass[t][thing]
|
||||
for ass in flat_bom:
|
||||
name = ass["name"][:-9].replace('_', ' ').title().replace(' ',' ')
|
||||
print('| <span style="writing-mode: vertical-rl; text-orientation: mixed;">%s</span> ' % name, file = doc_file, end = '')
|
||||
print('| <span style="writing-mode: vertical-rl; text-orientation: mixed;">TOTALS</span> | |', file = doc_file)
|
||||
|
||||
print(('|--:' * len(flat_bom) + '|--:|:--|'), file = doc_file)
|
||||
for v in sorted(vitamins, key = lambda s: s.split(":")[-1]):
|
||||
for ass in flat_bom:
|
||||
count = ass["vitamins"][v] if v in ass["vitamins"] else '.'
|
||||
print('| %s ' % pad(count, 2, 1), file = doc_file, end = '')
|
||||
print('| %s | %s |' % (pad(vitamins[v], 2, 1), pad(v.split(":")[1], 2)), file = doc_file)
|
||||
print(('| ' * len(flat_bom) + '| | **3D Printed parts** |'), file = doc_file)
|
||||
for p in sorted(printed):
|
||||
for ass in flat_bom:
|
||||
count = ass["printed"][p] if p in ass["printed"] else '.'
|
||||
print('| %s ' % pad(count, 2, 1), file = doc_file, end = '')
|
||||
print('| %s | %s |' % (pad(printed[p], 2, 1), pad(p, 3)), file = doc_file)
|
||||
|
||||
for t in types:
|
||||
if things[t]:
|
||||
totals = {}
|
||||
heading = headings[t][0:1].upper() + headings[t][1:]
|
||||
print(('| ' * len(flat_bom) + '| | **%s** |') % heading, file = doc_file)
|
||||
for thing in sorted(things[t], key = lambda s: s.split(":")[-1]):
|
||||
for ass in flat_bom:
|
||||
count = ass[t][thing] if thing in ass[t] else 0
|
||||
print('| %s ' % pad(count if count else '.', 2, 1), file = doc_file, end = '')
|
||||
name = ass["name"]
|
||||
if name in totals:
|
||||
totals[name] += count
|
||||
else:
|
||||
totals[name] = count
|
||||
print('| %s | %s |' % (pad(things[t][thing], 2, 1), pad(thing.split(":")[-1], 2)), file = doc_file)
|
||||
|
||||
grand_total = 0
|
||||
for ass in flat_bom:
|
||||
name = ass["name"]
|
||||
total = totals[name] if name in totals else 0
|
||||
print('| %s ' % pad(total if total else '.', 2, 1), file = doc_file, end = '')
|
||||
grand_total += total
|
||||
print("| %s | %s |" % (pad(grand_total, 2, 1), pad('Total %s count' % headings[t], 2)), file = doc_file)
|
||||
|
||||
print(file = doc_file)
|
||||
eop(print_mode, doc_file)
|
||||
#
|
||||
@@ -266,56 +280,56 @@ def views(target, do_assemblies = None):
|
||||
print("### Vitamins", file = doc_file)
|
||||
print("|Qty|Description|", file = doc_file)
|
||||
print("|--:|:----------|", file = doc_file)
|
||||
for v in vitamins:
|
||||
for v in sorted(vitamins, key = lambda s: s.split(":")[-1]):
|
||||
print("|%d|%s|" % (vitamins[v], v.split(":")[1]), file = doc_file)
|
||||
print("\n", file = doc_file)
|
||||
|
||||
printed = ass["printed"]
|
||||
if printed:
|
||||
print('### 3D Printed parts', file = doc_file)
|
||||
i = 0
|
||||
for p in printed:
|
||||
keys = sorted(list(printed.keys()))
|
||||
for i in range(len(keys)):
|
||||
p = keys[i]
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', printed[p], p), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(printed) - 1:
|
||||
n = (i % 3) + 1
|
||||
print('\n|%s' % ('--|' * n), file = doc_file)
|
||||
for j in range(n):
|
||||
part = list(printed.keys())[i - n + j + 1]
|
||||
part = keys[i - n + j + 1]
|
||||
print('|  %s' % (part, part.replace('.stl','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
print('\n', file = doc_file)
|
||||
i += 1
|
||||
print('\n', file = doc_file)
|
||||
|
||||
routed = ass["routed"]
|
||||
if routed:
|
||||
print("### CNC Routed parts", file = doc_file)
|
||||
i = 0
|
||||
for r in routed:
|
||||
keys = sorted(list(routed.keys()))
|
||||
for i in range(len(keys)):
|
||||
r = keys[i]
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', routed[r], r), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(routed) - 1:
|
||||
n = (i % 3) + 1
|
||||
print('\n|%s' % ('--|' * n), file = doc_file)
|
||||
for j in range(n):
|
||||
part = list(routed.keys())[i - n + j + 1]
|
||||
part = keys[i - n + j + 1]
|
||||
print('|  %s' % (part, part.replace('.dxf','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
print('\n', file = doc_file)
|
||||
i += 1
|
||||
print('\n', file = doc_file)
|
||||
|
||||
sub_assemblies = ass["assemblies"]
|
||||
if sub_assemblies:
|
||||
print("### Sub-assemblies", file = doc_file)
|
||||
i = 0
|
||||
for a in sub_assemblies:
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', a["count"], a["name"]), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(sub_assemblies) - 1:
|
||||
keys = sorted(list(sub_assemblies.keys()))
|
||||
for i in range(len(keys)):
|
||||
a = keys[i]
|
||||
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', sub_assemblies[a], a), file = doc_file, end = '')
|
||||
if (i % 3) == 2 or i == len(keys) - 1:
|
||||
n = (i % 3) + 1
|
||||
print('\n|%s' % ('--|' * n), file = doc_file)
|
||||
for j in range(n):
|
||||
a = sub_assemblies[i - n + j + 1]["name"].replace('_assembly', '_assembled')
|
||||
a = keys[i - n + j + 1].replace('_assembly', '_assembled')
|
||||
print('|  %s' % (a, a + '_tn.png', '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
print('\n', file = doc_file)
|
||||
i += 1
|
||||
print('\n', file = doc_file)
|
||||
|
||||
small = not ass["big"]
|
||||
|
48
tests/flat_hinge.scad
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
use <../utils/layout.scad>
|
||||
use <../printed/flat_hinge.scad>
|
||||
|
||||
width = 50; // [20 : 100]
|
||||
depth = 20; // [8 : 50]
|
||||
thickness = 4; //[1 : 10]
|
||||
screws = 5; // [1 : 20]
|
||||
knuckles = 5; // [3 : 10]
|
||||
pin_diameter = 4; // [1: 10]
|
||||
knuckle_diameter = 9; //[4 : 15]
|
||||
margin = 0; // [0 : 10]
|
||||
clearance = 0.2;
|
||||
|
||||
angle = 0; // [-90 : 180]
|
||||
|
||||
big_hinge = ["big", width, depth, thickness, pin_diameter, knuckle_diameter, knuckles, M3_dome_screw, screws, clearance, margin];
|
||||
small_hinge = ["small", 20, 16, 2, 2.85, 7, 3, M3_dome_screw, 2, 0.2, 0];
|
||||
|
||||
hinges = [small_hinge, big_hinge];
|
||||
|
||||
module flat_hinges()
|
||||
layout([for(h = hinges) hinge_width(h)], 10)
|
||||
if($preview)
|
||||
hinge_fastened_assembly(hinges[$i], 3, 3, angle);
|
||||
else
|
||||
hinge_male(hinges[$i]);
|
||||
|
||||
flat_hinges();
|
29
tests/green_terminals.scad
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/green_terminals.scad>
|
||||
|
||||
module green_terminals()
|
||||
layout([for(t = green_terminals) gt_depth(t)], 15)
|
||||
rotate(180)
|
||||
green_terminal(green_terminals[$i], len(green_terminals) + 1 - $i);
|
||||
|
||||
if($preview)
|
||||
green_terminals();
|
45
tests/pin_headers.scad
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/pin_headers.scad>
|
||||
|
||||
pins = 10;
|
||||
|
||||
module pin_headers()
|
||||
layout([for(p = pin_headers) hdr_pitch(p) * pins], 15) {
|
||||
idc_transition(pin_headers[$i], 10);
|
||||
|
||||
translate([0, 20])
|
||||
pin_header(pin_headers[$i], 10, 2);
|
||||
|
||||
translate([0, 40])
|
||||
box_header(pin_headers[$i], 10, 2);
|
||||
|
||||
translate([0, 65])
|
||||
pin_socket(pin_headers[$i], 10, 2);
|
||||
|
||||
translate([0, 95])
|
||||
pin_socket(pin_headers[$i], 10, 2, right_angle = true);
|
||||
|
||||
}
|
||||
|
||||
if($preview)
|
||||
pin_headers();
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
BIN
tests/png/flat_hinge.png
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
tests/png/green_terminals.png
Normal file
After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 155 KiB |
BIN
tests/png/pin_headers.png
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
tests/png/psu_shroud.png
Normal file
After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 35 KiB |
BIN
tests/png/ssr_shroud.png
Normal file
After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
BIN
tests/png/wire.png
Normal file
After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 29 KiB |
@@ -52,8 +52,8 @@ module polyholes() {
|
||||
sizes = [1.5, 2, 3, 4];
|
||||
for(i = [0 : len(sizes) - 1])
|
||||
translate([i * 10, -10]) {
|
||||
color(pp1_colour) linear_extrude(height = 1)
|
||||
poly_ring(ir = ir, or = cir + sizes[i] * extrusion_width);
|
||||
color(pp1_colour)
|
||||
poly_tube(ir = ir, or = cir + sizes[i] * extrusion_width, h = 1);
|
||||
|
||||
rod(2 * ir, 3);
|
||||
}
|
||||
|
38
tests/psu_shroud.scad
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/screws.scad>
|
||||
include <../vitamins/psus.scad>
|
||||
use <../printed/psu_shroud.scad>
|
||||
|
||||
thickness = 3;
|
||||
|
||||
module psu_shrouds()
|
||||
layout([for(p = psus) psu_width(p)], 10) let(psu = psus[$i])
|
||||
if(psu_terminals(psu))
|
||||
rotate(90) {
|
||||
if($preview)
|
||||
psu_shroud_fastened_assembly(psu, 6, thickness, psu[0]);
|
||||
else
|
||||
psu_shroud(psu, 6, psu[0]);
|
||||
}
|
||||
|
||||
psu_shrouds();
|
37
tests/ssr_shroud.scad
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/layout.scad>
|
||||
|
||||
include <../vitamins/screws.scad>
|
||||
include <../vitamins/ssrs.scad>
|
||||
use <../printed/ssr_shroud.scad>
|
||||
|
||||
thickness = 3;
|
||||
|
||||
module ssr_shrouds()
|
||||
layout([for(s = ssrs) ssr_width(s)], 15) let(ssr = ssrs[$i])
|
||||
rotate(90) {
|
||||
if($preview)
|
||||
ssr_shroud_fastened_assembly(ssr, 6, thickness, ssr[0]);
|
||||
else
|
||||
ssr_shroud(ssr, 6, ssr[0]);
|
||||
}
|
||||
|
||||
ssr_shrouds();
|
@@ -23,8 +23,9 @@ include <../vitamins/screws.scad>
|
||||
include <../vitamins/ssrs.scad>
|
||||
|
||||
module ssrs()
|
||||
layout([for(s = ssrs) ssr_length(s)], 15)
|
||||
ssr_assembly(ssrs[$i], M4_cap_screw, 3);
|
||||
layout([for(s = ssrs) ssr_width(s)], 15)
|
||||
rotate(90)
|
||||
ssr_assembly(ssrs[$i], M4_cap_screw, 3);
|
||||
|
||||
if($preview)
|
||||
ssrs();
|
||||
|
@@ -36,7 +36,10 @@ module teardrops() {
|
||||
tearslot(h = 0, r = 3, w = 10);
|
||||
|
||||
translate([30, 15])
|
||||
vertical_tearslot(h = 0, r =3, l = 10);
|
||||
vertical_tearslot(h = 0, r =3, l = 10);
|
||||
|
||||
translate([20, 10])
|
||||
semi_teardrop(h = 0, r = 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
82
tests/wire.scad
Normal file
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
include <../core.scad>
|
||||
|
||||
include <../vitamins/wire.scad>
|
||||
|
||||
bundle = [7, 1.4];
|
||||
|
||||
bundle_r = cable_radius(bundle);
|
||||
|
||||
thickness = 2;
|
||||
w = 50;
|
||||
d = 20;
|
||||
h = 40;
|
||||
wire_l = 90;
|
||||
|
||||
module wires() {
|
||||
translate_z(bundle_r)
|
||||
rotate([0, 90, 0]) {
|
||||
n = cable_wires(bundle);
|
||||
d = cable_wire_size(bundle);
|
||||
if(n > 6)
|
||||
color("green") {
|
||||
cylinder(d = d, h = wire_l, center = true);
|
||||
wire("green", 7, wire_l);
|
||||
}
|
||||
|
||||
m = n > 6 ? n - 1 : n;
|
||||
for(i = [0 : m - 1])
|
||||
rotate(i * 360 / m)
|
||||
translate([bundle_r - d / 2, 0]) {
|
||||
colour = ["black", "brown", "red", "orange", "yellow", "blue", "purple"][i];
|
||||
wire(colour, 7, wire_l);
|
||||
color(colour)
|
||||
cylinder(d = d, h = wire_l, center = true);
|
||||
}
|
||||
|
||||
%cylinder(r = bundle_r, h = wire_l - 10, center = true);
|
||||
}
|
||||
|
||||
color(pp1_colour) {
|
||||
rotate([90, 0, 90])
|
||||
linear_extrude(height = thickness)
|
||||
difference() {
|
||||
translate([-w / 2, 0])
|
||||
square([w, h]);
|
||||
|
||||
mouse_hole(bundle, 0);
|
||||
}
|
||||
|
||||
translate_z(-thickness)
|
||||
linear_extrude(height = thickness)
|
||||
difference() {
|
||||
translate([thickness -d, -w / 2])
|
||||
square([d, w]);
|
||||
|
||||
translate([-15, 0])
|
||||
cable_tie_holes(bundle_r, 0);
|
||||
}
|
||||
}
|
||||
translate([-15, 0])
|
||||
cable_tie(bundle_r, thickness);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
wires();
|
@@ -63,6 +63,22 @@ module pose(a = [55, 0, 25], t = [0, 0, 0], exploded = undef) //! Pose an
|
||||
translate(-t)
|
||||
children();
|
||||
|
||||
module pose_hflip(exploded = undef) //! Pose an STL or assembly for rendering to png by flipping around the Y axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only.
|
||||
if(is_undef($pose) || !is_undef($posed) || (!is_undef(exploded) && exploded != !!exploded()))
|
||||
children();
|
||||
else
|
||||
let($posed = true) // only pose the top level
|
||||
hflip()
|
||||
children();
|
||||
|
||||
module pose_vflip(exploded = undef) //! Pose an STL or assembly for rendering to png by flipping around the X axis, ```exploded = true for``` just the exploded view or ```false``` for unexploded only.
|
||||
if(is_undef($pose) || !is_undef($posed) || (!is_undef(exploded) && exploded != !!exploded()))
|
||||
children();
|
||||
else
|
||||
let($posed = true) // only pose the top level
|
||||
vflip()
|
||||
children();
|
||||
|
||||
|
||||
module assembly(name) { //! Name an assembly that will appear on the BOM, there needs to a module named ```<name>_assembly``` to make it
|
||||
if(bom_mode())
|
||||
|
@@ -22,8 +22,14 @@
|
||||
//
|
||||
include <../../global_defs.scad>
|
||||
|
||||
function inch(x) = x * 25.4; //! Inch to mm conversion (For fractional inches, 'inch(1 + 7/8)' will work as expected.)
|
||||
function foot(x) = x * 25.4 * 12; //! Foot to mm conversion
|
||||
function yard(x) = x * 25.4 * 12 * 3; //! Yard to mm conversion
|
||||
function mm(x) = x; //! Explicit mm specified
|
||||
function cm(x) = x * 10.0; //! cm to mm conversion
|
||||
function m(x) = x * 1000.0; //! m to mm conversion
|
||||
|
||||
function sqr(x) = x * x; //! Returns the square of ```x```
|
||||
function inch(x) = x * 25.4; //! Inch to mm conversion
|
||||
function echoit(x) = echo(x) x; //! Echo expression and return it, useful for debugging
|
||||
function in(list, x) = !!len([for(v = list) if(v == x) true]); //! Returns true if ```x``` is an element in the ```list```
|
||||
function Len(x) = is_list(x) ? len(x) : 0; //! Returns the length of a list or 0 if ```x``` is not a list
|
||||
@@ -31,8 +37,8 @@ function r2sides(r) = $fn ? $fn : ceil(max(min(360/ $fa, r * 2 * PI / $fs), 5));
|
||||
function r2sides4n(r) = floor((r2sides(r) + 3) / 4) * 4; //! Round up the number of sides to a multiple of 4 to ensure points land on all axes
|
||||
|
||||
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
|
||||
module vflip() rotate([180, 0, 0]) children(); //! Invert children by doing a 180 flip around the X axis
|
||||
module hflip() rotate([0, 180, 0]) children(); //! Invert children by doing a 180 glip around the Y axis
|
||||
module vflip() rotate([180, 0, 0]) children(); //! Invert children by doing a 180° flip around the X axis
|
||||
module hflip() rotate([0, 180, 0]) children(); //! Invert children by doing a 180° flip around the Y axis
|
||||
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
|
||||
|
||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
|
||||
|
@@ -23,9 +23,9 @@
|
||||
//!
|
||||
//! The module provides `poly_circle()`, `poly_cylinder()` and `poly_ring()` that is useful for making printed washers and pillars.
|
||||
//
|
||||
function sides(r) = max(round(4 * r), 3); //! Optimium number of sides for specified radius
|
||||
function corrected_radius(r, n = 0) = r / cos(180 / (n ? n : sides(r))); //! Adjusted radius to make flats lie on the circle
|
||||
function corrected_diameter(d, n = 0) = d / cos(180 / (n ? n : sides(d / 2))); //! Adjusted diameter to make flats lie on the circle
|
||||
function sides(r) = max(round(4 * r), 3); //! Optimium number of sides for specified radius
|
||||
function corrected_radius(r, n = 0) = r / cos(180 / (n ? n : sides(r))); //! Adjusted radius to make flats lie on the circle
|
||||
function corrected_diameter(d, n = 0) = d / cos(180 / (n ? n : sides(d / 2))); //! Adjusted diameter to make flats lie on the circle
|
||||
|
||||
module poly_circle(r, sides = 0) { //! Make a circle adjusted to print the correct size
|
||||
n = sides ? sides : sides(r);
|
||||
@@ -38,8 +38,8 @@ module poly_cylinder(r, h, center = false, sides = 0) //! Make a cylinder adjust
|
||||
|
||||
module poly_ring(or, ir) { //! Make a 2D ring adjusted to have the correct internal radius
|
||||
cir = corrected_radius(ir);
|
||||
filaments = floor((or - cir) / extrusion_width);
|
||||
if(filaments > 3)
|
||||
filaments = (or - cir) / extrusion_width;
|
||||
if(filaments > 3 + eps)
|
||||
difference() {
|
||||
circle(or);
|
||||
|
||||
@@ -62,6 +62,10 @@ module poly_ring(or, ir) { //! Make a 2D ring adjusted to have the correct inter
|
||||
}
|
||||
}
|
||||
|
||||
module poly_tube(or, ir, h, center = false) //! Make a tube adjusted to have the correct internal radius
|
||||
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)
|
||||
circle(r = corrected_radius(r, r2sides(r)));
|
||||
|
@@ -34,6 +34,18 @@ module teardrop(h, r, center = true, truncate = true) //! For making horizontal
|
||||
polygon([[0, 0], [eps, 0], [0, r * sqrt(2)]]);
|
||||
}
|
||||
|
||||
module semi_teardrop(h, r, d = undef, center = true) //! A semi teardrop in the positive Y domain
|
||||
render(convexity = 5)
|
||||
extrude_if(h, center)
|
||||
intersection() {
|
||||
R = is_undef(d) ? r : d / 2;
|
||||
teardrop(r = R, h = 0);
|
||||
|
||||
sq = R + 1;
|
||||
translate([-sq, 0])
|
||||
square([2 * sq, sq]);
|
||||
}
|
||||
|
||||
module teardrop_plus(h, r, center = true, truncate = true) //! Slightly bigger teardrop to allow for the 3D printing staircase effect
|
||||
teardrop(h, r + layer_height / 4, center, truncate);
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//! Round 2D shapes uisng `offset()`, which is fast and 3D shapes with [`offset_3D()`](#offset), which is very slow.
|
||||
//! Round 2D shapes using `offset()`, which is fast and 3D shapes with [`offset_3D()`](#offset), which is very slow.
|
||||
//!
|
||||
//! A single radius can be specified or separate internal and external radii.
|
||||
//! If `chamfer_base` is `true` for `round_3D()` then the bottom edge is made suitable for 3D printing by chamfering once the
|
||||
|
@@ -61,7 +61,7 @@ function rotate_from_to(a, b) =
|
||||
//
|
||||
function calculate_twist(A, B) = let(D = transpose3(B) * A) atan2(D[1][0], D[0][0]);
|
||||
//
|
||||
// Compute a 4x4 matrix to orientate a frame of the sweep given the position and a 3x3 rotation matrix.
|
||||
// Compute a 4x3 matrix to orientate a frame of the sweep given the position and a 3x3 rotation matrix.
|
||||
//
|
||||
function orientate(p, r) =
|
||||
let(x = r[0], y = r[1], z = r[2])
|
||||
@@ -113,7 +113,7 @@ function skin_points(profile, path, loop, twist = 0) =
|
||||
|
||||
function cap(facets, segment = 0) = [for(i = [0 : facets - 1]) segment ? facets * segment + i : facets - 1 - i];
|
||||
|
||||
function quad(p, a,b,c,d) = norm(p[a] - p[c]) > norm(p[b] - p[d]) ? [[b, c, d], [b, d, a]] : [[a, b, c], [a, c, d]];
|
||||
function quad(p, a, b, c, d) = norm(p[a] - p[c]) > norm(p[b] - p[d]) ? [[b, c, d], [b, d, a]] : [[a, b, c], [a, c, d]];
|
||||
|
||||
function skin_faces(points, segs, facets, loop) = [for(i = [0 : facets - 1], s = [0 : segs - (loop ? 1 : 2)])
|
||||
each quad(points,
|
||||
|
@@ -47,6 +47,19 @@ LCD1602A = ["LCD1602A", "LCD display 1602A", 71.3, 24.3, 7.0, LCD1602APCB,
|
||||
[], // clearance need for the ts ribbon
|
||||
];
|
||||
|
||||
displays = [LCD1602A, HDMI5];
|
||||
SSD1963_4p3PCB = ["", "", 120, 74, 1.65, 3, 3, 0, "mediumblue", false, [[3, 3], [-3, 3], [-3, -3], [3, -3]],
|
||||
[ [2.75 + 1.27, 37, 90, "2p54header", 20, 2]
|
||||
],
|
||||
[]];
|
||||
|
||||
SSD1963_4p3 = ["SSD1963_4p3", "LCD display SSD1963 4.3\"", 105.5, 67.2, 3.4, SSD1963_4p3PCB,
|
||||
[0, 0, 0],
|
||||
[[-50, -26.5], [50, 31.5, 0.5]],
|
||||
[[-105.5 / 2, -65 / 2 + 1], [105.5 / 2, 65 / 2 + 1, 1]],
|
||||
0,
|
||||
[[0, -34.5], [12, -31.5]],
|
||||
];
|
||||
|
||||
displays = [HDMI5, SSD1963_4p3, LCD1602A];
|
||||
|
||||
use <display.scad>
|
||||
|
@@ -151,16 +151,16 @@ function nut_and_washer_thickness(screw, nyloc) = washer_thickness(screw_washer(
|
||||
function fan_screw_depth(type) = fan_boss_d(type) ? fan_depth(type) : fan_thickness(type);
|
||||
function fan_screw_length(type, thickness) = screw_longer_than(thickness + fan_screw_depth(type) + nut_and_washer_thickness(fan_screw(type), true)); //! Screw length required
|
||||
|
||||
module fan_assembly(type, thickness, include_fan = true) { //! Fan with its fasteners
|
||||
module fan_assembly(type, thickness, include_fan = true, screw = false) { //! Fan with its fasteners
|
||||
translate_z(-fan_depth(type) / 2) {
|
||||
if(include_fan)
|
||||
fan(type);
|
||||
|
||||
screw = fan_screw(type);
|
||||
nut = screw_nut(screw);
|
||||
Screw = screw ? screw : fan_screw(type);
|
||||
nut = screw_nut(Screw);
|
||||
fan_hole_positions(type) {
|
||||
translate_z(thickness)
|
||||
screw_and_washer(screw, fan_screw_length(type, thickness));
|
||||
screw_and_washer(Screw, fan_screw_length(type, thickness));
|
||||
|
||||
translate_z(include_fan ? -fan_screw_depth(type) : 0)
|
||||
vflip()
|
||||
|
183
vitamins/green_terminal.scad
Normal file
@@ -0,0 +1,183 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! Parametric green terminal blocks
|
||||
//
|
||||
include <../core.scad>
|
||||
use <../utils/tube.scad>
|
||||
|
||||
function gt_pitch(type) = type[1]; //! Pitch between terminals
|
||||
function gt_depth(type) = type[2]; //! Total front to back depth
|
||||
function gt_height(type) = type[3]; //! Height of the flat top
|
||||
function gt_top(type) = type[4]; //! Depth at the top
|
||||
function gt_front_height(type) = type[5]; //! Height at the front
|
||||
function gt_front_depth(type) = type[6]; //! Front ledge depth
|
||||
function gt_back_height(type) = type[7]; //! Height at the back
|
||||
function gt_back_depth(type) = type[8]; //! Back ledge depth
|
||||
function gt_screw_r(type) = type[9]; //! Screw head radius
|
||||
function gt_front_t(type) = type[10]; //! Thickness of frame around the front aperture
|
||||
function gt_box_w(type) = type[11]; //! Width inside the cable entry box
|
||||
function gt_box_h(type) = type[12]; //! Height of the cable entry box
|
||||
function gt_y_offset(type) = type[13]; //! Offset of the pins from centre of the depth
|
||||
function gt_y_offset2(type) = type[14]; //! Offset of the pins screws from the screws
|
||||
function gt_tube_h(type) = type[15]; //! Height of optional tubes around the screws
|
||||
|
||||
module green_terminal(type, ways, skip = []) { //! Draw green terminal blocks, skip can be used to remove pins.
|
||||
pitch = gt_pitch(type);
|
||||
|
||||
imperial = str(pitch / inch(1));
|
||||
vitamin(str("green_terminal(", type[0], ", ", ways, "): Terminal block ", ways, " way ", len(imperial) < 5 ? str(pitch / inch(1), "\"") : str(pitch, "mm")));
|
||||
width = ways * pitch;
|
||||
depth = gt_depth(type);
|
||||
height = gt_height(type);
|
||||
ledge_height = gt_front_height(type);
|
||||
ledge_depth = gt_front_depth(type);
|
||||
top = gt_top(type);
|
||||
back = gt_back_height(type);
|
||||
back_ledge = gt_back_depth(type);
|
||||
tube_h = gt_tube_h(type);
|
||||
module single(skip = false) {
|
||||
screw_r = gt_screw_r(type);
|
||||
box_w1 = pitch - 2 * gt_front_t(type);
|
||||
box_h1 = ledge_height - 2 * gt_front_t(type);
|
||||
box_w2 = gt_box_w(type);
|
||||
box_h2 = gt_box_h(type);
|
||||
y = gt_y_offset(type);
|
||||
y2 = gt_y_offset2(type);
|
||||
box_front = y + depth / 2 - 2;
|
||||
box_back = y - depth / 2 + 1;
|
||||
|
||||
module horizontal_section()
|
||||
difference() {
|
||||
translate([y, 0])
|
||||
square([depth, pitch], center = true);
|
||||
|
||||
translate([y + 1, 0])
|
||||
square([depth, box_w2], center = true);
|
||||
|
||||
translate([y + depth / 2, 0])
|
||||
hull() {
|
||||
square([1, box_w1], center = true);
|
||||
square([4, box_w2], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
color("lime") {
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(height = pitch, center = true, convexity = 5)
|
||||
polygon(points = [ // Vertical section
|
||||
[y + depth / 2, 0],
|
||||
[y + depth / 2, ledge_height / 2 - box_h1 / 2],
|
||||
[y + depth / 2 - 0.5, ledge_height / 2 - box_h1 / 2],
|
||||
[box_front, ledge_height / 2 - box_h2 / 2],
|
||||
[box_back, ledge_height / 2 - box_h2 / 2],
|
||||
[box_back, ledge_height / 2 + box_h2 / 2],
|
||||
[box_front, ledge_height / 2 + box_h2 / 2],
|
||||
[y + depth / 2 - 0.5, ledge_height / 2 + box_h1 / 2],
|
||||
[y + depth / 2, ledge_height / 2 + box_h1 / 2],
|
||||
[y + depth / 2, ledge_height],
|
||||
[y + depth / 2 - ledge_depth, ledge_height],
|
||||
[y2 + top / 2, height],
|
||||
[y2 + screw_r + eps, height],
|
||||
[y2 + screw_r + eps, ledge_height / 2 + box_h2 / 2],
|
||||
[y2 - screw_r - eps, ledge_height / 2 + box_h2 / 2],
|
||||
[y2 - screw_r - eps, height],
|
||||
[y2 -top / 2, height],
|
||||
[y - depth / 2 + back_ledge, back],
|
||||
[y - depth / 2, back],
|
||||
[y - depth / 2, 0],
|
||||
]);
|
||||
|
||||
translate([y2, 0, ledge_height / 2 + box_h2 / 2]) // Screw socket
|
||||
linear_extrude(height = height - ledge_height / 2 - box_h2 / 2)
|
||||
difference() {
|
||||
square([screw_r * 2 + 0.1, pitch], center = true);
|
||||
|
||||
circle(screw_r);
|
||||
}
|
||||
|
||||
|
||||
linear_extrude(height = ledge_height)
|
||||
intersection() {
|
||||
horizontal_section();
|
||||
|
||||
translate([0, -5])
|
||||
square([10, 10]);
|
||||
}
|
||||
|
||||
linear_extrude(height = back)
|
||||
intersection() {
|
||||
horizontal_section();
|
||||
|
||||
translate([-10, -5])
|
||||
square([10, 10]);
|
||||
}
|
||||
|
||||
if(tube_h)
|
||||
translate([y2, 0, height])
|
||||
linear_extrude(height = tube_h - height)
|
||||
intersection() {
|
||||
ring(or = top / 2, ir = screw_r);
|
||||
|
||||
square([10, pitch], center = true);
|
||||
}
|
||||
|
||||
}
|
||||
if(!skip)
|
||||
color("silver") {
|
||||
slot_depth = 1;
|
||||
screw_top = height - 0.5;
|
||||
pin_l = 3.3;
|
||||
translate([y2, 0]) {
|
||||
translate_z(screw_top - 2 * slot_depth) // screw head
|
||||
cylinder(r = screw_r, h = slot_depth);
|
||||
|
||||
translate_z(screw_top - slot_depth) // screw head
|
||||
linear_extrude(height = slot_depth)
|
||||
difference() {
|
||||
circle(screw_r);
|
||||
|
||||
square([10, screw_r / 4], center = true);
|
||||
}
|
||||
}
|
||||
translate([box_back, 0, ledge_height / 2]) {
|
||||
rotate([0, 90, 0])
|
||||
linear_extrude(height = box_front - box_back)
|
||||
difference() {
|
||||
square([box_h2, box_w2], center = true);
|
||||
|
||||
square([box_h2 - 0.1, box_w2 - 0.1], center = true);
|
||||
|
||||
}
|
||||
|
||||
cube([1, box_w2, box_h2], center = true); // terminal back
|
||||
}
|
||||
|
||||
translate_z(-pin_l)
|
||||
cube([0.44, 0.75, pin_l]); // pin
|
||||
}
|
||||
}
|
||||
for(i = [0: ways - 1])
|
||||
translate([0, i * pitch - width / 2 + pitch / 2])
|
||||
single(in(skip, i));
|
||||
}
|
||||
|
||||
module terminal_254(ways, skip = []) //! Draw 0.1" terminal block
|
||||
green_terminal(gt_2p54, ways, skip);
|
27
vitamins/green_terminals.scad
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Green terminal blocks
|
||||
//
|
||||
gt_2p54 = ["gt_2p54", 2.54, 6.6, 10, 3, 6, 0.4, 6.4, 1, 1, 0.2, 2, 2, 0, 0, 0];
|
||||
gt_3p5 = ["gt_3p5", 3.5, 7.3, 8.5, 4, 5, 0.4, 4, 0, 1.35, 0.4, 1.8, 2, 0, 0, 0];
|
||||
gt_6p35 = ["gt_6p35", 6.35, 12.6, 17.4, 6.8, 12, 0.4, 11, 2, 2.7, 0.8, 3.4, 4.2, 1.8, 1.1, 21.4];
|
||||
|
||||
green_terminals = [gt_2p54, gt_3p5, gt_6p35];
|
||||
|
||||
use <green_terminal.scad>
|
@@ -30,23 +30,25 @@ include <inserts.scad>
|
||||
function iec_part(type) = type[1]; //! Description
|
||||
function iec_screw(type) = type[2]; //! Screw type
|
||||
function iec_pitch(type) = type[3]; //! Screw hole pitch
|
||||
function iec_slot_w(type) = type[4]; //! Body width
|
||||
function iec_slot_h(type) = type[5]; //! Body height
|
||||
function iec_slot_r(type) = type[6]; //! Body corner radius
|
||||
function iec_bezel_w(type) = type[7]; //! Bezel width
|
||||
function iec_bezel_h(type) = type[8]; //! Bezel height
|
||||
function iec_bezel_r(type) = type[9]; //! Bezel corner radius
|
||||
function iec_bezel_t(type) = type[10]; //! Bezel thickness
|
||||
function iec_flange_w(type) = type[11]; //! Flange width not including the lugs
|
||||
function iec_flange_h(type) = type[12]; //! Flange height
|
||||
function iec_flange_r(type) = type[13]; //! Flange corner radius
|
||||
function iec_flange_t(type) = type[14]; //! Flange thickness
|
||||
function iec_width(type) = type[15]; //! Widest part including the lugs
|
||||
function iec_depth(type) = type[16]; //! Depth of the body below the flange
|
||||
function iec_spades(type) = type[17]; //! Spade type
|
||||
function iec_male(type) = type[18]; //! True for an outlet
|
||||
function iec_body_w(type) = type[4]; //! Body width
|
||||
function iec_body_w2(type) = type[5]; //! Body width at the narrow part
|
||||
function iec_body_h(type) = type[6]; //! Body height
|
||||
function iec_body_r(type) = type[7]; //! Body corner radius
|
||||
function iec_bezel_w(type) = type[8]; //! Bezel width
|
||||
function iec_bezel_h(type) = type[9]; //! Bezel height
|
||||
function iec_bezel_r(type) = type[10]; //! Bezel corner radius
|
||||
function iec_bezel_t(type) = type[11]; //! Bezel thickness
|
||||
function iec_flange_w(type) = type[12]; //! Flange width not including the lugs
|
||||
function iec_flange_h(type) = type[13]; //! Flange height
|
||||
function iec_flange_r(type) = type[14]; //! Flange corner radius
|
||||
function iec_flange_t(type) = type[15]; //! Flange thickness
|
||||
function iec_width(type) = type[16]; //! Widest part including the lugs
|
||||
function iec_depth(type) = type[17]; //! Depth of the body below the flange
|
||||
function iec_spades(type) = type[18]; //! Spade type
|
||||
function iec_male(type) = type[19]; //! True for an outlet
|
||||
|
||||
insert_overlap = 1.1; // chosen to make cap screws 10mm long.
|
||||
insert_screw_length = 10;
|
||||
function iec_insert_screw_length() = insert_screw_length; //! Screw length used for inserts
|
||||
|
||||
module iec(type) { //! Draw specified IEC connector
|
||||
vitamin(str("iec(", type[0], "): ", iec_part(type)));
|
||||
@@ -67,10 +69,10 @@ module iec(type) { //! Draw specified IEC connector
|
||||
cube([pin_w, pin_d, h - pin_chamfer], center = true);
|
||||
}
|
||||
|
||||
socket_w = 24;
|
||||
socket_w = 24.5;
|
||||
socket_w2 = 14;
|
||||
socket_h = 16.5;
|
||||
socket_h2 = 12;
|
||||
socket_h = 16.34;
|
||||
socket_h2 = socket_h - (socket_w - socket_w2);
|
||||
socket_d = 17;
|
||||
socket_r = 3;
|
||||
socket_r2 = 0.5;
|
||||
@@ -82,7 +84,7 @@ module iec(type) { //! Draw specified IEC connector
|
||||
translate([side * (socket_w / 2 - socket_r), -socket_h / 2 + socket_r])
|
||||
circle(socket_r);
|
||||
|
||||
translate([side * (socket_w / 2 - socket_r2), -socket_h / 2 + socket_h2 + socket_r2])
|
||||
translate([side * (socket_w / 2 - socket_r2), socket_h2 / 2 - socket_r2])
|
||||
circle(socket_r2);
|
||||
|
||||
translate([side * (socket_w2 / 2 - socket_r2), socket_h / 2 - socket_r2])
|
||||
@@ -93,7 +95,7 @@ module iec(type) { //! Draw specified IEC connector
|
||||
translate([0, socket_offset])
|
||||
if(iec_male(type))
|
||||
difference() {
|
||||
offset(3)
|
||||
offset(2)
|
||||
socket_shape();
|
||||
|
||||
difference() {
|
||||
@@ -110,6 +112,28 @@ module iec(type) { //! Draw specified IEC connector
|
||||
else
|
||||
socket_shape();
|
||||
|
||||
module body_shape() {
|
||||
hull() {
|
||||
bw = iec_body_w(type);
|
||||
bh = iec_body_h(type);
|
||||
br = iec_body_r(type);
|
||||
bw2 = iec_body_w2(type);
|
||||
bh2 = bh - (bw - bw2);
|
||||
br2 = 1;
|
||||
|
||||
for(side = [-1, 1]) {
|
||||
translate([side * (bw / 2 - br), -bh / 2 + br])
|
||||
circle4n(br);
|
||||
|
||||
translate([side * (bw / 2 - br2), bh2 / 2 - br2])
|
||||
circle4n(br2);
|
||||
|
||||
translate([side * (bw2 / 2 - br2), bh / 2 - br2])
|
||||
circle4n(br2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
color(grey20) {
|
||||
// Flange
|
||||
flange_t = iec_flange_t(type);
|
||||
@@ -152,12 +176,14 @@ module iec(type) { //! Draw specified IEC connector
|
||||
translate_z(-h)
|
||||
linear_extrude(height = h)
|
||||
difference() {
|
||||
rounded_square([iec_slot_w(type), iec_slot_h(type)], iec_slot_r(type));
|
||||
body_shape();
|
||||
|
||||
oriffice_shape();
|
||||
}
|
||||
// Back
|
||||
translate_z(-iec_depth(type))
|
||||
rounded_rectangle([iec_slot_w(type), iec_slot_h(type), iec_depth(type) - h], iec_slot_r(type), center = false);
|
||||
linear_extrude(height = iec_depth(type) - h)
|
||||
body_shape();
|
||||
}
|
||||
if(!iec_male(type))
|
||||
translate([0, socket_offset, iec_flange_t(type) + iec_bezel_t(type) - socket_d]) {
|
||||
@@ -174,6 +200,8 @@ module iec(type) { //! Draw specified IEC connector
|
||||
spade(spade[0], spade[1]);
|
||||
}
|
||||
|
||||
function iec_spade_depth(type) = iec_depth(type) + max([for(spade = iec_spades(type)) spade[1]]);
|
||||
|
||||
module iec_screw_positions(type) //! Position children at the screw holes
|
||||
for(side = [-1, 1])
|
||||
translate([side * iec_pitch(type) / 2, 0])
|
||||
@@ -181,36 +209,49 @@ module iec_screw_positions(type) //! Position children at the screw holes
|
||||
|
||||
module iec_holes(type, h = 100, poly = false, horizontal = false, insert = false) { //! Drill the required panel holes
|
||||
clearance = 0.2;
|
||||
screw = iec_screw(type);
|
||||
insert_type = screw_insert(screw);
|
||||
insert_overlap = max(0, insert_screw_length + clearance - iec_flange_t(type) - insert_hole_length(insert_type));
|
||||
|
||||
iec_screw_positions(type)
|
||||
if(insert)
|
||||
insert_hole(screw_insert(iec_screw(type)), insert_overlap, horizontal = horizontal);
|
||||
if(h)
|
||||
insert_hole(insert_type, insert_overlap, horizontal = horizontal);
|
||||
else
|
||||
poly_circle(insert_hole_radius(insert_type));
|
||||
else
|
||||
if(horizontal)
|
||||
teardrop_plus(r = screw_clearance_radius(iec_screw(type)), h = h);
|
||||
teardrop_plus(r = screw_clearance_radius(screw), h = h);
|
||||
else
|
||||
if(poly)
|
||||
poly_cylinder(r = screw_clearance_radius(iec_screw(type)), h = h, center = true);
|
||||
poly_cylinder(r = screw_clearance_radius(screw), h = h, center = true);
|
||||
else
|
||||
drill(screw_clearance_radius(iec_screw(type)), h);
|
||||
drill(screw_clearance_radius(screw), h);
|
||||
|
||||
extrude_if(h)
|
||||
hull()
|
||||
for(x = [-1, 1], y = [-1, 1], sag = horizontal && y > 1 ? layer_height : 0)
|
||||
translate([x * (iec_slot_w(type) / 2 - iec_slot_r(type)), y * (iec_slot_h(type) / 2 - iec_slot_r(type) + sag )])
|
||||
translate([x * (iec_body_w(type) / 2 - iec_body_r(type)), y * (iec_body_h(type) / 2 - iec_body_r(type) + sag )])
|
||||
if(horizontal)
|
||||
teardrop(0, iec_slot_r(type) + clearance / 2 + layer_height / 4);
|
||||
teardrop(0, iec_body_r(type) + clearance / 2 + layer_height / 4);
|
||||
else
|
||||
drill(iec_slot_r(type) + clearance / 2, 0);
|
||||
drill(iec_body_r(type) + clearance / 2, 0);
|
||||
}
|
||||
|
||||
module iec_assembly(type, thickness) { //! Assembly with fasteners given panel thickness
|
||||
module iec_inserts(type) { //! Place the inserts
|
||||
insert = screw_insert(iec_screw(type));
|
||||
|
||||
iec_screw_positions(type)
|
||||
insert(insert);
|
||||
}
|
||||
|
||||
module iec_assembly(type, thickness) { //! Assembly with fasteners given panel thickness
|
||||
screw = iec_screw(type);
|
||||
washer = screw_washer(screw);
|
||||
nut = screw_nut(screw);
|
||||
insert = screw_insert(screw);
|
||||
screw_length = thickness ? screw_longer_than(iec_flange_t(type) + thickness + washer_thickness(washer) + nut_thickness(nut, true))
|
||||
: screw_shorter_than(iec_flange_t(type) + insert_hole_length(insert) + insert_overlap);
|
||||
: insert_screw_length;
|
||||
|
||||
iec(type);
|
||||
|
||||
@@ -222,7 +263,5 @@ module iec_assembly(type, thickness) { //! Assembly with fasteners given panel t
|
||||
translate_z(-thickness)
|
||||
vflip()
|
||||
nut_and_washer(nut, true);
|
||||
else
|
||||
insert(insert);
|
||||
}
|
||||
}
|
||||
|
@@ -19,29 +19,43 @@
|
||||
include <screws.scad>
|
||||
include <spades.scad>
|
||||
|
||||
fused_spades = [[spade6p4, 14, -7, 0, 0],
|
||||
[spade6p4, 14, 7, 0, 0],
|
||||
[spade6p4, 14, 0, 11, 0],
|
||||
fused_spades = [[spade4p8, 8.5, 7, 3, 90],
|
||||
[spade4p8, 8.5, 0, 7, 90],
|
||||
[spade4p8, 8.5, 5, -7, 90]];
|
||||
|
||||
fused_spades2 = [[spade6p4, 13, -7, 0, 0],
|
||||
[spade6p4, 13, 7, 0, 0],
|
||||
[spade6p4, 13, 0, 11, 0],
|
||||
[spade4p8, 8.5, -7, -9, 90],
|
||||
[spade4p8, 8.5, 7, -9, 90]];
|
||||
|
||||
inlet_spades = [[spade6p4, 9, -7, -5.5, 0],
|
||||
[spade6p4, 9, 7, -5.5, 0],
|
||||
[spade6p4, 9, 0, 5.5, 0]];
|
||||
//
|
||||
// p s p s s s b b b b f f f f w d s m
|
||||
// a c i l l l e e e e l l l l i e p a
|
||||
// r r t o o o z z z z a a a a d p a l
|
||||
// t e c t t t e e e e n n n n t t d e
|
||||
// w h l l l l g g g g h h e
|
||||
// w h r e e e e s
|
||||
// w h r t
|
||||
// w h r t
|
||||
//
|
||||
IEC_fused_inlet = ["IEC_fused_inlet", "IEC fused inlet", M3_cs_cap_screw, 36, 27.3, 31.2, 3, 28, 31, 2, 2.5, 30, 33, 4, 2.5, 44, 21, fused_spades, false ];
|
||||
IEC_inlet = ["IEC_inlet", "IEC inlet", M3_cs_cap_screw, 40, 28.2, 20.2, 3, 28, 20.5, 4, 2.5, 37, 23, 1, 2.5, 48, 14, inlet_spades, false ];
|
||||
IEC_inlet_atx = ["IEC_inlet_atx", "IEC inlet for ATX", M3_cs_cap_screw, 40, 27.0, 19.0, 3, 30, 22, 2, 2.0, 30, 22, 2, 4.0, 50, 13, inlet_spades, false ];
|
||||
IEC_outlet = ["IEC_outlet", "IEC outlet", M3_cs_cap_screw, 40, 32, 24, 3, 28, 20.5, 2, 0.0, 29, 29, 2, 2.9, 50, 23, inlet_spades, true ];
|
||||
|
||||
iecs = [IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_outlet];
|
||||
atx_spades = [[spade3p5, 8, -7, -3, 90],
|
||||
[spade3p5, 8, 7, -3, 90],
|
||||
[spade3p5, 8, 0, 3, 90]];
|
||||
|
||||
outlet_spades = [[spade4p8ll, 8, -7, -2, 90],
|
||||
[spade4p8ll, 8, 7, -2, 90],
|
||||
[spade4p8ll, 8, 0, 2, 90]];
|
||||
|
||||
//
|
||||
// p s p b b b b b b b b f f f f w d s m
|
||||
// a c i o o o o e e e e l l l l i e p a
|
||||
// r r t d d d d z z z z a a a a d p a l
|
||||
// t e c y y y y e e e e n n n n t t d e
|
||||
// w h l l l l g g g g h h e
|
||||
// w w h r e e e e s
|
||||
// 2 w h r t
|
||||
// w h r t
|
||||
IEC_fused_inlet = ["IEC_fused_inlet", "IEC fused inlet JR-101-1F", M3_cs_cap_screw, 36, 27, 16, 31, 3, 28, 31, 2, 2.0, 30, 33, 4, 3.0, 44, 15, fused_spades, false ];
|
||||
IEC_fused_inlet2= ["IEC_fused_inlet2","IEC fused inlet old", M3_cs_cap_screw, 36, 27, 14, 31, 3, 28, 31, 2, 2.5, 30, 33, 4, 2.5, 44, 18, fused_spades2, false ];
|
||||
|
||||
IEC_inlet = ["IEC_inlet", "IEC inlet", M3_cs_cap_screw, 40, 28, 18, 20, 3, 28, 20.5, 4, 2.5, 37, 23, 1, 2.5, 48, 14, inlet_spades, false ];
|
||||
IEC_inlet_atx = ["IEC_inlet_atx", "IEC inlet for ATX", M3_cs_cap_screw, 40, 27, 18, 19, 3, 30.5, 22, 2, 2.0, 30.5, 22, 2, 4.0, 50, 15, atx_spades, false ];
|
||||
IEC_outlet = ["IEC_outlet", "IEC outlet RS 811-7193", M3_cs_cap_screw, 40, 32, 18, 24, 3, 28, 20.5, 2, 0.0, 29, 29, 2, 2.8, 50, 23, outlet_spades, true ];
|
||||
|
||||
iecs = [IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_fused_inlet2, IEC_outlet];
|
||||
use <iec.scad>
|
||||
|
@@ -94,12 +94,14 @@ module insert_hole(type, counterbore = 0, horizontal = false) { //! Make a hole
|
||||
}
|
||||
|
||||
module insert_boss(type, z, wall = 2 * extrusion_width) { //! Make a boss to take an insert
|
||||
difference() {
|
||||
ir = insert_hole_radius(type);
|
||||
linear_extrude(height = z)
|
||||
poly_ring(corrected_radius(ir) + wall, insert_screw_diameter(type) / 2 + 0.1);
|
||||
render(convexity = 3)
|
||||
difference() {
|
||||
ir = insert_hole_radius(type);
|
||||
linear_extrude(height = z)
|
||||
hull()
|
||||
poly_ring(corrected_radius(ir) + wall, ir);
|
||||
|
||||
translate_z(z)
|
||||
insert_hole(type, max(0, z - insert_hole_length(type) - 2 * layer_height));
|
||||
}
|
||||
translate_z(z)
|
||||
insert_hole(type, max(0, z - insert_hole_length(type) - 2 * layer_height));
|
||||
}
|
||||
}
|
||||
|
@@ -31,4 +31,4 @@ LED10mm = ["LED10mm", 10, 11.0, 2.0, 13.5, 2.54, 0.4];
|
||||
|
||||
LEDs = [LED3mm, LED5mm, LED10mm];
|
||||
|
||||
use <LED.scad>
|
||||
use <led.scad>
|
||||
|
@@ -25,7 +25,7 @@
|
||||
//! Uses STL files copyright geekammo and licenced with MIT license, see [microview/LICENSE.txt](vitamins/microview/LICENSE.txt).
|
||||
//
|
||||
include <../core.scad>
|
||||
use <pcb.scad> // for pin
|
||||
include <pin_headers.scad>
|
||||
|
||||
panel_clearance = 0.2;
|
||||
|
||||
@@ -54,6 +54,6 @@ module microview(cutout = false) { //! Draw microview or generate a panel cutou
|
||||
|
||||
for(side = [-1, 1], i = [0 : 7])
|
||||
translate([side * inch(0.35), (i - 3.5) * inch(0.1)])
|
||||
pin();
|
||||
pin(2p54header);
|
||||
}
|
||||
}
|
||||
|
@@ -25,6 +25,9 @@ panel_clearance = 0.2;
|
||||
include <../core.scad>
|
||||
include <screws.scad>
|
||||
include <buttons.scad>
|
||||
include <green_terminals.scad>
|
||||
include <pin_headers.scad>
|
||||
|
||||
use <../utils/rounded_cylinder.scad>
|
||||
use <../utils/dogbones.scad>
|
||||
use <../utils/tube.scad>
|
||||
@@ -53,8 +56,8 @@ module pcb_grid(type, x, y, z = 0) //! Positions children at specified grid pos
|
||||
|
||||
// allows negative ordinates to represent offsets from the far edge
|
||||
function pcb_coord(type, p) = let(l = pcb_length(type), w = pcb_width(type)) //! Convert offsets from the edge to coordinates relative to the centre
|
||||
[(p.x > 0 ? p.x : l + p.x) - l / 2,
|
||||
(p.y > 0 ? p.y : w + p.y) - w / 2];
|
||||
[(p.x >= 0 ? p.x : l + p.x) - l / 2,
|
||||
(p.y >= 0 ? p.y : w + p.y) - w / 2];
|
||||
|
||||
module pcb_screw_positions(type) { //! Positions children at the mounting hole positions
|
||||
holes = pcb_holes(type);
|
||||
@@ -66,145 +69,10 @@ module pcb_screw_positions(type) { //! Positions children at the mounting hole p
|
||||
children();
|
||||
}
|
||||
}
|
||||
// p p b p p b
|
||||
// i i e i i a
|
||||
// t n l n n s
|
||||
// c o e
|
||||
// h l w w c
|
||||
// c
|
||||
//
|
||||
2p54header = ["2p54header", 2.54, 12, 3.2, 0.66, "gold", grey20, 8.5];
|
||||
|
||||
function hdr_pitch(type) = type[1]; //! Header pitch
|
||||
function hdr_pin_length(type) = type[2]; //! Header pin length
|
||||
function hdr_pin_below(type) = type[3]; //! Header pin length underneath
|
||||
function hdr_pin_width(type) = type[4]; //! Header pin size
|
||||
function hdr_pin_colour(type) = type[5]; //! Header pin colour
|
||||
function hdr_base_colour(type) = type[6]; //! Header insulator colour
|
||||
function hdr_socket_depth(type) = type[7]; //! Socket depth for female housing
|
||||
|
||||
module pin(type = 2p54header, length = undef) { //! Draw a header pin
|
||||
w = hdr_pin_width(type);
|
||||
l = length == undef ? hdr_pin_length(type) : length;
|
||||
chamfer = w / 2;
|
||||
color(hdr_pin_colour(type))
|
||||
translate_z(l / 2 -hdr_pin_below(type))
|
||||
hull() {
|
||||
cube([w, w, l - 2 * chamfer], center = true);
|
||||
|
||||
cube([w - chamfer, w - chamfer, l], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_header(type = 2p54header, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw pin header
|
||||
pitch = hdr_pitch(type);
|
||||
h = pitch;
|
||||
|
||||
if(cutout)
|
||||
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
|
||||
else
|
||||
vitamin(str("pin_header(", type[0], cols, rows, arg(smt, false, "smt"), "): Pin header ", cols, " x ", rows));
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type);
|
||||
|
||||
color(hdr_base_colour(type))
|
||||
linear_extrude(height = h)
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), pitch / 2])
|
||||
hull() {
|
||||
chamfer = pitch / 4;
|
||||
square([pitch + eps, pitch - chamfer], center = true);
|
||||
|
||||
square([pitch - chamfer, pitch + eps], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module idc_transition(type, cols = 5, skip = [], cutout = false) { //! Draw IDC transition header
|
||||
rows = 2;
|
||||
pitch = hdr_pitch(type);
|
||||
height = 7.4;
|
||||
width = 6;
|
||||
length = cols * pitch + 5.08;
|
||||
if(cutout)
|
||||
;
|
||||
else {
|
||||
vitamin(str("idc_transition(", type[0], ", ", cols, "): IDC transition header ", cols, " x ", rows));
|
||||
|
||||
color(hdr_base_colour(type))
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(height = width, center = true, convexity = cols * rows)
|
||||
difference() {
|
||||
translate([0, height / 2])
|
||||
square([length, height], center = true);
|
||||
|
||||
for(i = [0 : cols * rows - 1])
|
||||
translate([pitch / 2 * (i - (cols * rows - 1) / 2), height / 2])
|
||||
circle(d = pitch / 2 + eps);
|
||||
|
||||
slot = pitch / 3;
|
||||
translate([0, height / 2 - pitch / 4 + slot / 2])
|
||||
square([cols * pitch, slot], center = true);
|
||||
}
|
||||
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1])
|
||||
if(!in(skip, x))
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, 2);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_socket(type = 2p54header, cols = 1, rows = 1, right_angle = false, height = 0, cutout = false) { //! Draw pin socket
|
||||
pitch = hdr_pitch(type);
|
||||
length = pitch * cols + 0.5;
|
||||
width = pitch * rows - 0.08;
|
||||
depth = max(hdr_socket_depth(type), height);
|
||||
ra_offset = 1.5;
|
||||
if(cutout)
|
||||
;
|
||||
else {
|
||||
vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"),
|
||||
"): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : ""));
|
||||
color(hdr_base_colour(type))
|
||||
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
|
||||
rotate([right_angle ? 90 : 0, 0, 0])
|
||||
translate_z(depth / 2)
|
||||
linear_extrude(height = depth, center = true)
|
||||
difference() {
|
||||
square([length, width], center = true);
|
||||
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)])
|
||||
square(hdr_pin_width(type), center = true);
|
||||
}
|
||||
|
||||
color(hdr_pin_colour(type))
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1]) {
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, hdr_pin_below(type) + width / 2 + (y - 0.5) * pitch);
|
||||
|
||||
if(right_angle) {
|
||||
rotate([-90, 0, 0])
|
||||
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) -width / 2, 0])
|
||||
pin(type, hdr_pin_below(type) + (y - 0.5) * pitch);
|
||||
|
||||
w = hdr_pin_width(type);
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
|
||||
rotate([0, -90, 0])
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
translate([0, -w / 2])
|
||||
square(w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module chip(length, width, thickness, cutout = false) //! Draw a black cube to represent a chip
|
||||
module chip(length, width, thickness, colour, cutout = false) //! Draw a coloured cube to represent a chip, or other rectangular component
|
||||
if(!cutout)
|
||||
color(grey20)
|
||||
color(colour)
|
||||
translate_z(thickness / 2) cube([length, width, thickness], center = true);
|
||||
|
||||
module usb_Ax2(cutout = false) { //! Draw USB type A dual socket
|
||||
@@ -552,6 +420,40 @@ module barrel_jack(cutout = false) { //! Draw barrel power jack
|
||||
}
|
||||
}
|
||||
|
||||
module uSD(size, cutout = false) { //! Draw uSD socket
|
||||
min_w = 12;
|
||||
w = size.x - min_w;
|
||||
t = 0.15;
|
||||
|
||||
if(cutout)
|
||||
;
|
||||
else
|
||||
translate_z(size.z / 2) {
|
||||
color("silver")
|
||||
rotate([90, 0, 90]) {
|
||||
linear_extrude(height = size.y, center = true)
|
||||
difference() {
|
||||
square([size.x, size.z], center = true);
|
||||
square([size.x - 2 * t, size.z - 2 * t], center = true);
|
||||
}
|
||||
|
||||
translate_z(-size.y / 2 + t / 2)
|
||||
cube([size.x, size.z, t], center = true);
|
||||
}
|
||||
if(w > 0)
|
||||
color(grey20)
|
||||
rotate([90, 0, 90])
|
||||
translate_z(t)
|
||||
linear_extrude(height = size.y - t, center = true)
|
||||
difference() {
|
||||
square([size.x - 2 * t, size.z - 2 * t], center = true);
|
||||
|
||||
translate([-size.x / 2 + min_w / 2 + 0.7, size.z / 2 - t])
|
||||
square([min_w, 2.2], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module flex(cutout = false) { //! Draw flexistrip connector
|
||||
l = 20.6;
|
||||
w = 3;
|
||||
@@ -693,109 +595,6 @@ module terminal_35(ways) { //! Draw 3.5mm terminal block
|
||||
single();
|
||||
}
|
||||
|
||||
module terminal_254(ways, skip = []) { //! Draw 0.1" terminal block
|
||||
vitamin(str("terminal_254(", ways, "): Terminal block ", ways, " way 0.1\""));
|
||||
pitch = 2.54;
|
||||
width = ways * pitch;
|
||||
depth = 6.2;
|
||||
height = 8.5;
|
||||
ledge_height = 5;
|
||||
ledge_depth = 0.7;
|
||||
top = 3;
|
||||
back = 3;
|
||||
module single(skip = false) {
|
||||
screw_r = 1;
|
||||
box_w1 = pitch - 0.4;
|
||||
box_h1 = ledge_height - 0.4;
|
||||
box_w2 = 2;
|
||||
box_h2 = 2;
|
||||
color("lime") {
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(height = pitch, center = true, convexity = 5)
|
||||
polygon(points = [
|
||||
[ depth / 2, 0],
|
||||
[ depth / 2, ledge_height / 2 - box_h1 / 2],
|
||||
[ depth / 2 - 0.5, ledge_height / 2 - box_h1 / 2],
|
||||
[ depth / 2 - 2, ledge_height / 2 - box_h2 / 2],
|
||||
[-depth / 2 + 1, ledge_height / 2 - box_h2 / 2],
|
||||
[-depth / 2 + 1, ledge_height / 2 + box_h2 / 2],
|
||||
[ depth / 2 - 2, ledge_height / 2 + box_h2 / 2],
|
||||
[ depth / 2 - 0.5, ledge_height / 2 + box_h1 / 2],
|
||||
[ depth / 2, ledge_height / 2 + box_h1 / 2],
|
||||
[ depth / 2, ledge_height],
|
||||
[ depth / 2 - ledge_depth, ledge_height],
|
||||
[ top / 2, height],
|
||||
[ screw_r + eps, height],
|
||||
[ screw_r + eps, ledge_height / 2 + box_h2 / 2],
|
||||
[-screw_r - eps, ledge_height / 2 + box_h2 / 2],
|
||||
[-screw_r - eps, height],
|
||||
[ -top / 2, height],
|
||||
[-depth / 2, back],
|
||||
[-depth / 2, 0],
|
||||
]);
|
||||
|
||||
translate_z(ledge_height / 2 + box_h2 / 2)
|
||||
linear_extrude(height = height - ledge_height / 2 - box_h2 / 2)
|
||||
difference() {
|
||||
square([screw_r * 2 + 0.1, pitch], center = true);
|
||||
|
||||
circle(screw_r);
|
||||
}
|
||||
|
||||
linear_extrude(height = ledge_height)
|
||||
difference() {
|
||||
translate([0.5, 0])
|
||||
square([depth - 1, pitch], center = true);
|
||||
|
||||
|
||||
translate([depth / 2, 0]) {
|
||||
square([9, box_w2], center = true);
|
||||
|
||||
hull() {
|
||||
square([1, box_w1], center = true);
|
||||
square([4, box_w2], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!skip)
|
||||
color("silver")
|
||||
translate_z(1) {
|
||||
slot_depth = 1;
|
||||
screw_top = height - 1.5;
|
||||
pin_l = 3.3 + ledge_height / 2 - 2;
|
||||
translate_z(ledge_height / 2) // screw
|
||||
cylinder(r = 1, h = screw_top - slot_depth - ledge_height / 2);
|
||||
|
||||
translate_z(screw_top - slot_depth) // screw head
|
||||
linear_extrude(height = slot_depth)
|
||||
difference() {
|
||||
circle(1);
|
||||
square([4, 0.5], center = true);
|
||||
}
|
||||
|
||||
translate_z(ledge_height / 2 - 1)
|
||||
rotate([0, 90, 0])
|
||||
linear_extrude(height = 2, center = true)
|
||||
difference() {
|
||||
square([2, 2], center = true);
|
||||
|
||||
square([1.5, 1.9], center = true);
|
||||
|
||||
}
|
||||
|
||||
translate([-1.5, 0, ledge_height / 2 - 1]) // terminal back
|
||||
cube([1, 2, 2], center = true);
|
||||
|
||||
translate_z(ledge_height / 2 - 2 - pin_l / 2)
|
||||
cube([0.44, 0.75, pin_l], center = true); // pin
|
||||
}
|
||||
}
|
||||
for(i = [0: ways -1])
|
||||
translate([0, i * pitch - width / 2 + pitch / 2])
|
||||
single(in(skip, i));
|
||||
}
|
||||
|
||||
module molex_254(ways) { //! Draw molex header
|
||||
vitamin(str("molex_254(", ways, "): Molex KK header ", ways, " way"));
|
||||
pitch = 2.54;
|
||||
@@ -822,12 +621,27 @@ module molex_254(ways) { //! Draw molex header
|
||||
cube([0.44, 0.75, above + below], center = true);
|
||||
}
|
||||
|
||||
module standoff(h, d, h2, d2) {
|
||||
color("white") {
|
||||
cylinder(d = d, h = h);
|
||||
|
||||
hull() {
|
||||
translate_z(-(h2 - h) / 2 + d2 / 2)
|
||||
sphere(d = d2);
|
||||
|
||||
translate_z(h +(h2 - h) / 2 - d2 / 2)
|
||||
sphere(d = d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb component from description
|
||||
function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z);
|
||||
rotate(comp.z) {
|
||||
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], len(comp) > 5 ? comp[6] : false, cutouts);
|
||||
if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], len(comp) > 5 ? comp[6] : false, cutouts);
|
||||
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], comp[6], len(comp) > 7 ? comp[7] : 0, cutouts);
|
||||
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], cutouts);
|
||||
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], len(comp) > 7 ? comp[7] : grey30, cutouts);
|
||||
if(show(comp, "rj45")) rj45(cutouts);
|
||||
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
|
||||
if(show(comp, "usb_uA")) usb_uA(cutouts);
|
||||
@@ -838,13 +652,18 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
|
||||
if(show(comp, "flex")) flex(cutouts);
|
||||
if(show(comp, "D_plug")) if(!cutouts) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
|
||||
if(show(comp, "molex_hdr")) if(!cutouts) molex_254(comp[4]);
|
||||
if(show(comp, "term254")) if(!cutouts) terminal_254(comp[4], comp[5]);
|
||||
if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5]);
|
||||
if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5]);
|
||||
if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5]);
|
||||
if(show(comp, "term35")) if(!cutouts) terminal_35(comp[4]);
|
||||
if(show(comp, "transition")) if(!cutouts) idc_transition(2p54header, comp[4], comp[5]);
|
||||
if(show(comp, "block"))
|
||||
color(comp[7]) if(!cutouts) translate_z(comp[6] / 2) cube([comp[4], comp[5], comp[6]], center = true);
|
||||
else if(comp[8]) translate([-50, 0, comp[6] / 2 - panel_clearance]) cube([100, comp[5] + 2 * panel_clearance, comp[6] + 2 * panel_clearance], center = true);
|
||||
if(show(comp, "button_6mm")) square_button(button_6mm);
|
||||
if(show(comp, "pcb")) if(!cutouts) translate_z(comp[4]) pcb(comp[5]);
|
||||
if(show(comp, "standoff")) if(!cutouts) standoff(comp[4], comp[5], comp[6], comp[7]);
|
||||
if(show(comp, "uSD")) uSD(comp[4], cutouts);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,10 +28,168 @@ include <screws.scad>
|
||||
// s
|
||||
// s
|
||||
//
|
||||
DuetW = ["DuetW", "Duet WiFi electronics",
|
||||
123, 100, 1.6, 0, 4.2, 0, "mediumblue", false, [[119, 4], [119, 96], [4, 96],[4, 4]],
|
||||
[],
|
||||
Ethernet = ["Ethernet", "Duet Ethernet piggy back",
|
||||
33.8, 37.5, 1.6, 0, 2.54, 0, "#1D39AB", false, [[27.1, -6.3], [7.5, -2.7], [21.3, -31.1]],
|
||||
[[10.7, -13.1, 180, "rj45"],
|
||||
[7.75, -36.2, 0, "-2p54header", 6, 1],
|
||||
[7.75, -26.04, 0, "-2p54header", 6, 1],
|
||||
[27.1, -6.3, 0, "-standoff", 5, 4.5, 12.5, 2.54],
|
||||
[7.5, -2.70, 0, "-standoff", 5, 4.5, 12.5, 2.54],
|
||||
[21.3, -31.1, 0, "-standoff", 5, 4.5, 12.5, 2.54],
|
||||
],
|
||||
[]];
|
||||
DuetE = ["DuetE", "Duet 2 Ethernet electronics",
|
||||
123, 100, 1.6, 0, 4.2, 0, "#2140BE", false, [[-4, 4], [-4, -4], [4, -4],[4, 4]],
|
||||
[[ 18.5, -69.15, 0, "pcb", 5, Ethernet],
|
||||
[ 42.9, -3.2, 90, "molex_hdr", 4],
|
||||
[ 59.8, -3.2, 90, "molex_hdr", 4],
|
||||
[ 76.2, -3.2, 90, "molex_hdr", 4],
|
||||
[ 92.6, -3.2, 90, "molex_hdr", 4],
|
||||
[109.9, -3.2, 90, "molex_hdr", 4],
|
||||
[109.9, -9.6, 90, "molex_hdr", 4],
|
||||
|
||||
[119.7, -31, 0, "molex_hdr", 3],
|
||||
[119.7, -88.6, 0, "molex_hdr", 2],
|
||||
|
||||
[114.9, -75.1, 0, "gterm635", 2],
|
||||
[114.9, -43.5, 0, "gterm635", 2],
|
||||
|
||||
[ 39, -97, -90, "molex_hdr", 4],
|
||||
[ 27.9, -97, -90, "molex_hdr", 4],
|
||||
|
||||
[ 83.7, -38.7, -90, "molex_hdr", 3],
|
||||
[ 74.3, -40.7, -90, "molex_hdr", 3],
|
||||
[ 64.0, -40.7, -90, "molex_hdr", 3],
|
||||
[ 54.0, -40.7, -90, "molex_hdr", 3],
|
||||
[ 44.1, -40.7, -90, "molex_hdr", 3],
|
||||
[ 35.0, -40.7, -90, "molex_hdr", 2],
|
||||
[ 28.9, -40.7, -90, "molex_hdr", 2],
|
||||
|
||||
[103.0, -48.8, -90, "molex_hdr", 2],
|
||||
[ 97.0, -48.8, -90, "molex_hdr", 2],
|
||||
[ 90.3, -48.8, -90, "molex_hdr", 2],
|
||||
[ 84.1, -48.8, -90, "molex_hdr", 2],
|
||||
[ 77.9, -48.8, -90, "molex_hdr", 2],
|
||||
|
||||
[105.2, -54.9, 0, "2p54header", 2, 1],
|
||||
[ 98.4, -54.9, 0, "2p54header", 2, 1],
|
||||
[ 90.2, -54.9, 0, "2p54header", 3, 1],
|
||||
[ 61.7, -83.1, 0, "2p54header", 5, 2],
|
||||
|
||||
[ 29.5, -3.6, 90, "gterm35", 4],
|
||||
|
||||
[ 45.0, -70.8, 45, "chip", 19, 19, 1.5],
|
||||
[ 34.6, -18.8, 0, "chip", 10, 10, 2],
|
||||
[ 53.2, -18.8, 0, "chip", 10, 10, 2],
|
||||
[ 71.8, -18.8, 0, "chip", 10, 10, 2],
|
||||
[ 90.4, -18.8, 0, "chip", 10, 10, 2],
|
||||
[109.9, -22.0, 0, "chip", 10, 10, 2],
|
||||
|
||||
[105.8, -86.3, 0, "2p54boxhdr", 5, 2],
|
||||
[ 85.2, -86.3, 0, "2p54boxhdr", 5, 2],
|
||||
[ 79.9, -95.7, 180, "2p54boxhdr", 25, 2],
|
||||
|
||||
[ 2.0, -47.3, 180, "usb_uA"],
|
||||
[ 8.4, -63.3, 180, "uSD", [15, 14.5, 2]],
|
||||
|
||||
[ 2.2, -9.7, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E1 heater
|
||||
[ 2.2, -13.2, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E0 heater
|
||||
[ 2.2, -16.7, 0, "chip", inch(0.03), inch(0.06), 1, "blue"], // Vin
|
||||
[ 2.2, -20.2, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // 5V
|
||||
[ 2.2, -24.0, 0, "chip", inch(0.03), inch(0.06), 1, "green"], // 3.3V
|
||||
[ 1.8, -41.8, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // USB
|
||||
[ 2.3, -53.5, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // Diag
|
||||
[ 49.8, -2.0, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E1 stop
|
||||
[ 52.9, -2.0, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E0 stop
|
||||
[ 68.8, -2.4, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // X stop
|
||||
[ 85.4, -2.4, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // Y stop
|
||||
[101.6, -1.8, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // Z stop
|
||||
[109.8, -58.8, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // Bed heater
|
||||
|
||||
[ 2.3, -37.2, 0, "chip", 3.6, 4.8, 2.0, "silver"], // Reset switch
|
||||
[ 0.0, -37.2, 0, "chip", 2.0, 2.6, 1.4, grey20], // Reset button
|
||||
],
|
||||
[": Micro SD card", ": Cat 5 patch cable 300mm"]];
|
||||
|
||||
|
||||
Duex2 = ["Duex2", "Duex2 expansion board",
|
||||
123, 100, 1.6, 0, 4.2, 0, "#2140BE", false, [[-4, 4], [-4, -4], [4, -4],[4, 4]],
|
||||
[ [ 79.8, -4.3, 180, "2p54boxhdr", 25, 2],
|
||||
[ 27.8, -3.0, 0, "2p54header", 10, 1],
|
||||
|
||||
[ 45.7, -14.7, 0, "2p54header", 3, 1], // Endstop voltage select
|
||||
[ 34.8, -15.1, 0, "2p54header", 3, 2], // Fan voltage select
|
||||
[ 4.8, -55.2, 90, "2p54header", 1, 2], // 12V EN
|
||||
[ 59.5, -30.3, 0, "2p54header", 3, 1], // 5V Aux select
|
||||
[ 31.6, -41.4, 0, "2p54header", 2, 5], // SPIO
|
||||
|
||||
[ 4.7, -11.8, -90, "molex_hdr", 2], // Fan / LED 8
|
||||
[ 4.9, -23.9, -90, "molex_hdr", 2], // Fan / LED 7
|
||||
[ 12.0, -23.9, -90, "molex_hdr", 2], // Fan / LED 6
|
||||
[ 19.7, -23.9, -90, "molex_hdr", 2], // Fan / LED 5
|
||||
[ 27.3, -23.9, -90, "molex_hdr", 2], // Fan / LED 4
|
||||
[ 34.9, -23.9, -90, "molex_hdr", 2], // Fan / LED 3
|
||||
|
||||
[ 44.3, -23.9, -90, "molex_hdr", 3], // E6 stop
|
||||
[ 54.5, -23.9, -90, "molex_hdr", 3], // E5 stop
|
||||
[ 64.6, -23.9, -90, "molex_hdr", 3], // E4 stop
|
||||
[ 74.8, -23.9, -90, "molex_hdr", 3], // E3 stop
|
||||
[ 84.9, -23.9, -90, "molex_hdr", 3], // E2 stop
|
||||
|
||||
[ 57.0, -46.8, -90, "molex_hdr", 2], // E6 temp
|
||||
[ 64.6, -46.8, -90, "molex_hdr", 2], // E5 temp
|
||||
[ 57.0, -36.6, -90, "molex_hdr", 2], // E4 temp
|
||||
[ 64.6, -36.6, -90, "molex_hdr", 2], // E3 temp
|
||||
[ 72.2, -36.6, -90, "molex_hdr", 2], // E2 temp
|
||||
|
||||
[ 26.5, -58.2, -90, "molex_hdr", 3], // PWM_5
|
||||
[ 36.7, -58.2, -90, "molex_hdr", 3], // PWM_4
|
||||
[ 46.8, -58.2, -90, "molex_hdr", 3], // PWM_3
|
||||
[ 57.0, -58.2, -90, "molex_hdr", 3], // PWM_2
|
||||
[ 67.2, -58.2, -90, "molex_hdr", 3], // PWM_1
|
||||
|
||||
[ 83.2, -18.3, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E2 stop
|
||||
[ 74.5, -18.3, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E3 stop
|
||||
[ 63.8, -18.7, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E4 stop
|
||||
[ 54.7, -18.3, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E5 stop
|
||||
[ 44.3, -18.4, 90, "chip", inch(0.03), inch(0.06), 1, "red"], // E6 stop
|
||||
|
||||
[112.4, -15.5, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E2 heat
|
||||
[112.4, -22.9, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E3 heat
|
||||
[112.4, -29.1, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E4 heat
|
||||
[112.4, -36.1, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E5 heat
|
||||
[112.4, -43.4, 0, "chip", inch(0.03), inch(0.06), 1, "red"], // E6 heat
|
||||
|
||||
[118.6, -30.3, 0, "gterm35", 10], // Heaters
|
||||
[114.9, -56.5, 0, "gterm635", 2], // VIN
|
||||
[119.6, -69.0, 0, "molex_hdr", 2], // 5V AUX in
|
||||
[ 4.5, -49.4, 90, "molex_hdr", 2], // 12V
|
||||
|
||||
[110.7, -81.2, 0, "chip", 10, 10, 2],
|
||||
[ 86.1, -81.2, 0, "chip", 10, 10, 2],
|
||||
|
||||
[109.9, -96.8, -90, "molex_hdr", 4],
|
||||
[ 86.1, -96.8, -90, "molex_hdr", 4],
|
||||
|
||||
|
||||
|
||||
],
|
||||
[]];
|
||||
|
||||
Duex5 = ["Duex5", "Duex5 expasnion board",
|
||||
123, 100, 1.6, 0, 4.2, 0, "#2140BE", false, [[-4, 4], [-4, -4], [4, -4],[4, 4]],
|
||||
concat(Duex2[11], [
|
||||
[ 61.5, -81.2, 0, "chip", 10, 10, 2],
|
||||
[ 36.9, -81.2, 0, "chip", 10, 10, 2],
|
||||
[ 12.3, -81.2, 0, "chip", 10, 10, 2],
|
||||
|
||||
[ 61.5, -96.4, -90, "molex_hdr", 4],
|
||||
[ 36.9, -96.4, -90, "molex_hdr", 4],
|
||||
[ 14.3, -96.4, -90, "molex_hdr", 4],
|
||||
|
||||
]),
|
||||
[]];
|
||||
|
||||
|
||||
Melzi = ["Melzi", "Melzi electronics", 203.2, 49.53, 1.6, 3.81, 3.1, 6, "green", false, [[3.81, 3.81], [-3.81, 3.81], [-3.81, -3.81], [3.81, -3.81]],
|
||||
[],
|
||||
@@ -49,10 +207,11 @@ RPI3 = ["RPI3", "Raspberry Pi 3", 85, 56, 1.4, 3, 2.75, 6, "green"
|
||||
[10.6, 2, -90, "usb_uA"],
|
||||
[3.6, 28, 90, "flex"],
|
||||
[45, 11.5,-90, "flex"],
|
||||
[7.75, 28, 180, "-uSD", [12, 11.5, 1.28]],
|
||||
],
|
||||
[": Micro SD card"]];
|
||||
|
||||
ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "mediumblue", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],
|
||||
ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "#2140BE", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],
|
||||
[[30.226, -2.54, 0, "2p54socket", 10, 1],
|
||||
[54.61, -2.54, 0, "2p54socket", 8, 1],
|
||||
[36.83, 2.54, 0, "2p54socket", 8, 1],
|
||||
@@ -78,7 +237,7 @@ ArduinoUno3 = ["ArduinoUno3", "Arduino Uno R3", 68.58, 53.34, 1.6, 0, 3.3, 0, "m
|
||||
M2p5_pan_screw
|
||||
];
|
||||
|
||||
Keyes5p1 = ["Keyes5p1", "Keyes5.1 Arduino Uno expansion board", 68.58, 53.34, 1.6, 0, 3.3, 0, "mediumblue", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],
|
||||
Keyes5p1 = ["Keyes5p1", "Keyes5.1 Arduino Uno expansion board", 68.58, 53.34, 1.6, 0, 3.3, 0, "#2140BE", false, [[15.24, 50.8],[66.04, 35.56],[66.04, 7.62],[13.97, 2.54]],
|
||||
[[30.226, -2.54, 0, "-2p54header", 10, 1],
|
||||
[54.61, -2.54, 0, "-2p54header", 8, 1],
|
||||
[36.83, 2.54, 0, "-2p54header", 8, 1],
|
||||
@@ -128,6 +287,6 @@ PERF74x51 = ["PERF74x51", "Perfboard 74 x 51mm", 74, 51, 1.0, 0, 3.0, 0, "sienna
|
||||
|
||||
PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3.5, 3.5], [-3.5, 3.5], [-3.5, -3.5], [3.5, -3.5]], [], []];
|
||||
|
||||
pcbs = [ExtruderPCB, PI_IO, RPI3, ArduinoUno3, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetW, Melzi];
|
||||
pcbs = [ExtruderPCB, PI_IO, RPI3, ArduinoUno3, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi];
|
||||
|
||||
use <pcb.scad>
|
||||
|
184
vitamins/pin_header.scad
Normal file
@@ -0,0 +1,184 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
//! Pin headers and sockets, etc.
|
||||
include <../core.scad>
|
||||
use <../utils/dogbones.scad>
|
||||
|
||||
panel_clearance = 0.2;
|
||||
|
||||
function hdr_pitch(type) = type[1]; //! Header pitch
|
||||
function hdr_pin_length(type) = type[2]; //! Header pin length
|
||||
function hdr_pin_below(type) = type[3]; //! Header pin length underneath
|
||||
function hdr_pin_width(type) = type[4]; //! Header pin size
|
||||
function hdr_pin_colour(type) = type[5]; //! Header pin colour
|
||||
function hdr_base_colour(type) = type[6]; //! Header insulator colour
|
||||
function hdr_socket_depth(type) = type[7]; //! Socket depth for female housing
|
||||
|
||||
module pin(type, length = undef) { //! Draw a header pin
|
||||
w = hdr_pin_width(type);
|
||||
l = length == undef ? hdr_pin_length(type) : length;
|
||||
chamfer = w / 2;
|
||||
color(hdr_pin_colour(type))
|
||||
translate_z(l / 2 -hdr_pin_below(type))
|
||||
hull() {
|
||||
cube([w, w, l - 2 * chamfer], center = true);
|
||||
|
||||
cube([w - chamfer, w - chamfer, l], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw pin header
|
||||
pitch = hdr_pitch(type);
|
||||
h = pitch;
|
||||
|
||||
if(cutout)
|
||||
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
|
||||
else
|
||||
vitamin(str("pin_header(", type[0], cols, rows, arg(smt, false, "smt"), "): Pin header ", cols, " x ", rows));
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type);
|
||||
|
||||
color(hdr_base_colour(type))
|
||||
linear_extrude(height = h)
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), pitch / 2])
|
||||
hull() {
|
||||
chamfer = pitch / 4;
|
||||
square([pitch + eps, pitch - chamfer], center = true);
|
||||
|
||||
square([pitch - chamfer, pitch + eps], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module box_header(type, cols = 1, rows = 1, smt = false, cutout = false) { //! Draw box header
|
||||
pitch = hdr_pitch(type);
|
||||
w = cols * pitch + 7.62;
|
||||
l = rows * pitch + 3.52;
|
||||
h = 8.7;
|
||||
base = h - 6.4;
|
||||
|
||||
if(cutout)
|
||||
dogbone_rectangle([cols * pitch + 2 * panel_clearance, rows * pitch + 2 * panel_clearance, 100], center = false);
|
||||
else
|
||||
vitamin(str("box_header(", type[0], cols, rows, arg(smt, false, "smt"), "): Pin header ", cols, " x ", rows));
|
||||
|
||||
translate_z(smt ? 3.5 - h : 0) {
|
||||
for(x = [0 : cols - 1], y = [0 : rows - 1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type);
|
||||
|
||||
color(hdr_base_colour(type)) {
|
||||
linear_extrude(height = base)
|
||||
square([w, l], center = true);
|
||||
|
||||
linear_extrude(height = h)
|
||||
difference() {
|
||||
square([w, l], center = true);
|
||||
|
||||
square([w - 2.4, l - 2.4], center = true);
|
||||
|
||||
translate([0, -l / 2])
|
||||
square([4.5, 4.5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module idc_transition(type, cols = 5, skip = [], cutout = false) { //! Draw IDC transition header
|
||||
rows = 2;
|
||||
pitch = hdr_pitch(type);
|
||||
height = 7.4;
|
||||
width = 6;
|
||||
length = cols * pitch + 5.08;
|
||||
if(cutout)
|
||||
;
|
||||
else {
|
||||
vitamin(str("idc_transition(", type[0], ", ", cols, "): IDC transition header ", cols, " x ", rows));
|
||||
|
||||
color(hdr_base_colour(type))
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(height = width, center = true, convexity = cols * rows)
|
||||
difference() {
|
||||
translate([0, height / 2])
|
||||
square([length, height], center = true);
|
||||
|
||||
for(i = [0 : cols * rows - 1])
|
||||
translate([pitch / 2 * (i - (cols * rows - 1) / 2), height / 2])
|
||||
circle(d = pitch / 2 + eps);
|
||||
|
||||
slot = pitch / 3;
|
||||
translate([0, height / 2 - pitch / 4 + slot / 2])
|
||||
square([cols * pitch, slot], center = true);
|
||||
}
|
||||
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1])
|
||||
if(!in(skip, x))
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, 5);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, cutout = false) { //! Draw pin socket
|
||||
pitch = hdr_pitch(type);
|
||||
length = pitch * cols + 0.5;
|
||||
width = pitch * rows - 0.08;
|
||||
depth = max(hdr_socket_depth(type), height);
|
||||
ra_offset = 1.5;
|
||||
if(cutout)
|
||||
;
|
||||
else {
|
||||
vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"),
|
||||
"): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : ""));
|
||||
color(hdr_base_colour(type))
|
||||
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
|
||||
rotate([right_angle ? 90 : 0, 0, 0])
|
||||
translate_z(depth / 2)
|
||||
linear_extrude(height = depth, center = true)
|
||||
difference() {
|
||||
square([length, width], center = true);
|
||||
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1])
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2)])
|
||||
square(hdr_pin_width(type), center = true);
|
||||
}
|
||||
|
||||
color(hdr_pin_colour(type))
|
||||
for(x = [0 : cols - 1], y = [0 : rows -1]) {
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), 0])
|
||||
pin(type, hdr_pin_below(type) + width / 2 + (y - 0.5) * pitch);
|
||||
|
||||
if(right_angle) {
|
||||
rotate([-90, 0, 0])
|
||||
translate([pitch * (x - (cols - 1) / 2), -pitch * (y - (rows - 1) / 2) -width / 2, 0])
|
||||
pin(type, hdr_pin_below(type) + (y - 0.5) * pitch);
|
||||
|
||||
w = hdr_pin_width(type);
|
||||
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2) - w / 2, pitch * (y - (rows - 1) / 2) + width / 2 - w / 2])
|
||||
rotate([0, -90, 0])
|
||||
rotate_extrude(angle = 90, $fn = 32)
|
||||
translate([0, -w / 2])
|
||||
square(w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
vitamins/pin_headers.scad
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2018
|
||||
// nop.head@gmail.com
|
||||
// hydraraptor.blogspot.com
|
||||
//
|
||||
// This file is part of NopSCADlib.
|
||||
//
|
||||
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
|
||||
// GNU General Public License as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with NopSCADlib.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
// p p b p p b
|
||||
// i i e i i a
|
||||
// t n l n n s
|
||||
// c o e
|
||||
// h l w w c
|
||||
// c
|
||||
//
|
||||
2p54header = ["2p54header", 2.54, 12, 3.2, 0.66, "gold", grey20, 8.5];
|
||||
|
||||
pin_headers = [ 2p54header ];
|
||||
|
||||
use <pin_header.scad>
|
@@ -139,6 +139,8 @@ module psu_grill(width, height) {
|
||||
}
|
||||
}
|
||||
|
||||
function psu_terminal_block_z(type) = psu_face_cutouts(psu_faces(type)[f_left])[0][2].y + psu_height(type) / 2;
|
||||
|
||||
module psu(type) { //! Draw a power supply
|
||||
vitamin(str("psu(", type[0], "): PSU ", psu_name(type)));
|
||||
|
||||
@@ -242,7 +244,7 @@ module psu(type) { //! Draw a power supply
|
||||
rt = psu_face_thickness(faces[f_right]);
|
||||
lt = psu_face_thickness(faces[f_left]);
|
||||
cutout = psu_face_cutouts(faces[f_left])[0];
|
||||
z = cutout[2].y + h / 2;
|
||||
z = psu_terminal_block_z(type);
|
||||
pw = w -ft - bt;
|
||||
pl = l - right - rt;
|
||||
pcb_thickness = 1.6;
|
||||
|
@@ -20,15 +20,16 @@
|
||||
//
|
||||
// Ring terminals
|
||||
//
|
||||
// o i l w h t s
|
||||
// d d e i o h c
|
||||
// n d l i r
|
||||
// g t e c e
|
||||
// t h k w
|
||||
// h
|
||||
// o i l w h t s
|
||||
// d d e i o h c
|
||||
// n d l i r
|
||||
// g t e c e
|
||||
// t h k w
|
||||
// h
|
||||
//
|
||||
M3_ringterm = ["M3_ringterm", 6, 3, 12, 3, 1.5, 0.2, M3_dome_screw];
|
||||
M3_ringterm = ["M3_ringterm", 6, 3, 12, 3, 1.5, 0.2, M3_dome_screw];
|
||||
M3_ringterm_cs = ["M3_ringterm_cs", 6, 3, 12, 3, 1.5, 0.2, M3_cap_screw];
|
||||
|
||||
ring_terminals = [M3_ringterm];
|
||||
ring_terminals = [M3_ringterm, M3_ringterm_cs];
|
||||
|
||||
use <ring_terminal.scad>
|
||||
|
@@ -74,7 +74,7 @@ module sheet_2D(type, w, d, corners = [0, 0, 0, 0]) { //! 2D sheet template with
|
||||
}
|
||||
}
|
||||
|
||||
module sheet(type, w, d, corners = [0, 0, 0, 0]) //! Draw speified sheet
|
||||
module sheet(type, w, d, corners = [0, 0, 0, 0]) //! Draw specified sheet
|
||||
linear_extrude(height = sheet_thickness(type), center = true)
|
||||
sheet_2D(type, w, d, corners);
|
||||
|
||||
|
@@ -17,12 +17,13 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
spade3 = [3.8, 3.0, 0.4, 1.0, 3.9];
|
||||
spade6p4 = [8.3, 6.4, 0.8, 1.8, 8];
|
||||
spade4p8 = [6.4, 4.8, 0.5, 1.8, 8];
|
||||
spade4p8l = [7.0, 4.8, 0.5, 1.8, 8];
|
||||
spade4p8ll = [8.0, 4.8, 0.5, 1.8, 4.8];
|
||||
spade3 = [3.8, 3.0, 0.4, 1.0, 3.9];
|
||||
spade3p5 = [7.0, 3.5, 0.8, 1.75, 6.8];
|
||||
spade6p4 = [8.3, 6.4, 0.8, 1.8, 8];
|
||||
spade4p8 = [6.4, 4.8, 0.5, 1.8, 8];
|
||||
spade4p8l = [7.0, 4.8, 0.5, 1.8, 8];
|
||||
spade4p8ll = [8.0, 4.8, 0.5, 1.8, 4.8];
|
||||
|
||||
spades = [spade3, spade6p4, spade4p8, spade4p8l, spade4p8ll];
|
||||
spades = [spade3, spade3p5, spade6p4, spade4p8, spade4p8l, spade4p8ll];
|
||||
|
||||
use <spade.scad>
|
||||
|
@@ -30,6 +30,7 @@ function spool_hub_bore(type) = type[6]; //! Bore through the hub
|
||||
function spool_hub_diameter(type) = type[7]; //! Diameter of the thicker hub
|
||||
function spool_hub_taper(type) = type[8]; //! Diameter at which it tapers down to rim thickness
|
||||
function spool_height(type) = spool_width(type) + 2 * spool_hub_thickness(type); //! Outside width
|
||||
function spool_pitch(type) = spool_width(type) + spool_rim_thickness(type); //! Spacing of the rims
|
||||
|
||||
module spool(type) { //! Draw specified spool
|
||||
vitamin(str("spool(", type[0], "): Filament spool ", spool_diameter(type), " x ", spool_width(type)));
|
||||
|
@@ -23,10 +23,11 @@
|
||||
// i i e i u o u u
|
||||
// a d p m b r b b
|
||||
// t t e
|
||||
// h h t t d t
|
||||
// h h t t d taper_d
|
||||
spool_300x88 = ["spool_300x88", 300, 88, 43, 6, 8, 52, 214, 300];
|
||||
spool_300x85 = ["spool_300x85", 300, 85, 60, 4, 8, 52, 250, 280];
|
||||
spool_200x55 = ["spool_200x55", 200, 55, 40, 5, 5, 52, 200, 200];
|
||||
|
||||
spools = [spool_200x55, spool_300x85];
|
||||
spools = [spool_200x55, spool_300x85, spool_300x88];
|
||||
|
||||
use <spool.scad>
|
||||
|
@@ -18,59 +18,54 @@
|
||||
//
|
||||
|
||||
//
|
||||
//! Wires. Just a BOM entry at the moment and cable bundle size fuctions for holes. See
|
||||
//! <http://mathworld.wolfram.com/CirclePacking.html>.
|
||||
//! Just a BOM entry at the moment and cable bundle size functions for holes, plus cable ties.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <zipties.scad>
|
||||
|
||||
module wire(color, strands, length, strand = 0.2)
|
||||
module wire(color, strands, length, strand = 0.2) //! Add stranded wire to the BOM
|
||||
vitamin(str(": Wire ", color, " ", strands, "/", strand, "mm strands, length ",length, "mm"));
|
||||
|
||||
module ribbon_cable(ways, length)
|
||||
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
|
||||
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));
|
||||
|
||||
//
|
||||
// Cable sizes
|
||||
//
|
||||
function cable_wires(cable) = cable[0];
|
||||
function cable_wire_size(cable) = cable[1];
|
||||
function cable_wires(cable) = cable[0]; //! Number of wires in a bindle
|
||||
function cable_wire_size(cable) = cable[1]; //! Size of each wire in a bundle
|
||||
|
||||
// numbers from http://mathworld.wolfram.com/CirclePacking.html
|
||||
function cable_radius(cable) = ceil([0, 1, 2, 2.15, 2.41, 2.7, 3, 3, 3.3][cable_wires(cable)] * cable_wire_size(cable)) / 2; // radius of a bundle
|
||||
function cable_radius(cable) = [0, 1, 2, 2.15, 2.41, 2.7, 3, 3, 3.3][cable_wires(cable)] * cable_wire_size(cable) / 2; //! Radius of a bundle of wires, see <http://mathworld.wolfram.com/CirclePacking.html>.
|
||||
|
||||
function wire_hole_radius(cable) = cable_radius(cable) + 0.5;
|
||||
function wire_hole_radius(cable) = ceil(2 * cable_radius(cable) +1) / 2; //! Radius of a hole to accept a bundle of wires
|
||||
|
||||
// arrangement of bundle in flat cable clip
|
||||
function cable_bundle(cable) = [[0,0], [1,1], [2,1], [2, 0.5 + sin(60)], [2,2], [3, 0.5 + sin(60)], [3,2]][cable_wires(cable)];
|
||||
function cable_bundle(cable) = //! Arrangement of a bundle in a flat cable clip
|
||||
[[0,0], [1,1], [2,1], [2, 0.5 + sin(60)], [2,2], [3, 0.5 + sin(60)], [3,2]][cable_wires(cable)];
|
||||
|
||||
function cable_width(cable) = cable_bundle(cable)[0] * cable_wire_size(cable); // width in flat clip
|
||||
function cable_height(cable) = cable_bundle(cable)[1] * cable_wire_size(cable); // height in flat clip
|
||||
function cable_width(cable) = cable_bundle(cable)[0] * cable_wire_size(cable); //! Width in flat clip
|
||||
function cable_height(cable) = cable_bundle(cable)[1] * cable_wire_size(cable); //! Height in flat clip
|
||||
|
||||
module mouse_hole(cable, h = 100) {
|
||||
module mouse_hole(cable, h = 100) { //! A mouse hole to allow a panel to go over a wire bundle.
|
||||
r = wire_hole_radius(cable);
|
||||
|
||||
rotate(90) slot(r, 2 * r, h = h);
|
||||
}
|
||||
|
||||
module cable_tie_holes(cable_r, h = 100) {
|
||||
module cable_tie_holes(cable_r, h = 100) { //! Holes to thread a ziptie through a panel to make a cable tie.
|
||||
r = cnc_bit_r;
|
||||
l = 3;
|
||||
extrude_if(h)
|
||||
for(side = [-1, 1])
|
||||
translate([0, side * (cable_r + r)])
|
||||
translate([0, side * (cable_r + ziptie_thickness(small_ziptie) / 2)])
|
||||
hull()
|
||||
for(end = [-1, 1])
|
||||
translate([end * (l / 2 - r), 0])
|
||||
drill(r, 0);
|
||||
}
|
||||
|
||||
module cable_tie(cable_r, thickness) {
|
||||
w = 2 * (cable_r + cnc_bit_r);
|
||||
translate_z(thickness / 2)
|
||||
module cable_tie(cable_r, thickness) { //! A ziptie threaded around cable radius ```cable_r``` and through a panel with specified ```thickness```.
|
||||
translate_z(cable_r)
|
||||
rotate([-90, 0, 90])
|
||||
ziptie(small_ziptie, w / 2);
|
||||
ziptie(small_ziptie, cable_r, thickness);
|
||||
}
|
||||
|
||||
//cable_tie_holes(6 / 2);
|
||||
//cable_tie(6 / 2, 3);
|
||||
|
@@ -22,7 +22,7 @@
|
||||
//
|
||||
|
||||
include <../core.scad>
|
||||
use <../utils/tube.scad>
|
||||
use <../utils/rounded_polygon.scad>
|
||||
|
||||
function ziptie_width(type) = type[1]; //! Width
|
||||
function ziptie_thickness(type) = type[2]; //! Thickness
|
||||
@@ -30,24 +30,41 @@ function ziptie_latch(type) = type[3]; //! Latch dimensions
|
||||
function ziptie_colour(type) = type[4]; //! Colour
|
||||
function ziptie_tail(type) = type[5]; //! The length without teeth
|
||||
|
||||
module ziptie(type, r)
|
||||
module ziptie(type, r, t = 0) //! Draw specified ziptie wrapped around radius ```r``` and optionally through panel thickness ```t```
|
||||
{
|
||||
latch = ziptie_latch(type);
|
||||
length = ceil(2 * PI * r + ziptie_tail(type) + latch.z + 1);
|
||||
lx = latch.x / 2;
|
||||
zt = ziptie_thickness(type);
|
||||
cr = zt; // sharp corner raduus
|
||||
z = r + t - cr;
|
||||
x = r - cr;
|
||||
inside_corners = t ? [ [0, 0, r], [-x, z, cr], [x, z, cr] ] : [];
|
||||
outside_corners = t ? [ [0, 0, r + zt], [-x, z, cr + zt], [x, z, cr + zt] ] : [];
|
||||
x1 = lx - zt / 2;
|
||||
x2 = x1 + x1 * zt / r;
|
||||
inside_path = concat([ [0, 0, r], [x1, -r, eps] ], inside_corners);
|
||||
outside_path = concat([ [0, 0, r + zt], [x2, -r - zt, eps] ], outside_corners);
|
||||
|
||||
tangents = rounded_polygon_tangents(outside_path);
|
||||
length = ceil(rounded_polygon_length(outside_path, tangents) + ziptie_tail(type) + latch.z + 1);
|
||||
len = length <= 100 ? 100 : length;
|
||||
|
||||
vitamin(str("ziptie(", type[0], ", ", r, "): Ziptie ", len, "mm min length"));
|
||||
|
||||
angle = (r > latch.x / 2) ? asin((latch.x / 2) / r) - asin(ziptie_thickness(type) / latch.x) : 0;
|
||||
color(ziptie_colour(type)) union() {
|
||||
tube(ir = r, or = r + ziptie_thickness(type), h = ziptie_width(type));
|
||||
translate([0, -r, - latch.y / 2])
|
||||
rotate([90, 0, angle]) {
|
||||
union() {
|
||||
cube(latch);
|
||||
color(ziptie_colour(type)){
|
||||
linear_extrude(height = ziptie_width(type), center = true)
|
||||
difference() {
|
||||
rounded_polygon(outside_path, tangents);
|
||||
rounded_polygon(inside_path);
|
||||
}
|
||||
|
||||
translate([latch.x / 2, latch.y / 2, (latch.z + 1) / 2])
|
||||
translate([lx, -r])
|
||||
rotate([90, 0, 0])
|
||||
union() {
|
||||
rounded_rectangle(latch, 0.5, center = false);
|
||||
|
||||
translate_z((latch.z + 1) / 2)
|
||||
cube([ziptie_thickness(type), ziptie_width(type), latch.z + 1], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|