creepy-hand: final version
[clinton/3d-models.git] / acorn / Paraboloid.scad
1 //////////////////////////////////////////////////////////////////////////////////////////////
2 // Paraboloid module for OpenScad
3 //
4 // Copyright (C) 2013 Lochner, Juergen
5 // http://www.thingiverse.com/Ablapo/designs
6 //
7 // This program is free software. It is
8 // licensed under the Attribution - Creative Commons license.
9 // http://creativecommons.org/licenses/by/3.0/
10 //////////////////////////////////////////////////////////////////////////////////////////////
11
12 module paraboloid (y=10, f=5, rfa=0, fc=1, detail=44, x, hi){
13 // y = height of paraboloid
14 // f = focus distance
15 // fc : 1 = center paraboloid in focus point(x=0, y=f); 0 = center paraboloid on top (x=0, y=0)
16 // rfa = radius of the focus area : 0 = point focus
17 // detail = $fn of cone
18
19 hi = (y+2*f)/sqrt(2); // height and radius of the cone -> alpha = 45° -> sin(45°)=1/sqrt(2)
20 x =2*f*sqrt(y/f); // x = half size of parabola
21
22 translate([0,0,-f*fc]) // center on focus
23 rotate_extrude(convexity = 10,$fn=detail ) // extrude paraboild
24 translate([rfa,0,0]) // translate for fokus area
25 difference(){
26 union(){ // adding square for focal area
27 projection(cut = true) // reduce from 3D cone to 2D parabola
28 translate([0,0,f*2]) rotate([45,0,0]) // rotate cone 45° and translate for cutting
29 translate([0,0,-hi/2])cylinder(h= hi, r1=hi, r2=0, center=true, $fn=detail); // center cone on tip
30 translate([-(rfa+x ),0]) square ([rfa+x , y ]); // focal area square
31 }
32 translate([-(2*rfa+x ), -1/2]) square ([rfa+x ,y +1] ); // cut of half at rotation center
33 }
34 }
35
36
37 //paraboloid (y=50,f=10,rfa= 0,fc=1,detail=120);
38 paraboloid (y=50,f=10,rfa= 0,fc=1,detail=120);