summaryrefslogtreecommitdiff
path: root/testdata/scad/misc/vector-values.scad
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2012-05-28 16:48:46 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2012-05-28 16:48:46 (GMT)
commitdd2002a81673b3875ce8c4e8a61cb10278c4eb03 (patch)
tree7aaadf1c9b12cd37a7a913d3e76256f6406fa939 /testdata/scad/misc/vector-values.scad
parent4381762f5aa2e6a56258618e585e1510ead88684 (diff)
parent67eb2ebe90447e966dc1e08b91c43d937c521583 (diff)
Tidy up code. Generate proper test png images. Merge branch 'master' into caliston1.
Conflicts: src/PolySetCGALEvaluator.cc
Diffstat (limited to 'testdata/scad/misc/vector-values.scad')
-rw-r--r--testdata/scad/misc/vector-values.scad40
1 files changed, 40 insertions, 0 deletions
diff --git a/testdata/scad/misc/vector-values.scad b/testdata/scad/misc/vector-values.scad
new file mode 100644
index 0000000..1872b39
--- /dev/null
+++ b/testdata/scad/misc/vector-values.scad
@@ -0,0 +1,40 @@
+// Value vector tests.
+
+a1=[0,1,2];
+b1=[3,4,5];
+c1=a1*b1;
+echo(str("Testing vector dot product: ",c1));
+
+d1=[1,0];
+echo(str(" Bounds check: ",a1*d1));
+
+m2=[[0,1],[1,0]];
+v2=[2,3];
+p2=m2*v2;
+echo(str("Testing matrix * vector: ",p2));
+
+d2=[0,0,1];
+echo(str(" Bounds check: ",m2*d2));
+
+m3=[[1,-1,1],[1,0,-1]];
+v3=[1,1];
+p3=v3*m3;
+echo(str("Testing vector * matrix: ",p3));
+
+echo(str(" Bounds check: ",m3*v3));
+
+ma4=[ [1,0],[0,1] ];
+mb4=[ [1,0],[0,1] ];
+echo(str("Testing id matrix * id matrix: ",ma4*mb4));
+
+ma5=[ [1, 0, 1]
+ ,[0, 1,-1] ];
+mb5=[ [1,0]
+ ,[0,1]
+ ,[1,1] ];
+echo(str("Testing asymmetric matrix * matrix: ",ma5*mb5));
+echo(str("Testing alternate asymmetric matrix * matrix: ",mb5*ma5));
+
+echo(str(" Bounds check: ",ma5*ma4));
+
+cube(1.0);
contact: Jan Huwald // Impressum