nonuniform

fun IMeshData.nonuniform(count: Int, random: Random = Random.Default, weightFunction: WeightFunction): List<Vector3>(source)

Generates a list of points within the mesh using a non-uniform distribution. The points are sampled according to a provided weight function, where each point is influenced by the weights of the vertices of the triangulated polygons.

Return

a list of Vector3 instances representing the sampled points within the mesh

Parameters

count

the number of points to generate within the mesh

random

the random number generator used for sampling; defaults to Random.Default

weightFunction

a function that calculates the weight for a given vertex of a polygon