]> git.scottworley.com Git - nt3d/blobdiff - box_by_extrude.html
Pass numeric parameters as numbers
[nt3d] / box_by_extrude.html
index e8183f2ccf59632f570f4ec999f00a44e7eab787..a95a7d300a7b90243c28954838cafb7a887491ad 100644 (file)
@@ -3,12 +3,11 @@
     <title>Box by extrude</title>
     <script type="text/javascript" src="nt3d.js"></script>
     <script type="text/javascript">
-      function box_by_extrude(size_as_string) {
-        var size = parseFloat(size_as_string);
-        var origin = [0,    0   ];
-        var x      = [size, 0   ];
-        var y      = [0,    size];
-        var xy     = [size, size];
+      function box_by_extrude(size) {
+        var origin = [0,    0,    0];
+        var x      = [size, 0,    0];
+        var y      = [0,    size, 0];
+        var xy     = [size, size, 0];
        return nt3d.extrude([origin, x, xy, y],
                            [[0, 0, 0], [0, 0, 1]],
                            [[0, 0, 1], [0, 0, 1]],