76 if (keepedge ==
NULL &&
len == 3) {
100 if (keepedge ==
NULL &&
len == 2) {
109 if (
e->l !=
e->l->radial_next) {
154 if (
e->l !=
e->l->radial_next) {
170 if (l_a->
v ==
l_b->
v) {
185 const bool no_double)
203 if (cd_loop_mdisp_offset != -1) {
207 #ifdef USE_BMESH_HOLES
215 if (cd_loop_mdisp_offset != -1) {
216 float f_dst_center[3];
217 float f_src_center[3];
226 bm, f_new, f_tmp, f_dst_center, f_src_center, cd_loop_mdisp_offset);
236 if (cd_loop_mdisp_offset != -1) {
274 #ifdef USE_BMESH_HOLES
285 for (i = 0; i < n; i++) {
293 for (j = 0; j < 2; j++) {
294 BMEdge *e_iter = (j == 0) ?
e : e_new;
297 if (l_iter->
v == v_new) {
321 const bool join_faces,
322 const bool kill_degenerate_faces,
323 const bool kill_duplicate_faces)
338 const float w[2] = {1.0f - fac, fac};
342 if (l_iter->
v == tv && l_iter->
next->
v == v_kill) {
394 bm, e_kill, v_kill, do_del,
true, kill_degenerate_faces, kill_duplicate_faces);
406 const bool kill_degenerate_faces,
407 const bool kill_duplicate_faces)
426 bm, e_kill, v_kill, do_del,
true, kill_degenerate_faces);
436 bm, e_kill, v_kill, 1.0f, do_del,
false, kill_degenerate_faces, kill_duplicate_faces);
443 BMesh *
bm,
BMEdge *e_kill,
BMVert *v_kill,
const bool do_del,
const bool kill_degenerate_faces)
461 if (cd_loop_mdisp_offset != -1) {
499 if (cd_loop_mdisp_offset != -1) {
504 float f_center_old[3];
508 for (j = 0; j < 2; j++) {
526 bm,
l->
f, oldfaces[i], f_center, f_center_old, cd_loop_mdisp_offset);
529 }
while (
l != e1->
l);
540 for (j = 0; j < 2; j++) {
553 }
while (
l != e1->
l);
569 for (i = 0; i < numcuts; i++) {
570 percent = 1.0f / (
float)(numcuts + 1 - i);
574 r_varr[numcuts - i - 1] = v_new;
599 if (face->
len == 2) {
600 fprintf(
err,
"WARNING: found two-edged face. face ptr: %p\n", face);
608 fprintf(
err,
"Found bmesh edge with identical verts!\n");
609 fprintf(
err,
" edge ptr: %p, vert: %p\n",
l->
e,
l->
e->
v1);
615 for (i = 0; i < face->
len; i++) {
616 for (j = 0; j < face->
len; j++) {
622 fprintf(
err,
"Found duplicate verts in bmesh face!\n");
623 fprintf(
err,
" face ptr: %p, vert: %p\n", face,
verts[i]);
673 if (la->
v == lb->
v) {
681 if (la->
v == lb->
v) {
696 float ed_dir_new_flip[3];
698 float ed_dir_v1_old[3];
699 float ed_dir_v2_old[3];
701 float ed_dir_v1_new[3];
702 float ed_dir_v2_new[3];
757 if (
dot_v3v3(cross_old, cross_new) < 0.0f) {
762 if (
dot_v3v3(cross_old, cross_new) < 0.0f) {
769 if ((
dot_v3v3(ed_dir_new, ed_dir_v1_new) > 0.999f) ||
770 (
dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f)) {
791 char f_active_prev = 0;
870 fb->head.hflag = f_hflag_prev_2;
872 if (f_active_prev == 1) {
875 else if (f_active_prev == 2) {
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const struct CustomData *data, int type)
void CustomData_bmesh_interp(struct CustomData *data, const void **src_blocks, const float *weights, const float *sub_weights, int count, void *dst_block)
A (mainly) macro array library.
#define BLI_array_grow_items(arr, num)
#define BLI_array_append(arr, item)
#define BLI_array_staticdeclare(arr, maxstatic)
#define BLI_array_declare(arr)
#define BLI_array_len(arr)
#define BLI_array_free(arr)
MINLINE float normalize_v3(float r[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
_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.
#define BM_DEFAULT_ITER_STACK_SIZE
void BM_elem_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const void *ele_src, void *ele_dst)
BMFace * BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
Join Connected Faces.
void BM_face_verts_kill(BMesh *bm, BMFace *f)
BMVert * bmesh_kernel_unglue_region_make_vert_multi_isolated(BMesh *bm, BMLoop *l_sep)
void BM_vert_kill(BMesh *bm, BMVert *v)
BMFace * bmesh_kernel_split_face_make_edge(BMesh *bm, BMFace *f, BMLoop *l_v1, BMLoop *l_v2, BMLoop **r_l, BMEdge *e_example, const bool no_double)
Split Face Make Edge (SFME)
void BM_face_kill(BMesh *bm, BMFace *f)
BMEdge * bmesh_kernel_join_edge_kill_vert(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_exists, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Join Edge Kill Vert (JEKV)
BMVert * bmesh_kernel_unglue_region_make_vert(BMesh *bm, BMLoop *l_sep)
Un-glue Region Make Vert (URMV)
BMVert * bmesh_kernel_unglue_region_make_vert_multi(BMesh *bm, BMLoop **larr, int larr_len)
void bmesh_kernel_loop_reverse(BMesh *bm, BMFace *f, const int cd_loop_mdisp_offset, const bool use_loop_mdisp_flip)
Loop Reverse.
BMFace * BM_face_copy(BMesh *bm_dst, BMesh *bm_src, BMFace *f, const bool copy_verts, const bool copy_edges)
BMVert * bmesh_kernel_split_edge_make_vert(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
Split Edge Make Vert (SEMV)
BMVert * bmesh_kernel_join_vert_kill_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_exists, const bool kill_degenerate_faces)
Join Vert Kill Edge (JVKE)
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.
void BM_face_interp_multires_ex(BMesh *bm, BMFace *f_dst, const BMFace *f_src, const float f_dst_center[3], const float f_src_center[3], const int cd_loop_mdisp_offset)
void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f)
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
void BM_data_interp_face_vert_edge(BMesh *bm, const BMVert *v_src_1, const BMVert *UNUSED(v_src_2), BMVert *v, BMEdge *e, const float fac)
void BM_data_interp_from_verts(BMesh *bm, const BMVert *v_src_1, const BMVert *v_src_2, BMVert *v_dst, const float fac)
Data, Interpolate From Verts.
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del)
Faces Join Pair.
void BM_edge_calc_rotate(BMEdge *e, const bool ccw, BMLoop **r_l1, BMLoop **r_l2)
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
BMVert * BM_face_loop_separate_multi_isolated(BMesh *bm, BMLoop *l_sep)
bool BM_disk_dissolve(BMesh *bm, BMVert *v)
BMEdge * BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float fac, const bool do_del, const bool join_faces, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Vert Collapse Faces.
bool BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2)
Check if Edge Rotate Gives Degenerate Faces.
bool BM_vert_dissolve(BMesh *bm, BMVert *v)
Dissolve Vert.
BMVert * BM_face_loop_separate(BMesh *bm, BMLoop *l_sep)
Rip a single face from a vertex fan.
bool BM_edge_rotate_check_beauty(BMEdge *e, BMLoop *l1, BMLoop *l2)
BMEdge * BM_vert_collapse_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces, const bool kill_duplicate_faces)
Vert Collapse Faces.
BMVert * BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts, BMVert **r_varr)
Split an edge multiple times evenly.
bool BM_edge_rotate_check(BMEdge *e)
Check if Rotate Edge is OK.
void BM_edge_verts_swap(BMEdge *e)
BMFace * BM_face_split(BMesh *bm, BMFace *f, BMLoop *l_a, BMLoop *l_b, BMLoop **r_l, BMEdge *example, const bool no_double)
Face Split.
BMFace * BM_face_split_n(BMesh *bm, BMFace *f, BMLoop *l_a, BMLoop *l_b, float cos[][3], int n, BMLoop **r_l, BMEdge *example)
Face Split with intermediate points.
BMVert * BM_edge_collapse(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces)
BMEdge * BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_flag)
Rotate Edge.
BMVert * BM_face_loop_separate_multi(BMesh *bm, BMLoop **larr, int larr_len)
@ BM_EDGEROT_CHECK_EXISTS
@ BM_EDGEROT_CHECK_BEAUTY
@ BM_EDGEROT_CHECK_SPLICE
@ BM_EDGEROT_CHECK_DEGENERATE
bool BM_face_validate(BMFace *face, FILE *err)
void BM_face_normal_flip(BMesh *bm, BMFace *f)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
#define BM_ELEM_API_FLAG_DISABLE(element, f)
#define BM_ELEM_API_FLAG_TEST(element, f)
#define BM_ELEM_API_FLAG_ENABLE(element, f)
int bmesh_disk_count(const BMVert *v)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
int BM_vert_edge_count_at_most(const BMVert *v, const int count_max)
BMLoop * BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v)
Other Loop in Face Sharing a Vertex.
bool BM_vert_is_manifold(const BMVert *v)
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
BMLoop * BM_face_edge_share_loop(BMFace *f, BMEdge *e)
Return the Loop Shared by Face and Edge.
bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BM_vert_face_count_is_equal(v, n)
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_vert_in_edge(const 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 BMLoop * l_b
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()
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SyclQueue void void * src
BLI_INLINE float fb(float length, float L)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
struct BMLoop * radial_next