Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Triangulation/Delaunay/Sweep/DTSweep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ private static void FinalizationConvexHull( DTSweepContext tcx ) {
t1 = t1.NeighborCWFrom(tcx.Front.Head.Point);
do {
tcx.RemoveFromList(t1);
// NOTE: there was a NullReferenceException
// probably t1 was null
if (t1 == null)
{
break; // TODO: is this solution OK?
}
p1 = t1.PointCCWFrom(p1);
t1 = t1.NeighborCCWFrom(p1);
} while (p1 != first);
Expand Down Expand Up @@ -195,7 +201,21 @@ private static void FinalizationPolygon( DTSweepContext tcx ) {
// Get an Internal triangle to start with
DelaunayTriangle t = tcx.Front.Head.Next.Triangle;
TriangulationPoint p = tcx.Front.Head.Next.Point;
while (!t.GetConstrainedEdgeCW(p)) t = t.NeighborCCWFrom(p);
while (!t.GetConstrainedEdgeCW(p))
{
DelaunayTriangle nextTriangle = t.NeighborCCWFrom(p);
// NOTE: there was a NullReferenceException
// probably t was null
// TODO: is this solution ok?
if (nextTriangle != null)
{
t = nextTriangle;
}
else
{
break;
}
}

// Collect interior triangles constrained by edges
tcx.MeshClean(t);
Expand Down