Made ribbon_clamps parametric on screw size.

This commit is contained in:
Chris Palmer 2020-09-11 19:53:14 +01:00
parent 6b0132c32e
commit 332933a4fd
8 changed files with 71 additions and 55 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 KiB

After

Width:  |  Height:  |  Size: 819 KiB

View File

@ -117,17 +117,17 @@ cable_grommets_y = 0;
translate([x5, cable_grommets_y]) translate([x5, cable_grommets_y])
cable_grommets(); cable_grommets();
translate([x5, cable_grommets_y + 50]) translate([x5 + 80, cable_grommets_y])
feet(); ribbon_clamps();
translate([x5, cable_grommets_y + 75]) translate([x5, cable_grommets_y + 60])
fixing_blocks(); fixing_blocks();
translate([x5, cable_grommets_y + 100]) translate([x5, cable_grommets_y + 90])
corner_blocks(); corner_blocks();
translate([x5, cable_grommets_y + 150]) translate([x5, cable_grommets_y + 150])
ribbon_clamps(); feet();
translate([x5 + 70, cable_grommets_y + 150]) translate([x5 + 70, cable_grommets_y + 150])
screw_knobs(); screw_knobs();

View File

@ -24,69 +24,72 @@ include <../core.scad>
use <../vitamins/insert.scad> use <../vitamins/insert.scad>
use <../vitamins/cable_strip.scad> use <../vitamins/cable_strip.scad>
wall = 2; wall = 1.6;
min_wall = 2 * extrusion_width; min_wall = 2 * extrusion_width;
screw = M3_cap_screw; screw = M3_cap_screw;
insert = screw_insert(screw);
screw_depth = insert_length(insert) + 1;
function ribbon_clamp_hole_pitch(ways) = ribbon_clamp_slot(ways) + 2 * min_wall + 2 * corrected_radius(insert_hole_radius(insert)); //! Hole pitch function ribbon_clamp_screw_depth(screw = screw) = insert_length(screw_insert(screw)) + 1;
function ribbon_clamp_width() = 2 * (insert_hole_radius(insert) + wall); //! Width function ribbon_clamp_hole_pitch(ways, screw = screw) =
function ribbon_clamp_length(ways) = ribbon_clamp_hole_pitch(ways) + ribbon_clamp_width(); //! Length given ways ribbon_clamp_slot(ways) + 2 * min_wall + 2 * corrected_radius(insert_hole_radius(screw_insert(screw))); //! Hole pitch
function ribbon_clamp_height() = screw_depth + 1; //! Height
module ribbon_clamp_hole_positions(ways, side = undef) //! Place children at hole positions function ribbon_clamp_width(screw = screw) = 2 * (insert_hole_radius(screw_insert(screw)) + wall); //! Width
function ribbon_clamp_length(ways, screw = screw) = ribbon_clamp_hole_pitch(ways, screw) + ribbon_clamp_width(screw); //! Length given ways
function ribbon_clamp_height(screw = screw) = ribbon_clamp_screw_depth(screw) + 1; //! Height
module ribbon_clamp_hole_positions(ways, screw = screw, side = undef) //! Place children at hole positions
for(x = is_undef(side) ? [-1, 1] : side) for(x = is_undef(side) ? [-1, 1] : side)
translate([x * ribbon_clamp_hole_pitch(ways) / 2, 0]) translate([x * ribbon_clamp_hole_pitch(ways, screw) / 2, 0])
children(); children();
module ribbon_clamp_holes(ways, h = 20) //! Drill screw holes module ribbon_clamp_holes(ways, h = 20, screw = screw) //! Drill screw holes
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
drill(screw_clearance_radius(screw), h); drill(screw_clearance_radius(screw), h);
module ribbon_clamp(ways) { //! Generate STL for given number of ways module ribbon_clamp(ways, screw = screw) { //! Generate STL for given number of ways
stl(str("ribbon_clamp_", ways)); screw_d = screw_radius(screw) * 2;
stl(str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : ""));
pitch = ribbon_clamp_hole_pitch(ways); pitch = ribbon_clamp_hole_pitch(ways, screw);
d = ribbon_clamp_width(); d = ribbon_clamp_width(screw);
h = ribbon_clamp_height(); h = ribbon_clamp_height(screw);
t = h - ribbon_clamp_slot_depth() - wall; t = round_to_layer(ribbon_clamp_slot_depth() + wall);
insert = screw_insert(screw);
difference() { difference() {
union() { union() {
hull() { hull() {
translate_z(h - t / 2) translate_z(h - t / 2)
cube([ribbon_clamp_hole_pitch(ways), d, t], center = true); cube([ribbon_clamp_hole_pitch(ways, screw), d, t], center = true);
translate_z(1) translate_z(1)
cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true); cube([pitch, max(wall, d - 2 * (h - t)), 2], center = true);
} }
ribbon_clamp_hole_positions(ways, -1) ribbon_clamp_hole_positions(ways, screw, -1)
cylinder(d = d, h = h); cylinder(d = d, h = h);
ribbon_clamp_hole_positions(ways, 1) ribbon_clamp_hole_positions(ways, screw, 1)
cylinder(d = d, h = h); cylinder(d = d, h = h);
} }
translate_z(h) translate_z(h)
cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true); cube([ribbon_clamp_slot(ways), d + 1, ribbon_clamp_slot_depth() * 2], center = true);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
translate_z(h) translate_z(h)
rotate(22.5) rotate(22.5)
insert_hole(insert, screw_depth - insert_length(insert)); insert_hole(insert, ribbon_clamp_screw_depth(screw) - insert_length(insert));
} }
} }
module ribbon_clamp_assembly(ways) pose([55, 180, 25]) //! Printed part with inserts in place module ribbon_clamp_assembly(ways, screw) pose([55, 180, 25]) //! Printed part with inserts in place
assembly(str("ribbon_clamp_", ways)) { assembly(let(screw_d = screw_radius(screw) * 2)str("ribbon_clamp_", ways, screw_d != 3 ? str("_", screw_d) : "")) {
h = ribbon_clamp_height(); h = ribbon_clamp_height(screw);
insert = screw_insert(screw);
stl_colour(pp1_colour) render() stl_colour(pp1_colour) render()
translate_z(h) vflip() ribbon_clamp(ways); translate_z(h) vflip() ribbon_clamp(ways, screw);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
vflip() vflip()
insert(insert); insert(insert);
} }
@ -99,20 +102,24 @@ module ribbon_clamp_fastened_assembly(ways, thickness, screw = screw) { //! Clam
vitamin(str(": Tape self amalgamating silicone ",tape_l," x 25mm")); vitamin(str(": Tape self amalgamating silicone ",tape_l," x 25mm"));
washer = screw_washer(screw); washer = screw_washer(screw);
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + screw_depth); screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + ribbon_clamp_screw_depth(screw));
ribbon_clamp_assembly(ways); ribbon_clamp_assembly(ways, screw);
color("red") translate_z(tape_thickness / 2) color("red") translate_z(tape_thickness / 2)
cube([tape_l, tape_width, tape_thickness], center = true); cube([tape_l, tape_width, tape_thickness], center = true);
ribbon_clamp_hole_positions(ways) ribbon_clamp_hole_positions(ways, screw)
vflip() vflip()
translate_z(thickness) translate_z(thickness)
screw_and_washer(screw, screw_length, true); screw_and_washer(screw, screw_length, true);
} }
module ribbon_clamp_20_stl() ribbon_clamp(20); module ribbon_clamp_20_stl() ribbon_clamp(20);
module ribbon_clamp_8_2_stl() ribbon_clamp(8, M2_dome_screw);
//! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C. //! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C.
module ribbon_clamp_20_assembly() ribbon_clamp_assembly(20); module ribbon_clamp_20_assembly() ribbon_clamp_assembly(20);
//! * Place inserts into the holes and press home with a soldering iron with a conical bit heated to 200&deg;C.
module ribbon_clamp_8_2_assembly() ribbon_clamp_assembly(8, M2_dome_screw);

