From a9f371ff81df6ee1a50d7a0376c278e6b6a16129 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 18 Dec 2012 02:10:03 -0800 Subject: [PATCH 1/1] Add closed_trianglefan --- box_by_trianglefan.html | 4 ++-- nt3d.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/box_by_trianglefan.html b/box_by_trianglefan.html index 1972560..7d4271b 100644 --- a/box_by_trianglefan.html +++ b/box_by_trianglefan.html @@ -14,8 +14,8 @@ var yz = [0, size, size]; var xyz = [size, size, size]; return [].concat( - nt3d.trianglefan([origin, x, xz, z, yz, y, xy, x]), - nt3d.trianglefan([xyz, yz, z, xz, x, xy, y, yz])); + nt3d.closed_trianglefan([origin, x, xz, z, yz, y, xy]), + nt3d.closed_trianglefan([xyz, yz, z, xz, x, xy, y])); } var params = [["Size", 1]]; diff --git a/nt3d.js b/nt3d.js index ae17af1..daa628b 100644 --- a/nt3d.js +++ b/nt3d.js @@ -30,6 +30,9 @@ nt3d = { } return result; }, + closed_trianglefan: function(fan) { + return nt3d.trianglefan(fan.concat([fan[1]])); + }, quadstrip: function(strip) { if (strip.length % 2 != 0) { alert("quadstrip length not divisble by 2!"); -- 2.44.1