-
Notifications
You must be signed in to change notification settings - Fork 1
/
series.scad
41 lines (33 loc) · 1020 Bytes
/
series.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
include <settings.scad>;
use <include/stem.scad>;
//translate([-10,-10,0]) assembled($fn=120, $inner_slop_x=-.05, $inner_slop_y=-.05);
//assembled($fn=120);
//translate([10,10,0]) assembled($fn=120, $inner_slop_x=.05, $inner_slop_y=.05);
x_range = [6:17];
y_range = [-6:6];
spacing= total_width+2;
x_tolerance = .02;
y_tolerance = x_tolerance;
combine_tolerances = true;
if (combine_tolerances) {
vec = [each x_range];
num = len(vec);
root = ceil(sqrt(num));
for(j = [0:root-1]) {
for(k = [0:root-1]) {
if (j*root + k < num) {
i = vec[j*root + k];
translate([j*spacing, k*spacing,0]) rotate([0, stem_model == "trackpoint-lp" ? 180 : 0, 0])
assembled($fn=120,
$inner_slop_x=i*x_tolerance,
$inner_slop_y=i*y_tolerance);
}
}
}
} else {
for(i = x_range) {
for(j = y_range) {
translate([i*spacing, j*spacing,0]) rotate([0, stem_model == "trackpoint-lp" ? 180 : 0, 0]) assembled($fn=120, $inner_slop_x=i*x_tolerance, $inner_slop_y=j*y_tolerance);
}
}
}