checkpoint
[anneal.git] / src / Main.java
index c789e0f..dc880cd 100644 (file)
@@ -80,37 +80,37 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
             Geom.P p0 = goal.newP(stlf.coordArray[i+0].x * MAG, stlf.coordArray[i+0].y * MAG, stlf.coordArray[i+0].z * MAG);
             Geom.P p1 = goal.newP(stlf.coordArray[i+1].x * MAG, stlf.coordArray[i+1].y * MAG, stlf.coordArray[i+1].z * MAG);
             Geom.P p2 = goal.newP(stlf.coordArray[i+2].x * MAG, stlf.coordArray[i+2].y * MAG, stlf.coordArray[i+2].z * MAG);
-            Geom.V n  = goal.new V(stlf.normArray[i/3].x * MAG, stlf.normArray[i/3].y  * MAG, stlf.normArray[i/3].z * MAG);
+            Geom.Vec n  = goal.new Vec(stlf.normArray[i/3].x * MAG, stlf.normArray[i/3].y  * MAG, stlf.normArray[i/3].z * MAG);
             Geom.T t  = goal.newT(p0, p1, p2, n);
         }
 
         // rotate to align major axis -- this probably needs to be done by a human.
-        goal.transform(goal.new M(goal.new V(0, 0, 1), (float)(Math.PI/2)));
+        goal.transform(goal.new M(goal.new Vec(0, 0, 1), (float)(Math.PI/2)));
 
 
-        float goal_width  = goal.diagonal().dot(goal.new V(1, 0, 0));
-        float goal_height = goal.diagonal().dot(goal.new V(0, 1, 0));
-        float goal_depth  = goal.diagonal().dot(goal.new V(0, 0, 1));
+        float goal_width  = goal.diagonal().dot(goal.new Vec(1, 0, 0));
+        float goal_height = goal.diagonal().dot(goal.new Vec(0, 1, 0));
+        float goal_depth  = goal.diagonal().dot(goal.new Vec(0, 0, 1));
 
         float width  = (float)0.6;
         float height = (float)0.08;
         float depth  = (float)0.3;
         translations = new Geom.M[] {
 
-            tile.new M(tile.new V(-(width/2),  height,    0)),
-            tile.new M(tile.new V( (width/2),  height,    0)),
-            tile.new M(tile.new V(-(width/2), -height,    0)),
-            tile.new M(tile.new V( (width/2), -height,    0)),
-            tile.new M(tile.new V(-(width/2),       0,  depth)),
-            tile.new M(tile.new V( (width/2),       0,  depth)),
-            tile.new M(tile.new V(-(width/2),       0, -depth)),
-            tile.new M(tile.new V( (width/2),       0, -depth)),
-
-            tile.new M(tile.new V( width,           0,    0)),
-            tile.new M(tile.new V(-width,           0,    0)),
+            tile.new M(tile.new Vec(-(width/2),  height,    0)),
+            tile.new M(tile.new Vec( (width/2),  height,    0)),
+            tile.new M(tile.new Vec(-(width/2), -height,    0)),
+            tile.new M(tile.new Vec( (width/2), -height,    0)),
+            tile.new M(tile.new Vec(-(width/2),       0,  depth)),
+            tile.new M(tile.new Vec( (width/2),       0,  depth)),
+            tile.new M(tile.new Vec(-(width/2),       0, -depth)),
+            tile.new M(tile.new Vec( (width/2),       0, -depth)),
+
+            tile.new M(tile.new Vec( width,           0,    0)),
+            tile.new M(tile.new Vec(-width,           0,    0)),
             /*
-            tile.new M(tile.new V(     0,           0,    depth)),
-            tile.new M(tile.new V(     0,           0,   -depth)),
+            tile.new M(tile.new Vec(     0,           0,    depth)),
+            tile.new M(tile.new Vec(     0,           0,   -depth)),
             */
         };
 
@@ -221,10 +221,10 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
 
         tile.bind();
 
-        //mid.move(tile.new V((float)0,0,(float)-0.05));
-        //ltn.move(tile.new V((float)0,0,(float)-0.05));
+        //mid.move(tile.new Vec((float)0,0,(float)-0.05));
+        //ltn.move(tile.new Vec((float)0,0,(float)-0.05));
 
-        //mtf.move(tile.new V(0, (float)-0.05, (float)0.05));
+        //mtf.move(tile.new Vec(0, (float)-0.05, (float)0.05));
 
 
         System.out.println("tile volume: " + tile.volume());
@@ -236,7 +236,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
         Random random = new Random();
 
     public synchronized void breakit() {
-        if (verts > 20) return;
+        if (verts > 300) return;
         //double min = (tile.avgedge/tile.numedges)*(1+(4/(double)verts));
         //if (verts>0 && tile.es.peek().length() < min) return;
         PriorityQueue<Geom.E> es = new PriorityQueue<Geom.E>();
@@ -261,7 +261,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
         r1 = r1 - (float)Math.floor(r1);
         r1 = r1 * (float)0.01;
         r1 = r1 - (float)0.005;
-        Geom.V v = p.watchback().minus(p).norm().times(r1);
+        Geom.Vec v = p.watchback().minus(p).norm().times(r1);
 
         //v = p.norm().times(v.dot(p.norm()));
 
@@ -350,7 +350,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
             i++;
             if (i != 1 /*&& i!=4*/) continue;
             Geom.P p = tile.newP(0, 0, 0).times(m);
-            Geom.V v = tile.new V(p.x, p.y, p.z);
+            Geom.Vec v = tile.new Vec(p.x, p.y, p.z);
             v = v.times((float)1.04);
             gl.glTranslatef(v.x, v.y, v.z);
             draw(gl, false, tile);