Computes a packing of spheres into a closed and self-intersection free triangle mesh. The possible range of radii of spheres can be chosen; large spheres are preferred during the packing. The optimal solution is not guaranteed as it has NP-hard complexity.
Note that the precision of the method is limited by the precision of the GPU, i.e., non-exact arithmetic with 32-bit floating point numbers is used.
the input tm to pack spheres into. It has to be a closed triangle mesh and may not have self-intersections.
out
output iterator into which the packed spheres are written.
np
an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
target number of spheres to be packed into tm.
Type: unsigned int
Default: 10,000
minimum radius of packed spheres
Type: float
Default: 0
maximum radius of packed spheres
Type: float
Default: std::numeric_limits<float>::max()
a functor that is called before each split to decide whether the packing should continue.
Type: an instance of std::function<bool(unsigned int iteration, unsigned int performed_splits, unsigned int number_of_spheres, float sphere_volume, float object_volume, const float4 *)>.
Default: No functor is used. Packing continues until number_of_target_spheres or maximum_splits are met.
Extra: float4 is a CUDA data type and has 4 members: float x, y, z, w.
number of grid cells for the longest side of the bounding box. Grid cells are cubes.
Type: unsigned int
Default: 4
how often the grid is subdivided at most.
Type: unsigned int
Default: 6
iterations of placing spheres between splitting the grid into a higher resolution.
Type: unsigned int
Default: 30
a property map associating points to the vertices of tm
Type: a class model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_3 as value type
Default: boost::get(CGAL::vertex_point, tm)
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t must be available in TriangleMesh.