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:
authorCampbell Barton <ideasman42@gmail.com>2012-03-13 05:11:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-13 05:11:08 +0400
commit8646bb446419592f8acc8ed0cdf8337bfc4a07eb (patch)
tree4ee959f06e2ffe18cb9dd1c91266c9e9ad81c686 /source/blender/editors/mesh/knifetool.c
parentb457c7fdbdf0b8cf7a4535574d9894d8850c55f4 (diff)
workaround [#30480] Knife tool flicker
the problem was numeric precision when in ortho mode the start/end points for the view vector would be 2000 apart which caused trouble for the intersection test.
Diffstat (limited to 'source/blender/editors/mesh/knifetool.c')
-rw-r--r--source/blender/editors/mesh/knifetool.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c
index f70257614bf..1866b88a1bf 100644
--- a/source/blender/editors/mesh/knifetool.c
+++ b/source/blender/editors/mesh/knifetool.c
@@ -1178,6 +1178,16 @@ static void knife_find_line_hits(knifetool_opdata *kcd)
mul_m4_v3(kcd->ob->imat, v3);
mul_m4_v3(kcd->ob->imat, v4);
+ /* numeric error, 'v1' -> 'v2', 'v2' -> 'v4' can end up being ~2000 units apart in otho mode
+ * (from ED_view3d_win_to_segment_clip() above)
+ * this gives precision error in 'knife_edge_tri_isect', rather then solving properly
+ * (which may involve using doubles everywhere!),
+ * limit the distance between these points */
+ if (kcd->is_ortho) {
+ limit_dist_v3(v1, v3, 200.0f);
+ limit_dist_v3(v2, v4, 200.0f);
+ }
+
BLI_smallhash_init(ehash);
/* test two triangles of sceen line's plane */