Documentation
¶
Index ¶
- func Cube2k(p g3.Node) int
- func IsBoundary(vol Space, node g3.Node) bool
- func K2cube(k int) (p g3.Node)
- func Kh2point(k, h int) g3.Node
- func Normal(vol Space, node g3.Node) g3.Vector
- type Space
- type Space16
- type SparseVolume
- func (v *SparseVolume) Get(node g3.Node) bool
- func (vol *SparseVolume) Get16(node g3.Node) uint16
- func (v *SparseVolume) MapBoundary(f func(node g3.Node))
- func (vol *SparseVolume) N() int
- func (vol *SparseVolume) Set16(node g3.Node, val uint16)
- func (v *SparseVolume) SetAllFilled(threshold, val uint16)
- func (v *SparseVolume) Volume() (res int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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)
Click to show internal directories.
Click to hide internal directories.