Last chance! 50% off unlimited learning
Sale ends in
Subsamples surface of a triangular mesh and returns a set of points located on that mesh
vcgSample(
mesh,
SampleNum = 100,
type = c("km", "pd", "mc"),
MCsamp = 20,
geodes = TRUE,
strict = FALSE,
iter.max = 100,
threads = 0
)
sampled points
triangular mesh of class 'mesh3d'
integer: number of sampled points (see details
below)
character: seclect sampling type ("mc"=MonteCarlo Sampling, "pd"=PoissonDisk Sampling,"km"=kmean clustering)
integer: MonteCarlo sample iterations used in PoissonDisk sampling.
logical: maximise geodesic distance between sample points (only for Poisson Disk sampling)
logical: if type="pd"
and the amount of coordinates exceeds SampleNum
, the resulting coordinates will be subsampled again by kmean clustering to reach the requested number.
integer: maximum iterations to use in k-means clustering.
integer number of threads to use for k-means clustering
Poisson disk subsampling will not generate the exact amount of coordinates specified in SampleNum
, depending on MCsamp
the result will contain more or less coordinates.
data(humface)
ss <- vcgSample(humface,SampleNum = 500, type="km",threads=1)
if (FALSE) {
require(rgl)
points3d(ss)
}
Run the code above in your browser using DataLab