NFC: Remove a redundant pass over all verticies in ear triangulation.

pull/665/head
phkahler 2020-07-19 13:05:52 -04:00
parent b0fc1912ea
commit 2640034124
1 changed files with 3 additions and 8 deletions

View File

@ -312,14 +312,6 @@ void SContour::UvTriangulateInto(SMesh *m, SSurface *srf) {
bool toggle = false;
while(l.n > 3) {
// Some points may have changed ear-ness, so recalculate
for(i = 0; i < l.n; i++) {
if(l[i].ear == EarType::UNKNOWN) {
(l[i]).ear = IsEar(i, scaledEps) ?
EarType::EAR : EarType::NOT_EAR;
}
}
int bestEar = -1;
double bestChordTol = VERY_POSITIVE;
// Alternate the starting position so we generate strip-like
@ -328,6 +320,9 @@ void SContour::UvTriangulateInto(SMesh *m, SSurface *srf) {
int offset = toggle ? -1 : 0;
for(i = 0; i < l.n; i++) {
int ear = WRAP(i+offset, l.n);
if(l[ear].ear == EarType::UNKNOWN) {
(l[ear]).ear = IsEar(ear, scaledEps) ? EarType::EAR : EarType::NOT_EAR;
}
if(l[ear].ear == EarType::EAR) {
if(srf->degm == 1 && srf->degn == 1) {
// This is a plane; any ear is a good ear.