// GLOBAL VARIABLES Mesh M = new Mesh(); Mesh S = new Mesh(); int showSkeletOnly=1; int rings=1; // number of rings for colorcoding float r=10.0; // radius of spheres for displaying vertices class Mesh { // int w=6; // size of initial Tmesh-grid made in setup // ==================================== INIT, CREATE, COPY MESH ==================================== Mesh() {} void reset() {nv=0; nc=0; nt=0;} void declare() { for (int i=0; i0)&&(depthrr) ncc=n(ncc); return ncc;} boolean isStick(int cc, float v) { float a = rad[v(n(cc))]; float b = rad[v(p(cc))]; return ((bg(c).disTo(g(o(c)))) {flip(c);}; }; }; } // assumes manifold void collapse() {collapse(c);} void collapse(int c) { // collapse edge opposite to corner c int b=p(c), oc=o(c), vnc=v(n(c)); visible[t(c)]=false; visible[t(oc)]=false; if (true) return; for (int a=b; a!=n(oc); a=p(r(a))) {V[a]=vnc;}; V[p(c)]=vnc; V[n(oc)]=vnc; O[l(c)]=r(c); O[r(c)]=l(c); O[l(oc)]=r(oc); O[r(oc)]=l(oc); } // ========================================================== HOLES =========================================== pt holeCenter = new pt (0,0,0); vec holeNormal = new vec(0,0,1); pt centerOfHole() {pt C=new pt(0,0,0); int nb=0; for (int i=0; i hl="+hl); }; }; for (int t=lnt; t