slam.topology

Functions

adjacency_matrix(mesh)

Compute the adjacency matrix of the graph corresponding to the input mesh.

boundaries_intersection(boundaries)

compute the intersections inside a boundary :param boundaries: list of list of vertex indices corresponding to the path :return: list of common vertices between each tuple

boundary_angles(boundary, vertices_coord)

compute the angle between consecutive edges in a path :param boundary: list of vertex indices corresponding to the path :param vertices_coord: array (n, 3) of vertex coordinates :return:

close_mesh(mesh[, boundary_in])

see also trimesh.repair.fill_holes(mesh): This function implements the following paper with slight modifications. Zhao, W., Gao, S., & Lin, H. (2007). A robust hole-filling algorithm for triangular mesh. The Visual Computer, 23(12), 987–997. https://doi.org/10.1007/s00371-007-0167-y :param mesh: :param boundary_in: :return:.

create_vertex(three_vertices[, r])

create a vertex along the bisector of the angle formed by three vertices :param three_vertices: array(3,3) coordinates of the three vertices :param r: distance to the new vertex on the bisector :return:

cut_mesh(mesh, atex_in)

cut the mesh into submeshes following the values in the texture returns as many meshes as the number of different values in the texture the vertices on the border between two submeshes are duplicated into both submeshes :param mesh: :param atex_in: :return:

edges_to_boundary(edges_bound, mesh_edges)

build the boundary by traversing edges return list of connected components ORDERED ACCORDING TO THEIR LENGTH, i.e. THE FIRST THE SHORTEST complex boundary corresponds to multiple holes in the surface or bad shaped boundary In each boundary, the output is a list of vertex indices that respects the order of mesh edges i.e. travelling direction along the edges of the boundary is the same as in edges of the mesh :param edges_bound: edges from the mesh that constitue the boundary but are not ordered properly :param mesh_edges: edges of the mesh that will serve to define the travelling direction of the output boundary path :return: list of boundaries that are themself lists of vertices.

ismember(ar1, ar2)

k_ring_neighborhood(mesh, index[, k, adja])

Generate the k-ring neighborhood around a vertex :param mesh: :param index: :param k: :param adja: adjacency matrix :return: texture is an array whose values are between 0 and k (all the i-ring neighborhoods) and k+1 else

list_count(liste)

count the occurrences of all items in a list and return a dictionary that is of the form {nb_occurence:list_item}, which is the opposite of standard implementation usually found on the web —————————————————————– in python >= 2.7, collections may be used, see example below >> from collections import Counter >> z = [‘blue’, ‘red’, ‘blue’, ‘yellow’, ‘blue’, ‘red’] >> Counter(z) Counter({‘blue’: 3, ‘red’: 2, ‘yellow’: 1}) :param liste: :return:

local_barycentric_smoothing(faces, vertices, …)

local smoothing of the coordinates of vertices_to_smooth the smoothed coordinates of each vertex in vertices_to_smooth in vertices corrrespond to the barycenter of its neigbhors :param faces: :param vertices: :param vertices_to_smooth: :return:

mesh_boundary(mesh[, verbose])

compute borders of a mesh :param mesh: :return:

remove_mesh_boundary_faces(mesh[, …])

remove from the mesh the faces and that have face_vertex_number number of vertices or more on the boundary of the mesh If face_vertex_number = 3 the faces with all 3 vertices on the boundary of the mesh will be removed.

sub_cut_mesh(mesh, atex, val)

texture_boundary(mesh, atex, val)

compute indexes that are the boundary of a region defined by value in a texture :param mesh: :param atex: :param val: :return:

texture_boundary_vertices(atex, val, …)

compute indices of vertices that are the boundary of a region defined by value in the texture, without any topological or ordering constraint :param atex: :param val: :param vertex_neighbors: :return: