octree

package
v0.0.0-...-8a12d84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: BSD-2-Clause Imports: 1 Imported by: 1

Documentation

Overview

Package octree provides parallelizable functions for a linear octree.

Interleaved values are given as a morton encoding, also known as Z ordering. This is given by spacing the bits out of a uint by two bits. Naturally sorting the resulting uints provides locality and can be searched with common methods such as binary search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Children16

func Children16(n uint64) (a, b, c, d, e, f, g, h uint64)

Children16 assumes n is a node in a point-based tree and subdivides n into eight equal spaces.

func Deinterleave16

func Deinterleave16(a uint64) (x, y, z, w uint16)

Deinterleave16 deinterleaves a uint64 into four uint16s.

func Deinterleave8

func Deinterleave8(a uint32) (x, y, z, w uint8)

Deinterleave8 deinterleaves a uint32 into four uint16s.

func Dilate16

func Dilate16(x uint16) uint64

Dilate16 expands the bits of a uint16 with two zero bits.

func Dilate8

func Dilate8(x uint8) uint32

Dilate8 expands the bits of a uint8 with two zero bits.

func Interleave16

func Interleave16(x, y, z, w uint16) uint64

Interleave16 returns x, y, z interleaved and w occupying the least significant bits.

func Interleave8

func Interleave8(x, y, z, w uint8) uint32

Interleave8 returns x, y, z interleaved and w occupying the least significant bits.

func SortU32s

func SortU32s(a []uint32)

SortU32s is a convenience method for sorting a slice of uint32s.

func SortU64s

func SortU64s(a []uint64)

SortU64s is a convenience method for sorting a slice of uint64s.

func Subdivide16

func Subdivide16(u uint64, lvl int, p *[]uint64)

Subdivide16 treats u as a node in a point tree and recursively subdivides u up to lvl, collecting results at lvl into p.

func Undilate16

func Undilate16(x uint64) uint16

Undilate16 constricts the bits of a uint64 removing two bits starting with the least significant bit and every third bit there-after.

func Undilate8

func Undilate8(x uint32) uint8

Undilate8 constricts the bits of a uint32 removing two bits starting with the least significant bit and every third bit there-after.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL