#mesh #half-edge #3d #graphics #geometry

tri-mesh

A triangle mesh data structure including basic operations

8 releases (5 breaking)

0.6.0 Nov 2, 2022
0.5.0 Feb 29, 2020
0.4.0 Mar 14, 2019
0.3.0 Feb 27, 2019
0.1.2 Jan 16, 2019

#783 in Data structures

Download history 10/week @ 2024-02-11 38/week @ 2024-02-25 5/week @ 2024-03-03 21/week @ 2024-03-10 6/week @ 2024-03-17 1/week @ 2024-03-24 113/week @ 2024-03-31

142 downloads per month

MIT license

210KB
5K SLoC

tri-mesh

crates.io Docs.rs Continuous integration MIT licensed

This crate contains an implementation of the half-edge data structure which represents a triangle mesh and is efficient for creating, editing, traversing and computing on that mesh. The mesh can easily be created from and exported into a format that is efficient for visualization.

This crate also contains basic functionality to safely operate on this mesh data structure and which can be used for implementing more advanced operations, for example

  • Half-edge walker to traverse the mesh
  • Iterators over primitives (vertices, half-edges, edges, faces)
  • Edit functionality (e.g. split edge, collapse edge, flip edge)

Finally, a set of more or less advanced operations is also provided, for example

  • Transformations affecting the vertex positions (e.g. moving a single vertex or rotate the entire mesh)
  • Measures on vertices, edges and faces (e.g. position of vertex, area of face)
  • Quality functionality (e.g. flip edges recursively to improve triangle quality, collapse small faces)
  • Intersection functionality (e.g. face/ray intersection, edge/point intersection)
  • Merge used for merging of entire meshes (e.g. append one mesh to another or merge overlapping primitives in a mesh)
  • Split functionality (e.g. clone a subset of a mesh or split two meshes at their intersection)

Please, see the documentation for more details.

Dependencies

~2.2–4MB
~78K SLoC