nowfound

Work · July 17, 2023

RG

Rectfillcurve – generate rectangle-filling curves

How do you visit every coordinate in an NxM grid once? The easiest is to process line-by-line, from the first to last column, but if you want better caching you might try alternating the column direction for each row. The Morton/Z-order and Hilbert order give even better cache coherency for some tasks, although the classic versions only work on squares with power-of-two length sides. Luckily for me, people have developed generalized versions of those algorithms which can handle arbitrary-sized rectangles. I've taken those and packaged all of the those curves into "rectfillcurve", with…

In plain words

Rectfillcurve generates algorithms for visiting every coordinate in a rectangular grid exactly once, optimizing for cache performance. It implements multiple curve-filling approaches including row-by-row, alternating directions, Morton/Z-order, and Hilbert order curves, along with a pseudo-random option. The tool handles arbitrary-sized rectangles through generalized algorithms, offering an iterator API and available in both C and Python for developers working with spatial data structures.

written from the facts on this page · September 2026

From the sources

In the maker’s words, at launch

How do you visit every coordinate in an NxM grid once? The easiest is to process line-by-line, from the first to last column, but if you want better caching you might try alternating the column direction for each row. The Morton/Z-order and Hilbert order give even better cache coherency for some tasks, although the classic versions only work on squares with power-of-two length sides. Luckily for me, people have developed generalized versions of those algorithms which can handle arbitrary-sized rectangles. I've taken those and packaged all of the those curves into "rectfillcurve", with an iterator API for generating those curves, and a bonus "mlcg curve" with a pseudo-random visit order that should have poor cache behavior. Implemented in stand-alone C, and also available as a Python module.

More work this month

the category →
  • Let agents source clips from terabytes of your local video

    Work · 18d ago · clipto.com

  • Free local transcription that is 100% Private

    Work · 17d ago · hynote.ai

  • The app store for voice native apps that lives in your notch

    Work · 28d ago · voiceos.com

  • Ask any question, get a video back instantly

    Work · 24d ago · scrimba.com

  • Handle all of the work before, during, and after meetings

    Work · 17d ago · calendly.com

Launched alongside, July 2023

the whole month →
  • Clustr1,529

    The reality check for your crypto portfolio

    Commerce · 2023 · clustr.io

  • WL

    Hey everyone, I here is a small open-source project I've been working on lately. I'd love to hear your thoughts and improvement ideas :) GitHub: [github.com/Vincenius/workout-lol](https://github.com/Vincenius/workout-lol)

    Dev tools · 2023 · workout.lol

  • HN

    I saw this [0] pretty cool thread by user revskill, and wanted a quicker way to search through it, but also to keep them all in one place so I can read them at my leisure whenever I get time. Right now is like 60 lines of Ruby using Nokogiri, but I will certainly look into it further down the line and improve the list. There's a cronjob checking the thread every 12 hours but I will eventually shut that down and it will become static after that. There are some really awesome blogs in there. I really recommend going through the list, it made my day. [0] "Could you share your personal blog…

    Life & fun · 2023 · dm.hn

  • Lazy929

    Capture at the speed of thought

    AI · 2023 · lazy.so

  • A safe space for your thoughts, private, local, p2p & open

    Commerce · 2023 · anytype.io

  • n8n 1.0788

    Workflow automation for technical people

    Dev tools · 2023 · n8n.io