ICurve
Description
- Derived from
- Extended by
-
Curve abstract
Base interface for classes that represent a curve that interpolates through a sequence of control points.
A curve has zero or more control points, which may be added with the Add*
methods and cleared with Clear. Each control point has a required position value and an optional tangent value. Each value is a tuple with 1 to 4 components. By replicating control points, the curve can be further adjusted (see Replicate). Control point information may be queried with Count, Range, HasTangents and GetAt. Interpolation of points (1D through 4D) along the curve is performed by the Compute*
methods. With Length, WalkIndex and WalkDistance, spatial information about the curve is exposed. Regarding WalkDistance and WalkIndex, the following holds true:
A,B := control point indices within valid range WalkIndex(A, WalkDistance(A, B)) ~= B WalkIndex(B, WalkDistance(B, A)) ~= A (only almost equal because of numeric algorithm) WalkDistance(A, B) = -WalkDistance(B, A)
Walking along a curve is implemented with a recursive numeric algorithm and may involve significant floating-point calculations. Computing the walk distance between integral control point indices will use an internal cache of walk distance values and thus reduces to a simple lookup-table query.
- See also
Public / Methods
Add
4 overloads
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Add2
4 overloads
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
WalkDistance
Computes the walk distance from the given start control point to the given end control point.
- See also
Public / Attributes
Length
Returns the length curve.
Getting this value is equivalent to calling WalkDistance for Range.
Range
Returns the range of control point indices.
Control points within this range can be used to compute points, without clamping at the first and last control points.
Replicate
Returns how many times a control point may be replicated, in order to control the curve.
A control point is replicated by calling one of the Add*
methods, passing identical position values. The replication count values have the following meaning:
-
Replicate = 2
When Continuity is Continuity.Curvature, replicating a control point once or twice reduces to Continuity.Tangent or Continuity.Position, respectively. The first and the last control point may only be replicated at most once, to avoid curve segments of zero length. -
Replicate = 1
When Continuity is Continuity.Tangent and HasTangents istrue
, the original control point defines the incoming tangent values and the last replicated control point defines the outgoing tangent values. If the incoming and outgoing tangent values are different, Continuity reduces to Continuity.Position. -
Replicate = 0
Replicated control points will be discarded.
Extensions
Add
3 overloads
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that has tangents will specify zero for tangent values.
- See also
Add2
3 overloads
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also
Adds a control point to this curve.
Using this method on a curve that does not have tangents will discard the tangent values.
- See also