Edge
using Autodesk.DesignScript.Interfaces;
using Autodesk.DesignScript.Runtime;
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.get_CurveGeometry(), true);
public Face[] AdjacentFaces => Track(Face.Wrap(EdgeEntity.get_AdjacentFaces(), true));
public Vertex StartVertex => Track(Vertex.Wrap(EdgeEntity.get_StartVertex(), true));
public Vertex EndVertex => Track(Vertex.Wrap(EdgeEntity.get_EndVertex(), true));
[IsVisibleInDynamoLibrary(false)]
public CoEdge[] CoEdges {
get {
return CoEdge.Wrap(EdgeEntity.get_CoEdges(), true);
}
}
internal Edge(IEdgeEntity host, bool persist)
: base(host, persist)
{
}
public override string ToString()
{
return "Edge(StartVertex = " + StartVertex?.ToString() + ", EndVertex = " + EndVertex?.ToString() + ")";
}
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;
}
}
}