Blender  V3.3
Classes | Macros | Typedefs | Functions
bmesh_edgeloop.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_mempool.h"
#include "BLI_stack.h"
#include "BLI_utildefines_iter.h"
#include "bmesh.h"
#include "bmesh_edgeloop.h"

Go to the source code of this file.

Classes

struct  BMEdgeLoopStore
 
struct  VertStep
 

Macros

#define BM_EDGELOOP_IS_CLOSED   (1 << 0)
 
#define EDGELOOP_EPS   1e-10f
 
#define NODE_AS_V(n)   ((BMVert *)((LinkData *)n)->data)
 
#define NODE_AS_CO(n)   ((BMVert *)((LinkData *)n)->data)->co
 
#define EDGE_SPLIT(node_copy, node_other)
 

Typedefs

typedef struct BMEdgeLoopStore BMEdgeLoopStore
 

Functions

static int bm_vert_other_tag (BMVert *v, BMVert *v_prev, BMEdge **r_e)
 
static bool bm_loop_build (BMEdgeLoopStore *el_store, BMVert *v_prev, BMVert *v, int dir)
 
int BM_mesh_edgeloops_find (BMesh *bm, ListBase *r_eloops, bool(*test_fn)(BMEdge *, void *user_data), void *user_data)
 
static void vs_add (BLI_mempool *vs_pool, ListBase *lb, BMVert *v, BMEdge *e_prev, const int iter_tot)
 
static bool bm_loop_path_build_step (BLI_mempool *vs_pool, ListBase *lb, const int dir, BMVert *v_match[2])
 
bool BM_mesh_edgeloops_find_path (BMesh *bm, ListBase *r_eloops, bool(*test_fn)(BMEdge *, void *user_data), void *user_data, BMVert *v_src, BMVert *v_dst)
 
void BM_mesh_edgeloops_free (ListBase *eloops)
 
void BM_mesh_edgeloops_calc_center (BMesh *bm, ListBase *eloops)
 
void BM_mesh_edgeloops_calc_normal (BMesh *bm, ListBase *eloops)
 
void BM_mesh_edgeloops_calc_normal_aligned (BMesh *bm, ListBase *eloops, const float no_align[3])
 
void BM_mesh_edgeloops_calc_order (BMesh *UNUSED(bm), ListBase *eloops, const bool use_normals)
 
BMEdgeLoopStoreBM_edgeloop_copy (BMEdgeLoopStore *el_store)
 
BMEdgeLoopStoreBM_edgeloop_from_verts (BMVert **v_arr, const int v_arr_tot, bool is_closed)
 
void BM_edgeloop_free (BMEdgeLoopStore *el_store)
 
bool BM_edgeloop_is_closed (BMEdgeLoopStore *el_store)
 
ListBaseBM_edgeloop_verts_get (BMEdgeLoopStore *el_store)
 
int BM_edgeloop_length_get (BMEdgeLoopStore *el_store)
 
const floatBM_edgeloop_normal_get (struct BMEdgeLoopStore *el_store)
 
const floatBM_edgeloop_center_get (struct BMEdgeLoopStore *el_store)
 
void BM_edgeloop_edges_get (struct BMEdgeLoopStore *el_store, BMEdge **e_arr)
 
void BM_edgeloop_calc_center (BMesh *UNUSED(bm), BMEdgeLoopStore *el_store)
 
bool BM_edgeloop_calc_normal (BMesh *UNUSED(bm), BMEdgeLoopStore *el_store)
 
bool BM_edgeloop_calc_normal_aligned (BMesh *UNUSED(bm), BMEdgeLoopStore *el_store, const float no_align[3])
 
void BM_edgeloop_flip (BMesh *UNUSED(bm), BMEdgeLoopStore *el_store)
 
void BM_edgeloop_expand (BMesh *bm, BMEdgeLoopStore *el_store, int el_store_len, bool split, GSet *split_edges)
 
bool BM_edgeloop_overlap_check (struct BMEdgeLoopStore *el_store_a, struct BMEdgeLoopStore *el_store_b)
 

Detailed Description

Generic utility functions for getting edge loops from a mesh.

Definition in file bmesh_edgeloop.c.

Macro Definition Documentation

◆ BM_EDGELOOP_IS_CLOSED

#define BM_EDGELOOP_IS_CLOSED   (1 << 0)

Definition at line 31 of file bmesh_edgeloop.c.

◆ EDGE_SPLIT

#define EDGE_SPLIT (   node_copy,
  node_other 
)
Value:
{ \
BMVert *v_split, *v_other = (node_other)->data; \
BMEdge *e_split, *e_other = BM_edge_exists((node_copy)->data, v_other); \
v_split = BM_edge_split( \
bm, e_other, split_swap ? (node_copy)->data : v_other, &e_split, 0.0f); \
v_split->e = e_split; \
BLI_assert(v_split == e_split->v2); \
BLI_gset_insert(split_edges, e_split); \
(node_copy)->data = v_split; \
} \
((void)0)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
Definition: bmesh_mods.c:448
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
Definition: bmesh_query.c:1553
SyclQueue void void size_t num_bytes void
bNode * node_copy(bNodeTree *dst_tree, const bNode &src_node, const int flag, const bool unique_name)
Definition: node.cc:2274

◆ EDGELOOP_EPS

#define EDGELOOP_EPS   1e-10f

Definition at line 34 of file bmesh_edgeloop.c.

◆ NODE_AS_CO

#define NODE_AS_CO (   n)    ((BMVert *)((LinkData *)n)->data)->co

Definition at line 546 of file bmesh_edgeloop.c.

◆ NODE_AS_V

