[Bf-blender-cvs] [eee3529eaf4] master: Docs: improve poly_to_tri_count doc-string

Campbell Barton noreply at git.blender.org
Sun Jun 20 16:05:47 CEST 2021


Commit: eee3529eaf444cc0db0ad46182dccab46907c361
Author: Campbell Barton
Date:   Mon Jun 21 00:02:09 2021 +1000
Branches: master
https://developer.blender.org/rBeee3529eaf444cc0db0ad46182dccab46907c361

Docs: improve poly_to_tri_count doc-string

It wasn't obvious this can be used for calculating the triangle index
from the polygon and loop index.

===================================================================

M	source/blender/blenlib/intern/math_geom_inline.c

===================================================================

diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c
index 23c351026f2..655d3fcc4c0 100644
--- a/source/blender/blenlib/intern/math_geom_inline.c
+++ b/source/blender/blenlib/intern/math_geom_inline.c
@@ -244,10 +244,13 @@ MINLINE int min_axis_v3(const float vec[3])
 }
 
 /**
- * Simple method to find how many tri's we need when we already know the corner+poly count.
+ * Simple function to either:
+ * - Calculate how many triangles needed from the total number of polygons + loops.
+ * - Calculate the first triangle index from the polygon index & that polygons loop-start.
  *
- * \param poly_count: The number of ngon's/tris (1-2 sided faces will give incorrect results)
- * \param corner_count: also known as loops in BMesh/DNA
+ * \param poly_count: The number of polygons or polygon-index
+ * (3+ sided faces, 1-2 sided give incorrect results).
+ * \param corner_count: The number of corners (also called loop-index).
  */
 MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
 {



More information about the Bf-blender-cvs mailing list