/// <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 HeGraphBaseFactory <G, V, E> factory, IEnumerable <Line> lines, double tolerance = SlurMath.ZeroTolerance, bool allowMultiEdges = false, bool allowLoops = false) where G : HeGraphBase <V, E> where V : HeGraphBase <V, E> .Vertex, IVertex3d where E : HeGraphBase <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 HeGraphBaseFactory <G, V, E> factory, IEnumerable <Line> lines, Action <V, Vec3d> setPosition, double tolerance = SlurMath.ZeroTolerance, bool allowMultiEdges = false, bool allowLoops = false) where G : HeGraphBase <V, E> where V : HeGraphBase <V, E> .Vertex where E : HeGraphBase <V, E> .Halfedge { var pts = new List <Vec3d>(); foreach (var ln in lines) { pts.Add(ln.From); pts.Add(ln.To); } return(factory.CreateFromLineSegments(pts, setPosition, tolerance, allowMultiEdges, allowLoops)); }