#define NODE_AS_V (   n)    ((BMVert *)((LinkData *)n)->data)

Definition at line 545 of file bmesh_edgeloop.c.

Typedef Documentation

◆ BMEdgeLoopStore

Function Documentation

◆ BM_edgeloop_calc_center()

void BM_edgeloop_calc_center ( BMesh UNUSEDbm,
BMEdgeLoopStore el_store 
)

◆ BM_edgeloop_calc_normal()

bool BM_edgeloop_calc_normal ( BMesh UNUSEDbm,
BMEdgeLoopStore el_store 
)

◆ BM_edgeloop_calc_normal_aligned()

bool BM_edgeloop_calc_normal_aligned ( BMesh UNUSEDbm,
BMEdgeLoopStore el_store,
const float  no_align[3] 
)

◆ BM_edgeloop_center_get()

const float* BM_edgeloop_center_get ( struct BMEdgeLoopStore el_store)

Definition at line 540 of file bmesh_edgeloop.c.

References BMEdgeLoopStore::co.

Referenced by bm_edgering_pair_interpolate(), and bridge_loop_pair().

◆ BM_edgeloop_copy()

BMEdgeLoopStore* BM_edgeloop_copy ( struct BMEdgeLoopStore el_store)

Copy a single edge-loop.

Returns
new edge-loops.

Definition at line 490 of file bmesh_edgeloop.c.

References BLI_duplicatelist(), MEM_mallocN, and BMEdgeLoopStore::verts.

Referenced by bridge_loop_pair().

◆ BM_edgeloop_edges_get()

void BM_edgeloop_edges_get ( struct BMEdgeLoopStore el_store,
BMEdge **  e_arr 
)

◆ BM_edgeloop_expand()

void BM_edgeloop_expand ( BMesh bm,
BMEdgeLoopStore el_store,
int  el_store_len,
bool  split,
GSet split_edges 
)

◆ BM_edgeloop_flip()

void BM_edgeloop_flip ( BMesh UNUSEDbm,
BMEdgeLoopStore el_store 
)

◆ BM_edgeloop_free()

void BM_edgeloop_free ( BMEdgeLoopStore el_store)

◆ BM_edgeloop_from_verts()

BMEdgeLoopStore* BM_edgeloop_from_verts ( BMVert **  v_arr,
const int  v_arr_tot,
bool  is_closed 
)

◆ BM_edgeloop_is_closed()

bool BM_edgeloop_is_closed ( BMEdgeLoopStore el_store)

◆ BM_edgeloop_length_get()

int BM_edgeloop_length_get ( BMEdgeLoopStore el_store)

◆ BM_edgeloop_normal_get()

const float* BM_edgeloop_normal_get ( struct BMEdgeLoopStore el_store)

Definition at line 535 of file bmesh_edgeloop.c.

References BMEdgeLoopStore::no.

Referenced by bm_edgering_pair_interpolate(), and bridge_loop_pair().

◆ BM_edgeloop_overlap_check()

bool BM_edgeloop_overlap_check ( struct BMEdgeLoopStore el_store_a,
struct BMEdgeLoopStore el_store_b 
)

◆ BM_edgeloop_verts_get()

ListBase* BM_edgeloop_verts_get ( BMEdgeLoopStore el_store)

◆ bm_loop_build()

static bool bm_loop_build ( BMEdgeLoopStore el_store,
BMVert v_prev,
BMVert v,
int  dir 
)
static

◆ bm_loop_path_build_step()

static bool bm_loop_path_build_step ( BLI_mempool vs_pool,
ListBase lb,
const int  dir,
BMVert v_match[2] 
)
static

◆ BM_mesh_edgeloops_calc_center()

void BM_mesh_edgeloops_calc_center ( BMesh bm,
ListBase eloops 
)

Definition at line 396 of file bmesh_edgeloop.c.

References bm, BM_edgeloop_calc_center(), ListBase::first, and BMEdgeLoopStore::next.

Referenced by bmo_bridge_loops_exec().

◆ BM_mesh_edgeloops_calc_normal()

void BM_mesh_edgeloops_calc_normal ( BMesh bm,
ListBase eloops 
)

Definition at line 404 of file bmesh_edgeloop.c.

References bm, BM_edgeloop_calc_normal(), ListBase::first, and BMEdgeLoopStore::next.

Referenced by bmo_bridge_loops_exec().

◆ BM_mesh_edgeloops_calc_normal_aligned()

void BM_mesh_edgeloops_calc_normal_aligned ( BMesh bm,
ListBase eloops,
const float  no_align[3] 
)

◆ BM_mesh_edgeloops_calc_order()

void BM_mesh_edgeloops_calc_order ( BMesh UNUSEDbm,
ListBase eloops,
const bool  use_normals 
)

◆ BM_mesh_edgeloops_find()

int BM_mesh_edgeloops_find ( BMesh bm,
struct ListBase r_eloops,
bool(*)(BMEdge *, void *user_data test_fn,
void user_data 
)

◆ BM_mesh_edgeloops_find_path()

bool BM_mesh_edgeloops_find_path ( BMesh bm,
ListBase r_eloops,
bool(*)(BMEdge *, void *user_data test_fn,
void user_data,
BMVert v_src,
BMVert v_dst 
)

◆ BM_mesh_edgeloops_free()

void BM_mesh_edgeloops_free ( ListBase eloops)

◆ bm_vert_other_tag()

static int bm_vert_other_tag ( BMVert v,
BMVert v_prev,
BMEdge **  r_e 
)
static

◆ vs_add()

static void vs_add ( BLI_mempool vs_pool,
ListBase lb,
BMVert v,
BMEdge e_prev,
const int  iter_tot 
)
static