41 bm, quad_method, ngon_method, 4,
true, op, slot_facemap_out, slot_facemap_double_out);
64 bool calc_winding =
false;
82 for (i = 0; i < 2; i++) {
85 sf_vert->
tmp.p = e_verts[i];
93 nors_tot = sf_vert_map.
size();
101 bool is_degenerate =
true;
105 for (sf_vert = sf_ctx.
fillvertbase.first(), i = 0; sf_vert; sf_vert = sf_vert->
next, i++) {
111 nors[i].
value = -1.0f;
122 e_pair[e_index++] =
e;
127 float dir_a[3], dir_b[3];
129 is_degenerate =
false;
144 if (is_degenerate) [[unlikely]] {
152 for (i = 0; i < nors_tot; i++) {
153 if (nors[i].value == -1.0f) [[unlikely]] {
156 if (
dot_v3v3(normal, nors[i].no) < 0.0f) {
167 calc_winding =
false;
180 int winding_votes = 0;
187 for (i = 0, i_prev = 2; i < 3; i_prev = i++) {
190 winding_votes += (
e->l->v == v_tri[i]) ? 1 : -1;
195 if (winding_votes < 0) {
197 std::swap(sf_tri.
v2, sf_tri.
v3);
253 if (f_double) [[unlikely]] {
279 else if (
e->l ==
nullptr) {
These structs are the foundation for all linked lists in the library system.
Read Blender memory allocation and freeing.
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype)
#define BMO_edge_flag_test(bm, e, oflag)
#define BMO_edge_flag_enable(bm, e, oflag)
#define BMO_face_flag_enable(bm, e, oflag)
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
#define BMO_face_flag_test(bm, e, oflag)
Value & lookup_or_add_cb(const Key &key, const CreateValueF &create_value)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
int BMO_slot_buffer_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag, bool do_flush)
BMO_FLAG_BUFFER.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
BMO_FLAG_BUFFER.
void BLI_scanfill_end(ScanFillContext *sf_ctx)
@ BLI_SCANFILL_CALC_LOOSE
@ BLI_SCANFILL_CALC_POLYS
@ BLI_SCANFILL_CALC_HOLES
bool BMO_op_initf(BMesh *bm, BMOperator *op, int flag, const char *fmt,...)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
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.
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void BM_edge_kill(BMesh *bm, BMEdge *e)
void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3])
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
struct ScanFillVert * BLI_scanfill_vert_add(ScanFillContext *sf_ctx, const float vec[3])
int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_)
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
void BLI_scanfill_begin(ScanFillContext *sf_ctx)
MINLINE void negate_v3(float r[3])
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct ScanFillEdge * BLI_scanfill_edge_add(ScanFillContext *sf_ctx, struct ScanFillVert *v1, struct ScanFillVert *v2)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
MINLINE float normalize_v3(float n[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void BM_face_kill(BMesh *bm, BMFace *f)
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, int flag, const float nor_proj[3])
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del, BMFace **r_double)
Faces Join Pair.
void BM_mesh_triangulate(BMesh *bm, const int quad_method, const int ngon_method, const int min_vertices, const bool tag_only, BMOperator *op, BMOpSlot *slot_facemap_out, BMOpSlot *slot_facemap_double_out)
void BMO_op_finish(BMesh *bm, BMOperator *op)
BMESH OPSTACK FINISH OP.
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
ListBaseT< ScanFillFace > fillfacebase
ListBaseT< ScanFillVert > fillvertbase
struct ScanFillVert * next
union blender::ScanFillVert::@124355022001164321030006076112165043115032300246 tmp