Mesh

mesh offers a set of functions to create and manipulate meshes.

Note: The mesh module and Mesh struct are two distinct things. The mesh module is a set of factory functions to create Meshes. The Mesh struct is a representation of a mesh in memory.

Scene

Manual creation


module mesh
rect( pos: float2,size: float2 ) -> Mesh
box( pos: float3,size: float3 ) -> Mesh
uvSphere( pos: float3,radius: float,vertices: int,rings: int ) -> Mesh
icoSphere( pos: float3,radius: float,subdivisions: int ) -> Mesh
plane( pos: float3,size: float2,subdivisions: int2 ) -> Mesh

Returns a [-1, 1] position for a given index.

triangleFromIndex( index: int ) -> float2
circleFromIndex( vertexIndex: int,vertices: int ) -> float2
rectFromIndex( index: int,vertices: int ) -> float2
empty( numVerts: int ) -> Mesh
join( mesh1: Mesh,mesh2: Mesh ) -> Mesh
clone( ) -> mesh