X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=42f03d24abfe9c3a5cd782e69269593b0a22b0fa;hp=c563563a906c1e87c9706793570fdfac3c1292f5;hb=0333b4f07d3e3cacb5975fe7ac3c8c3933150e37;hpb=366e1c99a39b4ac6e8a55828678ce0213e1badc2 diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index c563563..42f03d2 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -109,25 +109,6 @@ public class Mesh implements Iterable { fundamentalQuadric = m.times(1/(float)count); } - public void applyQuadricToNeighbor() { - if (score_against == null) return; - - Vertex new_nearest = (Vertex)nearest(); - if (nearest_in_other_mesh != null && new_nearest == nearest_in_other_mesh) return; - - if (nearest_in_other_mesh != null) unApplyQuadricToNeighbor(); - if (nearest_in_other_mesh != null) throw new Error(); - - nearest_in_other_mesh = new_nearest; - - nearest_in_other_mesh.unComputeError(); - nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.plus(fundamentalQuadric()); - nearest_in_other_mesh.quadric_count++; - nearest_in_other_mesh.computeError(); - - reComputeError(); - } - public void reComputeErrorAround() { reComputeError(); if (nearest_in_other_mesh != null) nearest_in_other_mesh.reComputeError(); @@ -142,7 +123,10 @@ public class Mesh implements Iterable { score -= oldscore; oldscore = 0; } - public HasQuadric nearest() { return score_against.vertices.nearest(p, this); } + public HasQuadric nearest() { + if (score_against==null) return null; + return score_against.vertices.nearest(p, this); + } public void computeError() { oldscore = quadric_count != 0