Blender  V3.3
Macros
bmesh_path.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_heap_simple.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "bmesh.h"
#include "bmesh_path.h"

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 struct BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_vert (BMesh *bm, BMVert *v_src, BMVert *v_dst, const struct 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 struct BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_edge (BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const struct 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 struct BMCalcPathParams *params)
 
LinkNodeBM_mesh_calc_path_face (BMesh *bm, BMFace *f_src, BMFace *f_dst, const struct 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.c.

Macro Definition Documentation

◆ COST_INIT_MAX

#define COST_INIT_MAX   FLT_MAX

Definition at line 20 of file bmesh_path.c.

Function Documentation

◆ BM_mesh_calc_path_edge()

LinkNode* BM_mesh_calc_path_edge ( BMesh bm,
BMEdge e_src,
BMEdge e_dst,
const struct BMCalcPathParams params,
bool(*)(BMEdge *, void *user_data filter_fn,
void user_data 
)

◆ BM_mesh_calc_path_face()

LinkNode* BM_mesh_calc_path_face ( BMesh bm,
BMFace f_src,
BMFace f_dst,
const struct BMCalcPathParams params,
bool(*)(BMFace *, void *user_data filter_fn,
void user_data 
)

◆ BM_mesh_calc_path_vert()

LinkNode* BM_mesh_calc_path_vert ( BMesh bm,
BMVert v_src,
BMVert v_dst,
const struct BMCalcPathParams params,
bool(*)(BMVert *, void *user_data filter_fn,
void user_data 
)

◆ edgetag_add_adjacent()

static void edgetag_add_adjacent ( HeapSimple heap,
BMEdge e_a,
BMEdge **  edges_prev,
float cost,
const struct BMCalcPathParams params 
)
static

◆ 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 195 of file bmesh_path.c.

References BM_edge_other_vert(), BMVert::co, step_cost_3_v3(), v, v1, 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 struct 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 410 of file bmesh_path.c.

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 46 of file bmesh_path.c.

References step_cost_3_v3_ex(), v1, 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 29 of file bmesh_path.c.

References dot_v3v3(), fabsf, normalize_v3(), sqrtf, sub_v3_v3v3(), v1, 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 struct BMCalcPathParams params 
)
static