/// <summary>
 ///
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="lines"></param>
 /// <param name="tolerance"></param>
 /// <param name="allowMultiEdges"></param>
 /// <param name="allowLoops"></param>
 /// <returns></returns>
 public static G CreateFromLineSegments <G, V, E>(this HeGraphFactory <G, V, E> factory, IEnumerable <Line> lines, double tolerance = D.ZeroTolerance, bool allowMultiEdges = false, bool allowLoops = false)
     where G : HeGraph <V, E>
     where V : HeGraph <V, E> .Vertex, IPosition3d
     where E : HeGraph <V, E> .Halfedge
 {
     return(factory.CreateFromLineSegments(lines, (v, p) => v.Position = p, tolerance, allowMultiEdges, allowLoops));
 }
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="G"></typeparam>
        /// <typeparam name="V"></typeparam>
        /// <typeparam name="E"></typeparam>
        /// <param name="factory"></param>
        /// <param name="lines"></param>
        /// <param name="setPosition"></param>
        /// <param name="tolerance"></param>
        /// <param name="allowMultiEdges"></param>
        /// <param name="allowLoops"></param>
        /// <returns></returns>
        public static G CreateFromLineSegments <G, V, E>(this HeGraphFactory <G, V, E> factory, IEnumerable <Line> lines, Action <V, Vector3d> setPosition, double tolerance = D.ZeroTolerance, bool allowMultiEdges = false, bool allowLoops = false)
            where G : HeGraph <V, E>
            where V : HeGraph <V, E> .Vertex
            where E : HeGraph <V, E> .Halfedge
        {
            var pts = new List <Vector3d>();

            foreach (var ln in lines)
            {
                pts.Add(ln.From);
                pts.Add(ln.To);
            }

            return(factory.CreateFromLineSegments(pts, setPosition, tolerance, allowMultiEdges, allowLoops));
        }