Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-07-03 04:02:45 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-07-03 04:02:45 +0400
commit98a7ca61fa905792bd3fdfa6c29f44691c9582ac (patch)
tree47455f2482f6eca0352c10c57482641eec6afb57 /source/blender/bmesh/operators/bmo_hull.c
parent4e39a854b4589cddff484649d95cce4c71d4e9f4 (diff)
parent2ed69a95f499081aacc15c0295f3461c38430554 (diff)
Merged changes in the trunk up to revision 48505.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_hull.c')
-rw-r--r--source/blender/bmesh/operators/bmo_hull.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c
index 160db7cba75..1bd2f41209b 100644
--- a/source/blender/bmesh/operators/bmo_hull.c
+++ b/source/blender/bmesh/operators/bmo_hull.c
@@ -140,11 +140,14 @@ static void hull_add_triangle(BMesh *bm, GHash *hull_triangles, BLI_mempool *poo
static int hull_point_tri_side(const HullTriangle *t, const float co[3])
{
- float p[3], d;
+ /* Added epsilon to fix bug [#31941], improves output when some
+ * vertices are nearly coplanar. Might need further tweaking for
+ * other cases though. */
+ float p[3], d, epsilon = 0.0001;
sub_v3_v3v3(p, co, t->v[0]->co);
d = dot_v3v3(t->no, p);
- if (d < 0) return -1;
- else if (d > 0) return 1;
+ if (d < -epsilon) return -1;
+ else if (d > epsilon) return 1;
else return 0;
}