hilbert_curve_generator 0.1.2

A WIP Hilbert Space-Filling Curve Coordinate Generator
Documentation
  • Coverage
  • 0%
    0 out of 8 items documented0 out of 6 items with examples
  • Size
  • Source code size: 12.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 436.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • benjaminwgordon/HSFC-generator
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • benjaminwgordon

Hilbert-Curve-Generator

A WIP Hilbert Space-Filling Curve Coordinate Generator. Can produce cartesian coordinates for the vertices of a Hilbert Space-Filling Curve in 2 or 3 dimensions using the Skilling Transform Method.

Project Structure:

Hilbert-Curve

This module contains functionality for generating the Cartesian coordinates of the vertices in a Hilbert Space-Filling Curve in both 2D and 3D.

It also contains utility functions for converting the output vertices into different formats:

  • (x,y,z) in binary
  • (x,y,z) in decimal

BRGC

Brgc is the Binary Reflected Gray Code Iterator

This module generates the cartesian coordinates of each vertex in the HSFC using a technique that begins with a list of the first n binary numbers counted using the Binary Reflected Gray Code counting system.

The iterator exposed by this module can be used to generate points in a BRGC of any magnitude, although for the typical purposes of generating square hilbert curves and cubic hilbert cubes, the number of generated points will typically be pn, where n is the number of dimensions for the resulting cartesian coordinates (2D and 3D currently supported), and p is the number of data bits for each coordinate (each side of your square/cube will have 2p vertices)

Skilling_Transform

This module contains functions for applying the Skilling Transform to an existing Vec of BRGC.

The Skilling Transform is an algorithm for generating the cartesian coordinates of vertices in a Hilbert curve without using the traditional recursive method.

I've optimized for readability and ease of understanding in the code, since the algorithm is not immediately clear. There was a good deal of trial and error in implementing this algorithm. If I spend more time on this project, I'll try replacing all the string manipulation with bit manipulation and benchmark the speed difference.