Mesh
classin packageklyn.graphics3d
public final class Mesh
Mesh

Immutable indexed triangle mesh, independent of any GPU context. Vertices use eight packed Floats: position XYZ, normal XYZ, texture UV. Indices refer to vertices; winding is counterclockwise. Constructor copies buffers once, O(vertices + indices). GPU uploads are cached by mesh identity. Example: mesh = Mesh("triangle", vertices, indices)

Properties
Modifier and Type Member Description
public readonly property bounds
bounds as Bounds3d
Bounds copy, O(1).
public readonly property indexCount
indexCount as Int
Number of indices, O(1).
public readonly property name
name as String
Mesh name.
public readonly property vertexCount
vertexCount as Int
Number of vertices, O(1).
Constructors
Modifier and Type Member Description
public Mesh
Mesh(name as String, vertices as IList<Float>, indices as IList<UInt>)
Validates and copies geometry; normals must be finite and nonzero.
Methods
Modifier and Type Member Description
public copyIndices
copyIndices() as UInt[]
Explicit CPU index copy, O(indices).
public copyVertices
copyVertices() as Float[]
Explicit CPU buffer copy, O(vertices).
public position
position(index as Int) as Vector3d<Double>
Reads a position in O(1); checks its vertex index.