volume

package
v0.0.0-...-e416b65 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cube2k

func Cube2k(p g3.Node) int

func IsBoundary

func IsBoundary(vol Space, node g3.Node) bool

func K2cube

func K2cube(k int) (p g3.Node)

func Kh2point

func Kh2point(k, h int) g3.Node

func Normal

func Normal(vol Space, node g3.Node) g3.Vector

Types

type Space

type Space interface {
	Get(node g3.Node) bool
	N() int
}

type Space16

type Space16 interface {
	Space
	Set16(node g3.Node, v uint16)
	Get16(node g3.Node) uint16
	SetAllFilled(threshold, val uint16)
	MapBoundary(f func(node g3.Node))
	Volume() int64
}

type SparseVolume

type SparseVolume struct {
	LK     int
	Cubes  [][]uint16
	Colors []uint16
	// contains filtered or unexported fields
}

SparseVolume represents a voxel cube.

func NewSparseVolume

func NewSparseVolume(n int) (v *SparseVolume)

NewSparseVolume create a voxel cube with side n.

func (*SparseVolume) Get

func (v *SparseVolume) Get(node g3.Node) bool

Get returns true, if the voxel is filled (color != 0).

func (*SparseVolume) Get16

func (vol *SparseVolume) Get16(node g3.Node) uint16

Get16 returns the color of the voxel (empty voxel has color == 0).

func (*SparseVolume) MapBoundary

func (v *SparseVolume) MapBoundary(f func(node g3.Node))

MapBoundary invokes a provided function on every border voxel.

func (*SparseVolume) N

func (vol *SparseVolume) N() int

func (*SparseVolume) Set16

func (vol *SparseVolume) Set16(node g3.Node, val uint16)

Set sets the color of the voxel.

func (*SparseVolume) SetAllFilled

func (v *SparseVolume) SetAllFilled(threshold, val uint16)

SetAllFilled sets the specified color to all voxels with color >= threshold.

func (*SparseVolume) Volume

func (v *SparseVolume) Volume() (res int64)

Jump to

Keyboard shortcuts

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