// 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 {
void importPolyloop(Polyloop P){
this.init(); //zeros out the mesh
for(int i=0;i
0)&&(depthrightmostVertValue){rightmostVertValue=G[i].x;}
}
distanceFromVertVals = rightmostVertValue - leftmostVertValue;
for(int i=0;irightmostVertValue){rightmostVertValue=G[i].x;}
}
distanceFromVertVals = rightmostVertValue - leftmostVertValue;
for(int i=0;iMt[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;