# Sampling

Meshes.RegularSamplingType
RegularSampling(n1, n2, ..., np)

Sample geometry regularly using n1 points along the first parametric dimension, n2 points along the second parametric dimension, ..., np poitns along the last parametric dimension.

Example

Sample sphere regularly with 360 longitudes and 180 latitudes:

sample(Sphere((0,0,0), 1), RegularSampling(360, 180))
source
Meshes.UniformSamplingType
UniformSampling(size, replace=false)

Sample elements uniformly from a given domain/data. Produce a sample of given size with or without replacement depending on the replace option.

source
Meshes.WeightedSamplingType
WeightedSampling(size, [weights]; replace=false)

Sample elements from a given domain/data using weights. Produce a sample of given size with or without replacement depending on the replace option. By default weights are uniform.

source
Meshes.BallSamplingType
BallSampling(radius; [options])

A method for sampling isolated elements from a given domain/data according to a norm-ball of given radius.

Options

• metric - Metric for the ball (default to Euclidean())
• maxsize - Maximum size of the resulting sample (default to none)
source