Răsfoiți Sursa

Fixed Triangulation false warning. Fixes #3564

The false warning occurred when a vertex was on an edge of a triangle. The snip function should then return false, as there is a vertex inside the triangle, but this was not detected because of rounding errors. The use of EPSILON instead of 0.0 fixes this
Olivier Deckers 12 ani în urmă
părinte
comite
c71891f402
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/extras/FontUtils.js

+ 1 - 1
src/extras/FontUtils.js

@@ -439,7 +439,7 @@ THREE.FontUtils.generateShapes = function( text, parameters ) {
 			cCROSSap = cX*apy - cY*apx;
 			bCROSScp = bX*cpy - bY*cpx;
 
-			if ( (aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0) ) return false;
+			if ( (aCROSSbp >= -EPSILON) && (bCROSScp >= -EPSILON) && (cCROSSap >= -EPSILON) ) return false;
 
 		}
 

粤ICP备19079148号