Get the latest tech news

What was the point of [ "x$var" = "xval" ]? (2021)


;dr: My hobby project FiniteCurve.com is a web app that draws an image with a single, long, non-intersecting line. This post explains the process.

I never intended to publish the program, but the result was striking enough that I compiled the C++ code to Wasm via emscripten, added a scrappy frontend, and put it online. The general approach is to generate a point cloud with a density matching a grayscale input image, and finding something close to a Hamiltonian path that doesn’t cross itself. There is some additional polish like ignoring areas under a certain size or that are just a long, thin line of points, shuffling to try to avoid holes in the middle of a graph, and pruning edges coming out of a single vertex that are too close in angle, but really — that’s it.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of point

point

Photo of xval

xval

Photo of x$var

x$var

Related news:

News photo

What's the point of buying the latest smartphone?

News photo

Federal Reserve Cuts Rates By Half a Point and Signals Era of Easing Has Begun

News photo

SocialAI: We tried the Twitter clone where no other humans are allowed