Zinc is a C++ library for spatial processing.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
libzinc move internal includes to quotes from angles Nov 21, 2018
test namespace aether -> zinc Nov 21, 2018
.gitignore initial commit Nov 20, 2018
AUTHORS add authors Nov 20, 2018
README.md fix blog link Nov 22, 2018
meson.build move some options from build.sh to meson.build Nov 21, 2018



Zinc is a C++ library for spatial processing.

  • Zinc provides efficient functions for processing Morton codes, and things built from Morton codes.
    • Currently only Morton curves because they are the easiest to implement and the only space filling curve on which some functions can be implemented, see get_next_z_address
  • Intervals are a start and end point on the Morton curve.
  • Regions are a finite list of intervals, able to represent arbitrary regions in N-dimensional space.
    • Morton regions a.k.a. linear octree
  • Intervals and Regions can store data, so they can be used as map types, not just set types.
  • AABBs (Axis-Aligned Bounding Boxes) can be used for creating regions
  • Regions have all the boolean set operations implemented on them apart from Xor: union, intersection, subtraction
  • They can be efficiently indexed by position
  • This is alpha software, but it may be useful

Read our blog for more detail


  • The Morton code type is currently limited to a single word size, so the Dimension and BitsPerDimension are currently limited to 2,32 and 3,21.


For usage examples, see test/zinc-test.cc


  • A C++17 compiler

For testing and installing:

  • Meson sudo apt install meson
  • we use clang++ >= 7 by default for better sanitisation
    • for -fsanitize=implicit-conversion and -fsanitize=integer
    • you can disable them in meson.build


CXX=clang++ meson out


ninja test -C out


ninja install -C out (needs permissions for /usr/local/include)


Zn comes from Z-order curve in N dimensions, and all the cool kids name their libraries after elements.

See also