View File

@ -4949,41 +4949,48 @@ Clamp for ribbon cable and polypropylene strip.
### Functions ### Functions
| Function | Description | | Function | Description |
|:--- |:--- | |:--- |:--- |
| ```ribbon_clamp_height()``` | Height | | ```ribbon_clamp_height(screw = screw)``` | Height |
| ```ribbon_clamp_hole_pitch(ways)``` | Hole pitch | | ```ribbon_clamp_length(ways, screw = screw)``` | Length given ways |
| ```ribbon_clamp_length(ways)``` | Length given ways | | ```ribbon_clamp_width(screw = screw)``` | Width |
| ```ribbon_clamp_width()``` | Width |
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```ribbon_clamp(ways)``` | Generate STL for given number of ways | | ```ribbon_clamp(ways, screw = screw)``` | Generate STL for given number of ways |
| ```ribbon_clamp_assembly(ways)``` | Printed part with inserts in place | | ```ribbon_clamp_assembly(ways, screw)``` | Printed part with inserts in place |
| ```ribbon_clamp_fastened_assembly(ways, thickness, screw = screw)``` | Clamp with fasteners in place | | ```ribbon_clamp_fastened_assembly(ways, thickness, screw = screw)``` | Clamp with fasteners in place |
| ```ribbon_clamp_hole_positions(ways, side = undef)``` | Place children at hole positions | | ```ribbon_clamp_hole_positions(ways, screw = screw, side = undef)``` | Place children at hole positions |
| ```ribbon_clamp_holes(ways, h = 20)``` | Drill screw holes | | ```ribbon_clamp_holes(ways, h = 20, screw = screw)``` | Drill screw holes |
![ribbon_clamp](tests/png/ribbon_clamp.png) ![ribbon_clamp](tests/png/ribbon_clamp.png)
### Vitamins ### Vitamins
| Qty | Module call | BOM entry | | Qty | Module call | BOM entry |
| ---:|:--- |:---| | ---:|:--- |:---|
| 2 | ```insert(F1BM2)``` | Heatfit insert M2 |
| 2 | ```insert(F1BM3)``` | Heatfit insert M3 | | 2 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | | Ribbon cable 20 way 100mm | | 1 | | Ribbon cable 20 way 100mm |
| 1 | | Ribbon cable 8 way 100mm |
| 2 | ```screw(M2_dome_screw, 8)``` | Screw M2 dome x 8mm |
| 2 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm | | 2 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 1 | | Tape self amalgamating silicone 11 x 25mm |
| 1 | | Tape self amalgamating silicone 26 x 25mm | | 1 | | Tape self amalgamating silicone 26 x 25mm |
| 2 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 2 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm | | 2 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 2 | ```star_washer(M2_washer)``` | Washer star M2 x 0.3mm |
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm | | 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
### Printed ### Printed
| Qty | Filename | | Qty | Filename |
| ---:|:--- | | ---:|:--- |
| 1 | ribbon_clamp_20.stl | | 1 | ribbon_clamp_20.stl |
| 1 | ribbon_clamp_8_2.stl |
### Assemblies ### Assemblies
| Qty | Name | | Qty | Name |
| ---:|:--- | | ---:|:--- |
| 1 | ribbon_clamp_20_assembly | | 1 | ribbon_clamp_20_assembly |
| 1 | ribbon_clamp_8_2_assembly |
<a href="#top">Top</a> <a href="#top">Top</a>

