Class IndexedPolycurve
A curve composed of a collection of line and arc segments. Parameterization of the curve is 0->n where n is the number of curves.
Implements
Inherited Members
Namespace: Elements.Geometry
Assembly: Hypar.Elements.dll
Syntax
[JsonObject]
public class IndexedPolycurve : BoundedCurve, ICurve, ITransformable<Curve>, IBoundedCurve, IEnumerable<BoundedCurve>, IEnumerable, IEquatable<IndexedPolycurve>
Constructors
IndexedPolycurve()
Create an indexed polycurve.
Declaration
public IndexedPolycurve()
IndexedPolycurve(IList<Vector3>, IList<IList<Int32>>)
Create an indexed polycurve.
Declaration
[JsonConstructor]
public IndexedPolycurve(IList<Vector3> vertices, IList<IList<int>> curveIndices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Vector3> | vertices | A collection of vertices. |
System.Collections.Generic.IList<System.Collections.Generic.IList<System.Int32>> | curveIndices | A collection of collections of indices. |
IndexedPolycurve(IList<Vector3>, IList<IList<Int32>>, Transform, Boolean)
Create an indexed polycurve.
Declaration
public IndexedPolycurve(IList<Vector3> vertices, IList<IList<int>> curveIndices = null, Transform transform = null, bool disableValidation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Vector3> | vertices | A collection of vertices. |
System.Collections.Generic.IList<System.Collections.Generic.IList<System.Int32>> | curveIndices | A collection of collections of indices. |
Transform | transform | An optional transform to apply to each vertex. |
System.Boolean | disableValidation |
IndexedPolycurve(List<BoundedCurve>, Transform)
Create an indexed polycurve.
Declaration
public IndexedPolycurve(List<BoundedCurve> curves, Transform transform = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<BoundedCurve> | curves | A collection of bounded curves. |
Transform | transform | An optional transform to apply to the vertices. |
Properties
CurveIndices
An optional collection of collections of indices of polycurve segments. Line segments are represented with two indices. Arc segments are represented with three indices.
Declaration
public IList<IList<int>> CurveIndices { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Collections.Generic.IList<System.Int32>> |
Domain
The domain of the curve.
Declaration
[JsonIgnore]
public override Domain1d Domain { get; }
Property Value
Type | Description |
---|---|
Domain1d |
Overrides
End
The end of the polycurve.
Declaration
[JsonIgnore]
public override Vector3 End { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Overrides
Start
The start of the polycurve.
Declaration
[JsonIgnore]
public override Vector3 Start { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Overrides
Vertices
The vertices of the polygon.
Declaration
[JsonProperty("Vertices", Required = Required.Always)]
[Required]
[MinLength(2)]
public IList<Vector3> Vertices { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Vector3> |
Methods
ArcLength(Double, Double)
Calculate the length of the polycurve between two parameters.
Declaration
public override double ArcLength(double start, double end)
Parameters
Type | Name | Description |
---|---|---|
System.Double | start | |
System.Double | end |
Returns
Type | Description |
---|---|
System.Double |
Overrides
Bounds()
Get the bounding box for this curve.
Declaration
public override BBox3 Bounds()
Returns
Type | Description |
---|---|
BBox3 |
Overrides
CheckCoincidenceAndThrow(IList<Vector3>)
Check for coincident vertices in the supplied vertex collection.
Declaration
protected void CheckCoincidenceAndThrow(IList<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Vector3> | vertices |
Equals(IndexedPolycurve)
Does this indexed polycurve equal the provided indexed polycurve?
Declaration
public bool Equals(IndexedPolycurve other)
Parameters
Type | Name | Description |
---|---|---|
IndexedPolycurve | other |
Returns
Type | Description |
---|---|
System.Boolean | True if the two curves are equal, otherwise false. |
GetEnumerator()
Get the enumerator for this indexed polycurve.
Declaration
public IEnumerator<BoundedCurve> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<BoundedCurve> | An enumerator of bounded curves. |
GetSubdivisionParameters(Double, Double)
Get parameters to be used to find points along the curve for visualization.
Declaration
public override double[] GetSubdivisionParameters(double startSetbackDistance = 0, double endSetbackDistance = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Double | startSetbackDistance | An optional setback from the start of the curve. |
System.Double | endSetbackDistance | An optional setback from the end of the curve. |
Returns
Type | Description |
---|---|
System.Double[] | A collection of parameter values. |
Overrides
Length()
Calculate the length of the indexed polycurve.
Declaration
public override double Length()
Returns
Type | Description |
---|---|
System.Double |
Overrides
ParameterAtDistanceFromParameter(Double, Double)
Get the parameter at a distance from the start parameter along the curve.
Declaration
public override double ParameterAtDistanceFromParameter(double distance, double start)
Parameters
Type | Name | Description |
---|---|---|
System.Double | distance | The distance from the start parameter. |
System.Double | start | The parameter from which to measure the distance between domain.min and domain.max. |
Returns
Type | Description |
---|---|
System.Double |
Overrides
PointAt(Double)
Get a point on the polycurve at parameter u.
Declaration
public override Vector3 PointAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A value between domain.min and domain.max. |
Returns
Type | Description |
---|---|
Vector3 | Returns a Vector3 indicating a point along the Polygon length from its start vertex. |
Overrides
PointAtInternal(Double, out Int32)
Get a point on the polycurve at parameter u.
Declaration
protected virtual Vector3 PointAtInternal(double u, out int curveIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | A value between domain.min and domain.max. |
System.Int32 | curveIndex | The index of the segment containing parameter u. |
Returns
Type | Description |
---|---|
Vector3 | Returns a Vector3 indicating a point along the Polygon length from its start vertex. |
ToPolygon()
Create a polygon from this polycurve.
Declaration
public Polygon ToPolygon()
Returns
Type | Description |
---|---|
Polygon |
ToString()
Get a string representation of this polycurve.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
TransformAt(Double)
Get the transform at the specified parameter along the polycurve.
Declaration
public override Transform TransformAt(double u)
Parameters
Type | Name | Description |
---|---|---|
System.Double | u | The parameter on the Polygon between domain.min and domain.max. |
Returns
Type | Description |
---|---|
Transform | A transform with its Z axis aligned trangent to the polycurve. |
Overrides
Transformed(Transform)
Create a transformed copy of this curve. Use of non-affine transforms (i.e. scale) will result in unpredictable results for curve methods such as Length().
Declaration
public override Curve Transformed(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform to apply. |
Returns
Type | Description |
---|---|
Curve |
Overrides
TransformedPolycurve(Transform)
Create new polycurve transformed by transform.
Declaration
public IndexedPolycurve TransformedPolycurve(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform to apply. |
Returns
Type | Description |
---|---|
IndexedPolycurve |
ValidateVertices()
Clean up any duplicate vertices, and warn about any vertices that are too close to each other.
Declaration
protected virtual void ValidateVertices()
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |