[Bf-blender-cvs] [50917ed] master: Fix T45853: Edge-slide UV-correct jitter

Campbell Barton noreply at git.blender.org
Tue Aug 25 15:02:25 CEST 2015


Commit: 50917edad54d2be0f5e3a6630382e28ab1fd32e0
Author: Campbell Barton
Date:   Tue Aug 25 22:45:09 2015 +1000
Branches: master
https://developer.blender.org/rB50917edad54d2be0f5e3a6630382e28ab1fd32e0

Fix T45853: Edge-slide UV-correct jitter

===================================================================

M	source/blender/blenlib/intern/math_geom.c

===================================================================

diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index ee1b74c..379c852 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2986,7 +2986,7 @@ static float mean_value_half_tan_v3(const struct Float3_Len *d_curr, const struc
 	float cross[3], area;
 	cross_v3_v3v3(cross, d_curr->dir, d_next->dir);
 	area = len_v3(cross);
-	if (LIKELY(area != 0.0f)) {
+	if (LIKELY(fabsf(area) > FLT_EPSILON)) {
 		const float dot = dot_v3v3(d_curr->dir, d_next->dir);
 		const float len = d_curr->len * d_next->len;
 		return (len - dot) / area;
@@ -3001,7 +3001,7 @@ static float mean_value_half_tan_v2(const struct Float2_Len *d_curr, const struc
 	float area;
 	/* different from the 3d version but still correct */
 	area = cross_v2v2(d_curr->dir, d_next->dir);
-	if (LIKELY(area != 0.0f)) {
+	if (LIKELY(fabsf(area) > FLT_EPSILON)) {
 		const float dot = dot_v2v2(d_curr->dir, d_next->dir);
 		const float len = d_curr->len * d_next->len;
 		return (len - dot) / area;




More information about the Bf-blender-cvs mailing list