Package-level declarations

Types

Link copied to clipboard
typealias Barycentric = Vector3
Link copied to clipboard
typealias SampleFunction<T> = (polygon: IIndexedPolygon, vertexData: IVertexData, barycentric: Barycentric) -> T

Represents a type alias for a function that processes data associated with a polygon and vertex data, producing a result of type T.

Link copied to clipboard
typealias WeightFunction = (vertexData: IVertexData, polygon: IIndexedPolygon, vertexIndex: Int) -> Double

A type alias representing a weight function for vertices in a polygon.

Properties

Link copied to clipboard

A constant weight function for barycentric coordinates that always returns a weight of 1.0.

Link copied to clipboard

A lambda function that extracts a Point from a given IIndexedPolygon, IVertexData, and Barycentric coordinate.

Link copied to clipboard

A lambda function that computes the 3D position within an indexed polygon given vertex data and barycentric coordinates.

Functions

Link copied to clipboard
fun IMeshData.hash(count: Int, seed: Int, x: Int): List<Vector3>

Generate points on the surface described by the mesh data

Link copied to clipboard

Computes a barycentric coordinate vector derived from hashing operations.

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

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.

Link copied to clipboard
fun <T> IMeshData.nonuniformEx(randomValuesUnsorted: List<Double>, randomPoints: List<Vector2>, weightFunction: WeightFunction, sampleFunction: (IIndexedPolygon, IVertexData, Barycentric) -> T): List<T>

Generates a list of samples by distributing random points across the mesh using weighted areas of triangles and a provided sample function.

Link copied to clipboard
fun IMeshData.nonuniformHammersley(count: Int, shuffle: Boolean = true, random: Random = Random.Default, weightFunction: WeightFunction): List<Vector3>

Generates a list of 3D points distributed on a mesh surface using a nonuniform sampling strategy with Hammersley sequence and a custom weight function.

Link copied to clipboard
fun IMeshData.nonuniformPoints(count: Int, random: Random = Random.Default, weightFunction: WeightFunction): List<Point>

Generates a list of non-uniformly distributed points on the mesh based on a specified weight function.

Link copied to clipboard
fun IMeshData.nonuniformRSeq(count: Int, shuffle: Boolean = true, random: Random = Random.Default, weightFunction: WeightFunction): List<Vector3>

Generates a non-uniform sequence of 3D points based on the provided weight function, using a combination of randomized values and the R2 low-discrepancy quasirandom sequence.

Link copied to clipboard
fun IMeshData.uniform(count: Int, random: Random = Random.Default): List<Vector3>

Generates a list of uniformly distributed points on the surface of the given mesh.

Link copied to clipboard

Generates a 3D vector with components representing uniform barycentric coordinates over a standard triangle. The barycentric coordinates are computed based on two input parameters, u and v, which are random values typically ranging between 0 and 1.

Link copied to clipboard
fun IMeshData.uniformPoints(count: Int, random: Random = Random.Default): List<Point>

Generates a uniformly distributed set of points over the surface of the mesh.

Link copied to clipboard
fun weightBarycentric(barycentric: Barycentric, weight0: Double, weight1: Double, weight2: Double): Barycentric

Adjusts a barycentric coordinate based on weights for each component and normalizes the result.