MeshReduce
The MeshReduce namespace contains algorithms for reducing the complexity of 3D meshes, by collapsing vertices and edges to reduce the number of triangles. This is commonly used in mesh optimization workflows, such as generating level-of-detail versions of models.
#include <geometry/TellusimMeshReduce.h>
Functions
Performs mesh reduction.
bool collapse(Mesh &dest, const Mesh &src, float32_t ratio, float32_t threshold = 0.0f, const ProgressCallback *func = nullptr)
bool collapse(MeshGeometry &dest, const MeshGeometry &src, float32_t ratio, float32_t threshold = 0.0f, const ProgressCallback *func = nullptr, uint32_t position = Maxu32)
Type | Name | Description |
---|---|---|
float32_t | ratio | Triangle reduction ratio (use negative ratio for border reduction) |
float32_t | threshold | Edge collapse threshold |
uint32_t | position | Position attribute index |
Types
using ProgressCallback = Function<bool(uint32_t progress)>