Skip to main content

Module gpu_mesh_processing

Module gpu_mesh_processing 

Source
Expand description

GPU triangle mesh processing (CPU mock implementation).

Provides vertex normal computation, Laplacian smoothing, edge collapse, Loop subdivision, decimation, AABB, surface area, volume, and vertex welding.

Structs§

GpuMesh
Triangle mesh stored in GPU-friendly interleaved layout.

Functions§

gpu_compute_aabb
Compute the axis-aligned bounding box of the mesh.
gpu_compute_normals
Recompute per-vertex normals using area-weighted face normals.
gpu_compute_surface_area
Compute total surface area as the sum of triangle areas.
gpu_compute_volume
Compute the signed volume of the mesh via the divergence theorem.
gpu_edge_collapse
Collapse edges whose midpoint error is below error_threshold.
gpu_loop_subdivision
Perform one step of Loop subdivision, returning a new mesh.
gpu_mesh_decimate
Simplify a mesh to approximately target_triangles.
gpu_smooth_normals
Laplacian normal smoothing: average each vertex normal with its neighbours.
gpu_weld_vertices
Merge vertices that are within tol distance of each other.
triangle_area
Compute the area of triangle (a, b, c) using the cross-product formula.
triangle_normal
Compute the unit normal of triangle (a, b, c).