author Campbell Barton Mon, 12 Dec 2011 09:28:46 +0000 (09:28 +0000) committer Campbell Barton Mon, 12 Dec 2011 09:28:46 +0000 (09:28 +0000)
also include an new & improved vertex placement method but left commented for now.

index fa53ffc7fe8ab2f94f9640933697a43754dc3be8..215847451c5f7b3f234a2c2ffbc5b79bfa3a3c79 100644 (file)
@@ -80,14 +80,52 @@ static void calc_corner_co(BMesh *bm, BMLoop *l, float *co, float fac)
sub_v3_v3v3(vec2, v4, v3);
}

-       /*simple percentage method */
-       mul_v3_fl(vec1, fac * 0.5);
+       if (1) {
+               /*simple percentage method */

-       if (inv)
-               negate_v3(vec1);
-
+
+               /* not strictly necessary, balance vectors
+                * so the longer edge doesn't skew the result,
+                * gives nicer, move event output */
+               float medium= (normalize_v3(vec1) + normalize_v3(vec2)) / 2.0f;
+               mul_v3_fl(vec1, medium);
+               mul_v3_fl(vec2, medium);
+               /* done */
+
+
+               mul_v3_fl(vec1, fac * 0.5);
+
+               if (inv)
+                       negate_v3(vec1);
+
+       }
+       else {
+               /* distance based */
+               float tvec[3];
+               float dist;
+
+               normalize_v3(vec1);
+               normalize_v3(vec2);
+
+               /* get the medium normalized direction */
+               normalize_v3(tvec);
+
+               /* for angle calculation */
+               negate_v3(vec2);
+
+               dist= shell_angle_to_dist(angle_normalized_v3v3(vec1, vec2) * 0.5);
+
+               mul_v3_fl(tvec, fac * dist);
+
+               if (inv)
+                       negate_v3(tvec);
+