nowfound

Work · July 17, 2023

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…

Rectfillcurve – generate rectangle-filling curves launched on July 17, 2023 with 24 votes, #1,456 of 4,347 launches that month and more than 75% of that year's launches. The site was still online in September 2026, 3 years on.

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

A standalone C library and Python extension module for generating space-filling curves for arbitrary-sized rectangles through an iterator API. (See Background for details.) "hilbert_classic" - the classic Hilbert curve , which requires a square with lengths which are a power of 2 in size (or 0x0). "morton_classic" - the classic Morton/Z-order curve , which requires a square with lengths which are a power of 2 in size (or 0x0). "mlcg" - use a multiplicative linear congruential generator to visit the coordinates in a random-like order. The rectangles are described by (width, height), with coordinates (i, j) where 0 <= i < width and 0 <=j < height. There is also an option to flip the…from hg.sr.ht

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&#x2F;Z-order and Hilbert order give even better cache coherency for some tasks, although…

Does a similar job

all alternatives →
  • Visualize rotating objects from the 4th, 5th, nth dimensions2023 · ncube.ndavd.com · ▲181

    Ever since I remember I had a lot of curiosity regarding hyper dimensional spaces. Picturing higher dimensions, such an impossible yet exciting idea... So years ago I came across a small GIF of a tesseract. Since then it left me wondering how cubes from even higher dimensions would look like... Years passed and I became a software developer, decided to tackle the problem myself and ncube was the result. ncube allows you to visualize rotating hypercubes of arbitrary dimensions. It works by rotating the hyperdimensional vertices and applying a chain of perspective projections to them until the…

  • Synthesize TikZ Graphics Programs for Scientific Figures and Sketches2024 · github.com · ▲132

    Creating high-quality scientific figures can be time-consuming and challenging, even though sketching ideas on paper is relatively easy. Furthermore, recreating existing figures that are not stored in formats preserving semantic information is equally complex. To tackle this problem, we introduce DeTikZify, a novel multimodal language model that automatically synthesizes scientific figures as semantics-preserving TikZ graphics programs based on sketches and existing figures. We also introduce a Monte Carlo Tree Search-based inference algorithm that enables DeTikZify to iteratively refine its…

  • Flatmap – a new tool to make vector tiles from OpenStreetMap data fast2021 · github.com · ▲158

    Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast - onthegomap/planetiler

  • Visual A* pathfinding and maze generation in Python2024 · github.com · ▲135

    I was fascinated reading through another recent HN submission about a highly efficient implementation of A* in Lisp, which got me thinking about how I could do something similar in Python. However, these kinds of pathfinding algorithms really need complex terrain&#x2F;mazes with interesting obstructions to showcase what they can do and how they work. So, I started thinking about how I could generate cool and diverse random "mazes" (they aren't really mazes, but I'm not sure what the best term is). I got a bit carried away thinking of lots of different cool ways to generate these mazes, such…

  • I've made a Monte-Carlo raytracer for glTF scenes in WebGPU2024 · github.com · ▲131

    This is a GPU "software" raytracer (i.e. using manual ray-scene intersections and not RTX) written using the WebGPU API that renders glTF scenes. It supports many materials, textures, material & normal mapping, and heavily relies on multiple importance sampling to speed up convergence.

  • Run TRELLIS.2 Image-to-3D generation natively on Apple SiliconApr 2026 · github.com · ▲202

    I ported Microsoft's TRELLIS.2 (4B parameter image-to-3D model) to run on Apple Silicon via PyTorch MPS. The original requires CUDA with flash_attn, nvdiffrast, and custom sparse convolution kernels: none of which work on Mac. I replaced the CUDA-specific ops with pure-PyTorch alternatives: a gather-scatter sparse 3D convolution, SDPA attention for sparse transformers, and a Python-based mesh extraction replacing CUDA hashmap operations. Total changes are a few hundred lines across 9 files. Generates ~400K vertex meshes from single photos in about 3.5 minutes on M4 Pro (24GB). Not as fast as…

More work this month

the category →

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, July 2023

the whole month →
  • Clustr▲1,526

    The reality check for your crypto portfolio

    Commerce · 2023 · clustr.io

  • 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&#x2F;Vincenius&#x2F;workout-lol](https:&#x2F;&#x2F;github.com&#x2F;Vincenius&#x2F;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

  • Lazy▲928

    One ⌘ shortcut to capture anything straight to Notion

    AI · 2023 · lazy.so

  • Anytype is built on the open-source AnySync protocol: a local-first protocol based on CRDTs. Users of Anytype can create spaces - graph-based databases with modular UI. Each space has unique access rights. Today, Anytype's beta is in single-player mode. Multiplayer mode, which will support local-first collaboration between multiple users, will be launched in the first half of 2024. Anytype fulfils the seven ideals of local first software from here - https:&#x2F;&#x2F;www.inkandswitch.com&#x2F;local-first&#x2F; , our team felt these things are important to all of us: • No spinners: your work…

    Commerce · 2023 · anytype.io

  • n8n 1.0▲786

    Workflow automation for technical people

    Dev tools · 2023 · n8n.io