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:
authorCampbell Barton <ideasman42@gmail.com>2016-05-09 16:46:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-09 16:47:57 +0300
commit8b13555b24ab159489b05ae9120d96dfbd7972a2 (patch)
tree6412c02ef9ddd511c53e8d791a489bc8969b27eb /source/blender/blenlib/intern/polyfill2d.c
parent9ac35be63a96c52c4773b4b2898b144cfa4b3438 (diff)
Docs: comment polyfill2d functions
Diffstat (limited to 'source/blender/blenlib/intern/polyfill2d.c')
-rw-r--r--source/blender/blenlib/intern/polyfill2d.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/polyfill2d.c b/source/blender/blenlib/intern/polyfill2d.c
index 800f4cb23c3..8d9881e4539 100644
--- a/source/blender/blenlib/intern/polyfill2d.c
+++ b/source/blender/blenlib/intern/polyfill2d.c
@@ -768,11 +768,7 @@ static void pf_ear_tip_cut(PolyFill *pf, PolyIndex *pi_ear_tip)
}
/**
- * Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.
- *
- * \param coords pairs describing vertices of the polygon, in either clockwise or counterclockwise order.
- * \return triples of triangle indices in clockwise order.
- * Note the returned array is reused for later calls to the same method.
+ * Initializes the #PolyFill structure before tessellating with #polyfill_calc.
*/
static void polyfill_prepare(
PolyFill *pf,
@@ -862,6 +858,9 @@ static void polyfill_calc(
pf_triangulate(pf);
}
+/**
+ * A version of #BLI_polyfill_calc that uses a memory arena to avoid re-allocations.
+ */
void BLI_polyfill_calc_arena(
const float (*coords)[2],
const unsigned int coords_tot,
@@ -905,6 +904,19 @@ void BLI_polyfill_calc_arena(
#endif
}
+/**
+ * Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.
+ *
+ * \param coords: 2D coordinates describing vertices of the polygon,
+ * in either clockwise or counterclockwise order.
+ * \param coords_tot: Total points in the array.
+ * \param coords_sign: Pass this when we know the sign in advance to avoid extra calculations.
+ *
+ * \param r_tris: This array is filled in with triangle indices in clockwise order.
+ * The length of the array must be ``coords_tot - 2``.
+ * Indices are guaranteed to be assigned to unique triangles, with valid indices,
+ * even in the case of degenerate input (self intersecting polygons, zero area ears... etc).
+ */
void BLI_polyfill_calc(
const float (*coords)[2],
const unsigned int coords_tot,