1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-16 13:08:15 +01:00

Added 2screw_blocks, a two screw version of corner blocks.

This commit is contained in:
Chris Palmer 2022-01-29 11:15:51 +00:00
parent 20db11f81e
commit c4ccc30b35
6 changed files with 176 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 KiB

After

Width:  |  Height:  |  Size: 978 KiB

View File

@ -160,10 +160,10 @@ translate([x5, cable_grommets_y + 60])
translate([x5, cable_grommets_y + 90])
corner_blocks();
translate([x5, cable_grommets_y + 150])
translate([x5, cable_grommets_y + 160])
feet();
translate([x5 + 70, cable_grommets_y + 150])
translate([x5 + 70, cable_grommets_y + 160])
screw_knobs();
translate([x5, cable_grommets_y + 470]) {

View File

@ -29,6 +29,9 @@
//! This allows the block and one set of fasteners to be on one assembly and the other fasteners on the mating assemblies.
//!
//! Star washers can be omitted by setting `star_washers` to false.
//!
//! A 2screw_block is a thinner version with two screws and two mating surfaces. It can be used as an alternative to fixing blocks when
//! high lateral rigity is not required.
//
include <../core.scad>
use <../vitamins/insert.scad>
@ -45,6 +48,7 @@ function corner_block_hole_offset(screw = def_screw) = //! Hole offset from the
let(insert = screw_insert(screw))
insert_length(insert) + max(overshoot + screw_clearance_radius(screw), insert_hole_radius(insert)) + 1;
function corner_block_width(screw = def_screw) = //! Block width, depth and height
corner_block_hole_offset(screw) + insert_outer_d(screw_insert(screw)) / 2 + wall;
@ -192,3 +196,127 @@ module corner_block_M30_assembly() corner_block_assembly(M3_cap_screw);
//! 1. Lay the blocks on each of their other two flat sides and repeat.
//
module corner_block_M40_assembly() corner_block_assembly(M4_cap_screw);
function 2screw_block_width(screw = def_screw) = //! 2 screw block width is narrower, height and depth are as corner_block
insert_outer_d(screw_insert(screw)) + 2 * wall;
function 2screw_block_v_hole(screw = def_screw) = translate([0, corner_block_hole_offset(screw)]) * rotate([180, 0, 0]); //! Transform to bottom hole
function 2screw_block_h_hole(screw = def_screw) = translate([0, 0, corner_block_hole_offset(screw)]) * rotate([90, 0, 0]); //! Transform to front hole
function 2screw_block_holes(screw) = concat([2screw_block_v_hole(screw)], [2screw_block_h_hole(screw)]); //! List of transforms to both holes
module 2screw_block_v_hole(screw = def_screw) //! Place children at the bottom screw hole
multmatrix(2screw_block_v_hole(screw))
children();
module 2screw_block_h_hole(screw = def_screw) //! Place children at the front screw hole
multmatrix(2screw_block_h_hole(screw))
children();
module 2screw_block_holes(screw = def_screw) //! Place children at both screw holes
for(p = 2screw_block_holes(screw))
multmatrix(p)
children();
module 2screw_block(screw = def_screw, name = false) { //! Generate the STL for a printed 2screw block
r = 1;
cb_width = 2screw_block_width(screw);
cb_height = corner_block_width(screw);
cb_depth = cb_height;
insert = screw_insert(screw);
corner_rad = insert_outer_d(insert) / 2 + wall;
offset = corner_block_hole_offset(screw);
stl(name ? name : str("2screw_block", "_M", screw_radius(screw) * 20))
difference() {
hull() {
translate([-cb_width / 2 + r, r])
cylinder(r = r, h = 1);
translate([cb_width / 2 - r, r])
cylinder(r = r, h = 1);
translate([0, offset, offset])
sphere(corner_rad);
translate([0, offset])
cylinder(r = corner_rad, h = 1);
translate([0, r, offset])
rotate([-90, 0, 180])
rounded_cylinder(r = corner_rad, h = r, r2 = r);
}
2screw_block_v_hole(screw)
insert_hole(insert, overshoot);
2screw_block_h_hole(screw)
insert_hole(insert, overshoot, true);
children();
}
}
module 2screw_block_assembly(screw = def_screw, name = false) //! The printed block with inserts
assembly(str("2screw_block_M", 20 * screw_radius(screw)), ngb = true) {
insert = screw_insert(screw);
stl_colour(name ? pp2_colour : pp1_colour)
render() 2screw_block(screw, name) children();
2screw_block_holes(screw)
insert(insert);
}
module fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true) { //! Printed block with fasteners
thickness2 = !is_undef(thickness_below) ? thickness_below : thickness;
function screw_len(t) = screw_length(screw, t + overshoot, star_washers ? 2 : 1, true);
screw_length = screw_len(thickness);
screw_length2 = screw_len(thickness2);
if(show_block)
2screw_block_assembly(screw, name) children();
if(thickness)
2screw_block_h_hole(screw)
translate_z(thickness)
screw_and_washer(screw, screw_length, star_washers);
if(thickness2)
2screw_block_v_hole(screw)
translate_z(thickness2)
screw_and_washer(screw, screw_length2, star_washers);
}
module 2screw_block_M20_stl() 2screw_block(M2_cap_screw);
module 2screw_block_M25_stl() 2screw_block(M2p5_cap_screw);
module 2screw_block_M30_stl() 2screw_block(M3_cap_screw);
module 2screw_block_M40_stl() 2screw_block(M4_cap_screw);
//
//! 1. Lay the blocks out and place an M2 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M20_assembly() 2screw_block_assembly(M2_cap_screw);
//
//! 1. Lay the blocks out and place an M2.5 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M25_assembly() 2screw_block_assembly(M2p5_cap_screw);
//
//! 1. Lay the blocks out and place an M3 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M30_assembly() 2screw_block_assembly(M3_cap_screw);
//
//! 1. Lay the blocks out and place an M4 insert in the forward facing hole.
//! 1. Push them home with a soldering iron with a conical bit heated to 200&deg;C.
//! When removing the iron it helps to twist it a little anti-clockwise to release it from the thread.
//! 1. Lay the blocks on each of their other flat side and repeat.
//
module 2screw_block_M40_assembly() 2screw_block_assembly(M4_cap_screw);

