}
public synchronized void breakit() {
- if (verts > 200) return;
+ if (verts > 50) return;
PriorityQueue<Mesh.E> es = new PriorityQueue<Mesh.E>();
for(Mesh.E e : tile.edges()) es.add(e);
for(int i=0; i<10; i++) {
public synchronized void rand(double temperature, Mesh.Vert p) {
double tile_score = tile.score();
double goal_score = goal.score();
- p.rescore();
+ p.applyQuadricToNeighbor();
Vec v = new Vec((random.nextFloat() - (float)0.5) / 1000,
(random.nextFloat() - (float)0.5) / 1000,
public void anneal() throws Exception {
int verts = 0;
while(true) {
- for(int i=0; i<1; i++) {
+ HashSet<Mesh.Vert> hs = new HashSet<Mesh.Vert>();
+ for(Mesh.Vert p : tile.vertices()) hs.add(p);
+ for(int i=0; i<10; i++) {
repaint();
- for(Mesh.T t : tile)
- for(Mesh.Vert p : new Mesh.Vert[] { t.v1(), t.v2(), t.v3() }) {
- rand(10,p);
- }
- goal.unscore();
- tile.unscore();
- goal.fundamental();
- tile.fundamental();
- goal.rescore();
- tile.rescore();
+ for(Mesh.Vert v : hs) rand(10,v);
}
breakit();
+ repaint();
+ goal.unApplyQuadricToNeighborAll();
+ repaint();
+ tile.recomputeAllFundamentalQuadrics();
+ repaint();
+ goal.applyQuadricToNeighborAll();
}
}