  procedure ExtendLine(CurPt: TFPoint);
  begin
    AddPtToList(FIntPoints, GetPoint(CurPt));
    vCounts.List[vCounts.Count - 1] := vCounts[vCounts.Count - 1] + 1;
    FP := CurPt;
  end;

  procedure AddLine(const FP1, FP2: TFPoint);
  var
    vInternalPoint: TPoint;
  begin
    P1 := GetPoint(FP1);
    P2 := GetPoint(FP2);
    if vCounts.Count > 0 then
    begin
      vInternalPoint := GetPoint(FP);
      if (Abs(P1.X - vInternalPoint.X) < 2) and (Abs(P1.Y - vInternalPoint.Y) < 2) then
      begin
        ExtendLine(FP2);
        Exit;
      end;
    end;

    if IsEqualPoints(P1, P2) then
    begin
      if FPenWidth > 1 then // thin dot for thick lines
      begin
        ExpPixelInteger(AObj, P1, FColor);
        Exit;
      end;
    end;
    // here we know that previous poly is finished and we add one pixel to the end
    AddLastPixelToPoly(FIntPoints, vCounts);
    AddPtsInt(FIntPoints, P1, P2);
    vCounts.Add(2);
    FP := FP2;
  end;


  function IsInOtherPixel(CurPt: TFPoint; dX, dY: Double): Boolean;
  begin
    Result := (Abs(CurPt.X - FP.X) > dX) or
      (Abs(CurPt.Y - FP.Y) > dY) or (Abs(CurPt.Z - FP.Z) > dX);
  end;
