Merge pull request #4979 from Jackie9527/1-3458
bugfix the three vertices are collinearkimkulling/remove-deprecated-badge
commit
fdcc45d010
|
@ -468,6 +468,21 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip when three point is in a line
|
||||||
|
aiVector2D left = *pnt0 - *pnt1;
|
||||||
|
aiVector2D right = *pnt2 - *pnt1;
|
||||||
|
|
||||||
|
left.Normalize();
|
||||||
|
right.Normalize();
|
||||||
|
auto mul = left * right;
|
||||||
|
|
||||||
|
// if the angle is 0 or 180
|
||||||
|
if (std::abs(mul - 1.f) < ai_epsilon || std::abs(mul + 1.f) < ai_epsilon) {
|
||||||
|
// skip this ear
|
||||||
|
ASSIMP_LOG_WARN("Skip a ear, due to its angle is near 0 or 180.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// and no other point may be contained in this triangle
|
// and no other point may be contained in this triangle
|
||||||
for ( tmp = 0; tmp < max; ++tmp) {
|
for ( tmp = 0; tmp < max; ++tmp) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue