Blender V4.3
bmesh_path.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_heap_simple.h"
#include "BLI_linklist.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "bmesh.hh"
#include "bmesh_path.hh"

Go to the source code of this file.

Macros

#define COST_INIT_MAX   FLT_MAX
 

Functions

Generic Helpers
static float step_cost_3_v3_ex (const float v1[3], const float v2[3], const float v3[3], bool skip_12, bool skip_23)
 
static float step_cost_3_v3 (const float v1[3], const float v2[3], const float v3[3])
 
BM_mesh_calc_path_vert
static void verttag_add_adjacent (HeapSimple *heap, BMVert *v_a, BMVert **verts_prev, float *cost, const BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_vert (BMesh *bm, BMVert *v_src, BMVert *v_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMVert *, void *user_data), void *user_data)
 
BM_mesh_calc_path_edge
static float edgetag_cut_cost_vert (BMEdge *e_a, BMEdge *e_b, BMVert *v)
 
static float edgetag_cut_cost_face (BMEdge *e_a, BMEdge *e_b, BMFace *f)
 
static void edgetag_add_adjacent (HeapSimple *heap, BMEdge *e_a, BMEdge **edges_prev, float *cost, const BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_edge (BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMEdge *, void *user_data), void *user_data)
 
BM_mesh_calc_path_face
static float facetag_cut_cost_edge (BMFace *f_a, BMFace *f_b, BMEdge *e, const void *const f_endpoints[2])
 
static float facetag_cut_cost_vert (BMFace *f_a, BMFace *f_b, BMVert *v, const void *const f_endpoints[2])
 
static void facetag_add_adjacent (HeapSimple *heap, BMFace *f_a, BMFace **faces_prev, float *cost, const void *const f_endpoints[2], const BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_face (BMesh *bm, BMFace *f_src, BMFace *f_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMFace *, void *user_data), void *user_data)
 

Detailed Description

Find a path between 2 elements.

Note
All 3 functions are similar, changes to one most likely apply to another.

Definition in file bmesh_path.cc.

Macro Definition Documentation

◆ COST_INIT_MAX

#define COST_INIT_MAX   FLT_MAX

Function Documentation

◆ BM_mesh_calc_path_edge()

◆ BM_mesh_calc_path_face()

◆ BM_mesh_calc_path_vert()

◆ edgetag_add_adjacent()

◆ edgetag_cut_cost_face()

static float edgetag_cut_cost_face ( BMEdge * e_a,
BMEdge * e_b,
BMFace * f )
static

◆ edgetag_cut_cost_vert()

static float edgetag_cut_cost_vert ( BMEdge * e_a,
BMEdge * e_b,
BMVert * v )
static

Definition at line 198 of file bmesh_path.cc.

References BM_edge_other_vert(), BMVert::co, step_cost_3_v3(), v, and v2.

Referenced by edgetag_add_adjacent().

◆ facetag_add_adjacent()

static void facetag_add_adjacent ( HeapSimple * heap,
BMFace * f_a,
BMFace ** faces_prev,
float * cost,
const void *const f_endpoints[2],
const BMCalcPathParams * params )
static

◆ facetag_cut_cost_edge()

static float facetag_cut_cost_edge ( BMFace * f_a,
BMFace * f_b,
BMEdge * e,
const void *const f_endpoints[2] )
static

◆ facetag_cut_cost_vert()

static float facetag_cut_cost_vert ( BMFace * f_a,
BMFace * f_b,
BMVert * v,
const void *const f_endpoints[2] )
static

Definition at line 413 of file bmesh_path.cc.

References BM_face_calc_center_median_weighted(), BMVert::co, step_cost_3_v3_ex(), and v.

Referenced by facetag_add_adjacent().

◆ step_cost_3_v3()

static float step_cost_3_v3 ( const float v1[3],
const float v2[3],
const float v3[3] )
static

Definition at line 49 of file bmesh_path.cc.

References step_cost_3_v3_ex(), and v2.

Referenced by edgetag_cut_cost_face(), and edgetag_cut_cost_vert().

◆ step_cost_3_v3_ex()

static float step_cost_3_v3_ex ( const float v1[3],
const float v2[3],
const float v3[3],
bool skip_12,
bool skip_23 )
static

Use skip options when we want to start measuring from a boundary.

Definition at line 32 of file bmesh_path.cc.

References dot_v3v3(), fabsf, normalize_v3(), sqrtf, sub_v3_v3v3(), and v2.

Referenced by facetag_cut_cost_edge(), facetag_cut_cost_vert(), and step_cost_3_v3().

◆ verttag_add_adjacent()

static void verttag_add_adjacent ( HeapSimple * heap,
BMVert * v_a,
BMVert ** verts_prev,
float * cost,
const BMCalcPathParams * params )
static