# datastructures

## Mesh

The mesh is implemented as a half-edge datastructure. It is meant for the representation of polygonal “surface” meshes. A mesh can be connected or disconnected. A mesh can be closed or open. A mesh can be comprised of only vertices.

 Mesh Definition of a mesh.

### Mesh matrices

 mesh_adjacency_matrix Creates a vertex adjacency matrix from a Mesh datastructure. mesh_connectivity_matrix Creates a connectivity matrix from a Mesh datastructure. mesh_degree_matrix Creates a vertex degree matrix from a Mesh datastructure. mesh_face_matrix Construct the face matrix from a Mesh datastructure. mesh_laplacian_matrix Construct a Laplacian matrix with uniform weights from a mesh data structure.
 trimesh_cotangent_laplacian_matrix Construct the Laplacian of a triangular mesh with cotangent weights. trimesh_vertexarea_matrix Compute the n x n diagonal matrix of per-vertex voronoi areas.

### Mesh algorithms

 mesh_bounding_box Compute the (axis aligned) bounding box of a mesh. mesh_bounding_box_xy Compute the (axis aligned) bounding box of a projection of the mesh in the XY plane. mesh_oriented_bounding_box_numpy Compute the (axis aligned) bounding box of a mesh. mesh_oriented_bounding_box_xy_numpy Compute the (axis aligned) bounding box of a projection of the mesh in the XY plane. mesh_contours_numpy Compute the contours of the mesh. mesh_dual Construct the dual of a mesh. mesh_geodesic_distances Compute geodesic from the vertices of a mesh to given source vertices. mesh_isolines_numpy Compute the isolines of a specified attribute of the vertices of a mesh. mesh_planarize_faces Planarise a set of connected faces. mesh_quads_to_triangles mesh_smooth_centroid Smooth a mesh by moving every free vertex to the centroid of its neighbors. mesh_smooth_area Smooth a mesh by moving each vertex to the barycenter of the centroids of the surrounding faces, weighted by area. mesh_subdivide Subdivide the input mesh. mesh_subdivide_tri Subdivide a mesh using simple insertion of vertices. mesh_subdivide_corner Subdivide a mesh by cutting croners. mesh_subdivide_quad Subdivide a mesh such that all faces are quads. mesh_subdivide_catmullclark Subdivide a mesh using the Catmull-Clark algorithm. mesh_subdivide_doosabin Subdivide a mesh following the doo-sabin scheme. mesh_transform Transform a mesh. mesh_transformed Transform a copy of mesh.
 trimesh_gaussian_curvature Compute the gaussian curvature at the vertices of a triangle mesh using the angular deficit. trimesh_remesh Remesh until all edges have a specified target length. trimesh_subdivide_loop Subdivide a triangle mesh using the Loop algorithm.

### Mesh helpers

 mesh_delete_duplicate_vertices Cull all duplicate vertices of a mesh and sanitize affected faces. mesh_face_adjacency Build a face adjacency dict. mesh_flip_cycles Flip the cycle directions of all faces. mesh_is_connected Verify that the mesh is connected. mesh_unify_cycles Unify the cycle directions of all faces.

## Network

The network is a connectivity graph. It is meant for the representation of networks of vertices connected by edges. The edges are directed. A network does not have faces. A network can be connected or disconnected. A network with vertices only is also a valid network.

 Network Definition of a network.

### Network algorithms

 network_complement Generate the complement network of a network. network_count_crossings Count the number of crossings (pairs of crossing edges) in the network. network_dual Construct the dual of a network. network_embed_in_plane Embed the network in the plane. network_find_crossings Identify all pairs of crossing edges in a network. network_find_faces Find the faces of a network. network_is_connected Verify that the network is connected. network_is_crossed Verify if a network has crossing edges. network_is_planar Check if the network is planar. network_is_planar_embedding Verify that a network is embedded in the plane without crossing edges. network_is_xy Verify that a network lies in the XY plane. network_smooth_centroid Smooth a network by moving each vertex to the centroid of its neighbors.

## VolMesh

The volmesh is a cellular mesh. It is implemented as a half-plane, the three-dimensional equivalent of a half-edge. It can, for example, be used for the representation of subdivided/partitioned polyhedra.

 VolMesh Class for working with volumetric meshes.