[Bf-blender-cvs] [a12bc92d466] temp-lineart-contained: LineArt: point on edge tolerance.

YimingWu noreply at git.blender.org
Tue Aug 17 05:52:13 CEST 2021


Commit: a12bc92d466094bce0d8eb4c2b2a89873f248d0d
Author: YimingWu
Date:   Tue Aug 17 11:50:58 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBa12bc92d466094bce0d8eb4c2b2a89873f248d0d

LineArt: point on edge tolerance.

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

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

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

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 53ea9fd654e..dbe908cf334 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -609,7 +609,7 @@ static int lineart_point_on_line_segment(double v[2], double v0[2], double v1[2]
   }
   else if (v[0] == v1[0]) {
     c2 = ratiod(v0[1], v1[1], v[1]);
-    return (c2 >= 0 && c2 <= 1);
+    return (c2 >= -DBL_TRIANGLE_LIM && c2 <= 1 + DBL_TRIANGLE_LIM);
   }
 
   if (v1[1] - v0[1]) {
@@ -617,10 +617,10 @@ static int lineart_point_on_line_segment(double v[2], double v0[2], double v1[2]
   }
   else if (v[1] == v1[1]) {
     c1 = ratiod(v0[0], v1[0], v[0]);
-    return (c1 >= 0 && c1 <= 1);
+    return (c1 >= -DBL_TRIANGLE_LIM && c1 <= 1 + DBL_TRIANGLE_LIM);
   }
 
-  if (LRT_DOUBLE_CLOSE_ENOUGH(c1, c2) && c1 >= 0 && c1 <= 1) {
+  if (LRT_DOUBLE_CLOSE_ENOUGH(c1, c2) && c1 >= -DBL_TRIANGLE_LIM && c1 <= 1 + DBL_TRIANGLE_LIM) {
     return 1;
   }



More information about the Bf-blender-cvs mailing list