Example #1
0
        /// <summary>
        /// Create a simple shallow copy of these mesh faces
        /// </summary>
        /// <returns></returns>
        public MeshFaceCollection FastDuplicate()
        {
            var result = new MeshFaceCollection();

            foreach (MeshFace face in this)
            {
                result.Add(new MeshFace(face));
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Get all mesh faces in this collection that contain any vertices
        /// shared with the specified vertex collection
        /// </summary>
        /// <param name="vertices"></param>
        /// <returns></returns>
        public MeshFaceCollection AllWithVertices(VertexCollection vertices)
        {
            var result = new MeshFaceCollection();

            foreach (MeshFace face in this)
            {
                if (face.ContainsAnyVertex(vertices))
                {
                    result.Add(face);
                }
            }
            return(result);
        }
Example #3
0
        /// <summary>
        /// Trim this collection of faces to only those which fit within the specified boundary polygon
        /// on the XY plane
        /// </summary>
        /// <param name="boundary"></param>
        /// <param name="vertices">Optional.  The collection of vertices to which new vertices created during
        /// this process should be added.</param>
        /// <returns></returns>
        public MeshFaceCollection TrimToPolygonXY(IList <Vertex> boundary, IList <Vertex> vertices = null)
        {
            MeshFaceCollection result = new MeshFaceCollection();

            foreach (MeshFace face in this)
            {
                IList <MeshFace> splitFaces = Intersect.PolygonOverlapXY <MeshFace>(face, boundary, vertices);
                if (splitFaces != null)
                {
                    foreach (MeshFace sFace in splitFaces)
                    {
                        result.Add(sFace);
                    }
                }
            }
            return(result);
        }