Esempio n. 1
0
 /// <summary>
 /// Return true if an Equal Elements.Geometry.Triangle appears at least once in the supplied list.
 /// </summary>
 /// <returns>
 /// True if the Triangle vertex positions are AlmostEqual to those of any Triangle in the supplied List.
 /// </returns>
 public static bool IsListed(this Elements.Geometry.Triangle triangle,
                             List <Elements.Geometry.Triangle> triangles)
 {
     foreach (var entry in triangles)
     {
         if (triangle.IsEqualTo(entry))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// Return the number of times an equal Elements.Geometry.Triangle in the supplied list.
        /// </summary>
        /// <returns>
        /// An integer.
        /// </returns>
        public static int Occurs(this Elements.Geometry.Triangle triangle,
                                 List <Elements.Geometry.Triangle> triangles)
        {
            int count = 0;

            foreach (var entry in triangles)
            {
                if (triangle.IsEqualTo(entry))
                {
                    count++;
                }
            }
            return(count);
        }