예제 #1
0
        /// <summary>
        /// Generates a polygon from a triangle
        /// </summary>
        /// <param name="tri">Triangle</param>
        /// <param name="orientation">Orientation for the new polygon</param>
        /// <returns>Returns the new generated polygon</returns>
        public static Polygon FromTriangle(Triangle tri, GeometricOrientation orientation = GeometricOrientation.CounterClockwise)
        {
            Polygon poly = new Polygon(tri.Point1, tri.Point2, tri.Point3)
            {
                Orientation = orientation
            };

            return(poly);
        }
예제 #2
0
        /// <summary>
        /// Generates a polygon array from a triangle array
        /// </summary>
        /// <param name="tris">Triangle array</param>
        /// <param name="orientation">Orientation for the new polygons of the array</param>
        /// <returns>Returns the new generated polygon array</returns>
        public static Polygon[] FromTriangleList(Triangle[] tris, GeometricOrientation orientation = GeometricOrientation.CounterClockwise)
        {
            Polygon[] polys = new Polygon[tris.Length];

            for (int i = 0; i < tris.Length; i++)
            {
                polys[i] = Polygon.FromTriangle(tris[i], orientation);
            }

            return(polys);
        }