Example #1
0
        /// <summary>
        /// 获取多边形所有边的相交点
        /// </summary>
        /// <param name="mainPoly"></param>
        /// <param name="diffpoly"></param>
        /// <param name="mainPolyIntersectArray"></param>
        /// <param name="Poly2IntersectArray"></param>
        public static void GetAllEdgeInterSectPoint(Polygon2D mainPoly, Polygon2D diffpoly, ref List <Double3>[] mainPolyIntersectArray, ref List <Double3>[] Poly2IntersectArray)
        {
            if (mainPoly == null || diffpoly == null)
            {
                return;
            }

            for (int i = 0; i < mainPoly.GetEdgeNum(); i++)
            {
                diffpoly.GetAllIntersectPoint(mainPoly.GetEdge(i), ref mainPolyIntersectArray[i]);
            }
            //
            for (int i = 0; i < diffpoly.GetEdgeNum(); i++)
            {
                mainPoly.GetAllIntersectPoint(diffpoly.GetEdge(i), ref Poly2IntersectArray[i]);
            }
        }
Example #2
0
        /// <summary>
        /// 获取多边形所有边的相交点
        /// </summary>
        /// <param name="poly1"></param>
        /// <param name="poly2"></param>
        /// <param name="Poly1IntersectArray"></param>
        /// <param name="Poly2IntersectArray"></param>
        private static void GetAllEdgeInterSectPoint(Polygon2D poly1, Polygon2D poly2, ref List <Double3>[] Poly1IntersectArray, ref List <Double3>[] Poly2IntersectArray)
        {
            if (poly1 == null || poly2 == null)
            {
                return;
            }

            for (int i = 0; i < poly1.GetEdgeNum(); i++)
            {
                poly2.GetAllIntersectPoint(poly1.GetEdge(i), ref Poly1IntersectArray[i]);
            }
            //
            for (int i = 0; i < poly2.GetEdgeNum(); i++)
            {
                GetAllIntersectPoint(poly2.GetEdge(i).startPoint, i, Poly1IntersectArray, ref Poly2IntersectArray[i]);
            }
        }