summaryrefslogtreecommitdiff
path: root/example.scad
blob: 65d20f4b5cbb20f91a856ba3ccd4af9b0ce1a43b (plain)
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

module test001()
{
	function r_from_dia(d) = d / 2;

	module rotcy(rot, r, h) {
		rot(rot) cylinder(r = r, h = h);
	}

	difference() {
		sphere(r = r_from_dia(size));
		rotcy([ 0  0 0], cy_r, cy_h);
		rotcy([90  0 0], cy_r, cy_h);
		rotcy([ 0 90 0], cy_r, cy_h);
	}

	size = 10;
	hole = 2;

	cy_r = r_from_dia(hole);
	cy_h = r_from_dia(size * 1.5);
}

module test002()
{
	difference() {
		cube([2 2 0.5], true);
		cube([0.5 0.5 2], true);
	}
}

module test003()
{
	intersection() {
		difference() {
			union() {
				cube([3 3 3], center = true);
				trans([0 0 -2.5]) cube([1.5 1.5 5], center = true);
			}
			union() {
				cube([5 1 1], center = true);
				cube([1 5 1], center = true);
				cube([1 1 5], center = true);
			}
		}
		trans([0 0 0.5])
			cylinder(h = 5, r1 = 2, r2 = 0.5, center = true);
	}
}

test003();

contact: Jan Huwald // Impressum