Hacker News new | ask | show | jobs
by bluenose69 1524 days ago
I remember clearly how postscript changed things for scientific work. Of course, it improved upon the daisy printers that we used for text. But the same language could also draw graphs, so it was a sort of all-in-one solution.

A limitation on the graph side of things was the requirement that any so-called "path" (to be drawn as a line or filled as a polygon) could hold at most 1500 elements. This limit was exceeded in a lot of work.

If the task was just to draw the line, the solution was simple: chop the path up into subpaths and draw each. (The transition point would be ugly due to line-ending issues, but the problem would be difficult to see on visual inspection).

This chopping method wasn't useful for polygons, though. So I came up with a scheme in which I examined each point with respect to it's two neighbours. If the point was within some distance of a line segment connecting the neighbours, then I omitted it. If the first pass got the number of points under 1500, I'd render them. Otherwise, I repeated the procedure, with wider tolerances. This was done in C, so it was not really too time-consuming. And it worked. The software is still in use today, many decades later.