Commit | Line | Data |
---|---|---|
851a9f51 CE |
1 | /* |
2 | Simple model to test for surface ringing at high print speeds. | |
3 | */ | |
4 | ||
5 | $fn = 64; | |
6 | ||
7 | radius = 35; | |
8 | height = 35; | |
9 | n_pits = 3; | |
10 | ||
11 | pit_radius = height/n_pits/2; | |
12 | //pit_height = radius*2; | |
13 | ||
14 | difference () { | |
15 | cylinder (h = height, r = radius, center = true, $fn = 128); | |
16 | cylinder (h = height+1, r = radius-radius/4, center = true, $fn = 128); | |
17 | pits (offset = radius); | |
18 | } | |
19 | pits (offset = -radius); | |
20 | ||
21 | pit_rotations = rands (min_value = 0, max_value = 180, value_count = n_pits); | |
22 | ||
23 | module pits (offset) { | |
24 | for (i = [0 : n_pits - 1]) { | |
25 | echo (pit_rotations[i]); | |
26 | rotate ([0, 0, pit_rotations[i]]) | |
27 | translate ([offset, 0, -height/2+pit_radius+i*height/n_pits]) | |
28 | rotate ([0, 90, 0]) { | |
29 | /*translate ([0, 0, -3])*/ sphere (r = pit_radius); | |
30 | // cylinder (h = 6, r = pit_radius, center = true); | |
31 | } | |
32 | } | |
33 | } | |
34 | ||
35 | ||
36 | module random_balls () { | |
37 | pit_offsets = rands (min_value = -radius/2, max_value = radius/2, value_count = n_pits); | |
38 | pit_rotations = rands (min_value = 0, max_value = 180, value_count = n_pits); | |
39 | ||
40 | for (i = [0 : n_pits-1]) { | |
41 | translate ([0, 0, max (-pit_radius, i*height/n_pits-pit_height)]) rotate ([pit_rotations[i], 90, 0]) | |
42 | translate ([radius, radius, 0]) sphere (r = pit_radius); | |
43 | //cylinder (h = pit_height, r = pit_radius, center = true); | |
44 | } | |
45 | } |