//--------------------------------------------------------------------------------------------------

        public static TopoDS_Vertex FindSharedVertex(TopoDS_Edge edge1, TopoDS_Edge edge2)
        {
            var vertices1 = edge1.Vertices();
            var vertices2 = edge2.Vertices();

            foreach (var vertex in vertices1)
            {
                if (vertices2.Any(v => v.IsSame(vertex)))
                {
                    return(vertex);
                }
            }
            return(null);
        }