reducePts[points_, tol_] :=
Module[{maxpos, testSeg, seg, distf},
distf[q : {x_, y_}, {p1 : {x1_, y1_}, p2 : {x2_, y2_}}] :=
With[{u = (q - p1).(p2 - p1)/(p2 - p1).(p2 - p1)},
Which[u <= 0, Norm[q - p1], u >= 1, Norm[q - p2], True,
Norm[q - (p1 + u (p2 - p1))]]];
testSeg[pts_List /; Length[pts] > 2] := Module[{dlst, max, pos},
dlst = distf[#, pts[[{1, -1}]]] & /@ pts[[2 ;; -1]];
max = Max[dlst];
If[max > tol, pos = Position[dlst, max][[1, 1]] + 1;
{testSeg[pts[[;; pos]]], testSeg[pts[[pos ;;]]]},