Edge
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
public class Edge : DesignScriptEntity
{
internal IEdgeEntity EdgeEntity => HostImpl as IEdgeEntity;
public Curve CurveGeometry => Curve.Wrap(EdgeEntity.CurveGeometry, true);
public Face[] AdjacentFaces => Track(Face.Wrap(EdgeEntity.AdjacentFaces, true));
public Vertex StartVertex => Track(Vertex.Wrap(EdgeEntity.StartVertex, true));
public Vertex EndVertex => Track(Vertex.Wrap(EdgeEntity.EndVertex, true));
internal Edge(IEdgeEntity host, bool persist)
: base(host, persist)
{
}
public override string ToString()
{
return "Edge(CurveGeometry = " + CurveGeometry + ", StartVertex = " + StartVertex + ", EndVertex = " + EndVertex + ")";
}
internal static Edge Wrap(IEdgeEntity host, bool persist = true)
{
if (host == null)
return null;
return new Edge(host, persist);
}
internal static Edge[] Wrap(IEdgeEntity[] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static Edge[][] Wrap(IEdgeEntity[][] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static IEdgeEntity[][] Unwrap(Edge[][] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static IEdgeEntity[] Unwrap(Edge[] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static IEdgeEntity[] Unwrap(IEnumerable<Edge> o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static IEdgeEntity Unwrap(Edge o)
{
return o.EdgeEntity;
}
}
}