Changes to workaround of issue #9390

git-svn-id: https://triangle.svn.codeplex.com/svn@67388 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
This commit is contained in:
SND\wo80_cp
2012-05-12 10:38:31 +00:00
parent ebec728626
commit 5bebd21141
+6 -10
View File
@@ -36,8 +36,7 @@ namespace TriangleNet
Osub hullsubseg = default(Osub);
Vertex horg, hdest;
int workaround, ntri = mesh.triangles.Count;
Queue<Triangle> infectedTris = new Queue<Triangle>();
int workaround, nseg= mesh.subsegs.Count;
// Find a triangle handle on the hull.
hulltri.triangle = Mesh.dummytri;
@@ -62,8 +61,6 @@ namespace TriangleNet
{
hulltri.Infect();
mesh.viri.Add(hulltri.triangle);
infectedTris.Enqueue(hulltri.triangle);
}
}
else
@@ -93,16 +90,15 @@ namespace TriangleNet
nexttri.Copy(ref hulltri);
hulltri.Oprev(ref nexttri);
workaround++;
if (workaround > ntri)
if (++workaround > nseg)
{
// Reverse infection
mesh.viri.Clear();
while (infectedTris.Count > 0)
foreach (var item in mesh.viri)
{
infectedTris.Dequeue().infected = false;
item.infected = false;
}
mesh.viri.Clear();
return false;
}
}