]> www.fi.muni.cz Git - things.git/commitdiff
Access card holder
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 16 May 2023 06:31:47 +0000 (08:31 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 16 May 2023 06:31:47 +0000 (08:31 +0200)
access-card-holder.scad [new file with mode: 0644]

diff --git a/access-card-holder.scad b/access-card-holder.scad
new file mode 100644 (file)
index 0000000..b6d2248
--- /dev/null
@@ -0,0 +1,53 @@
+infty = 200;
+eps = 0.01;
+
+card_x = 86 + 0.5;
+card_y = 54 + 0.5;
+card_z = 1.2;
+corner_r = 2.5;
+
+body_h = 10;
+wall = 1.2;
+
+clip_h = 4;
+clip_hole_d = 5;
+
+module credit_card() {
+       hull() {
+               translate([corner_r, corner_r, 0])
+                       cylinder(r = corner_r, h = card_z, $fn = 32);
+               translate([card_x - corner_r, corner_r, 0])
+                       cylinder(r = corner_r, h = card_z, $fn = 32);
+               translate([corner_r, card_y - corner_r, 0])
+                       cylinder(r = corner_r, h = card_z, $fn = 32);
+               translate([card_x - corner_r, card_y - corner_r, 0])
+                       cylinder(r = corner_r, h = card_z, $fn = 32);
+       }
+}
+
+difference() {
+       translate([0, 2*wall+card_z, 0])
+       rotate([90, 0, 0])
+       hull() {
+               cube([body_h, body_h, 2*wall+card_z]);
+               translate([sqrt(card_x^2+card_y^2) + 2*wall - body_h/2, body_h/2, 0])
+                       cylinder(r = body_h/2, h = 2*wall+card_z, $fn = 12);
+
+       }
+       % translate([wall, wall, body_h/2-0.3*corner_r]) // !!! heuristka
+       rotate([0, atan((card_y-corner_r)/(card_x-corner_r)), 0])
+       translate([0, card_z, 0])
+       rotate([90, 0, 0])
+               credit_card();
+       
+       translate([body_h, wall+card_z-eps, -eps])
+               cube([sqrt(card_x^2+card_y^2) + 2*wall - 2*body_h, wall+2*eps, body_h+2*eps]);
+}
+
+// clip with hole
+translate([-clip_hole_d/2, wall+card_z/2, 0])
+difference() {
+       cylinder(r = clip_hole_d/2 + wall, h = clip_h, $fn = 32);
+       translate([0, 0, -eps])
+               cylinder(r = clip_hole_d/2, h = clip_h + 2*eps);
+}