gizlang/meshopt
the decoders of the meshoptimizer bitstreams that EXT_meshopt_compression names: vertex attributes (header 0xa0), triangle indices (0xe1), index sequences (0xd1) and the filters of the extension's Appendix B. Every byte is checked before it is read, and malformed input throws. The encoder is not here.
import * as Meshopt from "gizlang/meshopt";Functions
indices
function indices(data: bytes, count: i64, size: i64): bytes throws stringDecodes a TRIANGLES stream of COUNT indices of SIZE bytes (2 or 4): a triangle list, COUNT divisible by 3.
Effects: fail, alloc.
sequence
function sequence(data: bytes, count: i64, size: i64): bytes throws stringDecodes an INDICES stream of COUNT indices of SIZE bytes (2 or 4): deltas against two baselines, for any index order.
Effects: fail, alloc.
vertices
function vertices(data: bytes, count: i64, stride: i64): bytes throws stringDecodes an ATTRIBUTES stream of COUNT elements of STRIDE bytes (the version 0 vertex codec, header 0xa0).
Effects: fail, alloc.
filtered
function filtered(data: bytes, count: i64, stride: i64, filter: string): bytes throws stringUndoes a filter on DATA of COUNT elements of STRIDE bytes. NONE gives DATA.
Effects: fail, alloc.