Browse Source

Comments for uncommented functions declarations within CSGMesh subdir

tamasmeszaros 1 year ago
parent
commit
198f00db8a

+ 3 - 0
src/libslic3r/CSGMesh/CSGMesh.hpp

@@ -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)
 {

+ 2 - 0
src/libslic3r/CSGMesh/CSGMeshCopy.hpp

@@ -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)
 {

+ 4 - 0
src/libslic3r/CSGMesh/PerformCSGMeshBooleans.hpp

@@ -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)
 {

+ 2 - 0
src/libslic3r/CSGMesh/SliceCSGMesh.hpp

@@ -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,

+ 1 - 0
src/libslic3r/CSGMesh/VoxelizeCSGMesh.hpp

@@ -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 = {})