Blender V5.3
bmesh_polygon_edgenet.cc File Reference
#include <algorithm>
#include "MEM_guardedalloc.h"
#include "BLI_kdopbvh.hh"
#include "BLI_linklist_stack.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_memarena.hh"
#include "BLI_sort_utils.hh"
#include "BLI_utildefines_stack.hh"
#include "BLI_vector.hh"
#include "BKE_customdata.hh"
#include "bmesh.hh"
#include "intern/bmesh_private.hh"

Go to the source code of this file.

Classes

struct  blender::VertOrder
struct  blender::EdgeGroupIsland
struct  blender::Edges_VertVert_BVHTreeTest
struct  blender::Edges_VertRay_BVHTreeTest
struct  blender::EdgeGroup_FindConnection_Args

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_FASTPATH_NOFORK
#define EDGE_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG
#define VERT_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG
#define FOREACH_VERT_EDGE(v_, e_, body_)
#define EDGE_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG
#define VERT_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG
#define VERT_IN_ARRAY   BM_ELEM_INTERNAL_TAG
#define EDGE_IS_NEW   BM_ELEM_SELECT_UV

Face Split Edge-Net

#BM_face_split_edgenet and helper functions.

Note
Don't use #BM_edge_is_wire or #BM_edge_is_boundary since we need to take flagged faces into account. Also take care accessing e->l directly.
#define FACE_NET   _FLAG_WALK
#define EDGE_NET   _FLAG_WALK
#define VERT_VISIT   _FLAG_WALK
#define VERT_IN_QUEUE   _FLAG_WALK_ALT
static uint blender::bm_edge_flagged_radial_count (BMEdge *e)
static BMLoop * blender::bm_edge_flagged_radial_first (BMEdge *e)
static void blender::normalize_v2_m3_v3v3 (float out[2], const float axis_mat[3][3], const float v1[3], const float v2[3])
static bool blender::bm_face_split_edgenet_find_loop_pair (BMVert *v_init, const float face_normal[3], const float face_normal_matrix[3][3], BMEdge *e_pair[2])
static bool blender::bm_face_split_edgenet_find_loop_pair_exists (BMVert *v_init)
static bool blender::bm_face_split_edgenet_find_loop_walk (BMVert *v_init, const float face_normal[3], VertOrder *edge_order, const uint edge_order_len, BMEdge *e_pair[2])
static bool blender::bm_face_split_edgenet_find_loop (BMVert *v_init, const float face_normal[3], const float face_normal_matrix[3][3], VertOrder *edge_order, const uint edge_order_len, BMVert **face_verts, BMEdge **face_edges, int *r_face_verts_len, bool *r_check_face_exists)
bool blender::BM_face_split_edgenet (BMesh *bm, BMFace *f, BMEdge **edge_net, const int edge_net_len, Vector< BMFace * > *r_face_arr)

Face Split Edge-Net Connect Islands

#BM_face_split_edgenet_connect_islands and helper functions.

Connect isolated mesh 'islands' so they form legal regions from which we can create faces.

Intended to be used as a pre-processing step for #BM_face_split_edgenet.

Warning
Currently this risks running out of stack memory (#alloca), likely we'll pass in a memory arena (cleared each use) eventually.
#define USE_PARTIAL_CONNECT
#define VERT_IS_VALID   BM_ELEM_INTERNAL_TAG
#define SORT_AXIS   0
BLI_INLINE bool blender::edge_isect_verts_point_2d (const BMEdge *e, const BMVert *v_a, const BMVert *v_b, float r_isect[2])
BLI_INLINE int blender::axis_pt_cmp (const float pt_a[2], const float pt_b[2])
static int blender::group_min_cmp_fn (const void *p1, const void *p2)
static void blender::bvhtree_test_edges_isect_2d_vert_cb (void *user_data, int index, const BVHTreeRay *, BVHTreeRayHit *hit)
static void blender::bvhtree_test_edges_isect_2d_ray_cb (void *user_data, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static BMEdge * blender::test_edges_isect_2d_vert (const EdgeGroup_FindConnection_Args *args, BMVert *v_origin, BMVert *v_other)
static BMEdge * blender::test_edges_isect_2d_ray (const EdgeGroup_FindConnection_Args *args, BMVert *v_origin, const float dir[3])
static int blender::bm_face_split_edgenet_find_connection (const EdgeGroup_FindConnection_Args *args, BMVert *v_origin, bool direction_sign)
static bool blender::test_tagged_and_notface (BMEdge *e, void *fptr)
static BMVert * blender::bm_face_split_edgenet_partial_connect (BMesh *bm, BMVert *v_delimit, BMFace *f)
static bool blender::bm_vert_partial_connect_check_overlap (const int *remap, const int v_a_index, const int v_b_index)
bool blender::BM_face_split_edgenet_connect_islands (BMesh *bm, BMFace *f, BMEdge **edge_net_init, const uint edge_net_init_len, bool use_partial_connect, MemArena *mem_arena, BMEdge ***r_edge_net_new, uint *r_edge_net_new_len)

Detailed Description

This file contains functions for splitting faces into isolated regions, defined by connected edges.

Definition in file bmesh_polygon_edgenet.cc.

Macro Definition Documentation

◆ EDGE_IS_NEW

#define EDGE_IS_NEW   BM_ELEM_SELECT_UV

◆ EDGE_NET

◆ EDGE_NOT_IN_STACK [1/2]

#define EDGE_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG

◆ EDGE_NOT_IN_STACK [2/2]

#define EDGE_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG

◆ FACE_NET

◆ FOREACH_VERT_EDGE

#define FOREACH_VERT_EDGE ( v_,
e_,
body_ )
Value:
{ \
BMEdge *e_ = v_->e; \
do { \
body_ \
} while ((e_ = BM_DISK_EDGE_NEXT(e_, v_)) != v_->e); \
} \
((void)0)
#define BM_DISK_EDGE_NEXT(e, v)

Referenced by blender::bm_face_split_edgenet_partial_connect().

◆ SORT_AXIS

#define SORT_AXIS   0

◆ USE_FASTPATH_NOFORK

#define USE_FASTPATH_NOFORK

◆ USE_PARTIAL_CONNECT

#define USE_PARTIAL_CONNECT

Definition at line 733 of file bmesh_polygon_edgenet.cc.

◆ VERT_IN_ARRAY

#define VERT_IN_ARRAY   BM_ELEM_INTERNAL_TAG

◆ VERT_IN_QUEUE

#define VERT_IN_QUEUE   _FLAG_WALK_ALT

Definition at line 54 of file bmesh_polygon_edgenet.cc.

Referenced by blender::BM_face_split_edgenet().

◆ VERT_IS_VALID

#define VERT_IS_VALID   BM_ELEM_INTERNAL_TAG

◆ VERT_NOT_IN_STACK [1/2]

#define VERT_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG

◆ VERT_NOT_IN_STACK [2/2]

#define VERT_NOT_IN_STACK   BM_ELEM_INTERNAL_TAG

◆ VERT_VISIT

#define VERT_VISIT   _FLAG_WALK

Definition at line 53 of file bmesh_polygon_edgenet.cc.