Skip to main content

Module mesh_ops

Module mesh_ops 

Source
Expand description

Triangle mesh operations: normals, volume, surface area, point containment.

Structs§

TriMesh
A simple triangle mesh.

Functions§

compute_adjacency
Build a vertex-to-vertex adjacency list from a triangle mesh.
compute_face_normals
Compute a unit normal for every triangle in the mesh.
compute_genus
Compute the genus of a closed orientable triangulated surface via the Euler characteristic: χ = V - E + F = 2 - 2g.
compute_vertex_normals
Compute per-vertex normals using area-weighted averaging of adjacent face normals.
edge_length_stats
Compute mesh statistics: min/max/average edge length.
find_boundary_edges
Find all boundary edges: edges shared by exactly one triangle.
is_watertight
Return true if the mesh is watertight (every edge is shared by exactly two faces).
laplacian_smooth
Apply iterations passes of Laplacian smoothing to verts.
merge_meshes
Merge two meshes (verts + tris) into one by concatenating vertices and offsetting triangle indices of the second mesh.
quadric_decimate
Quadric Error Metrics (QEM) mesh decimation.
split_edge
Split edge (v0, v1) in the mesh by inserting a midpoint vertex.
triangulate_polygon
Triangulate a simple convex or concave planar polygon using ear clipping.
vertex_cluster_simplify
Cluster vertices into a grid of grid_res × grid_res × grid_res cells.
weld_vertices
Merge vertices that are closer than tol into a single representative vertex.

Type Aliases§

Triangle
Vertex indices for a triangle.