Blender V5.0
bmesh_polygon.hh
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
11struct Heap;
12
13#include "BLI_compiler_attrs.h"
15#include "BLI_span.hh"
16
17#include "bmesh_class.hh"
18
29 bool use_fixed_quad,
30 BMLoop **r_loops,
31 uint (*r_index)[3]);
35void BM_face_calc_point_in_face(const BMFace *f, float r_co[3]);
36
46float BM_face_calc_normal(const BMFace *f, float r_no[3]) ATTR_NONNULL();
47/* exact same as 'BM_face_calc_normal' but accepts vertex coords */
49 const BMFace *f,
50 float r_no[3],
52
60 BMVert **varr, int varr_len, float r_normal[3], float r_center[3], int *r_index_tangent);
61void BM_verts_calc_normal_from_cloud(BMVert **varr, int varr_len, float r_normal[3]);
62
66float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3])
75float BM_face_calc_area_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
80float BM_face_calc_area_uv_signed(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT
85float BM_face_calc_area_uv(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT
95 const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
100void BM_face_calc_tangent_from_edge(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
102 float r_tangent_a[3],
103 float r_tangent_b[3]);
104
110void BM_face_calc_tangent_from_edge_pair(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
116void BM_face_calc_tangent_from_edge_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
122void BM_face_calc_tangent_from_vert_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
128void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
129
134void BM_face_calc_tangent_pair_auto(const BMFace *f, float r_tangent_a[3], float r_tangent_b[3])
135 ATTR_NONNULL();
136
140void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
145 const BMFace *f,
146 float r_center[3],
151void BM_face_calc_center_median(const BMFace *f, float r_center[3]) ATTR_NONNULL();
152/* exact same as 'BM_face_calc_normal' but accepts vertex coords */
154 const BMFace *f,
155 float r_center[3],
156 const blender::Span<blender::float3> vert_positions)
157 ATTR_NONNULL();
162void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
163
167void BM_face_calc_bounds_expand(const BMFace *f, float min[3], float max[3]);
168
170
175
176bool BM_vert_calc_normal_ex(const BMVert *v, char hflag, float r_no[3]);
177bool BM_vert_calc_normal(const BMVert *v, float r_no[3]);
183
191 BMFace *f,
192 int cd_loop_mdisp_offset,
193 bool use_loop_mdisp_flip) ATTR_NONNULL();
195
206bool BM_face_point_inside_test(const BMFace *f, const float co[3]) ATTR_WARN_UNUSED_RESULT
207 ATTR_NONNULL();
208
233 BMFace *f,
234 BMFace **r_faces_new,
235 int *r_faces_new_tot,
236 BMEdge **r_edges_new,
237 int *r_edges_new_tot,
238 struct LinkNode **r_faces_double,
239 int quad_method,
240 int ngon_method,
241 bool use_tag,
242 struct MemArena *pf_arena,
243 struct Heap *pf_heap) ATTR_NONNULL(1, 2);
244
253void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
258void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
259
272
285
294void BM_vert_tri_calc_tangent_from_edge(BMVert *verts[3], float r_tangent[3]);
296 float r_tangent_a[3],
297 float r_tangent_b[3]);
306void 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
BMesh * bm
void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_calc_tangent_pair_from_edge(const BMFace *f, float r_tangent_a[3], float r_tangent_b[3])
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_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()
float BM_face_calc_normal_vcos(const BMesh *bm, const BMFace *f, float r_no[3], blender::Span< blender::float3 > vertexCos) ATTR_NONNULL()
void BM_face_calc_tangent_from_vert_diagonal(const BMFace *f, float r_tangent[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 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])
float BM_face_calc_area_uv_signed(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_verts_calc_normal_from_cloud(BMVert **varr, int varr_len, float r_normal[3])
void BM_face_calc_tangent_from_edge(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
bool BM_vert_calc_normal(const BMVert *v, float r_no[3])
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_center[3], const blender::Span< blender::float3 > vert_positions) ATTR_NONNULL()
void BM_vert_tri_calc_tangent_from_edge(BMVert *verts[3], float r_tangent[3])
void BM_vert_tri_calc_tangent_pair_from_edge(BMVert *verts[3], float r_tangent_a[3], float r_tangent_b[3])
void BM_face_calc_tangent_from_edge_pair(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
void BM_face_calc_tangent_from_edge_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL()
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()
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()
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_calc_tangent_pair_auto(const BMFace *f, float r_tangent_a[3], float r_tangent_b[3]) 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_vert_tri_calc_tangent_edge_pair(BMVert *verts[3], float r_tangent[3])
void BM_face_calc_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_center[3], blender::Span< blender::float3 > vert_positions) 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
static float verts[][3]
#define min(a, b)
Definition sort.cc:36
max
Definition text_draw.cc:251
uint len