Blender V4.3
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
11struct Heap;
12
13#include "BLI_compiler_attrs.h"
15#include "BLI_span.hh"
16
27 bool use_fixed_quad,
28 BMLoop **r_loops,
29 uint (*r_index)[3]);
33void BM_face_calc_point_in_face(const BMFace *f, float r_co[3]);
34
44float BM_face_calc_normal(const BMFace *f, float r_no[3]) ATTR_NONNULL();
45/* exact same as 'BM_face_calc_normal' but accepts vertex coords */
47 const BMFace *f,
48 float r_no[3],
50
58 BMVert **varr, int varr_len, float r_normal[3], float r_center[3], int *r_index_tangent);
59void BM_verts_calc_normal_from_cloud(BMVert **varr, int varr_len, float r_normal[3]);
60
64float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3])
73float BM_face_calc_area_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
78float BM_face_calc_area_uv_signed(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT
83float BM_face_calc_area_uv(const BMFace *f, int cd_loop_uv_offset) ATTR_WARN_UNUSED_RESULT
93 const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT
98void BM_face_calc_tangent_edge(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
104void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
110void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
116void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
122void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3]) ATTR_NONNULL();
126void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
131 const BMFace *f,
132 float r_center[3],
137void BM_face_calc_center_median(const BMFace *f, float r_center[3]) ATTR_NONNULL();
138/* exact same as 'BM_face_calc_normal' but accepts vertex coords */
140 const BMFace *f,
141 float r_center[3],
142 const blender::Span<blender::float3> vert_positions)
143 ATTR_NONNULL();
148void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3]) ATTR_NONNULL();
149
153void BM_face_calc_bounds_expand(const BMFace *f, float min[3], float max[3]);
154
156
161
162bool BM_vert_calc_normal_ex(const BMVert *v, char hflag, float r_no[3]);
163bool BM_vert_calc_normal(const BMVert *v, float r_no[3]);
169
177 BMFace *f,
178 int cd_loop_mdisp_offset,
179 bool use_loop_mdisp_flip) ATTR_NONNULL();
181
192bool BM_face_point_inside_test(const BMFace *f, const float co[3]) ATTR_WARN_UNUSED_RESULT
193 ATTR_NONNULL();
194
219 BMFace *f,
220 BMFace **r_faces_new,
221 int *r_faces_new_tot,
222 BMEdge **r_edges_new,
223 int *r_edges_new_tot,
224 struct LinkNode **r_faces_double,
225 int quad_method,
226 int ngon_method,
227 bool use_tag,
228 struct MemArena *pf_arena,
229 struct Heap *pf_heap) ATTR_NONNULL(1, 2);
230
239void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
244void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len) ATTR_NONNULL();
245
258
271
280void BM_vert_tri_calc_tangent_edge(BMVert *verts[3], float r_tangent[3]);
289void 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
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()
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_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])
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_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()
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_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_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_center[3], blender::Span< blender::float3 > vert_positions) 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
static float verts[][3]
#define min(a, b)
Definition sort.c:32