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