// CORNER TABLE FOR TRIANGLE MESHES by Jarek Rosignac // Last edited Feb 17, 2008 Mesh M = new Mesh(); // creates a default triangle meshvoid computeValenceAndResetNormals() { // caches valence of each vertex //========================== class MESH =============================== class Mesh { // ==================================== INIT, CREATE, COPY ==================================== Mesh() {} int maxnv = 30000; // max number of vertices int maxnt = maxnv*2; // max number of triangles void declare() {c=0; sc=0; prevc=0; for (int i=0; i0)&&(depthMt[t(c)]) {c=3*i;};}; rings=255; for(int i=0; i0) visible[i]=false; } // ========================================================== GARBAGE COLLECTION =========================================== void clean() {excludeInvisibleTriangles(); compactVO(); compactV(); M.normals();} // removes deleted triangles and unused vertices void excludeInvisibleTriangles () {for (int b=0; b0.00001) { r=log(x) / log(2);} ; return(r);} vec labelD=new vec(-4,+4, 12); // offset vector for drawing labels int maxr=1;