View File

@ -4810,6 +4810,9 @@ This allows the block and one set of fasteners to be on one assembly and the oth
Star washers can be omitted by setting `star_washers` to false.
A 2screw_block is a thinner version with two screws and two mating surfaces. It can be used as an alternative to fixing blocks when
high lateral rigity is not required.
[printed/corner_block.scad](printed/corner_block.scad) Implementation.
[tests/corner_block.scad](tests/corner_block.scad) Code for this example.
@ -4817,6 +4820,10 @@ Star washers can be omitted by setting `star_washers` to false.
### Functions
| Function | Description |
|:--- |:--- |
| `2screw_block_h_hole(screw = def_screw)` | Transform to front hole |
| `2screw_block_holes(screw)` | List of transforms to both holes |
| `2screw_block_v_hole(screw = def_screw)` | Transform to bottom hole |
| `2screw_block_width(screw = def_screw)` | 2 screw block width is narrower, height and depth are as corner_block |
| `corner_block_h_holes(screw = def_screw)` | List of transforms to side holes |
| `corner_block_hole_offset(screw = def_screw)` | Hole offset from the edge |
| `corner_block_holes(screw)` | List of transforms to all holes |
@ -4827,11 +4834,17 @@ Star washers can be omitted by setting `star_washers` to false.
### Modules
| Module | Description |
|:--- |:--- |
| `2screw_block(screw = def_screw, name = false)` | Generate the STL for a printed 2screw block |
| `2screw_block_assembly(screw = def_screw, name = false)` | The printed block with inserts |
| `2screw_block_h_hole(screw = def_screw)` | Place children at the front screw hole |
| `2screw_block_holes(screw = def_screw)` | Place children at both screw holes |
| `2screw_block_v_hole(screw = def_screw)` | Place children at the bottom screw hole |
| `corner_block(screw = def_screw, name = false)` | Generate the STL for a printed corner block |
| `corner_block_assembly(screw = def_screw, name = false)` | The printed block with inserts |
| `corner_block_h_holes(screw = def_screw, index = undef)` | Place children at the side screw holes |
| `corner_block_holes(screw = def_screw)` | Place children at all the holes |
| `corner_block_v_hole(screw = def_screw)` | Place children at the bottom screw hole |
| `fastened_2screw_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false, show_block = true, star_washers = true)` | Printed block with fasteners |
| `fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, thickness_side2 = undef, name = false, show_block = true, star_washers = true)` | Printed block with all fasteners |
![corner_block](tests/png/corner_block.png)
@ -4839,26 +4852,30 @@ Star washers can be omitted by setting `star_washers` to false.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 3 | `insert(F1BM2)` | Heatfit insert M2 |
| 3 | `insert(F1BM2p5)` | Heatfit insert M2.5 |
| 3 | `insert(F1BM3)` | Heatfit insert M3 |
| 3 | `insert(F1BM4)` | Heatfit insert M4 |
| 3 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
| 3 | `screw(M2p5_pan_screw, 10)` | Screw M2.5 pan x 10mm |
| 3 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
| 3 | `screw(M4_dome_screw, 12)` | Screw M4 dome x 12mm |
| 3 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
| 3 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
| 3 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 3 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 3 | `star_washer(M2_washer)` | Washer star M2 x 0.3mm |
| 3 | `star_washer(M2p5_washer)` | Washer star M2.5 x 0.5mm |
| 3 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
| 3 | `star_washer(M4_washer)` | Washer star M4 x 0.8mm |
| 5 | `insert(F1BM2)` | Heatfit insert M2 |
| 5 | `insert(F1BM2p5)` | Heatfit insert M2.5 |
| 5 | `insert(F1BM3)` | Heatfit insert M3 |
| 5 | `insert(F1BM4)` | Heatfit insert M4 |
| 5 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
| 5 | `screw(M2p5_pan_screw, 10)` | Screw M2.5 pan x 10mm |
| 5 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
| 5 | `screw(M4_dome_screw, 12)` | Screw M4 dome x 12mm |
| 5 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
| 5 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
| 5 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 5 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
| 5 | `star_washer(M2_washer)` | Washer star M2 x 0.3mm |
| 5 | `star_washer(M2p5_washer)` | Washer star M2.5 x 0.5mm |
| 5 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
| 5 | `star_washer(M4_washer)` | Washer star M4 x 0.8mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | 2screw_block_M20.stl |
| 1 | 2screw_block_M25.stl |
| 1 | 2screw_block_M30.stl |
| 1 | 2screw_block_M40.stl |
| 1 | corner_block_M20.stl |
| 1 | corner_block_M25.stl |
| 1 | corner_block_M30.stl |
@ -4867,6 +4884,10 @@ Star washers can be omitted by setting `star_washers` to false.
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | 2screw_block_M20_assembly |
| 1 | 2screw_block_M25_assembly |
| 1 | 2screw_block_M30_assembly |
| 1 | 2screw_block_M40_assembly |
| 1 | corner_block_M20_assembly |
| 1 | corner_block_M25_assembly |
| 1 | corner_block_M30_assembly |

View File

@ -22,11 +22,18 @@ use <../printed/corner_block.scad>
screws = [M2_cap_screw, M2p5_pan_screw, M3_dome_screw, M4_dome_screw];
module do_corner_block(screw)
if($preview)
if($preview) {
fastened_corner_block_assembly(3, screw = screw);
else
translate([0, 30])
fastened_2screw_block_assembly(3, screw = screw);
}
else {
corner_block(screw);
translate([0, 30])
2screw_block(screw);
}
module corner_blocks()
for(i = [0 : len(screws) - 1])
translate([i * 30, 0])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 149 KiB