Search Results for

    Show / Hide Table of Contents

    Class Polygon2d

    Inheritance
    Object
    Polygon2d
    Implements
    IDuplicatable<Polygon2d>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: g3
    Assembly: cs.temp.dll.dll
    Syntax
    public class Polygon2d : IDuplicatable<Polygon2d>

    Constructors

    Polygon2d()

    Declaration
    public Polygon2d()

    Polygon2d(Polygon2d)

    Declaration
    public Polygon2d(Polygon2d copy)
    Parameters
    Type Name Description
    Polygon2d copy

    Polygon2d(Vector2d[])

    Declaration
    public Polygon2d(Vector2d[] v)
    Parameters
    Type Name Description
    Vector2d[] v

    Polygon2d(VectorArray2d)

    Declaration
    public Polygon2d(VectorArray2d v)
    Parameters
    Type Name Description
    VectorArray2d v

    Polygon2d(IEnumerable<Vector2d>)

    Declaration
    public Polygon2d(IEnumerable<Vector2d> copy)
    Parameters
    Type Name Description
    IEnumerable<Vector2d> copy

    Polygon2d(IList<Vector2d>)

    Declaration
    public Polygon2d(IList<Vector2d> copy)
    Parameters
    Type Name Description
    IList<Vector2d> copy

    Polygon2d(Double[])

    Declaration
    public Polygon2d(double[] values)
    Parameters
    Type Name Description
    Double[] values

    Polygon2d(Func<Int32, Vector2d>, Int32)

    Declaration
    public Polygon2d(Func<int, Vector2d> SourceF, int N)
    Parameters
    Type Name Description
    Func<Int32, Vector2d> SourceF
    Int32 N

    Fields

    Timestamp

    Declaration
    public int Timestamp
    Field Value
    Type Description
    Int32

    vertices

    Declaration
    protected List<Vector2d> vertices
    Field Value
    Type Description
    List<Vector2d>

    Properties

    ArcLength

    Declaration
    public double ArcLength { get; }
    Property Value
    Type Description
    Double

    Area

    Declaration
    public double Area { get; }
    Property Value
    Type Description
    Double

    AverageEdgeLength

    Declaration
    public double AverageEdgeLength { get; }
    Property Value
    Type Description
    Double

    Bounds

    Declaration
    public AxisAlignedBox2d Bounds { get; }
    Property Value
    Type Description
    AxisAlignedBox2d

    IsClockwise

    Declaration
    public bool IsClockwise { get; }
    Property Value
    Type Description
    Boolean

    Item[Int32]

    Declaration
    public Vector2d this[int key] { get; set; }
    Parameters
    Type Name Description
    Int32 key
    Property Value
    Type Description
    Vector2d

    Perimeter

    Declaration
    public double Perimeter { get; }
    Property Value
    Type Description
    Double

    SignedArea

    Declaration
    public double SignedArea { get; }
    Property Value
    Type Description
    Double

    Start

    Declaration
    public Vector2d Start { get; }
    Property Value
    Type Description
    Vector2d

    VertexCount

    Declaration
    public int VertexCount { get; }
    Property Value
    Type Description
    Int32

    Vertices

    Declaration
    public ReadOnlyCollection<Vector2d> Vertices { get; }
    Property Value
    Type Description
    ReadOnlyCollection<Vector2d>

    Methods

    AppendVertex(Vector2d)

    Declaration
    public void AppendVertex(Vector2d v)
    Parameters
    Type Name Description
    Vector2d v

    AppendVertices(IEnumerable<Vector2d>)

    Declaration
    public void AppendVertices(IEnumerable<Vector2d> v)
    Parameters
    Type Name Description
    IEnumerable<Vector2d> v

    Chamfer(Double, Double, Double)

    Declaration
    public void Chamfer(double chamfer_dist, double minConvexAngleDeg = 30, double minConcaveAngleDeg = 30)
    Parameters
    Type Name Description
    Double chamfer_dist
    Double minConvexAngleDeg
    Double minConcaveAngleDeg

    Contains(Polygon2d)

    Declaration
    public bool Contains(Polygon2d o)
    Parameters
    Type Name Description
    Polygon2d o
    Returns
    Type Description
    Boolean

    Contains(Segment2d)

    Checks that all points on a segment are within the area defined by the Polygon2d.

    Declaration
    public bool Contains(Segment2d o)
    Parameters
    Type Name Description
    Segment2d o
    Returns
    Type Description
    Boolean

    Contains(Vector2d)

    Returns true if point inside polygon, using fast winding-number computation

    Declaration
    public bool Contains(Vector2d P)
    Parameters
    Type Name Description
    Vector2d P
    Returns
    Type Description
    Boolean

    DistanceSquared(Vector2d)

    Declaration
    public double DistanceSquared(Vector2d p)
    Parameters
    Type Name Description
    Vector2d p
    Returns
    Type Description
    Double

    DistanceSquared(Vector2d, out Int32, out Double)

    Declaration
    public double DistanceSquared(Vector2d p, out int iNearSeg, out double fNearSegT)
    Parameters
    Type Name Description
    Vector2d p
    Int32 iNearSeg
    Double fNearSegT
    Returns
    Type Description
    Double

    Duplicate()

    Declaration
    public virtual Polygon2d Duplicate()
    Returns
    Type Description
    Polygon2d

    FindIntersections(Polygon2d)

    Declaration
    public List<Vector2d> FindIntersections(Polygon2d o)
    Parameters
    Type Name Description
    Polygon2d o
    Returns
    Type Description
    List<Vector2d>

    GetBounds()

    Declaration
    public AxisAlignedBox2d GetBounds()
    Returns
    Type Description
    AxisAlignedBox2d

    GetNormal(Int32)

    Normal at vertex i, which is perp to tangent direction, which is not so intuitive if edges have very different lengths. Points "inward" for clockwise polygon, outward for counter-clockwise

    Declaration
    public Vector2d GetNormal(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector2d

    GetNormal(Int32, Double)

    Declaration
    public Vector2d GetNormal(int iSeg, double segT)
    Parameters
    Type Name Description
    Int32 iSeg
    Double segT
    Returns
    Type Description
    Vector2d

    GetNormal_FaceAvg(Int32)

    Construct normal at poly vertex by averaging face normals. This is equivalent (?) to angle-based normal, ie is local/independent of segment lengths. Points "inward" for clockwise polygon, outward for counter-clockwise

    Declaration
    public Vector2d GetNormal_FaceAvg(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector2d

    GetTangent(Int32)

    Declaration
    public Vector2d GetTangent(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector2d

    Intersects(Polygon2d)

    Declaration
    public bool Intersects(Polygon2d o)
    Parameters
    Type Name Description
    Polygon2d o
    Returns
    Type Description
    Boolean

    Intersects(Segment2d)

    Checks if any point on a segment is within the area defined by the Polygon2d.

    Declaration
    public bool Intersects(Segment2d o)
    Parameters
    Type Name Description
    Segment2d o
    Returns
    Type Description
    Boolean

    MakeCircle(Double, Int32, Double)

    Declaration
    public static Polygon2d MakeCircle(double fRadius, int nSteps, double angleShiftRad = 0)
    Parameters
    Type Name Description
    Double fRadius
    Int32 nSteps
    Double angleShiftRad
    Returns
    Type Description
    Polygon2d

    MakeRectangle(Vector2d, Double, Double)

    Declaration
    public static Polygon2d MakeRectangle(Vector2d center, double width, double height)
    Parameters
    Type Name Description
    Vector2d center
    Double width
    Double height
    Returns
    Type Description
    Polygon2d

    MinimalBoundingBox(Double)

    Return minimal bounding box of vertices, computed to epsilon tolerance

    Declaration
    public Box2d MinimalBoundingBox(double epsilon)
    Parameters
    Type Name Description
    Double epsilon
    Returns
    Type Description
    Box2d

    NeighboursP(Int32, ref Vector2d, ref Vector2d)

    Declaration
    public void NeighboursP(int iVertex, ref Vector2d p0, ref Vector2d p1)
    Parameters
    Type Name Description
    Int32 iVertex
    Vector2d p0
    Vector2d p1

    NeighboursV(Int32, ref Vector2d, ref Vector2d, Boolean)

    Declaration
    public void NeighboursV(int iVertex, ref Vector2d v0, ref Vector2d v1, bool bNormalize = false)
    Parameters
    Type Name Description
    Int32 iVertex
    Vector2d v0
    Vector2d v1
    Boolean bNormalize

    OpeningAngleDeg(Int32)

    Declaration
    public double OpeningAngleDeg(int iVertex)
    Parameters
    Type Name Description
    Int32 iVertex
    Returns
    Type Description
    Double

    PointAt(Int32, Double)

    Declaration
    public Vector2d PointAt(int iSegment, double fSegT)
    Parameters
    Type Name Description
    Int32 iSegment
    Double fSegT
    Returns
    Type Description
    Vector2d

    PolyOffset(Double)

    offset polygon by fixed distance, by offsetting and intersecting edges. CCW polygon offsets "outwards", CW "inwards".

    Declaration
    public void PolyOffset(double dist)
    Parameters
    Type Name Description
    Double dist

    RemoveVertex(Int32)

    Declaration
    public void RemoveVertex(int idx)
    Parameters
    Type Name Description
    Int32 idx

    Reverse()

    Declaration
    public void Reverse()

    Rotate(Matrix2d, Vector2d)

    Declaration
    public Polygon2d Rotate(Matrix2d rotation, Vector2d origin)
    Parameters
    Type Name Description
    Matrix2d rotation
    Vector2d origin
    Returns
    Type Description
    Polygon2d

    Scale(Vector2d, Vector2d)

    Declaration
    public Polygon2d Scale(Vector2d scale, Vector2d origin)
    Parameters
    Type Name Description
    Vector2d scale
    Vector2d origin
    Returns
    Type Description
    Polygon2d

    Segment(Int32)

    Declaration
    public Segment2d Segment(int iSegment)
    Parameters
    Type Name Description
    Int32 iSegment
    Returns
    Type Description
    Segment2d

    SegmentItr()

    Declaration
    public IEnumerable<Segment2d> SegmentItr()
    Returns
    Type Description
    IEnumerable<Segment2d>

    SetVertices(List<Vector2d>, Boolean)

    Declaration
    public void SetVertices(List<Vector2d> newVertices, bool bTakeOwnership)
    Parameters
    Type Name Description
    List<Vector2d> newVertices
    Boolean bTakeOwnership

    Simplify(Double, Double, Boolean)

    Declaration
    public void Simplify(double clusterTol = 0.0001, double lineDeviationTol = 0.01, bool bSimplifyStraightLines = true)
    Parameters
    Type Name Description
    Double clusterTol
    Double lineDeviationTol
    Boolean bSimplifyStraightLines

    Transform(ITransform2)

    Declaration
    public Polygon2d Transform(ITransform2 xform)
    Parameters
    Type Name Description
    ITransform2 xform
    Returns
    Type Description
    Polygon2d

    Transform(Func<Vector2d, Vector2d>)

    Declaration
    public Polygon2d Transform(Func<Vector2d, Vector2d> transformF)
    Parameters
    Type Name Description
    Func<Vector2d, Vector2d> transformF
    Returns
    Type Description
    Polygon2d

    Translate(Vector2d)

    Declaration
    public Polygon2d Translate(Vector2d translate)
    Parameters
    Type Name Description
    Vector2d translate
    Returns
    Type Description
    Polygon2d

    VerticesItr(Boolean)

    Declaration
    public IEnumerable<Vector2d> VerticesItr(bool bRepeatFirstAtEnd)
    Parameters
    Type Name Description
    Boolean bRepeatFirstAtEnd
    Returns
    Type Description
    IEnumerable<Vector2d>

    VtxNormalOffset(Double, Boolean)

    Offset each point by dist along vertex normal direction (ie tangent-perp) CCW polygon offsets "outwards", CW "inwards".

    Declaration
    public void VtxNormalOffset(double dist, bool bUseFaceAvg = false)
    Parameters
    Type Name Description
    Double dist
    Boolean bUseFaceAvg

    WindingIntegral(Vector2d)

    Compute winding integral at point P

    Declaration
    public double WindingIntegral(Vector2d P)
    Parameters
    Type Name Description
    Vector2d P
    Returns
    Type Description
    Double

    Implements

    IDuplicatable<T>
    In This Article
    Back to top ViRGIS VR GIS