Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number of points. Update cubic interpolation to reduce number of points generated for a given smoothness Cache data on open and used cached data to avoid multiple re-calcs Remove minimum line length and number of segments and replace with standard max error level. Allows us to specify the tolerance of bezier interpolation
This commit is contained in:
@@ -244,7 +244,7 @@ void PLOTTER::BezierCurve( const VECTOR2I& aStart, const VECTOR2I& aControl1,
|
||||
BEZIER_POLY bezier_converter( ctrlPoints );
|
||||
|
||||
std::vector<VECTOR2I> approxPoints;
|
||||
bezier_converter.GetPoly( approxPoints, minSegLen );
|
||||
bezier_converter.GetPoly( approxPoints, aTolerance );
|
||||
|
||||
SetCurrentLineWidth( aLineThickness );
|
||||
MoveTo( aStart );
|
||||
|
||||
Reference in New Issue
Block a user