Blender  V3.3
Macros | Functions
bmo_bridge.c File Reference
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"

Go to the source code of this file.

Macros

#define EDGE_MARK   4
 
#define EDGE_OUT   8
 
#define FACE_OUT   16
 

Functions

static void bm_bridge_splice_loops (BMesh *bm, LinkData *el_a, LinkData *el_b, const float merge_factor)
 
static void bm_vert_loop_pair (BMesh *bm, BMVert *v1, BMVert *v2, BMLoop **l1, BMLoop **l2)
 
static float bm_edgeloop_offset_length (LinkData *el_a, LinkData *el_b, LinkData *el_b_first, const float len_max)
 
static void bm_bridge_best_rotation (struct BMEdgeLoopStore *el_store_a, struct BMEdgeLoopStore *el_store_b)
 
static void bm_face_edges_tag_out (BMesh *bm, BMFace *f)
 
static bool bm_edge_test_cb (BMEdge *e, void *bm_v)
 
static void bridge_loop_pair (BMesh *bm, struct BMEdgeLoopStore *el_store_a, struct BMEdgeLoopStore *el_store_b, const bool use_merge, const float merge_factor, const int twist_offset)
 
void bmo_bridge_loops_exec (BMesh *bm, BMOperator *op)
 

Detailed Description

Connect verts across faces (splits faces) and bridge tool.

Definition in file bmo_bridge.c.

Macro Definition Documentation

◆ EDGE_MARK

#define EDGE_MARK   4

Definition at line 17 of file bmo_bridge.c.

◆ EDGE_OUT

#define EDGE_OUT   8

Definition at line 18 of file bmo_bridge.c.

◆ FACE_OUT

#define FACE_OUT   16

Definition at line 19 of file bmo_bridge.c.

Function Documentation

◆ bm_bridge_best_rotation()

static void bm_bridge_best_rotation ( struct BMEdgeLoopStore el_store_a,
struct BMEdgeLoopStore el_store_b 
)
static

◆ bm_bridge_splice_loops()

static void bm_bridge_splice_loops ( BMesh bm,
LinkData el_a,
LinkData el_b,
const float  merge_factor 
)
static

◆ bm_edge_test_cb()

static bool bm_edge_test_cb ( BMEdge e,
void bm_v 
)
static

Definition at line 120 of file bmo_bridge.c.

References BMO_edge_flag_test, e, and EDGE_MARK.

Referenced by bmo_bridge_loops_exec().

◆ bm_edgeloop_offset_length()

static float bm_edgeloop_offset_length ( LinkData el_a,
LinkData el_b,
LinkData el_b_first,
const float  len_max 
)
static

Definition at line 72 of file bmo_bridge.c.

References BLI_assert, LinkData::data, len, len_v3v3(), LinkData::next, NULL, and LinkData::prev.

Referenced by bm_bridge_best_rotation().

◆ bm_face_edges_tag_out()

static void bm_face_edges_tag_out ( BMesh bm,
BMFace f 
)
static

Definition at line 111 of file bmo_bridge.c.

References bm, BM_FACE_FIRST_LOOP, BMO_edge_flag_enable, BMLoop::e, EDGE_OUT, and BMLoop::next.

Referenced by bridge_loop_pair().

◆ bm_vert_loop_pair()

static void bm_vert_loop_pair ( BMesh bm,
BMVert v1,
BMVert v2,
BMLoop **  l1,
BMLoop **  l2 
)
static

Definition at line 49 of file bmo_bridge.c.

References bm, BM_edge_exists(), BM_iter_at_index(), BM_LOOPS_OF_VERT, e, l, BMLoop::next, BMLoop::v, v1, and v2.

Referenced by bridge_loop_pair().

◆ bmo_bridge_loops_exec()

void bmo_bridge_loops_exec ( BMesh bm,
BMOperator op 
)

◆ bridge_loop_pair()

static void bridge_loop_pair ( BMesh bm,
struct BMEdgeLoopStore el_store_a,
struct BMEdgeLoopStore el_store_b,
const bool  use_merge,
const float  merge_factor,
const int  twist_offset 
)
static

This is a corner case:

 (loop a)    (loop b)
+--------+  +--------+

When loops are aligned to the direction between the loops values of 'dir_a/b' is degenerate, in this case compare the original directions (before they were corrected by 'el_dir'), see: T43013

Definition at line 125 of file bmo_bridge.c.

References add_v3_v3v3(), BLI_assert, BLI_listbase_rotate_first(), BLI_rfindlink(), bm, bm_bridge_best_rotation(), bm_bridge_splice_loops(), BM_CREATE_NOP, BM_EDGE, BM_edge_exists(), BM_edge_is_boundary(), BM_EDGELINK_NEXT, BM_edgeloop_calc_normal(), BM_edgeloop_calc_normal_aligned(), BM_edgeloop_center_get(), BM_edgeloop_copy(), BM_edgeloop_expand(), BM_edgeloop_flip(), BM_edgeloop_free(), BM_edgeloop_is_closed(), BM_edgeloop_length_get(), BM_edgeloop_normal_get(), BM_edgeloop_verts_get(), BM_elem_attrs_copy(), BM_elem_flag_enable, BM_elem_flag_set, BM_ELEM_TAG, BM_FACE, BM_face_create_verts(), bm_face_edges_tag_out(), BM_face_exists(), BM_FACE_FIRST_LOOP, BM_face_normal_update(), BM_iter_at_index(), BM_LOOPS_OF_VERT, BM_mesh_elem_hflag_disable_all(), bm_vert_loop_pair(), BMO_edge_flag_disable, BMO_face_flag_enable, BMO_ITER, BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_hflag_enable(), cross_v3_v3v3(), LinkData::data, dot_v3v3(), e, EDGE_OUT, ELEM, eps, BMLoop::f, fabsf, FACE_OUT, ListBase::first, is_zero_v3(), l_b, ListBase::last, len_squared_v3(), LIKELY, mod_i(), BMLoop::next, LinkData::next, normalize_v3_v3(), NULL, op_sub(), sub_v3_v3v3(), SWAP, BMesh::totface, and UNLIKELY.

Referenced by bmo_bridge_loops_exec().