Jelajahi Sumber

skip faces with zero normals

Former-commit-id: 176f869195f2a20f144ee1900c77d9f3c06a9ac9
Kenshi Takayama (kenshi 11 tahun lalu
induk
melakukan
6aa8e11d5b
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      include/igl/embree/reorient_facets_raycast.cpp

+ 1 - 0
include/igl/embree/reorient_facets_raycast.cpp

@@ -122,6 +122,7 @@
                  + b * V.row(FF(f,1)).template cast<float>().eval()
                  + b * V.row(FF(f,1)).template cast<float>().eval()
                  + c * V.row(FF(f,2)).template cast<float>().eval();
                  + c * V.row(FF(f,2)).template cast<float>().eval();
       Vector3f n = N.row(f).cast<float>();
       Vector3f n = N.row(f).cast<float>();
+      if (n.isZero()) continue;
       // random direction in hemisphere around n (avoid too grazing angle)
       // random direction in hemisphere around n (avoid too grazing angle)
       Vector3f d;
       Vector3f d;
       while (true) {
       while (true) {