# datastructures

## Meshes

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 Implementation of the base mesh data structure that adds some of the mesh algorithms as methods.

### Data structure

 HalfEdge Base half-edge data structure for representing meshes. BaseMesh Geometric implementation of a half edge data structure for polygon meshses.

### 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_connected_components mesh_contours_numpy Compute the contours of the mesh. mesh_delete_duplicate_vertices Cull all duplicate vertices of a mesh and sanitize affected faces. mesh_dual Construct the dual of a mesh. mesh_explode Explode a mesh into its disconnected parts. mesh_face_adjacency Build a face adjacency dict. mesh_flip_cycles Flip the cycle directions of all faces. mesh_geodesic_distances_numpy Compute geodesic from the vertices of a mesh to given source vertices. mesh_is_connected Verify that the mesh is connected. mesh_isolines_numpy Compute the isolines of a specified attribute of the vertices of a mesh. mesh_merge_faces Merge two faces of a mesh over their shared edge. mesh_offset Offset a mesh. 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_planarize_faces Planarise a set of connected faces. mesh_quads_to_triangles mesh_slice_plane Slice a mesh with a plane and construct the resulting submeshes. 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 corners. 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_thicken Thicken a mesh. mesh_transform Transform a mesh. mesh_transformed Transform a copy of mesh. mesh_transform_numpy Transform a mesh. mesh_transformed_numpy Transform a copy of mesh. mesh_unify_cycles Unify the cycle directions of all faces. mesh_weld Weld vertices of a mesh within some precision distance.
 meshes_join Join meshes without welding. meshes_join_and_weld Join and and weld meshes within some precision distance.

### 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.

### Conway Operators

 mesh_conway_dual Generates the dual mesh from a seed mesh. mesh_conway_join Generates the join mesh from a seed mesh. mesh_conway_ambo Generates the ambo mesh from a seed mesh. mesh_conway_kis Generates the kis mesh from a seed mesh. mesh_conway_needle Generates the needle mesh from a seed mesh. mesh_conway_zip Generates the zip mesh from a seed mesh. mesh_conway_truncate Generates the truncate mesh from a seed mesh. mesh_conway_ortho Generates the ortho mesh from a seed mesh. mesh_conway_expand Generates the expand mesh from a seed mesh. mesh_conway_gyro Generates the gyro mesh from a seed mesh. mesh_conway_snub Generates the snub mesh from a seed mesh. mesh_conway_meta Generates the meta mesh from a seed mesh. mesh_conway_bevel Generates the bevel mesh from a seed mesh.

## Triangle Meshes

### Algorithms

 trimesh_descent trimesh_face_circle Get data on circumcentre of triangular face. trimesh_gaussian_curvature Compute the gaussian curvature at the vertices of a triangle mesh using the angular deficit.

## Networks

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.

### Data structure

 Graph Base graph data structure for describing the topological relationships between nodes connected by edges.

### 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_embed_in_plane Embed the network in the plane. network_find_crossings Identify all pairs of crossing edges in a network. network_find_cycles 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_transform Transform a network. network_transformed Transform a copy of network.

## 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 Implementation of the base volmesh data structure that adds some of the mesh algorithms as methods.