Beispiel #1
0
        public static string  reduceTriangles(List <triangleInd> listInd, float factor, out int count)
        {
            int takeEvery = Convert.ToInt32(1f / factor);

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            count = 0;
            for (int i = 0; i < listInd.Count; i += takeEvery)
            {
                count++;
                triangleInd t = listInd[i];
                sb.Append(" " + t.ToString());
            }

            return(sb.ToString());
        }
Beispiel #2
0
        public static List <triangleInd> getTriangleIndicesFromString(string stringInput)
        {
            List <triangleInd> listInd = new List <triangleInd>();

            string[] arrInd = stringInput.Split(new Char[] { ' ' });
            for (int i = 0; i < arrInd.Length; i += 3)
            {
                if ((i + 3) < arrInd.Length)
                {
                    triangleInd t = new triangleInd(Convert.ToUInt32(arrInd[i]), Convert.ToUInt32(arrInd[i + 1]), Convert.ToUInt32(arrInd[i + 2]));
                    listInd.Add(t);
                }
            }

            return(listInd);
        }