- public boolean isBoundTo(E e) { return bg.isBoundTo(this, e); }
-
-
- public int compareTo(E e) { return e.length() > length() ? 1 : -1; }
-
- public void bindEdge(E e) {
- bg.add(e, true);
- }
- public void dobind() { if (bg != null) bg.dobind(this); }
-
- public Point shatter() { return shatter(midpoint(), null, null, false); }
- public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2, boolean swap) {
- if (shattered) return mid;
+ public float comparator() {
+ Vert nearest = score_against.nearest(midpoint());
+ //if (t==null) return length();
+ /*
+ double ang = Math.abs(crossAngle());
+ float minangle = (float)(Math.PI * 0.9);
+ if (ang > minangle)
+ return 300;
+ */
+ /*
+ if ((length() * length()) / t.area() > 10)
+ return (float)(length()*Math.sqrt(t.area()));
+ 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 void bindEdge(E e) { bind_to.add(e); }
+ public void dobind() { bind_to.dobind(this); }
+
+ public Point shatter() { return shatter(midpoint(), null, null); }
+ public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2) {
+ if (shattered || destroyed) return mid;