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:
Seth Hillbrand
2024-06-17 21:47:06 -07:00
parent 0d2c4c91fd
commit bcf6b620a8
31 changed files with 698 additions and 221 deletions
+1 -1
View File
@@ -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 );