-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlock_flex_magnetic.scad
More file actions
executable file
·43 lines (41 loc) · 2.24 KB
/
lock_flex_magnetic.scad
File metadata and controls
executable file
·43 lines (41 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Flex Magnet
*/
module flex_magnetic_positive(magnet_hole=6, height=6) {
if (magnet_hole > 0) {
translate([magnet_hole/2+1,0,0]) cylinder(.41,magnet_hole/2+1-.25,magnet_hole/2+1, $fn=100);
translate([magnet_hole/2+1,0,0.4]) cylinder(height-.4,magnet_hole/2+1,magnet_hole/2+1, $fn=100);
hull() {
translate([0.25,-magnet_hole/2-1+.25,0]) cube([magnet_hole/2+1-.25,magnet_hole+2-.5,1]);
translate([0,-magnet_hole/2-1,.4]) cube([magnet_hole/2+1,magnet_hole+2,height-.4]);
}
}
}
module flex_magnetic_negative(magnet_hole=6, height=6) {
if (magnet_hole > 0) {
translate([magnet_hole/2+1,0,1]) cylinder(height+2,magnet_hole/2,magnet_hole/2, $fn=100);
translate([1,-magnet_hole/2,1]) cube([magnet_hole/2,magnet_hole,height+2]);
translate([magnet_hole/2+1,0,-1]) cylinder(10,.9,.9,$fn=50);
translate([1,-.9,-1]) cube([magnet_hole/2,.9*2,10]);
}
}
module flex_magnetic_hex(square_basis, magnet_hole=6, height=6) {
if (magnet_hole > 0) {
hull() {
translate([square_basis/2,0,0]) rotate([0,0,90]) translate([magnet_hole/2+1,0,1]) cylinder(height+2,magnet_hole/2,magnet_hole/2, $fn=100);
rotate([0,0,-120]) mirror([1,0,0]) translate([square_basis/2,0,0]) rotate([0,0,90]) translate([magnet_hole/2+1,0,1]) cylinder(height+2,magnet_hole/2,magnet_hole/2, $fn=100);
}
translate([square_basis/2,0,0]) rotate([0,0,90]) union() {
//translate([magnet_hole/2+1,0,1]) cylinder(8,magnet_hole/2,magnet_hole/2, $fn=100);
translate([1,-magnet_hole/2,1]) cube([magnet_hole/2,magnet_hole,height+2]);
translate([magnet_hole/2+1,0,-1]) cylinder(10,.9,.9,$fn=50);
translate([1,-.9,-1]) cube([magnet_hole/2,.9*2,10]);
}
rotate([0,0,-120]) mirror([1,0,0]) translate([square_basis/2,0,0]) rotate([0,0,90]) union() {
//translate([magnet_hole/2+1,0,1]) cylinder(8,magnet_hole/2,magnet_hole/2, $fn=100);
translate([1,-magnet_hole/2,1]) cube([magnet_hole/2,magnet_hole,height+2]);
translate([magnet_hole/2+1,0,-1]) cylinder(10,.9,.9,$fn=50);
translate([1,-.9,-1]) cube([magnet_hole/2,.9*2,10]);
}
}
}