Skip to main content

Module procedural

Module procedural 

Source
Expand description

Bounded procedural meshes and pure mesh transforms. Bounded procedural triangle meshes and pure mesh transforms.

These helpers operate on owned crate::Mesh values. They deliberately do not resolve assets or interact with a renderer, so the same mesh is usable by native and WASM adapters.

Structs§

ProfilePoint
A radius and vertical position used by lathe.

Constants§

MAX_PROCEDURAL_INDICES
Largest number of triangle indices accepted by one procedural mesh.
MAX_PROCEDURAL_VERTICES
Largest number of vertices accepted by one procedural mesh.

Functions§

cone
Creates a capped cone centered at the origin and aligned with Y.
grid
Creates an XZ grid centered at the origin with upward normals.
lathe
Revolves a radius-height profile around Y. The profile must contain at least two finite points with non-negative radii.
parametric_surface
Samples a pure parameterization over [0, 1] × [0, 1] and derives smooth normals.
suzanne
Loads the bundled CC0 Suzanne test mesh in metres with its original normals.
torus_mesh
Creates a torus around the Y axis with caller-selected ring and tube resolution.
uv_sphere
Creates a UV sphere centred at the origin with caller-selected resolution.
validate_mesh
Validates mesh buffer shape, finite coordinates, normals, and triangle indices.