Forceflow / libmorton

C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates
MIT License
591 stars 71 forks source link

Morton Offsets #45

Open IJzerbaard opened 4 years ago

IJzerbaard commented 4 years ago

It is possible to quickly (that is, without going through a decode-modify-encode pipeline) compute neighbours of a Morton-encoded coordinate. The technique is mentioned on wikipedia.

That could be useful to add, though I realise the description of this library only mentions encoding and decoding.

Forceflow commented 4 years ago

I've been thinking about this, and as you say, it would take the library away from purely encoding/decoding.

Then again, it is useful.

Do a PR if you want to :)

Forceflow commented 4 years ago

I think I might add this to a seperate header, morton_ops.h A good thing for the todo list!

tonyskjellum commented 1 year ago

This is indeed very useful; did this get done later? :-) We have some 20+ year old code that uses incremental indexing extensively and it is very inexpensive even in scalar processing mode.

Forceflow commented 1 year ago

It's still on the todo list - feel free to write it and make a PR :p

tonyskjellum commented 1 year ago

We will start working on that.