Antkeeper  0.0.1
Functions
math::noise::voronoi Namespace Reference

Voronoi functions. More...

Functions

template<class T , std::size_t N>
std::tuple< T, vector< T, N >, hash::make_uint_t< T >> f1 (const vector< T, N > &position, T randomness=T{1}, const vector< T, N > &tiling=vector< T, N >::zero(), vector< hash::make_uint_t< T >, N >(*hash)(const vector< T, N > &)=&hash::pcg< T, N >)
 Finds the Voronoi cell (F1) containing the input position. More...
 
template<class T , std::size_t N>
std::tuple< T, vector< T, N >, hash::make_uint_t< T >, T > f1_edge (const vector< T, N > &position, T randomness=T{1}, const vector< T, N > &tiling=vector< T, N >::zero(), vector< hash::make_uint_t< T >, N >(*hash)(const vector< T, N > &)=&hash::pcg< T, N >)
 Finds the Voronoi cell (F1) containing the input position, along with the distance to the nearest edge. More...
 
template<class T , std::size_t N>
std::tuple< T, vector< T, N >, hash::make_uint_t< T >, T, vector< T, N >, hash::make_uint_t< T >> f1_f2 (const vector< T, N > &position, T randomness=T{1}, const vector< T, N > &tiling=vector< T, N >::zero(), vector< hash::make_uint_t< T >, N >(*hash)(const vector< T, N > &)=&hash::pcg< T, N >)
 Finds the Voronoi cell (F1) containing the input position, as well as the nearest neighboring cell (F2). More...
 

Detailed Description

Voronoi functions.

Function Documentation

◆ f1()

template<class T , std::size_t N>
std::tuple< T, vector<T, N>, hash::make_uint_t<T>> math::noise::voronoi::f1 ( const vector< T, N > &  position,
randomness = T{1},
const vector< T, N > &  tiling = vector<T, N>::zero(),
vector< hash::make_uint_t< T >, N >(*)(const vector< T, N > &)  hash = &hash::pcg<T, N> 
)

Finds the Voronoi cell (F1) containing the input position.

Template Parameters
TReal type.
NNumber of dimensions.
Parameters
positionInput position.
randomnessDegree of randomness, on [0, 1].
tilingDistance at which the Voronoi pattern should repeat. A value of 0 indicates no repetition.
hashHash function.
Returns
Tuple containing the square Euclidean distance from position to the F1 cell, the displacement vector from the input position to the F1 cell center, and a hash value indicating the ID of the F1 cell.

Definition at line 121 of file voronoi.hpp.

◆ f1_edge()

template<class T , std::size_t N>
std::tuple< T, vector<T, N>, hash::make_uint_t<T>, T> math::noise::voronoi::f1_edge ( const vector< T, N > &  position,
randomness = T{1},
const vector< T, N > &  tiling = vector<T, N>::zero(),
vector< hash::make_uint_t< T >, N >(*)(const vector< T, N > &)  hash = &hash::pcg<T, N> 
)

Finds the Voronoi cell (F1) containing the input position, along with the distance to the nearest edge.

Template Parameters
TReal type.
NNumber of dimensions.
Parameters
positionInput position.
randomnessDegree of randomness, on [0, 1].
tilingDistance at which the Voronoi pattern should repeat. A value of 0 indicates no repetition.
hashHash function.
Returns
Tuple containing the square Euclidean distance from position to the F1 cell center, the displacement vector from the input position to the F1 cell center, a hash value indicating the ID of the F1 cell, and the square Euclidean distance from position to the nearest edge.

Definition at line 214 of file voronoi.hpp.

◆ f1_f2()

template<class T , std::size_t N>
std::tuple< T, vector<T, N>, hash::make_uint_t<T>, T, vector<T, N>, hash::make_uint_t<T>> math::noise::voronoi::f1_f2 ( const vector< T, N > &  position,
randomness = T{1},
const vector< T, N > &  tiling = vector<T, N>::zero(),
vector< hash::make_uint_t< T >, N >(*)(const vector< T, N > &)  hash = &hash::pcg<T, N> 
)

Finds the Voronoi cell (F1) containing the input position, as well as the nearest neighboring cell (F2).

Template Parameters
TReal type.
NNumber of dimensions.
Parameters
positionInput position.
randomnessDegree of randomness, on [0, 1].
tilingDistance at which the Voronoi pattern should repeat. A value of 0 indicates no repetition.
hashHash function.
Returns
Tuple containing the square Euclidean distances, displacement vectors from the input position to the cell centers, and hash values indicating the cell IDs, for both the F1 and F2 cells.

Definition at line 343 of file voronoi.hpp.