|
Blender V4.3
|
#include <climits>#include "MEM_guardedalloc.h"#include "BLI_alloca.h"#include "BLI_linklist.h"#include "BLI_linklist_stack.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "BLI_utildefines_stack.h"#include "bmesh.hh"#include "bmesh_bisect_plane.hh"#include "BLI_strict_flags.h"Go to the source code of this file.
Macros | |
BMesh Element Accessors | |
Wrappers to hide internal data-structure abuse, later we may want to move this into some hash lookup to a separate struct, but for now we can store in BMesh data. | |
| #define | BM_VERT_DIR(v) ((short *)(&(v)->head.index))[0] /* Direction -1/0/1 */ |
| #define | BM_VERT_SKIP(v) ((short *)(&(v)->head.index))[1] /* Skip Vert 0/1 */ |
| #define | BM_VERT_DIST(v) ((v)->no[0]) /* Distance from the plane. */ |
| #define | BM_VERT_SORTVAL(v) ((v)->no[1]) /* Temp value for sorting. */ |
| #define | BM_VERT_LOOPINDEX(v) |
Functions | |
Math Functions | |
| static short | plane_point_test_v3 (const float plane[4], const float co[3], const float eps, float *r_depth) |
BMesh Flag Accessors | |
Hide flag access (for more readable code since same flag is used differently for vert/edge-face). | |
| BLI_INLINE void | vert_is_center_enable (BMVert *v) |
| BLI_INLINE void | vert_is_center_disable (BMVert *v) |
| BLI_INLINE bool | vert_is_center_test (BMVert *v) |
| BLI_INLINE bool | vert_pair_adjacent_in_orig_face (BMVert *v_a, BMVert *v_b, const uint f_len_orig) |
| BLI_INLINE void | edge_is_cut_enable (BMEdge *e) |
| BLI_INLINE void | edge_is_cut_disable (BMEdge *e) |
| BLI_INLINE bool | edge_is_cut_test (BMEdge *e) |
| BLI_INLINE void | face_in_stack_enable (BMFace *f) |
| BLI_INLINE void | face_in_stack_disable (BMFace *f) |
| BLI_INLINE bool | face_in_stack_test (BMFace *f) |
BMesh Face Bisect | |
| static int | bm_vert_sortval_cb (const void *v_a_v, const void *v_b_v) |
| static void | bm_face_bisect_verts (BMesh *bm, BMFace *f, const float plane[4], const short oflag_center, const short oflag_new) |
Public BMesh Bisect Function | |
| void | BM_mesh_bisect_plane (BMesh *bm, const float plane[4], const bool use_snap_center, const bool use_tag, const short oflag_center, const short oflag_new, const float eps) |
Cut the geometry in half using a plane.
Definition in file bmesh_bisect_plane.cc.
Definition at line 66 of file bmesh_bisect_plane.cc.
Referenced by bm_face_bisect_verts(), and BM_mesh_bisect_plane().
Definition at line 68 of file bmesh_bisect_plane.cc.
Referenced by BM_mesh_bisect_plane().
Definition at line 70 of file bmesh_bisect_plane.cc.
Referenced by bm_face_bisect_verts(), and vert_pair_adjacent_in_orig_face().
Definition at line 67 of file bmesh_bisect_plane.cc.
Referenced by bm_face_bisect_verts().
Definition at line 69 of file bmesh_bisect_plane.cc.
Referenced by bm_face_bisect_verts(), and bm_vert_sortval_cb().
|
static |
Definition at line 150 of file bmesh_bisect_plane.cc.
References BLI_array_alloca, BLI_assert, bm, BM_FACE_FIRST_LOOP, BM_face_is_normal_valid(), BM_face_split(), BM_face_vert_share_loop(), BM_loop_is_adjacent(), BM_VERT_DIR, BM_VERT_LOOPINDEX, BM_VERT_SKIP, BM_VERT_SORTVAL, bm_vert_sortval_cb(), BMO_edge_flag_enable, BMO_face_flag_enable, BMVert::co, cross_v3_v3v3(), dot_v3v3(), BMLoop::e, equals_v3v3(), BMLoop::f, is_inside(), l_b, BMFace::len, LIKELY, BMLoop::next, BMFace::no, normalize_v3(), BMLoop::prev, STACK_DECLARE, STACK_INIT, STACK_PUSH, STACK_SIZE, sub_v3_v3v3(), UNLIKELY, BMLoop::v, v, vert_is_center_test(), and vert_pair_adjacent_in_orig_face().
Referenced by BM_mesh_bisect_plane().
| void BM_mesh_bisect_plane | ( | BMesh * | bm, |
| const float | plane[4], | ||
| bool | use_snap_center, | ||
| bool | use_tag, | ||
| short | oflag_center, | ||
| short | oflag_new, | ||
| float | eps ) |
| use_snap_center | Snap verts onto the plane. |
| use_tag | Only bisect tagged edges and faces. |
| oflag_center | Operator flag, enabled for geometry on the axis (existing and created) |
Definition at line 388 of file bmesh_bisect_plane.cc.
References BLI_LINKSTACK_DECLARE, BLI_LINKSTACK_FREE, BLI_LINKSTACK_INIT, BLI_LINKSTACK_POP, BLI_LINKSTACK_PUSH, bm, BM_edge_split(), BM_EDGES_OF_MESH, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, bm_face_bisect_verts(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_VERT, BM_mesh_elem_hflag_disable_all(), BM_VERT, BM_VERT_DIR, BM_VERT_DIST, BM_VERTS_OF_EDGE, BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_vert_flag_enable, closest_to_plane_v3(), BMVert::co, e, edge_is_cut_enable(), edge_is_cut_test(), BMesh::elem_index_dirty, eps, BMLoop::f, face_in_stack_disable(), face_in_stack_enable(), face_in_stack_test(), MEM_freeN(), MEM_mallocN, plane_point_test_v3(), BMLoop::radial_next, BMesh::totedge, v, vert_is_center_disable(), vert_is_center_enable(), and vert_is_center_test().
Referenced by BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), and bmo_bisect_plane_exec().
|
static |
Definition at line 136 of file bmesh_bisect_plane.cc.
References BM_VERT_SORTVAL.
Referenced by bm_face_bisect_verts().
| BLI_INLINE void edge_is_cut_disable | ( | BMEdge * | e | ) |
Definition at line 107 of file bmesh_bisect_plane.cc.
References BM_elem_flag_disable, BM_ELEM_TAG, and e.
| BLI_INLINE void edge_is_cut_enable | ( | BMEdge * | e | ) |
Enable when the edge can be cut.
Definition at line 103 of file bmesh_bisect_plane.cc.
References BM_elem_flag_enable, BM_ELEM_TAG, and e.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE bool edge_is_cut_test | ( | BMEdge * | e | ) |
Definition at line 111 of file bmesh_bisect_plane.cc.
References BM_elem_flag_test, BM_ELEM_TAG, and e.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE void face_in_stack_disable | ( | BMFace * | f | ) |
Definition at line 121 of file bmesh_bisect_plane.cc.
References BM_elem_flag_enable, and BM_ELEM_TAG.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE void face_in_stack_enable | ( | BMFace * | f | ) |
Enable when the faces are added to the stack.
Definition at line 117 of file bmesh_bisect_plane.cc.
References BM_elem_flag_disable, and BM_ELEM_TAG.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE bool face_in_stack_test | ( | BMFace * | f | ) |
Definition at line 125 of file bmesh_bisect_plane.cc.
References BM_elem_flag_test, and BM_ELEM_TAG.
Referenced by BM_mesh_bisect_plane().
|
static |
Definition at line 39 of file bmesh_bisect_plane.cc.
References eps, and plane_point_side_v3().
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE void vert_is_center_disable | ( | BMVert * | v | ) |
Definition at line 87 of file bmesh_bisect_plane.cc.
References BM_elem_flag_disable, BM_ELEM_TAG, and v.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE void vert_is_center_enable | ( | BMVert * | v | ) |
Enable when vertex is in the center and its faces have been added to the stack.
Definition at line 83 of file bmesh_bisect_plane.cc.
References BM_elem_flag_enable, BM_ELEM_TAG, and v.
Referenced by BM_mesh_bisect_plane().
| BLI_INLINE bool vert_is_center_test | ( | BMVert * | v | ) |
Definition at line 91 of file bmesh_bisect_plane.cc.
References BM_elem_flag_test, BM_ELEM_TAG, and v.
Referenced by bm_face_bisect_verts(), and BM_mesh_bisect_plane().
| BLI_INLINE bool vert_pair_adjacent_in_orig_face | ( | BMVert * | v_a, |
| BMVert * | v_b, | ||
| const uint | f_len_orig ) |
Definition at line 96 of file bmesh_bisect_plane.cc.
References abs(), BM_VERT_LOOPINDEX, and ELEM.
Referenced by bm_face_bisect_verts().