+ var nan_count = 0;
+ var nan_point_count = 0;
+ var nan_face_count = 0;
+ for (var i = 0; i < n; i++) {
+ var nan_in_face = false;
+ for (var j = 0; j < 3; j++) {
+ var nan_in_point = false;
+ for (var k = 0; k < 3; k++) {
+ if (isNaN(this.points[i*3+j][k])) {
+ nan_count++;
+ nan_in_point = true;
+ nan_in_face = true;
+ }
+ }
+ if (nan_in_point) nan_point_count ++;
+ }
+ if (nan_in_face) nan_face_count ++;
+ }
+ if (nan_count != 0) {
+ alert(nan_count + " NaNs in " + nan_point_count + " points in " + nan_face_count + " faces.");
+ }