瀏覽代碼

add check if face are not undefinded (#24169)

add check if face are not undefinded

check with u.faces[i]
Suprhimp 3 年之前
父節點
當前提交
8a774733d9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/jsm/modifiers/SimplifyModifier.js

+ 1 - 1
examples/jsm/modifiers/SimplifyModifier.js

@@ -342,7 +342,7 @@ function collapse( vertices, faces, u, v ) { // u and v are pointers to vertices
 	// delete triangles on edge uv:
 	for ( let i = u.faces.length - 1; i >= 0; i -- ) {
 
-		if ( u.faces[ i ].hasVertex( v ) ) {
+		if ( u.faces[ i ] && u.faces[ i ].hasVertex( v ) ) {
 
 			removeFace( u.faces[ i ], faces );