當前位置: 首頁>>代碼示例>>C#>>正文


C# DTSweepContext.MeshClean方法代碼示例

本文整理匯總了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);
        }
開發者ID:Ayagami,項目名稱:Tesis,代碼行數:42,代碼來源:DTSweep.cs

示例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);
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:10,代碼來源:DTSweep.cs

示例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);
        }
開發者ID:bzamecnik,項目名稱:poly2tri-cs,代碼行數:24,代碼來源:DTSweep.cs


注:本文中的Poly2Tri.DTSweepContext.MeshClean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。