View File

@ -21,14 +21,14 @@ use <../printed/foot.scad>
module feet() module feet()
if($preview) { if($preview) {
translate([50, 0]) translate([40, 0])
foot_assembly(3); foot_assembly(3);
translate([foot_diameter(insert_foot()) / 2, 0]) translate([foot_diameter(insert_foot()) / 2, 0])
fastened_insert_foot_assembly(3); fastened_insert_foot_assembly(3);
} }
else { else {
translate([50, 0]) translate([40, 0])
foot(); foot();
insert_foot(); insert_foot();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -16,20 +16,22 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib. // You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>. // If not, see <https://www.gnu.org/licenses/>.
// //
include <../utils/core/core.scad> include <../core.scad>
use <../printed/ribbon_clamp.scad> use <../printed/ribbon_clamp.scad>
use <../vitamins/wire.scad> use <../vitamins/wire.scad>
ways = 20; ways = [8, 20];
screws = [M2_dome_screw, M3_cap_screw];
module ribbon_clamps() module ribbon_clamps()
translate([ribbon_clamp_length(ways) / 2, 0]) for(i = [0 : len(screws) - 1])
if($preview) { translate([ribbon_clamp_length(ways[i]) / 2, i * 30])
ribbon_clamp_fastened_assembly(ways, 3); if($preview) {
ribbon_clamp_fastened_assembly(ways[i], 3, screws[i]);
ribbon_cable(ways, 100); ribbon_cable(ways[i], 100);
} }
else else
ribbon_clamp(ways); ribbon_clamp(ways[i], screws[i]);
ribbon_clamps(); ribbon_clamps();