|
1 | 1 | include <../../variables.scad> |
2 | | - |
3 | 2 | use <../../lib/Round-Anything/polyround.scad> |
4 | 3 | use <../../lib/utils.scad> |
5 | 4 |
|
6 | 5 | module AttachmentCover(height=2) { |
7 | | - difference() { |
8 | | - intersection() { |
9 | | - hull() { |
10 | | - r0 = 2; |
11 | | - r1 = 1; |
12 | | - |
13 | | - translate([0, 0, -1]) |
14 | | - linear_extrude(1) |
15 | | - polygon(roundedRectangle(MountAttachment_width, MountAttachment_height, r0)); |
| 6 | + difference(){ |
| 7 | + hull(){ |
| 8 | + translate([0,0,0]) linear_extrude(epsilon) polygon(polyRound([ |
| 9 | + [0, MountAttachment_height/2, 2], |
| 10 | + [MountAttachment_width, MountAttachment_height/2, 5], |
| 11 | + [MountAttachment_width, -MountAttachment_height/2, 5], |
| 12 | + [0, -MountAttachment_height/2, 2], |
| 13 | + ], fn=$pfn)); |
16 | 14 |
|
17 | | - translate([0, 0, height-1]) |
18 | | - linear_extrude(1) |
19 | | - polygon(roundedRectangle(MountAttachment_width-2*(r0-r1), MountAttachment_height-2*(r0-r1), r1)); |
| 15 | + translate([-1,0,2-epsilon]) linear_extrude(epsilon) offset(r=-1) polygon(polyRound([ |
| 16 | + [0, MountAttachment_height/2, 2], |
| 17 | + [MountAttachment_width, MountAttachment_height/2, 5], |
| 18 | + [MountAttachment_width, -MountAttachment_height/2, 5], |
| 19 | + [0, -MountAttachment_height/2, 2], |
| 20 | + ], fn=$pfn)); |
| 21 | + } |
| 22 | + mirror([0, 0, 0]) { |
| 23 | + for(i = [-1, 1]) { |
| 24 | + for(j = [-1, 1]) { |
| 25 | + translate([ |
| 26 | + MountAttachment_width / 2 + i * MountAttachment_holes_dx / 2 + MountAttachment_holes_x_offset , |
| 27 | + j * MountAttachment_holes_dy / 2, |
| 28 | + 2, |
| 29 | + ]) |
| 30 | + ScrewHole( 2, |
| 31 | + m3_screw_diameter_loose, |
| 32 | + head_depth=1, |
| 33 | + head_diameter=m3_screw_head_diameter); |
| 34 | + } |
20 | 35 | } |
21 | | - |
22 | | - translate([-100, -100, 0]) |
23 | | - cube(200); |
24 | 36 | } |
25 | | - |
26 | | - // Screw holes |
27 | | - for(i=[-1,1])for(j=[-1,1]) |
28 | | - translate([i*MountAttachment_holes_dx/2, j*MountAttachment_holes_dy/2, height]) |
29 | | - ScrewHoleM3(height, head_depth=height/2); |
30 | 37 | } |
31 | 38 | } |
32 | 39 |
|
33 | | -AttachmentCover(); |
| 40 | +translate([-MountAttachment_width/4-6,0,0])AttachmentCover(); |
0 commit comments