Skip to content
Konjure / spatial intelligence

Mesh

← Builtin reference

Indexed triangle geometry.

Signature

type Mesh { positions: Tensor[f32] = tensor[f32]([], [0, 3])?; indices: Tensor[u32] = tensor[u32]([], [0, 3])?; }

The spatial adapter requires 3..=16384 positions and 1..=32768 triangles, validates indices, and computes normals when it builds a render mesh.

Fields

positions: Tensor[f32]
An N by 3 Tensor[f32] of local XYZ coordinates in meters. The empty default is not renderable.
Defaulttensor[f32]([], [0, 3])?
indices: Tensor[u32]
An M by 3 Tensor[u32]; each row is a triangle and every index must address a position.
Defaulttensor[u32]([], [0, 3])?

Examples

Define one triangle

Indices address positions in triples.

Tick 0 · 0.00 sThis device
main.kj⌘ / Ctrl + Enter
Loading…Drag to orbit · select to inspect
0 entities
Loading the language runtime…
Output 0
No output.
Expected output
3

Inspect an unfilled schema

Construction itself does not invoke the mesh adapter.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
0

Rust definition

Interpreter RecordValue geometry schema; adapter validation produces the render mesh.

See also