Blender
V3.3
|
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]) |
#define BLI_POLYFILL_ARENA_SIZE MEM_SIZE_OPTIMAL(1 << 14) |
Definition at line 44 of file BLI_polyfill_2d.h.
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.
coords | 2D coordinates describing vertices of the polygon, in either clockwise or counterclockwise order. |
coords_num | Total points in the array. |
coords_sign | Pass this when we know the sign in advance to avoid extra calculations. |
r_tris | This 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().
void BLI_polyfill_calc_arena | ( | const float(*) | coords[2], |
unsigned int | coords_num, | ||
int | coords_sign, | ||
unsigned int(*) | r_tris[3], | ||
struct MemArena * | arena | ||
) |
A version of BLI_polyfill_calc that uses a memory arena to avoid re-allocations.
Definition at line 830 of file polyfill_2d.c.
References BLI_memarena_alloc(), indices, pf, polyfill_calc(), polyfill_prepare(), TIMEIT_END, and TIMEIT_START.
Referenced by BLI_polyfill_calc(), BM_face_triangulate(), bmesh_calc_tessellation_for_face_beauty(), bmesh_calc_tessellation_for_face_impl(), C_BVHTree_FromPolygons(), mesh_calc_tessellation_for_face_impl(), mesh_tessface_calc(), and p_add_ngon().