*/
float width = (float)0.7;
float depth = (float)0.08;
- float height = (float)0.35;
+ float height = (float)0.4;
- float rshift = width/2;
+ float rshift = width/2;
float lshift = -(width/2);
//float halfup = height/2;
new Matrix(new Vec(rshift, depth, halfup)),
new Matrix(new Vec(lshift, -depth, halfup)),
new Matrix(new Vec(rshift, -depth, halfup)),
-
+ /*
+ new Matrix(new Vec(0, depth, halfup)),
+ new Matrix(new Vec(0, -depth, halfup)),
+ */
new Matrix(new Vec(lshift, 0, height)),
new Matrix(new Vec(rshift, 0, height)),
new Matrix(new Vec(lshift, 0, -height)),
};
+ //
+
+
Point ltf = new Point(lshift, (depth/2), (height/2));
Point mtf = new Point( 0.0, (depth/2), (height/2));
Vec v;
Matrix inv = p.errorQuadric();
- v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)1000);
+ v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)300);
if (p.quadric_count == 0) {
- v = goal.nearest(p.p).p.minus(p.p).norm().times(1/(float)1000);
+ v = goal.nearest(p.p).p.minus(p.p).norm().times(1/(float)300);
}
Vec v2 = new Vec((random.nextFloat() - (float)0.5) / 500,
(random.nextFloat() - (float)0.5) / 500,
(random.nextFloat() - (float)0.5) / 500);
- v = v.plus(v2.norm().times(1/(float)1000));
+ v = v.plus(v2.norm().times(1/(float)300));
+ //v = v2;
boolean good = p.move(v);
double delta = tile_delta + goal_delta;
double swapProbability = Math.exp((-1 * delta) / temp);
//boolean doSwap = good && (Math.random() < swapProbability);
- boolean doSwap = good && (tile_delta <= 0 && goal_delta <= 0);
+ //boolean doSwap = good && (tile_delta <= 0 && goal_delta <= 0);
+ boolean doSwap = good && (tile_delta + goal_delta <= 0);
if (doSwap) {
tile_score = new_tile_score;
goal_score = new_goal_score;
else if (nearest_in_other_mesh == null) {
if (score_against != null) {
Vert ne = score_against.nearest(p);
- oldscore = ne.fundamentalQuadric().preAndPostMultiply(p) * 100 * 100;
+ oldscore = ne.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
} else {
oldscore = 0;
}
} else {
- oldscore = nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 100;
+ oldscore = nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
}
} else {
- oldscore = (quadric.preAndPostMultiply(p) * 100);
+ oldscore = (quadric.preAndPostMultiply(p) * 100) / quadric_count;
}
oldscore = oldscore;
aspects += e.t.aspect()*e.t.aspect();
}
*/
-
+ /*
float minangle = (float)(Math.PI * 0.9);
if (ang > minangle)
oldscore += (ang - minangle);
-
+ */
e = e.pair.next;
} while (e != this.e);
if (numaspects > 0) oldscore += (aspects / numaspects);
return (float)(length()*Math.sqrt(t.area()));
return length()*t.area();
*/
- return length() + midpoint().distance(nearest.p);
+ return (float)Math.max(length(), midpoint().distance(nearest.p));
}
public int compareTo(E e) {
return e.comparator() > comparator() ? 1 : -1;