本文整理匯總了C#中Poly2Tri.DTSweepContext.MeshClean方法的典型用法代碼示例。如果您正苦於以下問題:C# DTSweepContext.MeshClean方法的具體用法?C# DTSweepContext.MeshClean怎麽用?C# DTSweepContext.MeshClean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Poly2Tri.DTSweepContext
的用法示例。
在下文中一共展示了DTSweepContext.MeshClean方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FinalizationConstraints
/// <summary>
/// NOTE: WORK IN PROGRESS - for now this will just clean out all triangles from
/// inside the outermost holes without paying attention to holes within holes..
/// hence the work in progress :)
///
/// Removes triangles inside "holes" (that are not inside of other holes already)
///
/// In the example below, assume that triangle ABC is a user-defined "hole". Thus
/// any triangles inside it (that aren't inside yet another user-defined hole inside
/// triangle ABC) should get removed. In this case, since there are no user-defined
/// holes inside ABC, we would remove triangles ADE, BCE, and CDE. We would also
/// need to combine the appropriate edges so that we end up with just triangle ABC
///
/// E
/// A +------+-----+ B A +-----------+ B
/// \ /| / \ /
/// \ / | / \ /
/// D + | / ======> \ /
/// \ | / \ /
/// \ |/ \ /
/// + +
/// C C
///
/// </summary>
private static void FinalizationConstraints(DTSweepContext tcx)
{
// Get an Internal triangle to start with
DelaunayTriangle t = tcx.Front.Head.Triangle;
TriangulationPoint p = tcx.Front.Head.Point;
while (!t.GetConstrainedEdgeCW(p))
{
DelaunayTriangle tTmp = t.NeighborCCWFrom(p);
if (tTmp == null)
{
break;
}
t = tTmp;
}
// Collect interior triangles constrained by edges
tcx.MeshClean(t);
}
示例2: FinalizationPolygon
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);
// Collect interior triangles constrained by edges
tcx.MeshClean(t);
}
示例3: FinalizationPolygon
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))
{
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);
}