We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2abd773 commit 0a6851aCopy full SHA for 0a6851a
Utils/IndexedFaceMesh.h
@@ -187,6 +187,9 @@ namespace Utilities
187
188
m_normals[i] = v1.cross(v2);
189
m_normals[i].normalize();
190
+ // fix normals of degenerate triangles that can become zero vectors
191
+ if (m_normals[i].squaredNorm() < 1e-6f)
192
+ m_normals[i] = Vector3r::UnitX();
193
}
194
195
Utils/VolumeIntegration.cpp
@@ -140,7 +140,8 @@ void VolumeIntegration::face_integrals(unsigned int f)
140
141
w = m_weights[f];
142
n = m_face_normals[f];
143
- k1 = 1 / n[C]; k2 = k1 * k1; k3 = k2 * k1; k4 = k3 * k1;
+ k1 = (n[C] == 0) ? 0 : 1 / n[C];
144
+ k2 = k1 * k1; k3 = k2 * k1; k4 = k3 * k1;
145
146
Fa = k1 * Pa;
147
Fb = k1 * Pb;
0 commit comments