[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48691] trunk/blender/source/blender/bmesh /operators/bmo_hull.c: decrease size for convex hull epsilon when checking which side of a face the vertex is on .

Campbell Barton ideasman42 at gmail.com
Fri Jul 6 22:16:04 CEST 2012


Revision: 48691
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48691
Author:   campbellbarton
Date:     2012-07-06 20:16:04 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
decrease size for convex hull epsilon when checking which side of a face the vertex is on.

this doesnt fix all cases but works better then it did.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/operators/bmo_hull.c

Modified: trunk/blender/source/blender/bmesh/operators/bmo_hull.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_hull.c	2012-07-06 19:22:21 UTC (rev 48690)
+++ trunk/blender/source/blender/bmesh/operators/bmo_hull.c	2012-07-06 20:16:04 UTC (rev 48691)
@@ -38,6 +38,9 @@
 #include "bmesh.h"
 
 #define HULL_EPSILON_FLT 0.0001f
+/* values above 0.0001 cause errors, see below for details, don't increase
+ * without checking against bug [#32027] */
+#define HULL_EPSILON_DOT_FLT 0.00000001f
 
 /* Internal operator flags */
 typedef enum {
@@ -144,12 +147,16 @@
 {
 	/* Added epsilon to fix bug [#31941], improves output when some
 	 * vertices are nearly coplanar. Might need further tweaking for
-	 * other cases though. */
+	 * other cases though.
+	 * ...
+	 * Update: epsilon of 0.0001 causes [#32027], use HULL_EPSILON_DOT_FLT
+	 * and give it a much smaller value
+	 * */
 	float p[3], d;
 	sub_v3_v3v3(p, co, t->v[0]->co);
 	d = dot_v3v3(t->no, p);
-	if      (d < -HULL_EPSILON_FLT) return -1;
-	else if (d >  HULL_EPSILON_FLT) return  1;
+	if      (d < -HULL_EPSILON_DOT_FLT) return -1;
+	else if (d >  HULL_EPSILON_DOT_FLT) return  1;
 	else return 0;
 }
 




More information about the Bf-blender-cvs mailing list