Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OpenSCAD program that draws a spiral (christmas) tree .... needs a while to calculate the STL depending on the step size.
- step=5; // blockiness of the loops
- basis=90; // width of the tree (approximatly !!!!! need to reprogam this i think)
- lussen=10; // number of loops
- dikte=5; // thickness of the green led strp
- lushoogte=12; // height of the green strip to attach the leds to.
- boomhoogte=400; // height of the tree
- hf=360/(boomhoogte-40)*lussen;
- versmalling=(basis)/(360*lussen);
- zmax=360*lussen;
- step=5;
- module blad()
- {
- color([0.5,1,0.5])
- for (z=[step:step:zmax])
- {
- translate([0,0,z/hf])
- polyhedron(points=[
- [sin(z)*(versmalling*z),cos(z)*(versmalling*z),0],
- [sin(z+step)*(versmalling*(z+step)),cos(z+step)*(versmalling*(z+step)),step/hf],
- [sin(z+step)*(versmalling*(z+step)),cos(z+step)*(versmalling*(z+step)),lushoogte+(step/hf)],
- [sin(z)*(versmalling*z),cos(z)*(versmalling*z),lushoogte],
- [sin(z)*((versmalling*z)+dikte),cos(z)*(versmalling*z+dikte),0],
- [sin(z+step)*(versmalling*(z+step)+dikte),cos(z+step)*(versmalling*(z+step)+dikte),step/hf],
- [sin(z+step)*(versmalling*(z+step)+dikte),cos(z+step)*(versmalling*(z+step)+dikte),lushoogte+step/hf],
- [sin(z)*(versmalling*z+dikte),cos(z)*(versmalling*z+dikte),lushoogte]
- ],faces=[ [3,2,1],[1,0,3],[0,1,5],[4,0,5],[2,3,6],[3,7,6],[6,7,5],[7,4,5],[2,6,1],[6,5,1],[7,3,0],[4,7,0] ]);
- }
- }
- module tak()
- {
- color([0.5,0.2,0]) translate([0,0,0])cylinder(h=boomhoogte,r=5,$fn=40);
- for (z=[120*4:120:zmax])
- {
- rotate([0,0,-z+90])
- translate([0,-2.5,z/hf+2])
- color([0.5,0.2,0])
- cube([versmalling*z+(5/2),5,lushoogte-4]);
- }
- }
- ;
- module boom()
- {
- blad();
- tak();
- }
- difference()
- {
- boom();
- color([0.5,0.2,0]) translate([0,0,-1])cylinder(h=boomhoogte+2,r=2.2,$fn=40);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement