blob: a9a3cf96f160832eaeb8a2cff097dbb29f28e724 (
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
53
54
55
56
57
58
59
60
61
62
63
64
|
module child1() {
echo("child1");
}
module child2() {
echo("child2");
}
module child3() {
echo("child3");
}
module child4() {
echo("child4");
}
module child5() {
echo("child5");
}
module test_children_empty() {
echo("Children empty: begin");
children();
echo("Children empty: end");
}
test_children_empty() {
child1();child2();child3();child4();child5();
}
module test_children_scalar() {
echo("Children scalar: begin");
children(0); // child1
children(4); // child5
children(2); // child3
children(5); // out
children(-1); // out
echo("Children scalar: end");
}
test_children_scalar() {
child1();child2();child3();child4();child5();
}
module test_children_vector() {
echo("Children vector: begin");
children([4]); // child5 last
children([0,3,1]); // child1, child4, child2
children([5,-1]); // out, out
echo("Children vector: end");
}
test_children_vector() {
child1();child2();child3();child4();child5();
}
module test_children_range() {
echo("Children range: begin");
children([0:4]); // all
children([1:2]); // child2, child3
children([0:2:4]); // child1, child3, child5
children([4:-1:0]); // out, out
echo("Children range: end");
}
test_children_range() {
child1();child2();child3();child4();child5();
}
// to avoid no object error
cube(1.0);
|