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
toldistance 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).