acorn: v0
authorClinton Ebadi <clinton@unknownlamer.org>
Mon, 14 Aug 2017 03:22:49 +0000 (23:22 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Mon, 14 Aug 2017 03:22:49 +0000 (23:22 -0400)
The mysterious acorn

acorn/Paraboloid.scad [new file with mode: 0644]
acorn/acorn-threads.scad [new file with mode: 0644]

diff --git a/acorn/Paraboloid.scad b/acorn/Paraboloid.scad
new file mode 100644 (file)
index 0000000..25d0dc5
--- /dev/null
@@ -0,0 +1,38 @@
+//////////////////////////////////////////////////////////////////////////////////////////////\r
+// Paraboloid module for OpenScad\r
+//\r
+// Copyright (C) 2013  Lochner, Juergen\r
+// http://www.thingiverse.com/Ablapo/designs\r
+//\r
+// This program is free software. It is \r
+// licensed under the Attribution - Creative Commons license.\r
+// http://creativecommons.org/licenses/by/3.0/\r
+//////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+module paraboloid (y=10, f=5, rfa=0, fc=1, detail=44, x, hi){\r
+       // y = height of paraboloid\r
+       // f = focus distance \r
+       // fc : 1 = center paraboloid in focus point(x=0, y=f); 0 = center paraboloid on top (x=0, y=0)\r
+       // rfa = radius of the focus area : 0 = point focus\r
+       // detail = $fn of cone\r
+\r
+       hi = (y+2*f)/sqrt(2);                                                           // height and radius of the cone -> alpha = 45° -> sin(45°)=1/sqrt(2)\r
+       x =2*f*sqrt(y/f);                                                                       // x  = half size of parabola\r
+       \r
+   translate([0,0,-f*fc])                                                              // center on focus \r
+       rotate_extrude(convexity = 10,$fn=detail )              // extrude paraboild\r
+       translate([rfa,0,0])                                                            // translate for fokus area      \r
+       difference(){\r
+               union(){                                                                                        // adding square for focal area\r
+                       projection(cut = true)                                                                                                                                                  // reduce from 3D cone to 2D parabola\r
+                               translate([0,0,f*2]) rotate([45,0,0])                                                                                                   // rotate cone 45° and translate for cutting\r
+                               translate([0,0,-hi/2])cylinder(h= hi, r1=hi, r2=0, center=true, $fn=detail);    // center cone on tip\r
+                       translate([-(rfa+x ),0]) square ([rfa+x , y ]);                                                                                 // focal area square\r
+               }\r
+               translate([-(2*rfa+x ), -1/2]) square ([rfa+x ,y +1] );                                         // cut of half at rotation center \r
+       }\r
+}\r
+\r
+\r
+//paraboloid (y=50,f=10,rfa= 0,fc=1,detail=120);\r
+paraboloid (y=50,f=10,rfa= 0,fc=1,detail=120);\r
diff --git a/acorn/acorn-threads.scad b/acorn/acorn-threads.scad
new file mode 100644 (file)
index 0000000..f532ffe
--- /dev/null
@@ -0,0 +1,124 @@
+// Threads for acorn model
+// Copyright (c) 2017 Clinton Ebadi <clinton@unknownlamer.org>
+
+use <threads.scad>
+use <screw_threads.scad>
+use <Paraboloid.scad>
+
+
+//outer_d = 178;
+thread_pitch = 2.0;
+thread_size = 1.5;
+outer_d = (26 - thread_size - 10)/2;
+base_d = outer_d / 3;
+thread_height = 4;
+wall_thickness = 3;
+base_height = 20;
+
+thread_tolerance = 0.6;
+thread_angle = 60;
+
+
+//cylinder (d = outer_d, h = 10);
+module acorn_thread (outer_d = outer_d, internal = false) {
+     //outer_d = outer_d + (internal ? thread_tolerance : 0);
+     outer_d = outer_d + thread_size;
+     thread_height = thread_height;     // + (internal ? thread_tolerance : 0);
+     local_thread_size = thread_size;   // + (internal ? thread_tolerance : 0);
+
+
+
+     if (internal) {
+         echo ("outer ring = ", outer_d+wall_thickness/2+local_thread_size);
+         ScrewHole (outer_diam=outer_d, height = thread_height, pitch = thread_pitch, angle = thread_angle) {
+              cylinder (d = outer_d+wall_thickness/2+thread_size, h = thread_height);
+         }
+     }
+
+         //translate ([0, 0, internal ? -0.0 : 0]) metric_thread (diameter=outer_d, pitch = thread_pitch, thread_size=local_thread_size, length = thread_height, internal=internal, angle=thread_angle);
+
+     if (!internal) {
+         difference () {
+              ScrewThread (outer_diam=outer_d, height = thread_height, pitch = thread_pitch, tooth_height = local_thread_size, angle = thread_angle);
+              cylinder (d = outer_d-wall_thickness-local_thread_size-0.01, h = thread_height * 4, center=true);
+         }
+     }
+}
+
+
+module acorn_base_1 () {
+     hull () {
+
+         translate ([0, 0, base_height-base_d/2]) cylinder (d=outer_d, h=0.1);
+         sphere (r = base_d);
+     }
+}
+
+module acorn_base_xxx () {
+     difference () {
+         acorn_base_1 ();
+         resize ([outer_d-wall_thickness, 0, 0], auto=true) acorn_base_1 ();
+         translate ([0, 0, base_height-base_d/2-wall_thickness]) cylinder (d = outer_d - wall_thickness, h = 5);
+     }
+}
+
+rfa = 2;
+real_outer_d = 4 * sqrt(outer_d/2)*sqrt(base_height/sqrt(outer_d/2)) + rfa*2;
+echo (real_outer_d);
+module nut_1 () {
+     paraboloid (y=base_height, f=sqrt(outer_d/2),rfa=rfa,fc=0,detail=120, x = outer_d, hi=base_height);
+}
+
+module nut () {
+     //cylinder(d=real_outer_d, h=base_height+1);
+     difference () {
+         nut_1 ();
+         translate ([0, 0, wall_thickness]) resize ([real_outer_d - wall_thickness, 0, 0], auto=true) nut_1 ();
+     }
+
+     translate ([0, 0, base_height-0.1]) acorn_thread (outer_d = real_outer_d);//, $fa=0.1, $fs=0.1);
+
+}
+
+
+
+//$fs = 0.1;
+//$fa = 1;
+
+module nuts () {
+//translate ([real_outer_d+10, 0, 0,])  nut ();
+translate ([0, 0, thread_height]) rotate ([180, 0, 0]) acorn_thread (outer_d = real_outer_d, internal=true); //, outer_d=real_outer_d);
+
+}
+
+//print_test();
+nuts ();
+
+//fit_test ();
+
+module print_test () {
+     translate ([real_outer_d+5, 0, thread_height]) rotate ([180, 0, 0]) acorn_thread (outer_d = real_outer_d, internal=true); //, outer_d=real_outer_d);
+     translate ([0, 0, thread_height]) rotate ([180, 0, 0]) union () {
+         translate ([0, 0, 0]) cylinder (d=real_outer_d-wall_thickness, h=thread_height);
+         translate ([0, 0, -thread_height*3]) cylinder (d=real_outer_d/2, h=thread_height*3);
+         acorn_thread (outer_d = real_outer_d);
+     }
+
+
+}
+
+module fit_test () {
+     intersection () {
+         union () {
+              color ("YellowGreen", 0.5) acorn_thread (outer_d = real_outer_d, internal=true);
+              /* /\*translate ([0, 0, thread_height]) rotate ([180, 0, 0]) *\/ color ("Peru") union () { */
+              /*           translate ([0, 0, 0]) cylinder (d=real_outer_d-wall_thickness, h=thread_height); */
+              /*           translate ([0, 0, -thread_height*3]) cylinder (d=real_outer_d/2, h=thread_height*3); */
+              /*           acorn_thread (outer_d = real_outer_d); */
+              /* } */
+         }
+         //color ("White", 0.5) cube (real_outer_d);
+     }
+
+
+}