summaryrefslogtreecommitdiff
path: root/testdata/scad/features/ifelse-tests.scad
blob: 3c72d559fdb2a896abb1c80204d226f2de03e0c8 (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
if (true) {
  cube(2, true);
  translate([-3,0,0]) cube(2, true);
}
else {
  cylinder(r=1,h=2);
  translate([-3,0,0]) cylinder(r=1,h=2);
}

translate([3,0,0])
  if (false) cylinder(r=1,h=2);
  else cube(2, true);

translate([0,3,0])
  if (false) cylinder(r=1,h=2);
  else if (true) cube(2, true);
  else sphere();

translate([3,3,0])
  if (false) cylinder(r=1,h=2);
  else if (false) sphere();
  else cube(2, true);

translate([6,0,0])
  if (0) cylinder(r=1,h=2);
  else cube(2, true);

translate([6,3,0])
  if (1) cube(2, true);
  else cylinder(r=1,h=2);

translate([9,0,0])
  if ("") cylinder(r=1,h=2);
  else cube(2, true);

translate([9,3,0])
  if ("hello") cube(2, true);
  else cylinder(r=1,h=2);

translate([12,0,0])
  if ([]) cylinder(r=1,h=2);
  else cube(2, true);

translate([12,3,0])
  if ([1,2,3]) cube(2, true);
  else cylinder(r=1,h=2);

translate([15,0,0])
  if (ILLEGAL) cylinder(r=1,h=2);
  else cube(2, true);
contact: Jan Huwald // Impressum