pacman-ghost: import "pac guy" model
[clinton/3d-models.git] / pacman-ghost / pacman-ghost.scad
CommitLineData
c9a67c51
CE
1//
2// Pacman Ghost
3// ------------
4//
5// Created by Joao Alves (jpralves@gmail.com)
6// ------------------------------------------
7//
8// Parameters:
9
10
11// Figure diameter
12diameter = 25; // [25:5:100]
13
14height = diameter*0.65;
15// Add keychain
16key_chain = 0; // [1:On, 0:Off]
17// Add LED hole
18led_Hole = 0; // [0:Off, 5:5mm, 8:8mm, 10:10mm]
19
20// Detail
21$fn=100; // [20:Low Res, 50:Normal Res, 100:Hi Res]
22
23rotate([0,0,-90])
24difference() {
25 union() {
26 cylinder(d = diameter, h = height);
27 translate([0, 0, height]) sphere(d = diameter);
28 if (key_chain == 1) {
29 translate([0, 0, height+diameter/2])
30 rotate([0, 90, 0])
31 rotate_extrude()
32 translate([4, 0, 0])
33 circle(r = 1.5);
34 }
35 }
36 translate([diameter/2, -diameter/4, height])
37 sphere(d = diameter/3.5);
38 translate([diameter/2, diameter/4, height])
39 sphere(d = diameter/3.5);
40 translate([0, 0, -0.1])
41 for(a = [0:11]) {
42 rotate([a/12*360,-90,0])
43 scale([1.5,1,1])
44 translate([0,0,diameter/12.5])
45 cylinder(diameter, 0,diameter/25*6.5, $fn=4);
46 }
47 if (led_Hole > 0) {
48 union() {
49 cylinder(d = led_Hole+2, h = height-(led_Hole+2));
50 translate([0, 0, height-(led_Hole+2)]) sphere(d = led_Hole+2);
51 }
52 }
53}