@gltf-transform/functions
Version:
Functions for common glTF modifications, written using the core API
28 lines (27 loc) • 886 B
TypeScript
import { Primitive } from '@gltf-transform/core';
interface JoinPrimitiveOptions {
skipValidation?: boolean;
}
/**
* Given a list of compatible Mesh {@link Primitive Primitives}, returns new Primitive
* containing their vertex data. Compatibility requires that all Primitives share the
* same {@link Material Materials}, draw mode, and vertex attribute types. Primitives
* using morph targets cannot currently be joined.
*
* Example:
*
* ```javascript
* import { joinPrimitives } from '@gltf-transform/functions';
*
* // Succeeds if Primitives are compatible, or throws an error.
* const result = joinPrimitives(mesh.listPrimitives());
*
* for (const prim of mesh.listPrimitives()) {
* prim.dispose();
* }
*
* mesh.addPrimitive(result);
* ```
*/
export declare function joinPrimitives(prims: Primitive[], _options?: JoinPrimitiveOptions): Primitive;
export {};