Analog Terminal Shell Clock
🇬🇧 As a clock lover, coming from a clock-making country and because I did not find any decent analog clock for the terminal, I decided to programm one. After realizing that it is really not that simple to draw beautiful lines in the terminal (not using sixel or kitty protocol), I came with a first solution that had somewhat antialiased but ugly, wide and nonreadable clockface-hands. After a second trial, I found the Bresenham line algorithm and even managed to proper antialias it. The culprit was: It was blurry, chunky and was not looking as crisp as I had expected. I guess that in the terminal, my eyes are trained to see pure non graphical information. Well then.
My conclusion after all that messing around is, that using the Bresenham algo is fine (of course it is!) but antialiasing is not. So I can keep the code quite a bit smaller. Is the clock really beautiful? Alas! Probably not – but hopefully useful at least.
🇩🇪 Als Uhrenliebhaber, der aus einem Land stammt, in dem Uhren hergestellt werden, und da ich keine anständige Analoguhr für das Terminal finden konnte, beschloss ich, selbst eine zu programmieren. Nachdem mir klar wurde, dass es gar nicht so einfach ist, schöne Linien im Terminal zu zeichnen (ohne sixel oder das Kitty-Protokoll), entwickelte ich eine erste Lösung mit zwar leicht geglätteten, aber hässlichen, breiten und unlesbaren Zeigern. Nach einem zweiten Versuch stieß ich auf den Bresenham-Linienalgorithmus und schaffte es sogar, ihn ordentlich zu glätten. Das Problem war: Das Ergebnis war verschwommen, klobig und sah nicht so scharf aus, wie ich es erwartet hatte. Ich vermute, dass meine Augen im Terminal darauf trainiert sind, reine, nicht-grafische Informationen zu erkennen. Na gut.
Mein Fazit nach all dem Herumprobieren lautet: Die Verwendung des Bresenham-Algorithmus ist in Ordnung (natürlich ist sie das!), das Antialiasing jedoch nicht. So kann ich den Code um einiges kleiner halten. Ist die Uhr wirklich schön? Ach! Wahrscheinlich nicht – aber hoffentlich zumindest nützlich.