Blender V5.0
BLI_polyfill_2d.h File Reference

Go to the source code of this file.

Macros

#define BLI_POLYFILL_ARENA_SIZE   MEM_SIZE_OPTIMAL(1 << 14)

Functions

void BLI_polyfill_calc_arena (const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3], struct MemArena *arena)
void BLI_polyfill_calc (const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3])

Macro Definition Documentation

◆ BLI_POLYFILL_ARENA_SIZE

Function Documentation

◆ BLI_polyfill_calc()

void BLI_polyfill_calc ( const float(*) coords[2],
unsigned int coords_num,
int coords_sign,
unsigned int(*) r_tris[3] )

Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.

Parameters
coords2D coordinates describing vertices of the polygon, in either clockwise or counterclockwise order.
coords_numTotal points in the array.
coords_signPass this when we know the sign in advance to avoid extra calculations.
r_trisThis array is filled in with triangle indices in clockwise order. The length of the array must be coords_num - 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).

Referenced by BKE_gpencil_stroke_fill_triangulate(), BKE_mesh_remap_calc_faces_from_mesh(), BM_face_calc_tessellation(), blender::geometry::ngon::calc_corner_tris(), blender::ed::sculpt_paint::trim::generate_geometry(), GPU_batch_tris_from_poly_2d_encoded(), test_polyfill_template(), and ui_draw_but_CURVEPROFILE().

◆ BLI_polyfill_calc_arena()