This commit is contained in:
Sven Oesau 2025-11-20 15:18:33 +01:00
parent 9570c99344
commit 3036f8612f
2 changed files with 8 additions and 8 deletions

View File

@ -20,8 +20,8 @@ While it is desirable to have a decomposition into a minimum number of
pieces, this problem is known to be NP-hard \cgalCite{c-cpplb-84}. This pieces, this problem is known to be NP-hard \cgalCite{c-cpplb-84}. This
package offers two methods for decomposing polyhedra. The package offers two methods for decomposing polyhedra. The
\ref Convex_decomposition_3Nef "Convex Decomposition of Nef Polyhedra" \ref Convex_decomposition_3Nef "Convex Decomposition of Nef Polyhedra"
splits polyhedra into convex pieces with an upper bound on the number splits polyhedra into convex pieces with an upper bound on their number.
of pieces. The \ref Convex_decomposition_3ACD_Intro The \ref Convex_decomposition_3ACD_Intro
"Approximate convex decomposition" method offers a fast "Approximate convex decomposition" method offers a fast
approximate decomposition of the convex hull into convex volumes. While approximate decomposition of the convex hull into convex volumes. While
any number of convex volumes can be generated, these convex volumes any number of convex volumes can be generated, these convex volumes

View File

@ -1533,11 +1533,11 @@ void merge(std::vector<Convex_hull_candidate<GeomTraits>>& candidates, const typ
/** /**
* \ingroup PkgConvexDecomposition3Ref * \ingroup PkgConvexDecomposition3Ref
* *
* \brief approximates the input mesh by a number of convex hulls. The input mesh is voxelized and the voxels intersecting with the mesh are labeled as surface. * \brief approximates the input mesh by a number of convex volumes. The input mesh is voxelized and the voxels intersecting with the mesh are labeled as surface.
* The remaining voxels are labeled as outside or inside by flood fill, in case the input mesh is closed, or by axis-aligned ray shooting, i.e., along x, * The remaining voxels are labeled as outside or inside by flood fill, in case the input mesh is closed, or by axis-aligned ray shooting, i.e., along x,
* y and z-axis in positive and negative directions. A voxel is only labeled as inside if at least 3 faces facing away from the voxel have been hit and * y and z-axis in positive and negative directions. A voxel is only labeled as inside if at least 3 faces facing away from the voxel have been hit and
* no face facing towards the voxel. In a next step, the convex hull of the mesh is hierarchically split until the `volume_error` threshold is satisfied. * no face facing towards the voxel. In a next step, the convex hull of the mesh is hierarchically split until the `volume_error` threshold is satisfied.
* Afterwards, a greedy pair-wise merging combines smaller convex hulls until the given number of convex hulls is met. * Afterwards, a greedy pair-wise merging combines smaller convex volumes until the given number of convex volumes is met.
* *
* \tparam FaceGraph a model of `HalfedgeListGraph`, and `FaceListGraph` * \tparam FaceGraph a model of `HalfedgeListGraph`, and `FaceListGraph`
* *
@ -1545,8 +1545,8 @@ void merge(std::vector<Convex_hull_candidate<GeomTraits>>& candidates, const typ
* *
* \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
* *
* \param tmesh the input triangle mesh to approximate by convex hulls * \param tmesh the input triangle mesh to approximate by convex volumes
* \param out_hulls output iterator into which convex hulls are recorded * \param out_volumes output iterator into which convex volumes are recorded
* \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
* *
* \cgalNamedParamsBegin * \cgalNamedParamsBegin
@ -1610,7 +1610,7 @@ void merge(std::vector<Convex_hull_candidate<GeomTraits>>& candidates, const typ
* \sa `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()` * \sa `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()`
*/ */
template<typename FaceGraph, typename OutputIterator, typename NamedParameters = parameters::Default_named_parameters> template<typename FaceGraph, typename OutputIterator, typename NamedParameters = parameters::Default_named_parameters>
std::size_t approximate_convex_decomposition(const FaceGraph& tmesh, OutputIterator out_hulls, const NamedParameters& np = parameters::default_values()) { std::size_t approximate_convex_decomposition(const FaceGraph& tmesh, OutputIterator out_volumes, const NamedParameters& np = parameters::default_values()) {
using Geom_traits = typename GetGeomTraits<FaceGraph, NamedParameters>::type; using Geom_traits = typename GetGeomTraits<FaceGraph, NamedParameters>::type;
using FT = typename Geom_traits::FT; using FT = typename Geom_traits::FT;
@ -1666,7 +1666,7 @@ std::size_t approximate_convex_decomposition(const FaceGraph& tmesh, OutputItera
merge(hulls, hull_volume, max_convex_hulls, Concurrency_tag()); merge(hulls, hull_volume, max_convex_hulls, Concurrency_tag());
for (std::size_t i = 0; i < hulls.size(); i++) for (std::size_t i = 0; i < hulls.size(); i++)
*out_hulls++ = std::make_pair(std::move(hulls[i].points), std::move(hulls[i].indices)); *out_volumes++ = std::make_pair(std::move(hulls[i].points), std::move(hulls[i].indices));
return hulls.size(); return hulls.size();
} }