Search Results for

    Show / Hide Table of Contents

    Class DCurve3

    DCurve3 is a 3D polyline, either open or closed (via .Closed) Despite the D prefix, it is not dynamic

    Inheritance
    Object
    DCurve3
    Implements
    ISampledCurve3d
    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 DCurve3 : ISampledCurve3d

    Constructors

    DCurve3()

    Declaration
    public DCurve3()

    DCurve3(DCurve3)

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

    DCurve3(ISampledCurve3d)

    Declaration
    public DCurve3(ISampledCurve3d icurve)
    Parameters
    Type Name Description
    ISampledCurve3d icurve

    DCurve3(Polygon2d, Int32, Int32)

    Declaration
    public DCurve3(Polygon2d poly, int ix = 0, int iy = 1)
    Parameters
    Type Name Description
    Polygon2d poly
    Int32 ix
    Int32 iy

    DCurve3(IEnumerable<Vector3d>, Boolean)

    Declaration
    public DCurve3(IEnumerable<Vector3d> verticesIn, bool bClosed)
    Parameters
    Type Name Description
    IEnumerable<Vector3d> verticesIn
    Boolean bClosed

    DCurve3(List<Vector3d>, Boolean, Boolean)

    Declaration
    public DCurve3(List<Vector3d> verticesIn, bool bClosed, bool bTakeOwnership = false)
    Parameters
    Type Name Description
    List<Vector3d> verticesIn
    Boolean bClosed
    Boolean bTakeOwnership

    Fields

    Timestamp

    Declaration
    public int Timestamp
    Field Value
    Type Description
    Int32

    vertices

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

    Properties

    ArcLength

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

    Closed

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

    End

    Declaration
    public Vector3d End { get; }
    Property Value
    Type Description
    Vector3d

    Item[Int32]

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

    SegmentCount

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

    Start

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

    VertexCount

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

    Vertices

    Declaration
    public IEnumerable<Vector3d> Vertices { get; }
    Property Value
    Type Description
    IEnumerable<Vector3d>

    Methods

    AppendVertex(Vector3d)

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

    Centroid(Int32)

    Declaration
    public Vector3d Centroid(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector3d

    ClearVertices()

    Declaration
    public void ClearVertices()

    DistanceSquared(Vector3d)

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

    DistanceSquared(Vector3d, out Int32, out Double)

    find squared distance from p to nearest segment on polyline

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

    GetBoundingBox()

    Declaration
    public AxisAlignedBox3d GetBoundingBox()
    Returns
    Type Description
    AxisAlignedBox3d

    GetSegment(Int32)

    Declaration
    public Segment3d GetSegment(int iSegment)
    Parameters
    Type Name Description
    Int32 iSegment
    Returns
    Type Description
    Segment3d

    GetVertex(Int32)

    Declaration
    public Vector3d GetVertex(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector3d

    NearestVertex(Vector3d)

    Find nearest vertex to point p

    Declaration
    public int NearestVertex(Vector3d p)
    Parameters
    Type Name Description
    Vector3d p
    Returns
    Type Description
    Int32

    Neighbours(Int32)

    Declaration
    public Index2i Neighbours(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Index2i

    OpeningAngleDeg(Int32)

    Compute opening angle at vertex i in degrees

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

    PointAt(Int32, Double)

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

    RemoveVertex(Int32)

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

    ResampleSharpTurns(Double, Double, Double)

    Resample curve so that:

    • if opening angle at vertex is > sharp_thresh, we emit two more vertices at +/- corner_t, where the t is used in prev/next lerps
    • if opening angle is > flat_thresh, we skip the vertex entirely (simplification) This is mainly useful to get nicer polylines to use as the basis for (eg) creating 3D tubes, rendering, etc

    [TODO] skip tiny segments?

    Declaration
    public DCurve3 ResampleSharpTurns(double sharp_thresh = 90, double flat_thresh = 189, double corner_t = 0.01)
    Parameters
    Type Name Description
    Double sharp_thresh
    Double flat_thresh
    Double corner_t
    Returns
    Type Description
    DCurve3

    Reverse()

    Declaration
    public void Reverse()

    SegmentItr()

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

    SetVertex(Int32, Vector3d)

    Declaration
    public void SetVertex(int i, Vector3d v)
    Parameters
    Type Name Description
    Int32 i
    Vector3d v

    SetVertices(VectorArray3d)

    Declaration
    public void SetVertices(VectorArray3d v)
    Parameters
    Type Name Description
    VectorArray3d v

    SetVertices(IEnumerable<Vector3d>)

    Declaration
    public void SetVertices(IEnumerable<Vector3d> v)
    Parameters
    Type Name Description
    IEnumerable<Vector3d> v

    SetVertices(List<Vector3d>, Boolean)

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

    Tangent(Int32)

    Declaration
    public Vector3d Tangent(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Vector3d

    Implements

    ISampledCurve3d
    In This Article
    Back to top ViRGIS VR GIS