C# Class burningmime.curves.SplineBuilder

Wraps a CurveBuilder and Spline together. Allows you to add data points as they come in and generate a smooth spline from them without doing unnecessary computation.
Exibir arquivo Open project: prepare/HTML-Renderer

Public Methods

Method Description
Add ( System.Windows.Vector p ) : bool

Adds a data point.

Clear ( ) : void

Clears the SplineBuilder.

Sample ( System.Double u ) : System.Windows.Vector

Gets the position of a point on the spline that's close to the desired point along the spline. For example, if u = 0.5, then a point that's about halfway through the spline will be returned. The returned point will lie exactly on one of the curves that make up the spline.

SplineBuilder ( System.Double pointDistance, System.Double error, int samplesPerCurve ) : System.Diagnostics
Tangent ( System.Double u ) : System.Windows.Vector

Gets the tangent of a point on the spline that's close to the desired point along the spline. For example, if u = 0.5, then the direction vector that's about halfway through the spline will be returned. The returned value will be a normalized direction vector.

Method Details

Add() public method

Adds a data point.
public Add ( System.Windows.Vector p ) : bool
p System.Windows.Vector Data point to add.
return bool

Clear() public method

Clears the SplineBuilder.
public Clear ( ) : void
return void

Sample() public method

Gets the position of a point on the spline that's close to the desired point along the spline. For example, if u = 0.5, then a point that's about halfway through the spline will be returned. The returned point will lie exactly on one of the curves that make up the spline.
public Sample ( System.Double u ) : System.Windows.Vector
u System.Double How far along the spline to sample (for example, 0.5 will be halfway along the length of the spline). Should be between 0 and 1.
return System.Windows.Vector

SplineBuilder() public method

public SplineBuilder ( System.Double pointDistance, System.Double error, int samplesPerCurve ) : System.Diagnostics
pointDistance System.Double
error System.Double
samplesPerCurve int
return System.Diagnostics

Tangent() public method

Gets the tangent of a point on the spline that's close to the desired point along the spline. For example, if u = 0.5, then the direction vector that's about halfway through the spline will be returned. The returned value will be a normalized direction vector.
public Tangent ( System.Double u ) : System.Windows.Vector
u System.Double How far along the spline to sample (for example, 0.5 will be halfway along the length of the spline). Should be between 0 and 1.
return System.Windows.Vector