Blender V5.0
BLI_polyfill_2d_beautify.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include <stdbool.h>
12
13struct Heap;
14struct MemArena;
15
22void BLI_polyfill_beautify(const float (*coords)[2],
23 unsigned int coords_num,
24 unsigned int (*tris)[3],
25
26 /* structs for reuse */
27 struct MemArena *arena,
28 struct Heap *eheap);
29
45float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2],
46 const float v2[2],
47 const float v3[2],
48 const float v4[2],
49 bool lock_degenerate,
50 float *r_area);
51#define BLI_polyfill_beautify_quad_rotate_calc(v1, v2, v3, v4) \
52 BLI_polyfill_beautify_quad_rotate_calc_ex(v1, v2, v3, v4, false, NULL)
53
54float BLI_polyfill_edge_calc_rotate_beauty__area(const float v1[3],
55 const float v2[3],
56 const float v3[3],
57 const float v4[3],
58 bool lock_degenerate);
59
60/* avoid realloc's when creating new structures for polyfill ngons */
61#define BLI_POLYFILL_ALLOC_NGON_RESERVE 64
void BLI_polyfill_beautify(const float(*coords)[2], unsigned int coords_num, unsigned int(*tris)[3], struct MemArena *arena, struct Heap *eheap)
float BLI_polyfill_edge_calc_rotate_beauty__area(const float v1[3], const float v2[3], const float v3[3], const float v4[3], bool lock_degenerate)
float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2], const float v2[2], const float v3[2], const float v4[2], bool lock_degenerate, float *r_area)
ATTR_WARN_UNUSED_RESULT const BMVert * v2