Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_mesh_intersect.hh')
-rw-r--r--source/blender/blenlib/BLI_mesh_intersect.hh28
1 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_mesh_intersect.hh b/source/blender/blenlib/BLI_mesh_intersect.hh
index f28be9bf59b..4aaed814bba 100644
--- a/source/blender/blenlib/BLI_mesh_intersect.hh
+++ b/source/blender/blenlib/BLI_mesh_intersect.hh
@@ -93,13 +93,16 @@ struct Plane {
Plane(const mpq3 &norm_exact, const mpq_class &d_exact);
Plane(const double3 &norm, const double d);
- /* Test equality on the exact fields. */
+ /** Test equality on the exact fields. */
bool operator==(const Plane &other) const;
- /* Hash on the exact fields. */
+ /** Hash on the exact fields. */
uint64_t hash() const;
void make_canonical();
+ /**
+ * This is wrong for degenerate planes, but we don't expect to call it on those.
+ */
bool exact_populated() const;
void populate_exact();
};
@@ -395,10 +398,16 @@ struct BoundingBox {
}
};
-/** Assume bounding boxes have been expanded by a sufficient epsilon. */
+/**
+ * Assume bounding boxes have been expanded by a sufficient epsilon on all sides
+ * so that the comparisons against the bb bounds are sufficient to guarantee that
+ * if an overlap or even touching could happen, this will return true.
+ */
bool bbs_might_intersect(const BoundingBox &bb_a, const BoundingBox &bb_b);
/**
+ * This is the main routine for calculating the self_intersection of a triangle mesh.
+ *
* The output will have duplicate vertices merged and degenerate triangles ignored.
* If the input has overlapping co-planar triangles, then there will be
* as many duplicates as there are overlaps in each overlapping triangular region.
@@ -406,7 +415,7 @@ bool bbs_might_intersect(const BoundingBox &bb_a, const BoundingBox &bb_b);
* that the output triangle was a part of (input can have -1 for that field and then
* the index in `tri[]` will be used as the original index).
* The orig structure of the output #IMesh gives the originals for vertices and edges.
- * NOTE: if the input tm_in has a non-empty orig structure, then it is ignored.
+ * \note if the input tm_in has a non-empty orig structure, then it is ignored.
*/
IMesh trimesh_self_intersect(const IMesh &tm_in, IMeshArena *arena);
@@ -416,10 +425,17 @@ IMesh trimesh_nary_intersect(const IMesh &tm_in,
bool use_self,
IMeshArena *arena);
-/** Return an IMesh that is a triangulation of a mesh with general polygonal faces. */
+/**
+ * Return an #IMesh that is a triangulation of a mesh with general
+ * polygonal faces, #IMesh.
+ * Added diagonals will be distinguishable by having edge original
+ * indices of #NO_INDEX.
+ */
IMesh triangulate_polymesh(IMesh &imesh, IMeshArena *arena);
-/** This has the side effect of populating verts in the #IMesh. */
+/**
+ * Writing the obj_mesh has the side effect of populating verts in the #IMesh.
+ */
void write_obj_mesh(IMesh &m, const std::string &objname);
} /* namespace blender::meshintersect */