Class DCurve3
DCurve3 is a 3D polyline, either open or closed (via .Closed)
Despite the D prefix, it is not dynamic
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class DCurve3 : ISampledCurve3d
Constructors
DCurve3()
Declaration
DCurve3(DCurve3)
Declaration
public DCurve3(DCurve3 copy)
Parameters
DCurve3(ISampledCurve3d)
Declaration
public DCurve3(ISampledCurve3d icurve)
Parameters
DCurve3(Polygon2d, Int32, Int32)
Declaration
public DCurve3(Polygon2d poly, int ix = 0, int iy = 1)
Parameters
DCurve3(IEnumerable<Vector3d>, Boolean)
Declaration
public DCurve3(IEnumerable<Vector3d> verticesIn, bool bClosed)
Parameters
DCurve3(List<Vector3d>, Boolean, Boolean)
Declaration
public DCurve3(List<Vector3d> verticesIn, bool bClosed, bool bTakeOwnership = false)
Parameters
Fields
Timestamp
Declaration
Field Value
vertices
Declaration
protected List<Vector3d> vertices
Field Value
Properties
ArcLength
Declaration
public double ArcLength { get; }
Property Value
Closed
Declaration
public bool Closed { get; set; }
Property Value
End
Declaration
public Vector3d End { get; }
Property Value
Item[Int32]
Declaration
public Vector3d this[int key] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
key |
|
Property Value
SegmentCount
Declaration
public int SegmentCount { get; }
Property Value
Start
Declaration
public Vector3d Start { get; }
Property Value
VertexCount
Declaration
public int VertexCount { get; }
Property Value
Vertices
Declaration
public IEnumerable<Vector3d> Vertices { get; }
Property Value
Methods
AppendVertex(Vector3d)
Declaration
public void AppendVertex(Vector3d v)
Parameters
Centroid(Int32)
Declaration
public Vector3d Centroid(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
ClearVertices()
Declaration
public void ClearVertices()
DistanceSquared(Vector3d)
Declaration
public double DistanceSquared(Vector3d p)
Parameters
Returns
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
Returns
GetBoundingBox()
Declaration
public AxisAlignedBox3d GetBoundingBox()
Returns
GetSegment(Int32)
Declaration
public Segment3d GetSegment(int iSegment)
Parameters
Type |
Name |
Description |
Int32 |
iSegment |
|
Returns
GetVertex(Int32)
Declaration
public Vector3d GetVertex(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
NearestVertex(Vector3d)
Find nearest vertex to point p
Declaration
public int NearestVertex(Vector3d p)
Parameters
Returns
Neighbours(Int32)
Declaration
public Index2i Neighbours(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
OpeningAngleDeg(Int32)
Compute opening angle at vertex i in degrees
Declaration
public double OpeningAngleDeg(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
PointAt(Int32, Double)
Declaration
public Vector3d PointAt(int iSegment, double fSegT)
Parameters
Returns
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
Returns
Reverse()
Declaration
SegmentItr()
Declaration
public IEnumerable<Segment3d> SegmentItr()
Returns
SetVertex(Int32, Vector3d)
Declaration
public void SetVertex(int i, Vector3d v)
Parameters
SetVertices(VectorArray3d)
Declaration
public void SetVertices(VectorArray3d v)
Parameters
SetVertices(IEnumerable<Vector3d>)
Declaration
public void SetVertices(IEnumerable<Vector3d> v)
Parameters
SetVertices(List<Vector3d>, Boolean)
Declaration
public void SetVertices(List<Vector3d> vertices, bool bTakeOwnership)
Parameters
Tangent(Int32)
Declaration
public Vector3d Tangent(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
Implements