-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.scad
44 lines (38 loc) · 795 Bytes
/
build.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
42
43
44
$build_id = "";
function building(filename) = is_undef(filename) ?
!is_undef(build)
: !is_undef(build) && build == filename;
function previewing() = !building();
module build(filename) {
$build_id = filename;
if(!is_undef(scad_build_scan) && scad_build_scan == true) {
echo(str("scad_build_scan: ", filename));
}
else if(previewing() || build == filename) {
children();
}
}
module preview_row(spacing) {
if(previewing()) {
for(x = [0:1:$children - 1]) {
translate([x * spacing, 0, 0]) {
children(x);
}
}
}
else {
children();
}
}
module preview_column(spacing) {
if(previewing()) {
for(y = [0:1:$children - 1]) {
translate([0, y * spacing, 0]) {
children(y);
}
}
}
else {
children();
}
}