flattenCubic function
List<DiagramPoint>
flattenCubic(
- DiagramPoint start,
- DiagramPoint firstControl,
- DiagramPoint secondControl,
- DiagramPoint end, {
- required double tolerance,
- List<
DiagramPoint> ? output,
Appends an adaptive polyline for a cubic Bézier to output, excluding
start, and returns output. Subdivision stops once both control points
are within tolerance of the chord, or at a depth of 16.
Implementation
List<DiagramPoint> flattenCubic(
DiagramPoint start,
DiagramPoint firstControl,
DiagramPoint secondControl,
DiagramPoint end, {
required double tolerance,
List<DiagramPoint>? output,
}) {
final result = output ?? <DiagramPoint>[];
_flattenCubic(
result,
start,
firstControl,
secondControl,
end,
tolerance * tolerance,
0,
);
return result;
}