A few weeks ago, I got myself a [Bamboo
Slate](https://www.amazon.de/Wacom-Bamboo-Slate-Smartpad-Digitalisierungs-Funktion/dp/B01L1V61MC)
tablet, and had a lot of fun playing around with the output. The Linux
software for talking to that device is
[Tuhi](https://github.com/tuhiproject/tuhi), which is GUI driven, but
also dumps the raw point and pressure data in JSON format into a
directory.

As a side effect of playing around with that, I published a [2d path
simplification library](https://github.com/gnoack/path) which uses the
[Ramer-Douglas-Peucker
algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).

Given a sequence of 2D points, the algorithm determines a subset of
these points so that the path drawn by these is still reasonably close
to the original. Here is an example output:

![](/images/hippie.png)
Original and simplified version side-by-side

I found the Ramer-Douglas-Peucker algorithm to be very clever, my
attempts to come up with my own algorithm had terrible results in
comparison.

The library is here:

* Source: https://github.com/gnoack/path
* Godoc: https://godoc.org/github.com/gnoack/path

I have a vague idea to use this for simplifying diagram drawings and
straightening out imprecisely drawn shapes, replacing squiggly boxes
and arrows with properly aligned ones. I'm not sure whether I'm going
in the right direction with this approach, given that I'm not making
use of pressure data and my knowledge of the shapes I want to
recognize; we'll see whether it'll turn out to work.
