X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2FGeom.java;fp=src%2FGeom.java;h=42abd82b039ef1fd01ec3049e35efa33814fdd93;hp=080690e66e577ad6ec109eaca8a9e0c60245b951;hb=1a864cc577c2b31049cd46f4fd9ed703802d7d17;hpb=113b9ec23d89a15c3d57532909e85580df4c4580 diff --git a/src/Geom.java b/src/Geom.java index 080690e..42abd82 100644 --- a/src/Geom.java +++ b/src/Geom.java @@ -196,10 +196,28 @@ public class Geom implements Iterable { E next; // next half-edge E pair; // partner half-edge + + public E bound_to = this; + public M bound_m = new M(); + public void bind(E e) { bind(e, new M()); } - public void bind(E e, M m) { - p1.bind(e.p2); - p2.bind(e.p1); + public void bind(E e2, M m) { + E e1 = this; + while(e1.bound_to != e1) e1 = e1.bound_to; + while(e2.bound_to != e2) e2 = e2.bound_to; + e1.bound_to = e2; + } + + public void dobind() { + if (bound_to == this) return; + E ex = this; + M m = new M(); + while(ex.bound_to != ex) { m = m.times(ex.bound_m); ex = ex.bound_to; } + p1.bind(ex.bound_to.p1); + p2.bind(ex.bound_to.p2); + } + + public void shatter() { } private void sync() {