Comments for uncommented functions declarations within CSGMesh subdir

This commit is contained in:
tamasmeszaros 2024-01-26 10:19:11 +01:00
parent 7afddb8006
commit 198f00db8a
5 changed files with 12 additions and 0 deletions

View File

@ -87,6 +87,7 @@ struct CSGPart {
{}
};
// Check if there are only positive parts (Union) within the collection.
template<class Cont> bool is_all_positive(const Cont &csgmesh)
{
bool is_all_pos =
@ -99,6 +100,8 @@ template<class Cont> bool is_all_positive(const Cont &csgmesh)
return is_all_pos;
}
// Merge all the positive parts of the collection into a single triangle mesh without performing
// any booleans.
template<class Cont>
indexed_triangle_set csgmesh_merge_positive_parts(const Cont &csgmesh)
{

View File

@ -55,6 +55,8 @@ void copy_csgrange_deep(const Range<It> &csgrange, OutIt out)
}
}
// Compare two csgmeshes. They are the same if all the triangle mesh pointers are equal and contain
// the same operations and transformed similarly.
template<class ItA, class ItB>
bool is_same(const Range<ItA> &A, const Range<ItB> &B)
{

View File

@ -136,6 +136,9 @@ void perform_csgmesh_booleans(MeshBoolean::cgal::CGALMeshPtr &cgalm,
cgalm = std::move(opstack.top().cgalptr);
}
// Check if all requirements for doing mesh booleans are met by the input csgrange.
// Returns the iterator to the first part which breaks criteria or csgrange.end() if all the parts
// are ok. The Visitor vfn is called for each "bad" part.
template<class It, class Visitor>
It check_csgmesh_booleans(const Range<It> &csgrange, Visitor &&vfn)
{
@ -186,6 +189,7 @@ It check_csgmesh_booleans(const Range<It> &csgrange, Visitor &&vfn)
return ret;
}
// Overload of the previous check_csgmesh_booleans without the visitor argument
template<class It>
It check_csgmesh_booleans(const Range<It> &csgrange)
{

View File

@ -49,6 +49,8 @@ inline void collect_nonempty_indices(csg::CSGType op,
} // namespace detail
// Slice the input csgrange and return the corresponding layers as a vector of ExPolygons.
// All boolean operations are performed on the 2D slices.
template<class ItCSG>
std::vector<ExPolygons> slice_csgmesh_ex(
const Range<ItCSG> &csgrange,

View File

@ -58,6 +58,7 @@ inline void perform_csg(CSGType op, VoxelGridPtr &dst, VoxelGridPtr &src)
} // namespace detail
// Convert the input csgrange to a voxel grid performing the boolean operations in the voxel realm.
template<class It>
VoxelGridPtr voxelize_csgmesh(const Range<It> &csgrange,
const VoxelizeParams &params = {})