smooth(error = 50) {
    let newGroupSegments = [];
    const groupList = this.getGroup();
    groupList.forEach((group) => {
      const points = [
        ...group.segments
          .filter((it) => it.segment.command.toLowerCase() !== "z")
          .map((it) => {
            return [...it.segment.values, 0];
          }),
      ];

      const bezierCurve = fitCurve(points, error);
      const newSegments = [];
      bezierCurve.forEach((curve, index) => {
        if (index === 0) {
          newSegments.push(Segment.M(...curve[0]));
        }

        newSegments.push(
          Segment.C(
            curve[1][0],
            curve[1][1],
            curve[2][0],
            curve[2][1],
            curve[3][0],
            curve[3][1]
          )
        );
      });

      if (
        group.segments[
          group.segments.length - 1
        ].segment.command.toLowerCase() === "z"
      ) {
        newSegments.push(Segment.Z());
      }

      newGroupSegments = newGroupSegments.concat(newSegments);
    });

    return PathParser.fromSegments(newGroupSegments);
  }
convert points to curve

@param {number} error count
@returns {PathParser}