Blender V4.3
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).

Definition at line 910 of file polyfill_2d.c.

References BLI_array_alloca, BLI_memarena_free(), BLI_memarena_new(), BLI_polyfill_calc_arena(), pf, polyfill_calc(), polyfill_prepare(), TIMEIT_END, TIMEIT_START, and UNLIKELY.

Referenced by BKE_gpencil_stroke_fill_triangulate(), BKE_mesh_remap_calc_faces_from_mesh(), BM_face_calc_tessellation(), 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()