Docs: comment polyfill2d functions

This commit is contained in:
Campbell Barton
2016-05-09 23:46:17 +10:00
parent 9ac35be63a
commit 8b13555b24

View File

@@ -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. * Initializes the #PolyFill structure before tessellating with #polyfill_calc.
*
* \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.
*/ */
static void polyfill_prepare( static void polyfill_prepare(
PolyFill *pf, PolyFill *pf,
@@ -862,6 +858,9 @@ static void polyfill_calc(
pf_triangulate(pf); pf_triangulate(pf);
} }
/**
* A version of #BLI_polyfill_calc that uses a memory arena to avoid re-allocations.
*/
void BLI_polyfill_calc_arena( void BLI_polyfill_calc_arena(
const float (*coords)[2], const float (*coords)[2],
const unsigned int coords_tot, const unsigned int coords_tot,
@@ -905,6 +904,19 @@ void BLI_polyfill_calc_arena(
#endif #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( void BLI_polyfill_calc(
const float (*coords)[2], const float (*coords)[2],
const unsigned int coords_tot, const unsigned int coords_tot,