MeshSet

This page documents the core MeshSet API. Filter-specific methods are documented in Filters to avoid duplicating the full filter list here.

Methods

MeshSet.__init__(...)

__init__(self) -> None

MeshSet.__len__(...)

__len__(self) -> int

MeshSet.__repr__(self, /)

Return repr(self).

MeshSet.apply_filter(...)

apply_filter(self, filter: str, params: dict = {}) -> _meshlab.FilterRunResult

MeshSet.clear(...)

clear(self) -> None

MeshSet.current_mesh(...)

current_mesh(self) -> object

The current Mesh object. Raises if the MeshSet has no current mesh.

MeshSet.current_mesh_id(...)

current_mesh_id(self) -> int

Persistent id of the current mesh – NOT its index. Raises if the MeshSet has no current mesh. Render-state JSON wants this value as a string: {‘mesh_id’: str(ms.current_mesh_id()), ‘settings’: {…}}.

MeshSet.current_mesh_index(...)

current_mesh_index(self) -> int

0-based position of the current mesh in the layer list, or -1 if there is none.

MeshSet.current_raster(...)

current_raster(self) -> int

MeshSet.document_origin(...)

document_origin(self) -> list[float] \| None

The point, in true coordinates, that every mesh’s coordinates are relative to, as (x, y, z); None when there is none. A georeferenced file (E57) far from zero sets it on load, so float positions keep their precision: add it to get true positions.

MeshSet.export_visible_layers(...)

export_visible_layers(self, path: str) -> None

Writes the visible layers into one scene file (USD), each with its matrix and label.

MeshSet.filter_descriptor(...)

filter_descriptor(self, filter: str) -> object

The filter’s full descriptor as a dict, keyed as in filters.json: descriptions, categories, tags, input requirements, references and every parameter with its type, help, default and range. Defaults and ranges are resolved against the current mesh, so a size given as a fraction of the bounding box arrives in model units.

MeshSet.filter_list(...)

filter_list(self) -> list[str]

MeshSet.import_layers(...)

import_layers(self, path: str, \*\*options) -> None

Reads every mesh, point cloud and polyline of a scene file (USD) as a layer of its own, placed by its matrix and named by its label. Keyword arguments are the format’s load options, as for load_new_mesh.

MeshSet.is_current_mesh_visible(...)

is_current_mesh_visible(self) -> bool

MeshSet.is_mesh_visible(...)

is_mesh_visible(self, index: int) -> bool

Whether the mesh at this 0-based position is visible.

MeshSet.list_filters(...)

list_filters(self) -> list[_meshlab.FilterInfo]

MeshSet.load_new_mesh(...)

load_new_mesh(self, path: str, \*\*options) -> None

Loads a mesh file as a new layer. Keyword arguments are the format’s load options, by id (STL: mergeDuplicateVertices=True); an unknown one or a bad value raises.

MeshSet.load_new_raster(...)

load_new_raster(self, file_name: str) -> None

MeshSet.load_project(...)

load_project(self, file_name: str) -> None

MeshSet.mesh(...)

mesh(self, index: int) -> object

Mesh at this 0-based position in the layer list.

MeshSet.mesh_id(...)

mesh_id(self, index: int) -> int

Persistent id of the mesh at this 0-based position, for building render-state JSON covering meshes other than the current one.

MeshSet.mesh_id_exists(...)

mesh_id_exists(self, id: int) -> bool

Whether a mesh with this persistent id is still in the document. Takes an id, not an index: ids are never reused, so a stale one is simply False.

MeshSet.mesh_number(...)

mesh_number(self) -> int

MeshSet.raster_number(...)

raster_number(self) -> int

MeshSet.render_snapshot(...)

render_snapshot(self, render_state_json: str, width: int, height: int) -> bytes

MeshSet.save_current_mesh(...)

save_current_mesh(self, path: str) -> None

MeshSet.save_current_mesh_texture(...)

save_current_mesh_texture(self, texture_index: int, path: str) -> None

MeshSet.save_project(...)

save_project(self, file_name: str) -> None

MeshSet.set_current_mesh(...)

set_current_mesh(self, index: int) -> None

Make the mesh at this 0-based position current.

MeshSet.set_current_mesh_visibility(...)

set_current_mesh_visibility(self, visibility: bool) -> None

MeshSet.set_current_raster(...)

set_current_raster(self, index: int) -> None

MeshSet.set_mesh_visibility(...)

set_mesh_visibility(self, index: int, visibility: bool) -> None

Show or hide the mesh at this 0-based position. Takes an index, matching the positional ‘mesh_visibility’ array in render-state JSON.