projects
/
anneal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[anneal.git]
/
src
/
edu
/
berkeley
/
qfat
/
Mesh.java
diff --git
a/src/edu/berkeley/qfat/Mesh.java
b/src/edu/berkeley/qfat/Mesh.java
index
264e379
..
1d4967f
100644
(file)
--- a/
src/edu/berkeley/qfat/Mesh.java
+++ b/
src/edu/berkeley/qfat/Mesh.java
@@
-15,7
+15,7
@@
public class Mesh implements Iterable<Mesh.T> {
public static final Random random = new Random();
private PointSet<Vert> pointset = new PointSet<Vert>();
public static final Random random = new Random();
private PointSet<Vert> pointset = new PointSet<Vert>();
-
+ public int size() { return pointset.size(); }
public Iterable<Vert> vertices() { return pointset; }
public Iterable<E> edges() {
public Iterable<Vert> vertices() { return pointset; }
public Iterable<E> edges() {
@@
-265,11
+265,11
@@
public class Mesh implements Iterable<Mesh.T> {
aspects += e.t.aspect()*e.t.aspect();
}
*/
aspects += e.t.aspect()*e.t.aspect();
}
*/
- /*
- float minangle = (float)(Math.PI * 0.9);
+
+ float minangle = (float)(Math.PI * 0.8);
if (ang > minangle)
oldscore += (ang - minangle);
if (ang > minangle)
oldscore += (ang - minangle);
- */
+
e = e.pair.next;
} while (e != this.e);
if (numaspects > 0) oldscore += (aspects / numaspects);
e = e.pair.next;
} while (e != this.e);
if (numaspects > 0) oldscore += (aspects / numaspects);
@@
-295,16
+295,25
@@
public class Mesh implements Iterable<Mesh.T> {
}
applyQuadricToNeighbor();
}
applyQuadricToNeighbor();
+ // FIXME: intersection test needed?
+ boolean good = true;
+
// should recompute fundamental quadrics of all vertices sharing a face, but we defer...
E e = this.e;
do {
// should recompute fundamental quadrics of all vertices sharing a face, but we defer...
E e = this.e;
do {
+ /*
+ if (Math.abs(e.crossAngle()) > (Math.PI * 0.9) ||
+ Math.abs(e.next.crossAngle()) > (Math.PI * 0.9)) {
+ good = false;
+ }
+ if (e.t.aspect() < 0.1) {
+ good = false;
+ }
+ */
e.p2.quadricStale = true;
e = e.pair.next;
} while(e != this.e);
e.p2.quadricStale = true;
e = e.pair.next;
} while(e != this.e);
- // FIXME: intersection test needed?
- boolean good = true;
-
if (!ignorecollision)
for(T t : Mesh.this) {
if (!good) break;
if (!ignorecollision)
for(T t : Mesh.this) {
if (!good) break;
@@
-472,6
+481,7
@@
public class Mesh implements Iterable<Mesh.T> {
return length()*t.area();
*/
return (float)Math.max(length(), midpoint().distance(nearest.p));
return length()*t.area();
*/
return (float)Math.max(length(), midpoint().distance(nearest.p));
+ //return length();
}
public int compareTo(E e) {
return e.comparator() > comparator() ? 1 : -1;
}
public int compareTo(E e) {
return e.comparator() > comparator() ? 1 : -1;