5 // Created by Joao Alves (jpralves@gmail.com)
6 // Tea Light added by Clinton Ebadi <clinton@unknownlamer.org>
7 // Pac Guy model by Fry Hyde
8 // ------------------------------------------
13 ghost_diameter = 50; // [25:5:100]
14 pacguy_diameter = ghost_diameter * 1.5;
16 height = ghost_diameter*0.65;
18 key_chain = 0; // [1:On, 0:Off]
20 led_hole = 0; // [0:Off, 5:5mm, 8:8mm, 10:10mm]
21 // Add tea light holder
30 $fa=4; // [20:Low Res, 10:Normal Res, 4:Hi Res]
36 // Built in sacrificial support layer
37 tea_light_support = true;
38 tea_light_support_thickness = 0.3;
46 cylinder(d = ghost_diameter, h = height);
47 translate([0, 0, height]) sphere(d = ghost_diameter);
49 translate([0, 0, height+ghost_diameter/2])
56 translate([ghost_diameter/2, -ghost_diameter/4, height])
57 sphere(d = ghost_diameter/3.5);
58 translate([ghost_diameter/2, ghost_diameter/4, height])
59 sphere(d = ghost_diameter/3.5);
60 translate([0, 0, -0.1])
62 rotate([a/12*360,-90,0])
64 translate([0,0,ghost_diameter/12.5])
65 cylinder(ghost_diameter, 0,ghost_diameter/25*6.5, $fn=4);
70 module led_hole (led_d = led_hole, led_h = 0) {
71 // led_h==0 auto-sets height, openscad can't reference other
72 // arguments so this abomination arises
73 led_h = led_h ? led_h : height - (led_d+2);
76 cylinder(d = led_d+2, h = led_h);
77 translate([0, 0, led_h]) sphere(d = led_d+2);
81 module tea_light_base () {
84 cylinder (d = base_diameter + 1, h = base_height + 1);
85 led_hole (led_d = bulb_diameter, led_h = base_height+8);
87 // sacrificial support layer, subtracted since this will be
88 // subtracted from the ghost body
89 if (tea_light_support) {
90 translate ([0, 0, base_height+(1 - tea_light_support_thickness)])
91 #cylinder (d=base_diameter+2, h=tea_light_support_thickness);
97 // original model ghost_diameter is 30.464mm, scale to 1mm and then to
98 // final ghost_diameter. z is slightly smaller due to bottom being cut
100 s = 1 / 30.464 * pacguy_diameter;
101 scale ([s, s, s]) translate ([0, 0, 28.742 / 2]) import ("PacGuy.stl", convexity=10);
104 module subtract_led () {
107 if (led_hole > 0) led_hole ();
108 if (tea_light) tea_light_base ();
113 rotate ([0, 0, -90]) ghost ();
118 translate ([ ghost ? (ghost_diameter + pacguy_diameter) / 2 + 10 : 0, 0, 0]) subtract_led () {