Mesh

class pmeshlab.Mesh
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pmeshlab.Mesh, vertex_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), face_matrix: numpy.ndarray[numpy.int32[m, 3]] = array([], shape=(0, 3), dtype=int32), v_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), f_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), v_quality_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), f_quality_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64)) -> None

Creates a mesh containing the data passed as input. If no data is passed as argument, an empty mesh will be created.

  1. __init__(self: pmeshlab.Mesh, vertex_matrix: numpy.ndarray[numpy.float64[m, 3]], face_list_of_indices: List[numpy.ndarray[numpy.uint32[m, 1]]], v_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), f_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), v_quality_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), f_quality_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64)) -> None

Creates a polygon mesh containing the data passed as input. At least a numpy array of vertices and a list of numpy arrays of face indices is required. Since MeshLab and PyMeshLab can store only triangle meshes, the newly created mesh is actually a triangle mesh with some edges that are marked as ‘faux’. This constructor creates a custom per face scalar attribute called poly_birth_faces that stores, for each face of the newly created mesh, the index of the polygonal mesh that generated it.

add_face_scalar_attribute(self: pmeshlab.Mesh, attribute_values: numpy.ndarray[numpy.float64[m, 1]], attribute_name: str) → None

Adds a new user defined scalar attribute associated to the faces of the mesh. Takes as input numpy array of scalar having the same size of the number of faces of the mesh, and the name of the new attribute. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given array has a different size from the face number of the mesh, or if the mesh already contains a face scalar attribute with the given name.

add_face_vector_attribute(self: pmeshlab.Mesh, attribute_values: numpy.ndarray[numpy.float64[m, 3]], attribute_name: str) → None

Adds a new user defined vector attribute associated to the faces of the mesh. Takes as input numpy array of vectors having 3 columns and the number of rows equal to the number of faces of the mesh, and the name of the new attribute. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given array has not the correct sizes, or if the mesh already contains a face vector attribute with the given name.

add_vertex_scalar_attribute(self: pmeshlab.Mesh, attribute_values: numpy.ndarray[numpy.float64[m, 1]], attribute_name: str) → None

Adds a new user defined scalar attribute associated to the vertices of the mesh. Takes as input numpy array of scalar having the same size of the number of vertices of the mesh, and the name of the new attribute. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given array has a different size from the vertex number of the mesh, or if the mesh already contains a vertex scalar attribute with the given name.

add_vertex_vector_attribute(self: pmeshlab.Mesh, attribute_values: numpy.ndarray[numpy.float64[m, 3]], attribute_name: str) → None

Adds a new user defined vector attribute associated to the vertices of the mesh. Takes as input numpy array of vectors having 3 columns and the number of rows equal to the number of vertices of the mesh, and the name of the new attribute. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given array has not the correct sizes, or if the mesh already contains a vertex vector attribute with the given name.

bounding_box(self: pmeshlab.Mesh) → pmeshlab.BoundingBox

Returns the bounding box of the mesh.

compact(self: pmeshlab.Mesh) → None

Compacts all the arrays of the mesh.

edge_number(self: pmeshlab.Mesh) → int

Returns the number of edges of the mesh.

face_color_array(self: pmeshlab.Mesh) → numpy.ndarray[numpy.uint32[m, 1]]

Returns the face color matrix as a numpy array of [NF] unsigned integers, where the (ARGB) is packed in a 32bit unsigned int (8 bits per component).Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no face color component.

face_color_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 4]]

Returns the face color matrix as a numpy array of [NF x 4] floats, where each component (RGBA) is in the interval [0, 1]. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no face color component.

face_face_adjacency_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.int32[m, 3]]

Returns face-to-face adjacency matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no face-to-face adjacency component.

face_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.int32[m, 3]]

Returns the face matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact.

face_normal_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 3]]

Returns the face normal matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact.

face_number(self: pmeshlab.Mesh) → int

Returns the number of faces of the mesh.

face_quality_array(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 1]]

Returns the face quality array of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no face quality component.

face_scalar_attribute_array(self: pmeshlab.Mesh, arg0: str) → numpy.ndarray[numpy.float64[m, 1]]

Returns a numpy array containing the scalar values of the given user defined attribute name associated to the faces of the mesh. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given name does not represent a face scalar attribute in the mesh.

face_vector_attribute_matrix(self: pmeshlab.Mesh, arg0: str) → numpy.ndarray[numpy.float64[m, 3]]

Returns a numpy matrix containing the vector values of the given user defined attribute name associated to the faces of the mesh. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given name does not represent a face vector attribute in the mesh.

is_compact(self: pmeshlab.Mesh) → bool

Returns true if all its arrays are compact.

selected_face_number(self: pmeshlab.Mesh) → int

Returns the number of selected faces of the mesh.

selected_vertex_number(self: pmeshlab.Mesh) → int

Returns the number of selected vertices of the mesh.

update_bounding_box(self: pmeshlab.Mesh) → None

Updates the bounding box of the mesh.

update_topology(self: pmeshlab.Mesh) → None

Updates the topology of the mesh.

vertex_color_array(self: pmeshlab.Mesh) → numpy.ndarray[numpy.uint32[m, 1]]

Returns the vertex color matrix as a numpy array of [NV] unsigned integers, where the (ARGB) is packed in a 32bit unsigned int (8 bits per component).Raises a MissingCompactnessException if the mesh is not compact.

vertex_color_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 4]]

Returns the vertex color matrix as a numpy array of [NV x 4] floats, where each component (RGBA) is in the interval [0, 1]. Raises a MissingCompactnessException if the mesh is not compact.

vertex_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 3]]

Returns the vertex matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact.

vertex_normal_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 3]]

Returns the vertex normal matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact.

vertex_number(self: pmeshlab.Mesh) → int

Returns the number of vertices of the mesh.

vertex_quality_array(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 1]]

Returns the vertex quality array of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no vertex quality component.

vertex_scalar_attribute_array(self: pmeshlab.Mesh, arg0: str) → numpy.ndarray[numpy.float64[m, 1]]

Returns a numpy array containing the scalar values of the given user defined attribute name associated to the vertices of the mesh. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given name does not represent a vertex scalar attribute in the mesh.

vertex_tex_coord_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 2]]

Returns the vertex texcoord matrix of the mesh as a numpy array. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no per-wedge tex coordinates component.

vertex_vector_attribute_matrix(self: pmeshlab.Mesh, arg0: str) → numpy.ndarray[numpy.float64[m, 3]]

Returns a numpy matrix containing the vector values of the given user defined attribute name associated to the vertices of the mesh. Raises a MissingCompactnessException if the mesh is not compact. Raises a PyMeshLabException if the given name does not represent a vertex vector attribute in the mesh.

wedge_tex_coord_matrix(self: pmeshlab.Mesh) → numpy.ndarray[numpy.float64[m, 2]]

Returns the per-wedge texcoord matrix of the mesh as a numpy array, composed of NF*3 rows (triplets of wedges for each face) and 2 columns. Raises a MissingCompactnessException if the mesh is not compact. Raises a MissingComponentException if the mesh has no vertex tex coordinates component.