/// <summary>
        /// Build an array of 2D polygonal outlines of the mesh projected onto the y = 0 plane.
        /// By default, will generate outlines going in the clockwise direction:
        /// e.g. given a triangle (a = (0,0,0), b = (1,0,0), c = (0,0,1)), will return an outline in the order
        /// (a, c, b).
        /// </summary>
        /// <param name="reverseOutlines">Build outlines in the opposite (counter-clockwise) direction.</param>
        public static Outline[] Generate(MeshData mesh, bool reverseOutlines = false)
        {
            Assert.IsNotNull(mesh);
            var            outlineGenerator = new OutlineGenerator(mesh);
            List <Outline> outlines         = outlineGenerator.GenerateOutlines();

            if (reverseOutlines)
            {
                outlines.ForEach(outline => outline.Reverse());
            }
            return(outlines.ToArray());
        }
예제 #2
0
        void ComputeMeshOutlines(MeshData mesh)
        {
            OutlineGenerator outlineGenerator = new OutlineGenerator(mesh);

            outlines = outlineGenerator.GenerateOutlines();
        }