C# 클래스 burningmime.curves.CurveFit

Implements a least-squares bezier curve fitting routine based on http://tog.acm.org/resources/GraphicsGems/gems/FitCurves.c with a few optimizations made by me. You can read the article here: http://read.pudn.com/downloads141/ebook/610086/Graphics_Gems_I.pdf page 626. To use, call the Fit static function and wait for magic to happen.
상속: CurveFitBase
파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

공개 메소드들

메소드 설명
Fit ( List points, System.Double maxError ) : CubicBezier[]

Attempts to fit a set of Bezier curves to the given data. It returns a set of curves that form a http://en.wikipedia.org/wiki/Composite_B%C3%A9zier_curve with C1 continuity (that is, each curve's start point is coincident with the previous curve's end point, and the tangent vectors of the start and end points are going in the same direction, so the curves will join up smoothly). Returns an empty array if less than two points in input. Input data MUST not contain repeated points (that is, the same point twice in succession). The best way to ensure this is to call any one of the methods in CurvePreprocess, since all three pre-processing methods will remove duplicate points. If repeated points are encountered, unexpected behavior can occur.

비공개 메소드들

메소드 설명
CurveFit ( ) : System

Private constructor so it can't be constructed externally.

FitRecursive ( int first, int last, System.Windows.Vector tanL, System.Windows.Vector tanR ) : void

Main fit function that attempts to fit a segment of curve and recurses if unable to.

GetInstance ( ) : CurveFit

메소드 상세

Fit() 공개 정적인 메소드

Attempts to fit a set of Bezier curves to the given data. It returns a set of curves that form a http://en.wikipedia.org/wiki/Composite_B%C3%A9zier_curve with C1 continuity (that is, each curve's start point is coincident with the previous curve's end point, and the tangent vectors of the start and end points are going in the same direction, so the curves will join up smoothly). Returns an empty array if less than two points in input. Input data MUST not contain repeated points (that is, the same point twice in succession). The best way to ensure this is to call any one of the methods in CurvePreprocess, since all three pre-processing methods will remove duplicate points. If repeated points are encountered, unexpected behavior can occur.
public static Fit ( List points, System.Double maxError ) : CubicBezier[]
points List Set of points to fit to.
maxError System.Double Maximum distance from any data point to a point on the generated curve.
리턴 CubicBezier[]