[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49794] branches/soc-2012-bratwurst/source /blender/editors/uvedit/uvedit_parametrizer.c: *Fix quadratic equation solution formula (hadn't used this since high

Antony Riakiotakis kalast at gmail.com
Sat Aug 11 03:17:18 CEST 2012


Revision: 49794
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49794
Author:   psy-fi
Date:     2012-08-11 01:17:16 +0000 (Sat, 11 Aug 2012)
Log Message:
-----------
*Fix quadratic equation solution formula (hadn't used this since high
school)
*Add some debug prints

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c

Modified: branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-11 01:05:09 UTC (rev 49793)
+++ branches/soc-2012-bratwurst/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-11 01:17:16 UTC (rev 49794)
@@ -3087,11 +3087,9 @@
 	q_c = b*b*(u*u - a*a*sth*sth);
 
 	/* find the two solutions for tc */
-	t1 = (q_b*q_b - 4*q_a*q_c)/(2*q_a);
-	t2 = (q_b*q_b + 4*q_a*q_c)/(2*q_a);
+	t1 = (-q_b - sqrt(q_b*q_b - 4*q_a*q_c))/(2*q_a);
+	t2 = (-q_b + sqrt(q_b*q_b - 4*q_a*q_c))/(2*q_a);
 
-//	printf("data: a %f, b %f, c %f, Ta %f, Tb %f, theta %f\n", a, b, c, Ta, Tb, theta);
-
 	t = (t1 > 0)? t1 : t2;
 
 	if ((t > u) && (a*cth < b*(t-u)/t) && (a/cth > b*(t-u)/t)) {
@@ -3101,6 +3099,7 @@
 	}
 
 	printf("solutions: %f, %f, final: %f\n", t1, t2, t);
+	printf("data: a %f, b %f, c %f, Ta %f, Tb %f, theta %f\n", a, b, c, Ta, Tb, theta);
 
 	return t;
 }
@@ -3221,6 +3220,7 @@
 			float ed_mean[3];
 			float ed_mean_len;
 
+			printf("\nobtuse set coming\n");
 			add_v3_v3v3(ed_mean, a, b);
 			ed_mean_len = 0.5*len_v3(ed_mean);
 			c_d *= 0.5;
@@ -3236,6 +3236,7 @@
 			theta = acos(theta);
 			BLI_assert(theta < M_PI_2);
 			tri2_result = p_chart_isomap_calculate_distance_from_triangle(theta, ed_mean_len, b_d, c_d, T_mean, dist_map[ib*nverts + i0]);
+			printf("obtuse set end\n\n");
 
 			sum_dist = minf(tri1_result, tri2_result);
 		}




More information about the Bf-blender-cvs mailing list