diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-24 14:16:20 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-24 14:16:20 (GMT) |
commit | 26046f6f0c4a774cbbb2af8ae7dc0e687963440c (patch) | |
tree | 38ff04fc460e8aa55134fb1ee6167fafb90a3423 /testdata/scad/misc/lookup-tests.scad | |
parent | eefcd6d0b271642d470cd55bc47d1579d943938e (diff) | |
parent | 95e399e06c6522f3fa67679808a1d52815368efa (diff) |
Merge branch 'master' into epec-kernel
Diffstat (limited to 'testdata/scad/misc/lookup-tests.scad')
-rw-r--r-- | testdata/scad/misc/lookup-tests.scad | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testdata/scad/misc/lookup-tests.scad b/testdata/scad/misc/lookup-tests.scad new file mode 100644 index 0000000..c03ec95 --- /dev/null +++ b/testdata/scad/misc/lookup-tests.scad @@ -0,0 +1,17 @@ +echo(lookup(undef, undef)); +echo(lookup(undef, [undef])); +echo(lookup(undef, [[undef]])); +echo(lookup(undef, [[undef, undef]])); +echo(lookup(0, [[0, 0]])); +echo(lookup(0.5, [[0, 0], + [1, 1]])); + +table = [[-1, -5], + [-10, -55], + [0, 0], + [1, 3], + [10, 333]]; +indices = [-20,-10,-9.9, -0.5, 0, 0.3, 1.1, 10, 10.1]; +for (i=[0:len(indices)-1]) { + echo(lookup(indices[i], table)); +} |