Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "BLI_buffer.h"
#include "BLI_linklist_stack.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_stack.h"
#include "BKE_context.h"
#include "BKE_editmesh.h"
#include "BKE_editmesh_bvh.h"
#include "BKE_layer.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "intern/bmesh_private.h"
#include "mesh_intern.h"
#include "tools/bmesh_boolean.h"
#include "tools/bmesh_intersect.h"
#include "tools/bmesh_separate.h"
Go to the source code of this file.
Classes | |
struct | LinkBase |
Macros | |
#define | USE_NET_ISLAND_CONNECT |
Functions | |
static int | bm_face_isect_self (BMFace *f, void *UNUSED(user_data)) |
static int | bm_face_isect_pair (BMFace *f, void *UNUSED(user_data)) |
static int | bm_face_isect_pair_swap (BMFace *f, void *UNUSED(user_data)) |
static void | edbm_intersect_select (BMEditMesh *em, struct Mesh *me, bool do_select) |
Boolean Intersect | |
| |
static int | edbm_intersect_boolean_exec (bContext *C, wmOperator *op) |
static void | edbm_intersect_boolean_ui (bContext *UNUSED(C), wmOperator *op) |
void | MESH_OT_intersect_boolean (struct wmOperatorType *ot) |
Face Split by Edges | |
static void | bm_face_split_by_edges (BMesh *bm, BMFace *f, const char hflag, BLI_Buffer *edge_net_temp_buf) |
static bool | bm_vert_in_faces_radial (BMVert *v, BMEdge *e_radial, BMFace *f_ignore) |
static void | ghash_insert_face_edge_link (GHash *gh, BMFace *f_key, BMEdge *e_val, MemArena *mem_arena) |
static int | bm_edge_sort_length_cb (const void *e_a_v, const void *e_b_v) |
static void | bm_face_split_by_edges_island_connect (BMesh *bm, BMFace *f, LinkNode *e_link, const int e_link_len, MemArena *mem_arena_edgenet) |
static BMEdge * | bm_face_split_edge_find (BMEdge *e_a, BMFace *f_a, BMVert *v_pivot, BMFace **ftable, const int ftable_len, float r_v_pivot_co[3], float *r_v_pivot_fac) |
static int | edbm_face_split_by_edges_exec (bContext *C, wmOperator *UNUSED(op)) |
void | MESH_OT_face_split_by_edges (struct wmOperatorType *ot) |
Simple Intersect (self-intersect) | |
enum | { ISECT_SEL = 0 , ISECT_SEL_UNSEL = 1 } |
enum | { ISECT_SEPARATE_ALL = 0 , ISECT_SEPARATE_CUT = 1 , ISECT_SEPARATE_NONE = 2 } |
enum | { ISECT_SOLVER_FAST = 0 , ISECT_SOLVER_EXACT = 1 } |
static int | edbm_intersect_exec (bContext *C, wmOperator *op) |
static void | edbm_intersect_ui (bContext *UNUSED(C), wmOperator *op) |
void | MESH_OT_intersect (struct wmOperatorType *ot) |
#define USE_NET_ISLAND_CONNECT |
Definition at line 43 of file editmesh_intersect.c.
anonymous enum |
Enumerator | |
---|---|
ISECT_SEL | |
ISECT_SEL_UNSEL |
Definition at line 120 of file editmesh_intersect.c.
anonymous enum |
Enumerator | |
---|---|
ISECT_SEPARATE_ALL | |
ISECT_SEPARATE_CUT | |
ISECT_SEPARATE_NONE |
Definition at line 125 of file editmesh_intersect.c.
anonymous enum |
Enumerator | |
---|---|
ISECT_SOLVER_FAST | |
ISECT_SOLVER_EXACT |
Definition at line 131 of file editmesh_intersect.c.
Definition at line 621 of file editmesh_intersect.c.
References BM_edge_calc_length_squared().
Referenced by bm_face_split_by_edges_island_connect().
Compare selected/unselected.
Definition at line 59 of file editmesh_intersect.c.
References BM_elem_flag_test, BM_ELEM_HIDDEN, and BM_ELEM_SELECT.
Referenced by edbm_intersect_boolean_exec(), and edbm_intersect_exec().
A flipped version of bm_face_isect_pair use for boolean 'difference', which depends on order.
Definition at line 74 of file editmesh_intersect.c.
References BM_elem_flag_test, BM_ELEM_HIDDEN, and BM_ELEM_SELECT.
Referenced by edbm_intersect_boolean_exec().
Compare selected with itself.
Definition at line 48 of file editmesh_intersect.c.
References BM_elem_flag_test, and BM_ELEM_SELECT.
Referenced by edbm_intersect_exec().
|
static |
Definition at line 491 of file editmesh_intersect.c.
References BLI_assert, BLI_buffer_append, BLI_buffer_clear, BLI_SMALLSTACK_DECLARE, BLI_SMALLSTACK_IS_EMPTY, BLI_SMALLSTACK_POP_EX, BLI_SMALLSTACK_PUSH, BLI_SMALLSTACK_SWAP, bm, BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_disable, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_FACE_FIRST_LOOP, BM_face_select_set(), BM_face_split_edgenet(), BM_ITER_ELEM, BLI_Buffer::count, BLI_Buffer::data, BMVert::e, e, MEM_freeN, BMLoop::next, BMLoop::v, and v.
Referenced by edbm_face_split_by_edges_exec().
|
static |
Definition at line 635 of file editmesh_intersect.c.
References BLI_memarena_alloc(), bm, BM_edge_face_pair(), BM_edge_select_set(), bm_edge_sort_length_cb(), BM_face_select_set(), BM_face_share_vert_count(), BM_face_split_edgenet(), BM_face_split_edgenet_connect_islands(), BM_faces_join(), LinkNode::link, LinkNode::next, and NULL.
Referenced by edbm_face_split_by_edges_exec().
|
static |
Check if v_pivot should be spliced into an existing edge.
Detect one of 3 cases:
Definition at line 704 of file editmesh_intersect.c.
References BLI_assert, BLI_SMALLSTACK_DECLARE, BLI_SMALLSTACK_POP, BLI_SMALLSTACK_PUSH, BM_DISK_EDGE_NEXT, BM_edge_exists(), BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_INTERNAL_TAG, BM_FACE_FIRST_LOOP, CLAMP, BMVert::co, copy_v3_v3(), BMVert::e, BMLoop::e, BMLoop::f, interp_v3_v3v3(), len_squared_v3v3(), line_point_factor_v3(), BMLoop::next, NULL, BMLoop::radial_next, UNLIKELY, UNUSED_VARS_NDEBUG, BMEdge::v1, and BMEdge::v2.
Referenced by edbm_face_split_by_edges_exec().
Check if a vert is in any of the faces connected to the edge, f_ignore is a face we happen to know isn't shared by the vertex.
Definition at line 573 of file editmesh_intersect.c.
References BLI_assert, BM_vert_in_face(), BMLoop::f, BMEdge::l, BMLoop::radial_next, and v.
Referenced by edbm_face_split_by_edges_exec().
|
static |
Definition at line 809 of file editmesh_intersect.c.
References angle_signed_on_axis_v3v3v3_v3(), BKE_bmbvh_find_face_closest(), BKE_bmbvh_free(), BKE_bmbvh_new(), BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BLI_assert, BLI_buffer_declare_static, BLI_buffer_free, BLI_ghash_free(), BLI_ghash_ptr_new(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_memarena_clear(), BLI_memarena_free(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_SMALLSTACK_DECLARE, BLI_SMALLSTACK_IS_EMPTY, BLI_SMALLSTACK_POP, BLI_SMALLSTACK_PUSH, BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), BMEditMesh::bm, bm, BM_EDGE, BM_edge_is_wire(), BM_edge_other_vert(), BM_edge_split(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_INTERNAL_TAG, BM_ELEM_SELECT, BM_ELEM_TAG, BM_FACE, bm_face_split_by_edges(), bm_face_split_by_edges_island_connect(), bm_face_split_edge_find(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_VERT, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_vert_in_face(), bm_vert_in_faces_radial(), BM_vert_splice(), BM_VERTS_OF_EDGE, BM_VERTS_OF_MESH, BMBVH_RESPECT_SELECT, C, BMVert::co, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, dot_v3v3(), e, EDBM_update(), BMesh::elem_index_dirty, BMLoop::f, fabsf, BMesh::ftable, ghash_insert_face_edge_link(), GHASH_ITER, l, LinkNode::link, LinkBase::list, LinkBase::list_len, BMEditMesh::looptris, mem_arena, MEM_freeN, mid_v3_v3v3(), LinkNode::next, BMLoop::next, BMFace::no, normalize_v3(), NULL, OPERATOR_FINISHED, BMLoop::prev, sub_v3_v3v3(), BMesh::totedgesel, BMesh::totface, BMesh::totfacesel, BMEditMesh::tottri, BMLoop::v, v, and BMEdge::v1.
Referenced by MESH_OT_face_split_by_edges().
|
static |
Definition at line 335 of file editmesh_intersect.c.
References BKE_editmesh_from_object(), BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BMEditMesh::bm, bm_face_isect_pair(), bm_face_isect_pair_swap(), BM_mesh_boolean(), BM_mesh_intersect(), C, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, edbm_intersect_select(), eps, ISECT_SOLVER_EXACT, BMEditMesh::looptris, MEM_freeN, NULL, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_enum_get(), RNA_float_get(), RPT_WARNING, BMesh::totfacesel, and BMEditMesh::tottri.
Referenced by MESH_OT_intersect_boolean().
|
static |
Definition at line 408 of file editmesh_intersect.c.
References ISECT_SOLVER_EXACT, wmOperator::layout, NULL, wmOperator::ptr, RNA_enum_get(), UI_ITEM_R_EXPAND, uiItemR(), uiItemS(), uiLayoutRow(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by MESH_OT_intersect_boolean().
|
static |
Definition at line 136 of file editmesh_intersect.c.
References BKE_editmesh_from_object(), BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BMEditMesh::bm, BM_elem_cb_check_hflag_enabled_simple, BM_ELEM_SELECT, bm_face_isect_pair(), bm_face_isect_self(), BM_mesh_boolean_knife(), BM_mesh_intersect(), BM_mesh_separate_faces(), C, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, edbm_intersect_select(), eps, ISECT_SEL, ISECT_SEPARATE_ALL, ISECT_SEPARATE_CUT, ISECT_SOLVER_EXACT, BMEditMesh::looptris, MEM_freeN, NULL, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_float_get(), RPT_WARNING, BMesh::totfacesel, and BMEditMesh::tottri.
Referenced by MESH_OT_intersect().
|
static |
Use for intersect and boolean.
Definition at line 88 of file editmesh_intersect.c.
References BMEditMesh::bm, BM_EDGE, BM_edge_select_set(), BM_EDGES_OF_MESH, BM_elem_flag_test, BM_ELEM_SELECT, BM_ELEM_TAG, BM_FACE, BM_ITER_MESH, BM_mesh_elem_hflag_disable_all(), BM_VERT, e, EDBM_selectmode_flush(), EDBM_update(), SCE_SELECT_EDGE, SCE_SELECT_VERTEX, and BMesh::selectmode.
Referenced by edbm_intersect_boolean_exec(), and edbm_intersect_exec().
|
static |
Definition at line 245 of file editmesh_intersect.c.
References ISECT_SOLVER_EXACT, wmOperator::layout, NULL, wmOperator::ptr, RNA_enum_get(), UI_ITEM_R_EXPAND, uiItemR(), uiItemS(), uiLayoutRow(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by MESH_OT_intersect().
|
static |
Definition at line 596 of file editmesh_intersect.c.
References BLI_ghash_ensure_p(), BLI_memarena_alloc(), LinkNode::link, LinkBase::list, LinkBase::list_len, mem_arena, LinkNode::next, and NULL.
Referenced by edbm_face_split_by_edges_exec().
void MESH_OT_face_split_by_edges | ( | struct wmOperatorType * | ot | ) |
Definition at line 1082 of file editmesh_intersect.c.
References wmOperatorType::description, ED_operator_editmesh(), edbm_face_split_by_edges_exec(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_mesh().
void MESH_OT_intersect | ( | struct wmOperatorType * | ot | ) |
Definition at line 270 of file editmesh_intersect.c.
References wmOperatorType::description, ED_operator_editmesh(), edbm_intersect_exec(), edbm_intersect_ui(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, ISECT_SEL, ISECT_SEL_UNSEL, ISECT_SEPARATE_ALL, ISECT_SEPARATE_CUT, ISECT_SEPARATE_NONE, ISECT_SOLVER_EXACT, ISECT_SOLVER_FAST, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_enum(), RNA_def_float_distance(), wmOperatorType::srna, and wmOperatorType::ui.
Referenced by ED_operatortypes_mesh().
void MESH_OT_intersect_boolean | ( | struct wmOperatorType * | ot | ) |
Definition at line 433 of file editmesh_intersect.c.
References BMESH_ISECT_BOOLEAN_DIFFERENCE, BMESH_ISECT_BOOLEAN_ISECT, BMESH_ISECT_BOOLEAN_UNION, wmOperatorType::description, ED_operator_editmesh(), edbm_intersect_boolean_exec(), edbm_intersect_boolean_ui(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, ISECT_SOLVER_EXACT, ISECT_SOLVER_FAST, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), RNA_def_enum(), RNA_def_float_distance(), wmOperatorType::srna, and wmOperatorType::ui.
Referenced by ED_operatortypes_mesh().