28 int i, i_prev =
len - 1;
29 for (i = 0; i <
len; i++) {
31 if (vert_arr[i] ==
NULL) {
41 int i, i_prev =
len - 1;
42 for (i = 0; i <
len; i++) {
44 if (edge_arr[i_prev] ==
NULL) {
54 int i, i_prev =
len - 1;
55 for (i = 0; i <
len; i++) {
90 }
while ((l_iter = l_iter->
next) != l_first);
97 if (l_other && l_other != l_iter) {
102 if (l_other->
v == l_iter->
v) {
104 l_src[1] = l_other->
next;
107 l_src[0] = l_other->
next;
111 for (j = 0; j < 2; j++) {
121 }
while ((l_iter = l_iter->
next) != l_first);
126 }
while ((l_iter = l_iter->
next) != l_first);
148 for (i = 0; i <
len; i++) {
157 e_iter = e_first =
v1->e;
178 edges_sort[i] = e_iter;
181 verts_sort[i] = v_iter;
188 if (
UNLIKELY(v_iter != verts_sort[0])) {
203 for (i = 0; i <
len; i++) {
237 const bool calc_winding,
238 const bool create_edges)
241 uint winding[2] = {0, 0};
242 int i, i_prev =
len - 1;
243 BMVert *v_winding[2] = {vert_arr[i_prev], vert_arr[0]};
247 for (i = 0; i <
len; i++) {
253 if (edge_arr[i] ==
NULL) {
261 if (edge_arr[i]->
l) {
262 BMVert *test_v1, *test_v2;
265 winding[(vert_arr[i_prev] == test_v2)]++;
276 if (winding[0] < winding[1]) {
294 bm, v_winding[winding[0]], v_winding[winding[1]], edge_arr,
len, f_example, create_flag);
302 float nor[3], cent[3];
303 int index_tangent = 0;
305 const float *far = vert_arr[index_tangent]->
co;
308 for (
int i = 0; i <
len; i++) {
311 vert_arr_map[i] = vert_arr[i];
319 for (
int i = 0; i <
len; i++) {
320 vert_arr[i] = vert_arr_map[vang[i].
data];
329 if ((bm_src == bm_dst) && (v_src == v_dst)) {
344 if ((bm_src == bm_dst) && (e_src == e_dst)) {
356 if ((bm_src == bm_dst) && (l_src == l_dst)) {
368 if ((bm_src == bm_dst) && (f_src == f_dst)) {
383 const void *ele_src_v,
385 const char hflag_mask,
391 const BMHeader *ele_src = ele_src_v;
405 if (hflag_mask == 0) {
408 else if (hflag_mask == 0xff) {
412 ele_dst->
hflag = ((ele_dst->
hflag & hflag_mask) | (ele_src->
hflag & ~hflag_mask));
416 switch (ele_dst->
htype) {
419 bm_src, bm_dst, (
const BMVert *)ele_src, (
BMVert *)ele_dst, cd_mask_exclude);
423 bm_src, bm_dst, (
const BMEdge *)ele_src, (
BMEdge *)ele_dst, cd_mask_exclude);
427 bm_src, bm_dst, (
const BMLoop *)ele_src, (
BMLoop *)ele_dst, cd_mask_exclude);
431 bm_src, bm_dst, (
const BMFace *)ele_src, (
BMFace *)ele_dst, cd_mask_exclude);
448 const BMHeader *ele_src = ele_src_v;
476 }
while ((l_iter = l_iter->
next) != l_first);
495 }
while ((l_iter = l_iter->
next) != l_first);
501 const Mesh *me_src_array[],
502 const int me_src_array_len,
506 if (allocsize ==
NULL) {
512 for (
int i = 0; i < me_src_array_len; i++) {
513 const Mesh *me_src = me_src_array[i];
549 if (allocsize ==
NULL) {
569 if (allocsize ==
NULL) {
581 for (
int i = 0; i < 4; i++) {
582 if (!(htypes[i] & htype)) {
589 for (
int l = 0;
l <
src->totlayer;
l++) {
681 switch (ese->
htype) {
683 eletable = (
BMElem **)vtable;
686 eletable = (
BMElem **)etable;
689 eletable = (
BMElem **)ftable;
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_merge(const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
void CustomData_bmesh_free_block_data_exclude_by_type(struct CustomData *data, void *block, eCustomDataMask mask_exclude)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, char htype)
const CustomData_MeshMasks CD_MASK_BMESH
void CustomData_bmesh_copy_data_exclude_by_type(const struct CustomData *source, struct CustomData *dest, void *src_block, void **dest_block, eCustomDataMask mask_exclude)
#define BLI_array_alloca(arr, realsize)
#define BLI_assert_msg(a, msg)
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_)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
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)
static void bm_face_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const BMFace *f_src, BMFace *f_dst, eCustomDataMask mask_exclude)
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_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.
static void bm_vert_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const BMVert *v_src, BMVert *v_dst, eCustomDataMask mask_exclude)
bool BM_verts_from_edges(BMVert **vert_arr, BMEdge **edge_arr, const int len)
void BM_elem_attrs_copy_ex(BMesh *bm_src, BMesh *bm_dst, const void *ele_src_v, void *ele_dst_v, const char hflag_mask, const uint64_t cd_mask_exclude)
char BM_face_flag_from_mflag(const char mflag)
void BM_elem_select_copy(BMesh *bm_dst, void *ele_dst_v, const void *ele_src_v)
static void bm_loop_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const BMLoop *l_src, BMLoop *l_dst, eCustomDataMask mask_exclude)
void BM_elem_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const void *ele_src, void *ele_dst)
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.
char BM_face_flag_to_mflag(BMFace *f)
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)
void BM_edges_from_verts_ensure(BMesh *bm, 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.
short BM_edge_flag_to_mflag(BMEdge *e)
char BM_vert_flag_from_mflag(const char mflag)
char BM_edge_flag_from_mflag(const short mflag)
void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst, BMesh *bm_src, const char htype, const BMAllocTemplate *allocsize)
char BM_vert_flag_to_mflag(BMVert *v)
static BMFace * bm_mesh_copy_new_face(BMesh *bm_new, BMesh *bm_old, BMVert **vtable, BMEdge **etable, BMFace *f)
BMesh * BM_mesh_copy(BMesh *bm_old)
bool BM_edges_from_verts(BMEdge **edge_arr, BMVert **vert_arr, const int len)
static void bm_edge_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const BMEdge *e_src, BMEdge *e_dst, eCustomDataMask mask_exclude)
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.
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 **verts, BMEdge **edges, const int len, const BMFace *f_example, const eBMCreateFlag create_flag)
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_elem_flag_test(ele, hflag)
#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 struct BMeshCreateParams *params)
#define BMALLOC_TEMPLATE_FROM_BM(bm)
char BM_mesh_cd_flag_from_bmesh(BMesh *bm)
void BM_mesh_cd_flag_apply(BMesh *bm, const char cd_flag)
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)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
BMVert * BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) 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()
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SyclQueue void void * src
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
static void error(const char *str)
unsigned __int64 uint64_t
struct BMEditSelection * next
struct BMLoop * radial_next