OK the picture is overexaggerated for dramatic affect...look at the options, for example
The tolerance that determines the degree of simplification. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.
- For POINT_REMOVE algorithm, the tolerance you specify is the maximum allowable offset.
This is apparently using the Douglas-Peuker thinning algorithm. Regardless of what you want to roll out on your own, you are going to be looking for an offset distance between 3 points or to determine a 3 point angle, keeping only those points that are within a tolerance. I would experiment keeping in mind the interpoint spacing that you have in your data set. For example if you have a line that is 100 meters long and 10 equally spaced extra points between the start and end point. What do you want to preserve? an offset distance of 10cm? 1 cm? 1 mm? or an angular range of 179-181? 179.5-180.5? 179.99-180.01? (with 180 being straight. There has got to be some point that you get to say enough, so I would experiment before you end up reinventing the wheel.
Good luck...I would be interesting if you provide some before and after samples of your efforts on a copy...of course.