|
Core 1.0
|
Poisson disc sampling with sixteen tiles and aperiodic tiling. More...
#include <sampling.h>
Public Member Functions | |
| DiscTileCorner (const double &, const double &, int, Random &=Random::R239) | |
| Create a Poisson sampling in a square domain. | |
| ~DiscTileCorner () | |
| Empty. | |
| Box2 | GetBox () const |
| Return the box. | |
| Vector2 | Vertex (int, int) const |
| Getter on the i-th sample. | |
| Vector2 | Vertex (int, int, int) const |
| Compute the i-th sample for a displaced tile. | |
| int | Size (int) const |
| Return the number of samples. | |
| double | SideLength () const |
| Return the side length of the tile. | |
| double | Radius () const |
| Return the radius of particles. | |
| QVector< Vector2 > | Sample (const ScalarField2 &) const |
| Sample a domain according to an input importance function. | |
| QVector< Vector2 > | Sample (const Box2 &) const |
| Sample a box by tiling the domain with the tiles of the set. | |
| DiscTile | Get (int) const |
| Return the i-th disc tile. | |
| double | Packing () const |
| Compute the average packing density. | |
| int | Select (int, int) const |
| Tile selection. | |
Protected Attributes | |
| double | s = 0.0 |
| Size. | |
| double | r = 0.0 |
| Radius. | |
| double | e = 0.0 |
| Squared radius with small epsilon tolerance. | |
| DiscTile | tiles [16] |
| Tiles. | |
Poisson disc sampling with sixteen tiles and aperiodic tiling.
Tiles are created using the Corner Cube algorithm, see:
A. Lagae, P. Dutré. An alternative for Wang tiles: colored edges versus colored corners. ACM Transactions on Graphics 25 (4), 1442-1459.
A. Lagae, P. Dutré. A procedural object distribution function. ACM Transactions on Graphics 24 (4), 2005.
|
explicit |
Create a Poisson sampling in a square domain.
| s | Size of the side of the square. |
| r | Radius of the samples. |
| n | Maximum number of samples in the dart throwing process. Note that the number of samples will be different. |
| ra | Random number generator. |
| double DiscTileCorner::Packing | ( | ) | const |
Compute the average packing density.
This is the mean of the packing densities of the sixteen tiles.
Sample a box by tiling the domain with the tiles of the set.
The tiles are selected by the aperiodic tiling, and only the samples that lie inside the box are returned.
| box | The box. |
| QVector< Vector2 > DiscTileCorner::Sample | ( | const ScalarField2 & | s | ) | const |
Sample a domain according to an input importance function.
| s | Scalar field defining the importance function. |
| int DiscTileCorner::Select | ( | int | x, |
| int | y ) const |
Tile selection.
| x,y | Integer coordinates of the tile. |
| int DiscTileCorner::Size | ( | int | t | ) | const |
Return the number of samples.
| t | Tile. |
| Vector2 DiscTileCorner::Vertex | ( | int | t, |
| int | i ) const |
Getter on the i-th sample.
| t | Tile. |
| i | Sample index. |
| Vector2 DiscTileCorner::Vertex | ( | int | x, |
| int | y, | ||
| int | i ) const |
Compute the i-th sample for a displaced tile.
| i | Sample index, should be lower than the size of tile at (x,y). |
| x,y | Integer coordinates of the tile. |