Simplify a surface mesh using CGAL edge collapse algorithmSimplifies a 3D surface mesh by iteratively collapsing edges while minimizing geometric error. Supports TriangulatedSurface, PolyhedralSurface, Solid, and MultiSolid geometries.
The algorithm uses CGAL's Surface_mesh_simplification package to perform edge collapse operations. The cost and placement of edge collapses are determined by the specified strategy.
- Parameters
-
| geometry | The input geometry to simplify (must be a surface or solid) |
| stopPredicate | When to stop the simplification process |
| strategy | The cost and placement strategy to use (default: EDGE_LENGTH) |
- Returns
- A simplified copy of the input geometry
- Precondition
- The input geometry must be valid and non-empty
-
For EDGE_COUNT_RATIO, the ratio must be in the range (0.0, 1.0)
-
The geometry must be 3-dimensional
- Warning
- Surface geometries (polygon soups) will be converted to CGAL::Surface_mesh, which may modify the topology if the input is not manifold
- See also
- https://doc.cgal.org/latest/Surface_mesh_simplification/index.html#Chapter_Triangulated_Surface_Mesh_Simplification
polyhedralSurface,
SimplificationStopPredicate::edgeCountRatio(0.5),
SimplificationStrategy::EDGE_LENGTH
);
#ifndef SFCGAL_ALGORITHM_SURFACE_SIMPLIFICATION_H
#define SFCGAL_ALGORITHM_SURFACE_SIMPLIFICATION_H
#include "SFCGAL/Geometry.h"
#include "SFCGAL/config.h"
#include <memory>
struct NoValidityCheck;
#ifdef SFCGAL_WITH_EIGEN
GARLAND_HECKBERT,
LINDSTROM_TURK
#endif // SFCGAL_WITH_EIGEN
};
struct SimplificationStopPredicate {
};
static auto
edgeCount(
size_t count) -> SimplificationStopPredicate
{
}
static auto
{
}
};
[[nodiscard]] SFCGAL_API auto
const Geometry &geometry, const SimplificationStopPredicate &stopPredicate,
-> std::unique_ptr<Geometry>;
[[nodiscard]] SFCGAL_API auto
const SimplificationStopPredicate &stopPredicate,
-> std::unique_ptr<Geometry>;
}
#endif // SFCGAL_ALGORITHM_SURFACE_SIMPLIFICATION_H