Blender  V3.3
bmesh_polygon.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
9 struct BMPartialUpdate;
10 struct Heap;
11 
12 #include "BLI_compiler_attrs.h"
13 
23 void BM_face_calc_tessellation(const BMFace *f,
24  bool use_fixed_quad,
25  BMLoop **r_loops,
26  uint (*r_index)[3]);
30 void BM_face_calc_point_in_face(const BMFace *f, float r_co[3]);
31 
41 float BM_face_calc_normal(const BMFace *f, float r_no[3]) ATTR_NONNULL();
42 /* exact same as 'BM_face_calc_normal' but accepts vertex coords */
43 float BM_face_calc_normal_vcos(const BMesh *bm,
44  const BMFace *f,
45  float r_no[3],
46  float const (*vertexCos)[3]) ATTR_NONNULL();
47 
55  BMVert **varr, int varr_len, float r_normal[3], float r_center[3], int *r_index_tangent);
56 void BM_verts_calc_normal_from_cloud(BMVert **varr, int varr_len, float r_normal[3]);
57 
61 float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3])
62  ATTR_NONNULL();
70 float BM_face_calc_area_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
71  ATTR_NONNULL();
75 float BM_face_calc_area_uv(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT
76  ATTR_NONNULL();
85  const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
86  ATTR_NONNULL();
90 void BM_face_calc_tangent_edge(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
96 void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
102 void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
108 void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
114 void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
118 void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
123  const BMFace *f,
124  float r_center[3],
125  float const (*vertexCos)[3]) ATTR_NONNULL();
129 void BM_face_calc_center_median(const BMFace *f, float r_center[3]) ATTR_NONNULL();
130 /* exact same as 'BM_face_calc_normal' but accepts vertex coords */
132  const BMFace *f,
133  float r_center[3],
134  float const (*vertexCos)[3]) ATTR_NONNULL();
139 void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
140 
144 void BM_face_calc_bounds_expand(const BMFace *f, float min[3], float max[3]);
145 
147 
152 
153 bool BM_vert_calc_normal_ex(const BMVert *v, char hflag, float r_no[3]);
154 bool BM_vert_calc_normal(const BMVert *v, float r_no[3]);
160 
168  BMFace *f,
169  int cd_loop_mdisp_offset,
170  bool use_loop_mdisp_flip) ATTR_NONNULL();
182 bool BM_face_point_inside_test(const BMFace *f, const float co[3]) ATTR_WARN_UNUSED_RESULT
183  ATTR_NONNULL();
184 
209  BMFace *f,
210  BMFace **r_faces_new,
211  int *r_faces_new_tot,
212  BMEdge **r_edges_new,
213  int *r_edges_new_tot,
214  struct LinkNode **r_faces_double,
215  int quad_method,
216  int ngon_method,
217  bool use_tag,
218  struct MemArena *pf_arena,
219  struct Heap *pf_heap) ATTR_NONNULL(1, 2);
220 
229 void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
234 void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
235 
242 void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]) ATTR_NONNULL();
247 void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]) ATTR_NONNULL();
248 
255 void BM_face_as_array_loop_tri(BMFace *f, BMLoop *r_loops[3]) ATTR_NONNULL();
260 void BM_face_as_array_loop_quad(BMFace *f, BMLoop *r_loops[4]) ATTR_NONNULL();
261 
270 void BM_vert_tri_calc_tangent_edge(BMVert *verts[3], float r_tangent[3]);
279 void BM_vert_tri_calc_tangent_edge_pair(BMVert *verts[3], float r_tangent[3]);
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
unsigned int uint
Definition: BLI_sys_types.h:67
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3]) ATTR_NONNULL()
float BM_face_calc_normal(const BMFace *f, float r_no[3]) ATTR_NONNULL()
BMESH UPDATE FACE NORMAL.
void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_normal_flip_ex(BMesh *bm, BMFace *f, int cd_loop_mdisp_offset, bool use_loop_mdisp_flip) ATTR_NONNULL()
Face Flip Normal.
void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3]) ATTR_NONNULL()
void BM_face_normal_flip(BMesh *bm, BMFace *f) ATTR_NONNULL()
void BM_face_normal_update(BMFace *f) ATTR_NONNULL()
bool BM_vert_calc_normal_ex(const BMVert *v, char hflag, float r_no[3])
void BM_face_calc_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_center[3], float const (*vertexCos)[3]) ATTR_NONNULL()
void void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL()
float BM_face_calc_area_uv(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_vert_normal_update(BMVert *v) ATTR_NONNULL()
float BM_face_calc_perimeter_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_face_calc_point_in_face(const BMFace *f, float r_co[3])
void BM_verts_calc_normal_from_cloud(BMVert **varr, int varr_len, float r_normal[3])
bool BM_vert_calc_normal(const BMVert *v, float r_no[3])
void BM_vert_tri_calc_tangent_edge(BMVert *verts[3], float r_tangent[3])
void BM_face_calc_tessellation(const BMFace *f, bool use_fixed_quad, BMLoop **r_loops, uint(*r_index)[3])
float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3]) ATTR_NONNULL()
void BM_face_as_array_loop_quad(BMFace *f, BMLoop *r_loops[4]) ATTR_NONNULL()
void BM_face_calc_center_median(const BMFace *f, float r_center[3]) ATTR_NONNULL()
void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
float BM_face_calc_area_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_face_triangulate(BMesh *bm, BMFace *f, BMFace **r_faces_new, int *r_faces_new_tot, BMEdge **r_edges_new, int *r_edges_new_tot, struct LinkNode **r_faces_double, int quad_method, int ngon_method, bool use_tag, struct MemArena *pf_arena, struct Heap *pf_heap) ATTR_NONNULL(1
BMESH TRIANGULATE FACE.
void BM_verts_calc_normal_from_cloud_ex(BMVert **varr, int varr_len, float r_normal[3], float r_center[3], int *r_index_tangent)
void BM_vert_normal_update_all(BMVert *v) ATTR_NONNULL()
float BM_face_calc_normal_vcos(const BMesh *bm, const BMFace *f, float r_no[3], float const (*vertexCos)[3]) ATTR_NONNULL()
bool BM_face_point_inside_test(const BMFace *f, const float co[3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]) ATTR_NONNULL()
void BM_edge_normals_update(BMEdge *e) ATTR_NONNULL()
void BM_face_calc_bounds_expand(const BMFace *f, float min[3], float max[3])
float BM_face_calc_area(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]) ATTR_NONNULL()
void BM_face_as_array_loop_tri(BMFace *f, BMLoop *r_loops[3]) ATTR_NONNULL()
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_center[3], float const (*vertexCos)[3]) ATTR_NONNULL()
void BM_vert_tri_calc_tangent_edge_pair(BMVert *verts[3], float r_tangent[3])
void BM_face_calc_tangent_edge(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL()
float BM_face_calc_perimeter(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
int len
Definition: draw_manager.c:108
static float verts[][3]
#define min(a, b)
Definition: sort.c:35
Definition: BLI_heap.c:43
float max