]> www.fi.muni.cz Git - things.git/commitdiff
toothbrush-holder-9x3.scad: published version
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 1 May 2014 09:12:53 +0000 (11:12 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 1 May 2014 09:12:53 +0000 (11:12 +0200)
toothbrush-holder-9x3.scad [new file with mode: 0644]

diff --git a/toothbrush-holder-9x3.scad b/toothbrush-holder-9x3.scad
new file mode 100644 (file)
index 0000000..dbe2100
--- /dev/null
@@ -0,0 +1,189 @@
+epsilon=0.01;
+infty=400;
+
+module cut_ellipse(height, dist, x) {
+       difference() {
+               translate([0, dist, height/2-x])
+                       rotate([90, 0, 0])
+                       scale([0.6, 1, 1])
+                       cylinder(r=height/2, h=2);
+               translate([0, 0, -infty/2])
+                       cube(infty, center=true);
+       };
+};
+
+module stem() {
+       hull() {
+               cut_ellipse(25, 31, 4);
+               cut_ellipse(10, 24, 6);
+       };
+       difference() {
+       union() {
+       translate([3.75, 31-epsilon, 0])
+               rotate([0, 15, 0]) {
+                       cube([1.5, 8, 8]);
+                       difference() {
+                               translate([1, 8, 0])
+                                       cylinder(r=2, h=8);
+                               translate([infty/2+1.5-epsilon, 0, 0])
+                                       cube(infty, center=true);
+                       };
+               };
+       translate([-3.75, 31-epsilon, 0])
+               rotate([0, -15, 0]) {
+                       translate([-1.5, 0, 0])
+                       cube([1.5, 8, 8]);
+                       difference() {
+                               translate([-1, 8, 0])
+                                       cylinder(r=2, h=8);
+                               translate([-infty/2-1.5+epsilon, 0, 0])
+                                       cube(infty, center=true);
+                       };
+               };
+       };
+       translate([0, 0, -infty/2])
+               cube(infty, center=true);
+       };
+
+/*
+       hull() {
+               cut_ellipse(12, 40, 0.5);
+               cut_ellipse( 8, 35, 2);
+       };
+       hull() {
+               cut_ellipse(12, 35, 2);
+               cut_ellipse(10, 25, 5);
+       };
+       hull() {
+               cut_ellipse(10, 25, 5);
+               cut_ellipse(12, 10, 4);
+       };
+*/
+       for (dist=[0:9.5:19])
+               translate([0, dist, 0])
+                       interdental_cylinder();
+};
+
+module stem_minus() {
+       for (dist=[0:9.5:19])
+               translate([0, dist, 0])
+                       interdental_hole();
+}
+
+module body() {
+       difference() { union() {
+       for (angle=[-24:6:24]) {
+               translate([0, -112, 0])
+               rotate([0, 0, angle])
+               translate([0, 130, 0])
+               difference() {
+                       stem();
+                       stem_minus();
+               }
+       };
+                       
+       translate([0, -112, 0]) difference() {
+               union() {
+                       cylinder(r=126, h=11);
+                       translate([0, 0, 11-epsilon])
+                       scale([1, 1, 0.07])
+                       sphere(r=126);
+                       difference() {
+                               union() {
+                                       difference() {
+                                       cylinder(r=159, h=11);
+                                       translate([0,0,-infty/2])
+                                               cylinder(r=158, h=infty);
+                                       };
+                               };
+                       
+               rotate([0, 0, -24])
+                       translate([infty/2, 0, 0])
+                               cube(infty, center=true);
+               rotate([0, 0, 24])
+                       translate([-infty/2, 0, 0])
+                               cube(infty, center=true);
+                       };
+               };
+               translate([0, 112-infty/2-epsilon, 0])
+                       cube(infty, center=true);
+/*
+               translate([0, 0, -infty/2-epsilon])
+                       cube(infty, center=true);
+               rotate([0, 0, -28])
+                       translate([infty/2, 0, 0])
+                               cube(infty, center=true);
+               rotate([0, 0, 28])
+                       translate([-infty/2, 0, 0])
+                               cube(infty, center=true);
+*/
+       };
+       translate([-50, 1, 6])
+       rotate([0, 90, 0])
+               cylinder(r=2.5, h=100, $fn=4);
+       };
+       rotate([-90, 0, 0])
+               translate([0,-6,3])
+               cylinder(r=3.5, h=55);
+       rotate([-90, 0, 0])
+               translate([0,-6,-infty/2])
+               cylinder(r=1.75, h=infty, $fn=6);
+       };
+};
+
+module interdental_hole() {
+       translate([0, 0, -infty/2])
+               cylinder(r=4, h=infty);
+}
+
+module interdental_cylinder() {
+       // translate([-5.5, -5.5, 0]) cube([11, 11, 8]);
+       difference() {
+               cylinder(r=5.5, h=11);
+               translate([-infty/2, 0, 19])
+                       rotate([0, 90, 0])
+                               cylinder(r=9, h=infty);
+       }
+/*
+       difference() {
+               translate([0, -5.50, 3])
+               rotate([-90, 0, 0])
+                       cylinder(r=5, h=11);
+               translate([0, 0, -infty/2-epsilon])
+                       cube(infty, center=true);
+       };
+*/
+};
+
+
+/*
+for (angle=[-45:18:45]) {
+       rotate([0, 0, angle])
+               for (dist=[30:10:60])
+                       translate([dist, 0, 0])
+                               difference() {
+                                       interdental_cylinder();
+                                       interdental_hole();
+                               }
+};
+
+
+difference() {
+       body();
+
+       rotate([-90, 0, 0])
+               translate([0,-4,3])
+               cylinder(r=3, h=infty);
+       rotate([-90, 0, 0])
+               translate([0,-4,-epsilon])
+               cylinder(r=1.5, h=infty);
+};
+*/
+
+body($fn=128);
+/* 
+difference() {
+       stem();
+       stem_minus();
+};
+*/