projects
/
anneal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint autogen tile
[anneal.git]
/
src
/
edu
/
berkeley
/
qfat
/
Main.java
diff --git
a/src/edu/berkeley/qfat/Main.java
b/src/edu/berkeley/qfat/Main.java
index
8b5b51f
..
2af52bf
100644
(file)
--- a/
src/edu/berkeley/qfat/Main.java
+++ b/
src/edu/berkeley/qfat/Main.java
@@
-456,27
+456,27
@@
public class Main extends MeshViewer {
translations = new Matrix[] {
translations = new Matrix[] {
- /*
+
Matrix.translate(new Vec(0, 0.2f,0))
Matrix.translate(new Vec(0, 0.2f,0))
- .times(Matrix.rotate(new Vec(0,1,0), (float)( 1*Math.PI/2))),
+ .times(Matrix.rotate(new Vec(0,1,0), (float)(1*Math.PI/2))),
Matrix.translate(new Vec(0,-0.2f,0))
Matrix.translate(new Vec(0,-0.2f,0))
- .times(Matrix.rotate(new Vec(0,1,0), (float)(-1*Math.PI/2))),
+ .times(Matrix.rotate(new Vec(0,1,0), (float)(1*Math.PI/2))),
Matrix.translate(new Vec( 0.2f,0,0))
Matrix.translate(new Vec( 0.2f,0,0))
- .times(Matrix.rotate(new Vec(1,0,0), (float)( 1*Math.PI/2))),
+ .times(Matrix.rotate(new Vec(1,0,0), (float)(-1*Math.PI/2))),
Matrix.translate(new Vec(-0.2f,0,0))
.times(Matrix.rotate(new Vec(1,0,0), (float)(-1*Math.PI/2))),
Matrix.translate(new Vec(-0.2f,0,0))
.times(Matrix.rotate(new Vec(1,0,0), (float)(-1*Math.PI/2))),
- */
+ Matrix.rotate(new Vec(0,0,1), (float)(2*Math.PI/2)),
/*
Matrix.rotate(new Vec(0,0,1), (float)(1*Math.PI/2)),
/*
Matrix.rotate(new Vec(0,0,1), (float)(1*Math.PI/2)),
- Matrix.rotate(new Vec(0,0,1), (float)(2*Math.PI/2)),
+
Matrix.rotate(new Vec(0,0,1), (float)(3*Math.PI/2)),
Matrix.rotate(new Vec(0,0,1), (float)(3*Math.PI/2)),
- */
- Matrix.rotate(new Vec(1,0,0), (float)(2*Math.PI/2)),
+ Matrix.rotate(new Vec(1,0,0), (float)(2*Math.PI/2)),
+ */
//Matrix.rotate(new Vec(0,0,1), (float)(2*Math.PI/2)),
//Matrix.scale(1,-1,1),
//Matrix.rotate(new Vec(0,0,1), (float)(2*Math.PI/2)),
//Matrix.scale(1,-1,1),
@@
-511,48
+511,47
@@
public class Main extends MeshViewer {
for(Matrix m2 : translations) {
for(Mesh.T t1 : tile) {
for(Mesh.T t2 : tile) {
for(Matrix m2 : translations) {
for(Mesh.T t1 : tile) {
for(Mesh.T t2 : tile) {
- if (t1==t2) continue;
Matrix m = m1.inverse().times(m2);
Matrix m = m1.inverse().times(m2);
- if ((t1.v1().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v2().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON) &&
- (t1.v3().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v1().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v2().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON) &&
+ (t1.v3().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON)) {
t2.e3().bindEdge(t1.e1(), m);
t2.e2().bindEdge(t1.e2(), m);
t2.e1().bindEdge(t1.e3(), m);
}
t2.e3().bindEdge(t1.e1(), m);
t2.e2().bindEdge(t1.e2(), m);
t2.e1().bindEdge(t1.e3(), m);
}
- if ((t1.v2().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v3().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON) &&
- (t1.v1().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v2().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v3().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON) &&
+ (t1.v1().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON)) {
t2.e3().bindEdge(t1.e2(), m);
t2.e2().bindEdge(t1.e3(), m);
t2.e1().bindEdge(t1.e1(), m);
}
t2.e3().bindEdge(t1.e2(), m);
t2.e2().bindEdge(t1.e3(), m);
t2.e1().bindEdge(t1.e1(), m);
}
- if ((t1.v3().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v1().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON) &&
- (t1.v2().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v3().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v1().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON) &&
+ (t1.v2().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON)) {
t2.e3().bindEdge(t1.e3(), m);
t2.e2().bindEdge(t1.e1(), m);
t2.e1().bindEdge(t1.e2(), m);
}
t2.e3().bindEdge(t1.e3(), m);
t2.e2().bindEdge(t1.e1(), m);
t2.e1().bindEdge(t1.e2(), m);
}
- if ((t1.v1().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v2().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON) &&
- (t1.v3().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v1().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v2().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON) &&
+ (t1.v3().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON)) {
t2.e1().bindEdge(t1.e1().pair, m);
t2.e2().bindEdge(t1.e2().pair, m);
t2.e3().bindEdge(t1.e3().pair, m);
}
t2.e1().bindEdge(t1.e1().pair, m);
t2.e2().bindEdge(t1.e2().pair, m);
t2.e3().bindEdge(t1.e3().pair, m);
}
- if ((t1.v2().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v3().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON) &&
- (t1.v1().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v2().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v3().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON) &&
+ (t1.v1().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON)) {
t2.e2().bindEdge(t1.e1().pair, m);
t2.e3().bindEdge(t1.e2().pair, m);
t2.e1().bindEdge(t1.e3().pair, m);
}
t2.e2().bindEdge(t1.e1().pair, m);
t2.e3().bindEdge(t1.e2().pair, m);
t2.e1().bindEdge(t1.e3().pair, m);
}
- if ((t1.v3().p.times(m).minus(t2.v1().p).mag() < MATCHING_EPSILON) &&
- (t1.v1().p.times(m).minus(t2.v2().p).mag() < MATCHING_EPSILON) &&
- (t1.v2().p.times(m).minus(t2.v3().p).mag() < MATCHING_EPSILON)) {
+ if ((t1.v3().p.times(m).distance(t2.v1().p) < MATCHING_EPSILON) &&
+ (t1.v1().p.times(m).distance(t2.v2().p) < MATCHING_EPSILON) &&
+ (t1.v2().p.times(m).distance(t2.v3().p) < MATCHING_EPSILON)) {
t2.e3().bindEdge(t1.e1().pair, m);
t2.e1().bindEdge(t1.e2().pair, m);
t2.e2().bindEdge(t1.e3().pair, m);
t2.e3().bindEdge(t1.e1().pair, m);
t2.e1().bindEdge(t1.e2().pair, m);
t2.e2().bindEdge(t1.e3().pair, m);
@@
-569,7
+568,7
@@
public class Main extends MeshViewer {
float factor = (float)Math.pow(tile.volume() / goal.volume(), 1.0/3.0);
float factor = (float)Math.pow(tile.volume() / goal.volume(), 1.0/3.0);
- goal.transform(Matrix.scale(factor/2.4f));
+ goal.transform(Matrix.scale(factor/2.1f));
goal.transform(Matrix.rotate(new Vec(0, 1, 0), (float)(Math.PI/2)));
// translate to match centroid
goal.transform(Matrix.rotate(new Vec(0, 1, 0), (float)(Math.PI/2)));
// translate to match centroid
@@
-634,7
+633,7
@@
public class Main extends MeshViewer {
//System.out.println(v.mag() + " " + max);
boolean good = p.move(m, false);
//System.out.println(v.mag() + " " + max);
boolean good = p.move(m, false);
- //if (!good) { /*misses++;*/ return; }
+ if (!good) { /*misses++;*/ return; }
double new_tile_error = tile.error();
double new_goal_error = goal.error();
double new_tile_error = tile.error();
double new_goal_error = goal.error();
@@
-659,6
+658,7
@@
public class Main extends MeshViewer {
p.move(Matrix.translate(v.times(-1)), true);
misses++;
}
p.move(Matrix.translate(v.times(-1)), true);
misses++;
}
+ p.reComputeErrorAround();
}
float hits = 0;
}
float hits = 0;
@@
-748,7
+748,10
@@
public class Main extends MeshViewer {
System.out.println("temp="+temp + " ratio="+(Math.ceil(acceptance*100)) + " " +
"points_per_second=" +
(count*1000)/((double)(System.currentTimeMillis()-then)));
System.out.println("temp="+temp + " ratio="+(Math.ceil(acceptance*100)) + " " +
"points_per_second=" +
(count*1000)/((double)(System.currentTimeMillis()-then)));
- for(Mesh.Vertex p : goal.vertices()) p.recomputeFundamentalQuadricIfNeighborChanged();
+ for(Mesh.Vertex p : goal.vertices()) {
+ p.quadricStale = true;
+ p.recomputeFundamentalQuadricIfNeighborChanged();
+ }
synchronized(safeTriangles) {
safeTriangles.clear();
synchronized(safeTriangles) {
safeTriangles.clear();