diff --git a/lib.scad b/lib.scad index 43a4904..ff7c14d 100644 --- a/lib.scad +++ b/lib.scad @@ -55,6 +55,7 @@ include include include include +include include include include diff --git a/libtest.png b/libtest.png index 9dc6158..26b0b14 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index 67b2e50..88563fd 100644 --- a/libtest.scad +++ b/libtest.scad @@ -71,6 +71,7 @@ use use use use +use use use use @@ -101,7 +102,7 @@ use use x0 = 0; -x1 = x0 + 100; +x1 = x0 + 110; x2 = x1 + 90; x3 = x2 + 130; x4 = x3 + 200; @@ -176,7 +177,7 @@ fans_y = displays_y + 80; transformers_y = fans_y + 120; psus_y = transformers_y + 190; -translate([x0 + 30, inserts_y]) +translate([x0 + 35, inserts_y]) inserts(); translate([x0, inserts_y]) @@ -250,7 +251,8 @@ translate([x0, psus_y]) { zipties_y = 0; bulldogs_y = zipties_y + 30; -leadnuts_y = bulldogs_y + 50; +swiss_clips_y = bulldogs_y + 35; +leadnuts_y = swiss_clips_y + 50; translate([x1, zipties_y]) zipties(); @@ -258,6 +260,9 @@ translate([x1, zipties_y]) translate([x1, bulldogs_y]) bulldogs(); +translate([x1, swiss_clips_y]) + swiss_clips(); + translate([x1, leadnuts_y]) leadnuts(); diff --git a/readme.md b/readme.md index 67a2b47..a586606 100644 --- a/readme.md +++ b/readme.md @@ -32,15 +32,15 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa D_connectors Modules Spools Handle Rounded_polygon Displays Nuts Springs PCB_mount Sector Extrusion_brackets O_ring Stepper_motors PSU_shroud Sweep - Extrusions Opengrab Toggles Printed_box Thread - Fans PCB Transformers Ribbon_clamp Tube - Fuseholder PCBs Tubings SSR_shroud - Geared_steppers PSUs Variacs Screw_knob - Green_terminals Pillars Veroboard Socket_box - Hot_ends Pin_headers Washers Strap_handle - Hygrometer Pulleys Wire - IECs Zipties - Inserts + Extrusions Opengrab Swiss_clips Printed_box Thread + Fans PCB Toggles Ribbon_clamp Tube + Fuseholder PCBs Transformers SSR_shroud + Geared_steppers PSUs Tubings Screw_knob + Green_terminals Pillars Variacs Socket_box + Hot_ends Pin_headers Veroboard Strap_handle + Hygrometer Pulleys Washers + IECs Wire + Inserts Zipties --- @@ -3215,6 +3215,55 @@ NEMA stepper motor model. | 15 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm | +Top + +--- + +## Swiss_clips +Swiss picture clip. +Used for holding glass on 3D printer beds. + +The bending model is an approximation because in real life the arms bend. +Should be reasonably accurate if not close to fully open. + + +[vitamins/swiss_clips.scad](vitamins/swiss_clips.scad) Object definitions. + +[vitamins/swiss_clip.scad](vitamins/swiss_clip.scad) Implementation. + +[tests/Swiss_clips.scad](tests/Swiss_clips.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| ```sclip_arm_length(type)``` | Length of arms | +| ```sclip_arm_width(type)``` | Width of spring arms | +| ```sclip_height(type)``` | External height | +| ```sclip_hinge_offset(type)``` | Offset of hinge | +| ```sclip_hook(type)``` | hook, length, width | +| ```sclip_length(type)``` | Total external length | +| ```sclip_max_gap(type)``` | Maximum opening | +| ```sclip_radius(type)``` | Bend radius | +| ```sclip_spigot(type)``` | Spigot length, width, height | +| ```sclip_thickness(type)``` | Thickness of the metal | +| ```sclip_width(type)``` | Width | + +### Modules +| Module | Description | +|:--- |:--- | +| ```swiss_clip(type, open = 0.9)``` | Draw a Swiss clip open by specified amount | +| ```swiss_clip_hole(type, open, h = 0)``` | Drill hole for spigot | + +![swiss_clips](tests/png/swiss_clips.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 1 | ```sheet(AL6, 40, 20, 1)``` | Aluminium tooling plate 40mm x 20mm x 6mm | +| 1 | ```sheet(glass2, 40, 20, 1)``` | Sheet glass 40mm x 20mm x 2mm | +| 2 | ```swiss_clip(UKPFS1008_10)``` | Swiss picture clip UKPFS1008_10 11mm | + + Top --- diff --git a/tests/Swiss_clips.scad b/tests/Swiss_clips.scad new file mode 100644 index 0000000..7389d7d --- /dev/null +++ b/tests/Swiss_clips.scad @@ -0,0 +1,52 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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 . +// +include <../utils/core/core.scad> +use <../utils/layout.scad> + +include <../vitamins/swiss_clips.scad> +include <../vitamins/sheets.scad> + +glass = glass2; +bed = AL6; +gap = sheet_thickness(bed) + sheet_thickness(glass); + +module swiss_clips() + layout([for(s = swiss_clips) sclip_length(s)], 5, true) + let(s = swiss_clips[$i]) { + swiss_clip(s); + + translate([0, 20]) { + swiss_clip(s, gap); + + translate([20, 0, -5]) + render_2D_sheet(bed) + difference() { + sheet_2D(bed, 40, 20, 1); + + translate([-20, 0]) + swiss_clip_hole(s, gap); + } + + translate([20, 0, -1 + eps]) + render_sheet(glass) sheet(glass, 40, 20, 1); + } + } + +if($preview) + swiss_clips(); diff --git a/tests/png/swiss_clips.png b/tests/png/swiss_clips.png new file mode 100644 index 0000000..e2a5bc4 Binary files /dev/null and b/tests/png/swiss_clips.png differ diff --git a/vitamins/swiss_clip.scad b/vitamins/swiss_clip.scad new file mode 100644 index 0000000..b52c798 --- /dev/null +++ b/vitamins/swiss_clip.scad @@ -0,0 +1,148 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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 . +// + +// +//! Swiss picture clip. +//! Used for holding glass on 3D printer beds. +//! +//! The bending model is an approximation because in real life the arms bend. +//! Should be reasonably accurate if not close to fully open. +// +include <../utils/core/core.scad> + +function sclip_length(type) = type[1]; //! Total external length +function sclip_height(type) = type[2]; //! External height +function sclip_width(type) = type[3]; //! Width +function sclip_thickness(type) = type[4]; //! Thickness of the metal +function sclip_radius(type) = type[5]; //! Bend radius +function sclip_arm_width(type) = type[6]; //! Width of spring arms +function sclip_spigot(type) = type[7]; //! Spigot length, width, height +function sclip_hook(type) = type[8]; //! hook, length, width +function sclip_hinge_offset(type) = type[9]; //! Offset of hinge +function sclip_arm_length(type) = type[10]; //! Length of arms +function sclip_max_gap(type) = type[11]; //! Maximum opening + +function arm_angle(type, open) = asin((sclip_height(type) - 2 * sclip_thickness(type) - open) / sclip_arm_length(type)); + +function spigot_angle(type, open) = + let(arm_w = sclip_arm_width(type), w = sclip_width(type) - 2 * arm_w) + (arm_angle(type, 0) - arm_angle(type, open)) * 2 * arm_w / w; + +module swiss_clip_hole(type, open, h = 0) { //! Drill hole for spigot + spigot = sclip_spigot(type); + angle = spigot_angle(type, open); + t = sclip_thickness(type); + or = sclip_radius(type); + ir = or - t; + shadow = (spigot.z - or) * sin(angle) - or * cos(angle) + or + t * cos(angle); + r = sqrt(sqr(shadow) + sqr(spigot.y)) / 2; + offset = sclip_hinge_offset(type); + hpot = offset - t; + + translate([sclip_length(type) - t - ir - offset + hpot * cos(angle) - (spigot.z - t) * sin(angle) + shadow / 2, 0]) + drill(r + 0.1, h); +} + +module swiss_clip(type, open = 0.9) { //! Draw a Swiss clip open by specified amount + vitamin(str("swiss_clip(", type[0], "): Swiss picture clip ", type[0], " ", sclip_max_gap(type),"mm")); + + length = sclip_length(type); + width = sclip_width(type); + height = sclip_height(type); + + spigot = sclip_spigot(type); + hook = sclip_hook(type); + offset = sclip_hinge_offset(type); + t = sclip_thickness(type); + arm_l = sclip_arm_length(type); + arm_w = sclip_arm_width(type); + w = width - 2 * arm_w; + or = sclip_radius(type); + ir = or - t; + angle = arm_angle(type, open); + angle2 = spigot_angle(type, open); + $fn = 360; + + color("silver") translate([-t - ir, 0, -height + t]) { + translate([length - offset - arm_l, -w / 2]) // Narrow part of base + cube([arm_l, w, t]); + + translate([length - offset, 0, t]) + rotate([0, -angle2, 0]) + translate([offset - length, 0, -t]) { + translate([length - offset, -width / 2]) // Wide part of base + cube([offset - spigot.x, width, t]); + + translate([length - spigot.x, -spigot.y / 2]) // Spigot base + cube([spigot.x - or, spigot.y, t]); + + translate([length - t, -spigot.y / 2, or]) // Spigot stem + cube([t, spigot.y, spigot.z - or]); + + translate([length - or, -spigot.y / 2, or]) // Spigot bend + rotate([-90, 0, 0]) + rotate_extrude(angle = 90) + translate([ir, 0]) + square([t, spigot.y]); + } + + translate([or, -hook.y / 2]) // Hook base + cube([hook.x, hook.y, t]); + + translate([0, -hook.y / 2, or]) // Hook stem + cube([t, hook.y, height - 2 * or]); + + translate([or, -hook.y / 2, or]) // Hook lower bend + rotate([0, 90, 90]) + rotate_extrude(angle = 90) + translate([ir, 0]) + square([t, hook.y]); + + translate([or, -hook.y / 2, height - t]) // Hook top + cube([hook.x - or, hook.y, t]); + + translate([or, hook.y / 2, height - or]) // Hook top bend + rotate([0, -90, 90]) + rotate_extrude(angle = 90) + translate([ir, 0]) + square([t, hook.y]); + + translate([length - offset, 0, t]) // Arms + rotate([0, angle, 0]) + for(side = [-1, 1]) + translate([-arm_l, side * (arm_w + w) / 2 - arm_w / 2, -t]) + cube([arm_l, arm_w, t]); + + translate([length - offset, -w / 2, t]) // Central gusset + rotate([-90, 0, 0]) + rotate(90 - angle2) + rotate_extrude(angle = angle2) + translate([0, 0]) + square([t, w]); + + for(side = [-1, 1]) // Arm gussets + translate([length - offset, side * (arm_w + w) / 2 - arm_w / 2, t]) + rotate([-90, 0, 0]) + rotate(90 - angle2) + rotate_extrude(angle = angle + angle2) + translate([0, 0]) + square([t, arm_w]); + + } +} diff --git a/vitamins/swiss_clips.scad b/vitamins/swiss_clips.scad new file mode 100644 index 0000000..e912367 --- /dev/null +++ b/vitamins/swiss_clips.scad @@ -0,0 +1,29 @@ +// +// NopSCADlib Copyright Chris Palmer 2020 +// 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 . +// + +// +//! Swiss picture clip. +//! Used for holding glass on 3D printer beds. +// + +UKPFS1008_10 = ["UKPFS1008_10", 39, 13, 13, 0.75, 1.5, 4, [3.5, 2.2, 4.4], [5.25, 4.12], 9, 37 - 9, 11]; + +swiss_clips = [ UKPFS1008_10 ]; + +use