mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-06-04 11:06:26 -04:00
Corrner block and fixing block assemblies now more flexible.
Can split the fasteners between assemblies and omit the star washers.
This commit is contained in:
parent
b8dba626d2
commit
566cbce98f
@ -57,8 +57,8 @@ module corner_block_v_hole(screw = def_screw) //! Place children at the bottom s
|
|||||||
multmatrix(corner_block_v_hole(screw))
|
multmatrix(corner_block_v_hole(screw))
|
||||||
children();
|
children();
|
||||||
|
|
||||||
module corner_block_h_holes(screw = def_screw) //! Place children at the side screw holes
|
module corner_block_h_holes(screw = def_screw, index = undef) //! Place children at the side screw holes
|
||||||
for(p = corner_block_h_holes(screw))
|
for(p = !is_undef(index) ? [corner_block_h_holes(screw)[index]] : corner_block_h_holes(screw))
|
||||||
multmatrix(p)
|
multmatrix(p)
|
||||||
children();
|
children();
|
||||||
|
|
||||||
@ -126,22 +126,33 @@ assembly(str("corner_block_M", 20 * screw_radius(screw))) {
|
|||||||
insert(insert);
|
insert(insert);
|
||||||
}
|
}
|
||||||
|
|
||||||
module fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false) { //! Printed block with all fasteners
|
module 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
|
||||||
|
thickness2 = !is_undef(thickness_below) ? thickness_below : thickness;
|
||||||
|
thickness3 = !is_undef(thickness_side2) ? thickness_side2 : thickness;
|
||||||
washer = screw_washer(screw);
|
washer = screw_washer(screw);
|
||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
screw_length = screw_shorter_than(2 * washer_thickness(washer) + thickness + insert_length(insert) + overshoot);
|
function screw_length(t) = screw_shorter_than((star_washers ? 2 : 1) * washer_thickness(washer) + t + insert_length(insert) + overshoot);
|
||||||
|
screw_length = screw_length(thickness);
|
||||||
|
screw_length2 = screw_length(thickness2);
|
||||||
|
screw_length3 = screw_length(thickness3);
|
||||||
|
|
||||||
corner_block_assembly(screw, name) children();
|
if(show_block)
|
||||||
|
corner_block_assembly(screw, name) children();
|
||||||
|
|
||||||
corner_block_h_holes(screw)
|
if(thickness)
|
||||||
translate_z(thickness)
|
corner_block_h_holes(screw, 0)
|
||||||
screw_and_washer(screw, screw_length, true);
|
translate_z(thickness)
|
||||||
|
screw_and_washer(screw, screw_length, star_washers);
|
||||||
|
|
||||||
thickness2 = thickness_below ? thickness_below : thickness;
|
if(thickness3)
|
||||||
screw_length2 = screw_shorter_than(2 * washer_thickness(washer) + thickness2 + insert_length(insert) + overshoot);
|
corner_block_h_holes(screw, 1)
|
||||||
corner_block_v_hole(screw)
|
translate_z(thickness3)
|
||||||
translate_z(thickness2)
|
screw_and_washer(screw, screw_length3, star_washers);
|
||||||
screw_and_washer(screw, screw_length2, true);
|
|
||||||
|
if(thickness2)
|
||||||
|
corner_block_v_hole(screw)
|
||||||
|
translate_z(thickness2)
|
||||||
|
screw_and_washer(screw, screw_length2, star_washers);
|
||||||
}
|
}
|
||||||
|
|
||||||
module corner_block_M20_stl() corner_block(M2_cap_screw);
|
module corner_block_M20_stl() corner_block(M2_cap_screw);
|
||||||
|
@ -116,20 +116,24 @@ assembly(str("fixing_block_M", 20 * screw_radius(screw))) {
|
|||||||
insert(insert);
|
insert(insert);
|
||||||
}
|
}
|
||||||
|
|
||||||
module fastened_fixing_block_assembly(thickness, screw = def_screw, screw2 = undef, thickness2 = undef) { //! Assembly with fasteners in place
|
module fastened_fixing_block_assembly(thickness, screw = def_screw, screw2 = undef, thickness2 = undef, show_block = true, star_washers = true) { //! Assembly with fasteners in place
|
||||||
module fb_screw(screw, thickness) {
|
module fb_screw(screw, thickness) {
|
||||||
washer = screw_washer(screw);
|
washer = screw_washer(screw);
|
||||||
insert = screw_insert(screw);
|
insert = screw_insert(screw);
|
||||||
screw_length = screw_longer_than(2 * washer_thickness(washer) + thickness + insert_length(insert));
|
screw_length = screw_longer_than((star_washers ? 2 : 1) * washer_thickness(washer) + thickness + insert_length(insert));
|
||||||
|
|
||||||
translate_z(thickness)
|
if(thickness)
|
||||||
screw_and_washer(screw, screw_length, true);
|
translate_z(thickness)
|
||||||
|
screw_and_washer(screw, screw_length, star_washers);
|
||||||
}
|
}
|
||||||
|
|
||||||
no_pose() fixing_block_assembly(screw);
|
if(show_block)
|
||||||
|
no_pose()
|
||||||
|
fixing_block_assembly(screw);
|
||||||
|
|
||||||
|
t2 = !is_undef(thickness2) ? thickness2 : thickness;
|
||||||
fixing_block_v_holes(screw)
|
fixing_block_v_holes(screw)
|
||||||
fb_screw(screw, thickness2 ? thickness2 : thickness);
|
fb_screw(screw, t2);
|
||||||
|
|
||||||
fixing_block_h_hole(screw)
|
fixing_block_h_hole(screw)
|
||||||
fb_screw(screw2 ? screw2 : screw, thickness);
|
fb_screw(screw2 ? screw2 : screw, thickness);
|
||||||
|
@ -3338,10 +3338,10 @@ Note that the block with its inserts is defined as a sub assembly, but its faste
|
|||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```corner_block(screw = def_screw, name = false)``` | Generate the STL for a printed corner block |
|
| ```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_assembly(screw = def_screw, name = false)``` | The printed block with inserts |
|
||||||
| ```corner_block_h_holes(screw = def_screw)``` | Place children at the side screw holes |
|
| ```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_holes(screw = def_screw)``` | Place children at all the holes |
|
||||||
| ```corner_block_v_hole(screw = def_screw)``` | Place children at the bottom screw hole |
|
| ```corner_block_v_hole(screw = def_screw)``` | Place children at the bottom screw hole |
|
||||||
| ```fastened_corner_block_assembly(thickness, screw = def_screw, thickness_below = undef, name = false)``` | Printed block with all 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 |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -3549,7 +3549,7 @@ Note that the block with its inserts is defined as a sub assembly, but its faste
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```fastened_fixing_block_assembly(thickness, screw = def_screw, screw2 = undef, thickness2 = undef)``` | Assembly with fasteners in place |
|
| ```fastened_fixing_block_assembly(thickness, screw = def_screw, screw2 = undef, thickness2 = undef, show_block = true, star_washers = true)``` | Assembly with fasteners in place |
|
||||||
| ```fixing_block(screw = def_screw)``` | Generate the STL |
|
| ```fixing_block(screw = def_screw)``` | Generate the STL |
|
||||||
| ```fixing_block_assembly(screw = def_screw)``` | Printed part with the inserts inserted |
|
| ```fixing_block_assembly(screw = def_screw)``` | Printed part with the inserts inserted |
|
||||||
| ```fixing_block_h_hole(screw = def_screw)``` | Position children on the horizontal hole |
|
| ```fixing_block_h_hole(screw = def_screw)``` | Position children on the horizontal hole |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user