trimesh.resources package

Module contents

trimesh.resources.get(name: str, decode: bool = True, decode_json: bool = False, as_stream: bool = False)

DERECATED JANUARY 2025 REPLACE WITH TYPED get_json, get_string, etc.

trimesh.resources.get_bytes(name: str) bytes

Get a resource from the trimesh/resources folder as binary data.

Parameters:

name (str) – File path relative to trimesh/resources

Returns:

File data as raw bytes.

Return type:

resource

trimesh.resources.get_json(name: str) dict

Get a resource from the trimesh/resources folder as a decoded string.

Parameters:

name (str) – File path relative to trimesh/resources

Returns:

File data decoded from JSON.

Return type:

resource

trimesh.resources.get_schema(name: str) dict

Load a schema and evaluate the referenced files.

Parameters:

name (str) – Filename of schema.

Returns:

Loaded and resolved schema.

Return type:

schema

trimesh.resources.get_stream(name: str) IO | BytesIO | StringIO | BinaryIO | TextIO

Get a resource from the trimesh/resources folder as a binary stream.

Parameters:

name (str) – File path relative to trimesh/resources

Returns:

File data as a binary stream.

Return type:

resource

trimesh.resources.get_string(name: str) str

Get a resource from the trimesh/resources folder as a decoded string.

Parameters:

name (str) – File path relative to trimesh/resources

Returns:

File data as a string.

Return type:

resource