Blender  V3.3
Macros | Functions
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

#define BLI_POLYFILL_ARENA_SIZE   MEM_SIZE_OPTIMAL(1 << 14)

Definition at line 44 of file BLI_polyfill_2d.h.

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 875 of file polyfill_2d.c.

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

Referenced by BKE_gpencil_stroke_fill_triangulate(), BKE_mesh_remap_calc_polys_from_mesh(), BM_face_calc_tessellation(), gpencil_sbuffer_stroke_ensure(), GPU_batch_tris_from_poly_2d_encoded(), sculpt_gesture_trim_geometry_generate(), test_polyfill_template(), ui_draw_but_CURVEPROFILE(), and uv_select_overlap().

◆ BLI_polyfill_calc_arena()

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