27 int i, i_prev =
len - 1;
28 for (i = 0; i <
len; i++) {
30 if (vert_arr[i] ==
nullptr) {
40 int i, i_prev =
len - 1;
41 for (i = 0; i <
len; i++) {
43 if (edge_arr[i_prev] ==
nullptr) {
53 int i, i_prev =
len - 1;
54 for (i = 0; i <
len; i++) {
82 }
while ((l_iter = l_iter->
next) != l_first);
89 if (l_other && l_other != l_iter) {
94 if (l_other->
v == l_iter->
v) {
96 l_src[1] = l_other->
next;
99 l_src[0] = l_other->
next;
103 for (j = 0; j < 2; j++) {
106 if ((filter_fn ==
nullptr) || filter_fn(l_src[j], user_data)) {
113 }
while ((l_iter = l_iter->
next) != l_first);
118 }
while ((l_iter = l_iter->
next) != l_first);
140 for (i = 0; i <
len; i++) {
149 e_iter = e_first = v1->
e;
170 edges_sort[i] = e_iter;
173 verts_sort[i] = v_iter;
180 if (
UNLIKELY(v_iter != verts_sort[0])) {
195 for (i = 0; i <
len; i++) {
229 const bool calc_winding,
230 const bool create_edges)
233 uint winding[2] = {0, 0};
234 int i, i_prev =
len - 1;
235 BMVert *v_winding[2] = {vert_arr[i_prev], vert_arr[0]};
239 for (i = 0; i <
len; i++) {
246 if (edge_arr[i] ==
nullptr) {
254 if (edge_arr[i]->
l) {
255 BMVert *test_v1, *test_v2;
258 winding[(vert_arr[i_prev] == test_v2)]++;
269 if (winding[0] < winding[1]) {
287 bm, v_winding[winding[0]], v_winding[winding[1]], edge_arr,
len, f_example, create_flag);
295 float nor[3], cent[3];
296 int index_tangent = 0;
298 const float *far = vert_arr[index_tangent]->
co;
301 for (
int i = 0; i <
len; i++) {
304 vert_arr_map[i] = vert_arr[i];
312 for (
int i = 0; i <
len; i++) {
313 vert_arr[i] = vert_arr_map[vang[i].
data];
410 }
while ((l_iter = l_iter->
next) != l_first);
430 l_iter->
head.
hflag = loops[j]->head.hflag & ~BM_ELEM_SELECT;
432 }
while ((l_iter = l_iter->
next) != l_first);
438 const Mesh *me_src_array[],
439 const int me_src_array_len,
443 if (allocsize ==
nullptr) {
447 for (
int i = 0; i < me_src_array_len; i++) {
448 const Mesh *me_src = me_src_array[i];
496 if (allocsize ==
nullptr) {
520 if (allocsize ==
nullptr) {
532 for (
int i = 0; i < 4; i++) {
533 if (!(htypes[i] & htype)) {
538 const int size = *(&allocsize->
totvert + i);
551 BMVert *
v, *v_new, **vtable =
nullptr;
552 BMEdge *
e, *e_new, **etable =
nullptr;
553 BMFace *f, *f_new, **ftable =
nullptr;
575 vtable =
static_cast<BMVert **
>(
577 etable =
static_cast<BMEdge **
>(
579 ftable =
static_cast<BMFace **
>(
643 switch (ese->htype) {
645 eletable = (
BMElem **)vtable;
648 eletable = (
BMElem **)etable;
651 eletable = (
BMElem **)ftable;
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_add_layer_named(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem, blender::StringRef name)
BMCustomDataCopyMap CustomData_bmesh_copy_map_calc(const CustomData &src, const CustomData &dst, eCustomDataMask mask_exclude=0)
void CustomData_bmesh_init_pool(CustomData *data, int totelem, char htype)
const CustomData_MeshMasks CD_MASK_BMESH
void CustomData_bmesh_copy_block(CustomData &data, void *src_block, void **dst_block)
void CustomData_init_layout_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
CustomData CustomData_shallow_copy_remove_non_bmesh_attributes(const CustomData *src, eCustomDataMask mask)
bool CustomData_merge_layout(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
#define BLI_array_alloca(arr, realsize)
#define LISTBASE_FOREACH(type, var, list)
float angle_signed_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
int BLI_sortutil_cmp_float(const void *a_, const void *b_)
Read Guarded memory(de)allocation.
bool(* BMLoopFilterFunc)(const BMLoop *, void *user_data)
#define BM_FACE_FIRST_LOOP(p)
void BM_mesh_copy_init_customdata(BMesh *bm_dst, BMesh *bm_src, const BMAllocTemplate *allocsize)
void BM_verts_sort_radial_plane(BMVert **vert_arr, int len)
static bool bm_edges_sort_winding(BMVert *v1, BMVert *v2, BMEdge **edges, const int len, BMEdge **edges_sort, BMVert **verts_sort)
void BM_face_copy_shared(BMesh *bm, BMFace *f, BMLoopFilterFunc filter_fn, void *user_data)
copies face loop data from shared adjacent faces.
bool BM_verts_from_edges(BMVert **vert_arr, BMEdge **edge_arr, const int len)
void BM_elem_select_copy(BMesh *bm_dst, void *ele_dst_v, const void *ele_src_v)
void BM_elem_attrs_copy(BMesh *bm, const BMCustomDataCopyMap &map, const BMVert *src, BMVert *dst)
void BM_mesh_copy_init_customdata_from_mesh_array(BMesh *bm_dst, const Mesh *me_src_array[], const int me_src_array_len, const BMAllocTemplate *allocsize)
void BM_mesh_copy_init_customdata_from_mesh(BMesh *bm_dst, const Mesh *me_src, const BMAllocTemplate *allocsize)
BMFace * BM_face_create_ngon_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool calc_winding, const bool create_edges)
void BM_edges_from_verts_ensure(BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr, const int len)
static BMFace * bm_mesh_copy_new_face(BMesh *bm_new, const BMCustomDataCopyMap &face_map, const BMCustomDataCopyMap &loop_map, BMVert **vtable, BMEdge **etable, BMFace *f)
BMFace * BM_face_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, const BMFace *f_example, const eBMCreateFlag create_flag)
Make Quad/Triangle.
void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst, BMesh *bm_src, const char htype, const BMAllocTemplate *allocsize)
BMesh * BM_mesh_copy(BMesh *bm_old)
bool BM_edges_from_verts(BMEdge **edge_arr, BMVert **vert_arr, const int len)
BMFace * BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, const int len, const BMFace *f_example, const eBMCreateFlag create_flag)
Make NGon.
BMFace * BM_face_create_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool create_edges)
BMFace * BM_face_create(BMesh *bm, BMVert *const *verts, BMEdge *const *edges, const int len, const BMFace *f_example, const eBMCreateFlag create_flag)
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
#define BM_elem_index_get(ele)
#define BM_elem_index_set(ele, index)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
#define BM_select_history_store(bm, ele)
const BMAllocTemplate bm_mesh_allocsize_default
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
#define BMALLOC_TEMPLATE_FROM_BM(bm)
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)
#define BM_ELEM_API_FLAG_DISABLE(element, f)
#define BM_ELEM_API_FLAG_TEST(element, f)
#define BM_ELEM_API_FLAG_ENABLE(element, f)
BMVert * BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
BLI_INLINE BMEdge * bmesh_disk_edge_next(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
static void error(const char *str)
Frequency::GEOMETRY nor[]
struct BMLoop * radial_next