toArc method

List<CubicArc> toArc(
  1. double size,
  2. double deltaSize, {
  3. double precision = 0.5,
})

Converts this line to CubicArc.

Implementation

List<CubicArc> toArc(double size, double deltaSize,
    {double precision = 0.5}) {
  final list = <CubicArc>[];

  final steps = (_distance * precision).floor().clamp(1, 30);

  Offset start = this.start;
  for (int i = 0; i < steps; i++) {
    final t = (i + 1) / steps;
    final loc = point(t);
    final width = size + deltaSize * t;

    list.add(CubicArc(
      start: start,
      location: loc,
      size: width,
    ));

    start = loc;
  }

  return list;
}