-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmas-light.scad
65 lines (62 loc) · 1.61 KB
/
xmas-light.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//Globe fairy light cap generator - bigclivedotcom
//Generates an LED cap based on a top and bottom
//diameter with flat sides.
//Suggested default values are in brackets.
//ADJUST THESE VARIABLES FOR GLOBE SHAPE AND SIZE
top=20; //Diameter of globe at top (6)
bottom=35; //Diameter of globe at base (20)
height=50; //length of lamp (40)
facets=12; //Number of facets around lamp (12 at first)
//More facets equals MUCH longer processing time!
//ADJUST THESE VARIABLES FOR BASE DIMENSIONS
baselen=13; //Length of base outside globe (4)
inside=13; //Internal diameter of base (5.5)
led=8; //LED HOLE diameter (5)
//Don't touch variables below this line
$fn=facets;
toprad=top/2;
botrad=bottom/2;
outside=inside+2;
base=baselen+5;
difference(){
union(){
difference(){
union(){
//Outside shell of globe
hull() {
//base of globe
sphere(r=botrad);
//top of globe
translate([0,0,height-toprad-botrad])
sphere(r=toprad);
}
}
//Inside hollow of globe
hull() {
//base of globe
sphere(r=botrad-1);
//top of globe
translate([0,0,height-toprad-botrad])
sphere(r=toprad-1);
}
}
//LED base cylinder
translate([0,0,0-botrad-(base-5)])
cylinder(h=base,d1=outside,d2=outside,$fn=100);
//LED base dome
translate([0,0,0-botrad+5])
cylinder(h=(outside-led)/2,d1=outside,d2=led+1,$fn=100);
}
//LED base interior
translate([0,0,0-botrad-(base-5)-.01])
cylinder(h=base+.02,d1=inside,d2=inside,$fn=100);
//LED dome interior
translate([0,0,0-botrad+5])
cylinder(h=(outside-led)/2-1,d1=inside,d2=led,$fn=100);
//LED hole
translate([0,0,0-botrad+5])
cylinder(h=10,d1=led,d2=led,$fn=100);
//x-ray cube
//translate([-50,-50,-40])
//cube([100,50,100]);
}