Exemplo n.º 1
0
 /// <summary>
 /// Method used to add a face properly for internal methods
 /// </summary>
 /// <param name="v1">a face vertex</param>
 /// <param name="v2">a face vertex</param>
 /// <param name="v3">a face vertex</param>
 /// <returns></returns>
 private void AddFaceFromSplit(Vertex v1, Vertex v2, Vertex v3,
                               Stack <CsgFace> facesFromSplit)
 {
     if (!(v1.Equals(v2) || v1.Equals(v3) || v2.Equals(v3)))
     {
         CsgFace face = new CsgFace(v1, v2, v3);
         if (face.GetArea() > EqualityTolerance)
         {
             bool exists = false;
             foreach (var test in facesFromSplit)
             {
                 if (test.Equals(face))
                 {
                     exists = true;
                     break;
                 }
             }
             if (!exists)
             {
                 Faces.Insert(face, face.GetBound());
                 facesFromSplit.Push(face);
             }
         }
     }
 }
Exemplo n.º 2
0
        private CsgFace AddFace(Vertex v1, Vertex v2, Vertex v3)
        {
            if (!(v1.Equals(v2) || v1.Equals(v3) || v2.Equals(v3)))
            {
                CsgFace face = new CsgFace(v1, v2, v3);
                if (face.GetArea() > EqualityTolerance)
                {
                    Faces.Insert(face, face.GetBound());

                    return(face);
                }
            }

            return(null);
        }