|
Blender V4.3
|
#include "bmesh_core.hh"Go to the source code of this file.
Functions | |
| bool | BM_verts_from_edges (BMVert **vert_arr, BMEdge **edge_arr, int len) |
| bool | BM_edges_from_verts (BMEdge **edge_arr, BMVert **vert_arr, int len) |
| void | BM_edges_from_verts_ensure (BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr, int len) |
| void | BM_verts_sort_radial_plane (BMVert **vert_arr, int len) |
| BMFace * | BM_face_create_quad_tri (BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, const BMFace *f_example, eBMCreateFlag create_flag) |
| Make Quad/Triangle. | |
| void | BM_face_copy_shared (BMesh *bm, BMFace *f, BMLoopFilterFunc filter_fn, void *user_data) |
| copies face loop data from shared adjacent faces. | |
| BMFace * | BM_face_create_ngon (BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, int len, const BMFace *f_example, eBMCreateFlag create_flag) |
| Make NGon. | |
| BMFace * | BM_face_create_ngon_verts (BMesh *bm, BMVert **vert_arr, int len, const BMFace *f_example, eBMCreateFlag create_flag, bool calc_winding, bool create_edges) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMCustomDataCopyMap &cd_map, const BMVert *src, BMVert *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMCustomDataCopyMap &cd_map, const BMEdge *src, BMEdge *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMCustomDataCopyMap &cd_map, const BMFace *src, BMFace *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMCustomDataCopyMap &cd_map, const BMLoop *src, BMLoop *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMVert *src, BMVert *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMEdge *src, BMEdge *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMFace *src, BMFace *dst) |
| void | BM_elem_attrs_copy (BMesh *bm, const BMLoop *src, BMLoop *dst) |
| void | BM_elem_select_copy (BMesh *bm_dst, void *ele_dst_v, const void *ele_src_v) |
| void | BM_mesh_copy_init_customdata_from_mesh_array (BMesh *bm_dst, const Mesh *me_src_array[], int me_src_array_len, const BMAllocTemplate *allocsize) |
| void | BM_mesh_copy_init_customdata_from_mesh (BMesh *bm_dst, const Mesh *me_src, const BMAllocTemplate *allocsize) |
| void | BM_mesh_copy_init_customdata (BMesh *bm_dst, BMesh *bm_src, const BMAllocTemplate *allocsize) |
| void | BM_mesh_copy_init_customdata_all_layers (BMesh *bm_dst, BMesh *bm_src, char htype, const BMAllocTemplate *allocsize) |
| BMesh * | BM_mesh_copy (BMesh *bm_old) |
Fill in an edge array from a vertex array (connected polygon loop).
Definition at line 38 of file bmesh_construct.cc.
References BM_edge_exists(), and len.
Referenced by bm_edgenet_face_from_path(), and BM_face_create_verts().
Fill in an edge array from a vertex array (connected polygon loop). Creating edges as-needed.
Definition at line 51 of file bmesh_construct.cc.
References bm, BM_CREATE_NO_DOUBLE, BM_edge_create(), and len.
Referenced by BM_face_create_verts().
| void BM_elem_attrs_copy | ( | BMesh * | bm, |
| const BMCustomDataCopyMap & | cd_map, | ||
| const BMEdge * | src, | ||
| BMEdge * | dst ) |
Definition at line 326 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, CustomData_bmesh_copy_block(), BMHeader::data, BMesh::edata, BMEdge::head, and BMHeader::hflag.
| void BM_elem_attrs_copy | ( | BMesh * | bm, |
| const BMCustomDataCopyMap & | cd_map, | ||
| const BMFace * | src, | ||
| BMFace * | dst ) |
Definition at line 332 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, copy_v3_v3(), CustomData_bmesh_copy_block(), BMHeader::data, BMFace::head, BMHeader::hflag, BMFace::mat_nr, BMFace::no, and BMesh::pdata.
| void BM_elem_attrs_copy | ( | BMesh * | bm, |
| const BMCustomDataCopyMap & | cd_map, | ||
| const BMLoop * | src, | ||
| BMLoop * | dst ) |
Definition at line 340 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, CustomData_bmesh_copy_block(), BMHeader::data, BMLoop::head, BMHeader::hflag, and BMesh::ldata.
| void BM_elem_attrs_copy | ( | BMesh * | bm, |
| const BMCustomDataCopyMap & | cd_map, | ||
| const BMVert * | src, | ||
| BMVert * | dst ) |
Copy attributes between elements with a precalculated map of copy operations. This significantly improves performance when copying, since all the work of finding common layers doesn't have to be done for every element.
Definition at line 319 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, copy_v3_v3(), CustomData_bmesh_copy_block(), BMHeader::data, BMVert::head, BMHeader::hflag, BMVert::no, and BMesh::vdata.
Referenced by bev_create_ngon(), bev_rebuild_polygon(), bevel_build_edge_polygons(), bm_edge_copy_with_arrays(), BM_edge_create(), BM_edge_split(), bm_extrude_copy_face_loop_attributes(), BM_face_copy(), BM_face_copy(), bm_face_copy_shared_all(), bm_face_copy_with_arrays(), BM_face_create(), bm_face_create__sfme(), BM_face_triangulate(), BM_faces_join(), bm_grid_fill_array(), BM_mesh_wireframe(), bm_vert_copy(), BM_vert_create(), bmo_edge_copy(), bmo_extrude_discrete_faces_exec(), bmo_face_copy(), bmo_face_inset_individual(), bmo_inset_region_exec(), bmo_poke_exec(), bmo_vert_copy(), bpy_bm_elem_copy_from(), bpy_bmedgeseq_new(), bpy_bmvertseq_new(), bridge_loop_pair(), edbm_tagged_loop_pairs_do_fill_faces(), mesh_customdatacorrect_restore(), remdoubles_createface(), and weld_cross_attrs_copy().
Definition at line 354 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, CustomData_bmesh_copy_block(), BMHeader::data, BMesh::edata, BMEdge::head, and BMHeader::hflag.
Definition at line 360 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, copy_v3_v3(), CustomData_bmesh_copy_block(), BMHeader::data, BMFace::head, BMHeader::hflag, BMFace::mat_nr, BMFace::no, and BMesh::pdata.
Definition at line 368 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, CustomData_bmesh_copy_block(), BMHeader::data, BMLoop::head, BMHeader::hflag, and BMesh::ldata.
Copy attributes between elements in the same BMesh.
Definition at line 347 of file bmesh_construct.cc.
References BLI_assert, bm, BM_ELEM_SELECT, copy_v3_v3(), CustomData_bmesh_copy_block(), BMHeader::data, BMVert::head, BMHeader::hflag, BMVert::no, and BMesh::vdata.
| void BM_elem_select_copy | ( | BMesh * | bm_dst, |
| void * | ele_dst_v, | ||
| const void * | ele_src_v ) |
Definition at line 375 of file bmesh_construct.cc.
References BLI_assert, BM_ELEM_SELECT, BM_elem_select_set(), BMHeader::hflag, and BMHeader::htype.
Referenced by bmesh_kernel_edge_separate(), and bmesh_kernel_vert_separate().
| void BM_face_copy_shared | ( | BMesh * | bm, |
| BMFace * | f, | ||
| BMLoopFilterFunc | filter_fn, | ||
| void * | user_data ) |
copies face loop data from shared adjacent faces.
| filter_fn | A function that filters the source loops before copying (don't always want to copy all). |
Definition at line 73 of file bmesh_construct.cc.
References _FLAG_OVERLAP, BLI_assert, bm, BM_ELEM_API_FLAG_DISABLE, BM_ELEM_API_FLAG_ENABLE, BM_ELEM_API_FLAG_TEST, BM_FACE_FIRST_LOOP, CustomData_bmesh_copy_block(), BMHeader::data, BMLoop::head, BMesh::ldata, BMLoop::next, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bm_face_copy_shared_all(), bmo_contextual_create_exec(), and bmo_inset_region_exec().
| BMFace * BM_face_create_ngon | ( | BMesh * | bm, |
| BMVert * | v1, | ||
| BMVert * | v2, | ||
| BMEdge ** | edges, | ||
| int | len, | ||
| const BMFace * | f_example, | ||
| eBMCreateFlag | create_flag ) |
Make NGon.
Makes an ngon from an unordered list of edges. Verts v1 and v2 define the winding of the new face.
edges are not required to be ordered, simply to form a single closed loop as a whole.
Definition at line 204 of file bmesh_construct.cc.
References BLI_array_alloca, BLI_assert, bm, bm_edges_sort_winding(), BM_face_create(), len, and v2.
Referenced by BM_face_create_ngon_verts(), and BM_faces_join().
| BMFace * BM_face_create_ngon_verts | ( | BMesh * | bm, |
| BMVert ** | vert_arr, | ||
| int | len, | ||
| const BMFace * | f_example, | ||
| eBMCreateFlag | create_flag, | ||
| bool | calc_winding, | ||
| bool | create_edges ) |
Create an ngon from an array of sorted verts
Special features this has over other functions.
Definition at line 224 of file bmesh_construct.cc.
References BLI_array_alloca, BLI_assert, bm, BM_CREATE_NO_DOUBLE, BM_edge_create(), BM_edge_exists(), BM_edge_ordered_verts(), BM_face_create_ngon(), ELEM, l, and len.
Referenced by bmo_contextual_create_exec(), and bmo_edgeloop_fill_exec().
| BMFace * BM_face_create_quad_tri | ( | BMesh * | bm, |
| BMVert * | v1, | ||
| BMVert * | v2, | ||
| BMVert * | v3, | ||
| BMVert * | v4, | ||
| const BMFace * | f_example, | ||
| eBMCreateFlag | create_flag ) |
Make Quad/Triangle.
Creates a new quad or triangle from a list of 3 or 4 vertices. If no_double is true, then a check is done to see if a face with these vertices already exists and returns it instead.
If a pointer to an example face is provided, its custom data and properties will be copied to the new face.
Definition at line 61 of file bmesh_construct.cc.
References bm, BM_face_create_verts(), and v2.
Referenced by bm_grid_fill_array(), BM_mesh_wireframe(), bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_create_icosphere_exec(), bmo_create_monkey_exec(), bmo_extrude_discrete_faces_exec(), bmo_face_inset_individual(), bmo_poke_exec(), and bmo_triangle_fill_exec().
Definition at line 548 of file bmesh_construct.cc.
References BMesh::act_face, BLI_assert, BM_CREATE_SKIP_CD, BM_EDGE, BM_edge_create(), BM_EDGES_OF_MESH, BM_elem_index_get, BM_elem_index_set, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_mesh_copy_init_customdata(), bm_mesh_copy_new_face(), BM_mesh_create(), BM_select_history_store, BM_VERT, BM_vert_create(), BM_VERTS_OF_MESH, BMALLOC_TEMPLATE_FROM_BM, BMVert::co, copy_v3_v3(), CustomData_bmesh_copy_block(), CustomData_bmesh_copy_map_calc(), BMHeader::data, e, BMesh::edata, BMesh::elem_index_dirty, BMEdge::head, BMVert::head, BMHeader::hflag, BMesh::ldata, LISTBASE_FOREACH, MEM_freeN(), MEM_mallocN, BMVert::no, params, BMesh::pdata, BMesh::selected, BMesh::selectmode, BMesh::shapenr, BMesh::totedge, BMesh::totedgesel, BMesh::totface, BMesh::totfacesel, BMesh::totvert, BMesh::totvertsel, BMesh::use_toolflags, v, and BMesh::vdata.
Referenced by BKE_editmesh_copy(), bpy_bmesh_copy(), EDBM_automerge_and_split(), EDBM_redo_state_restore(), and EDBM_redo_state_store().
| void BM_mesh_copy_init_customdata | ( | BMesh * | bm_dst, |
| BMesh * | bm_src, | ||
| const BMAllocTemplate * | allocsize ) |
Definition at line 494 of file bmesh_construct.cc.
References BM_EDGE, BM_FACE, BM_LOOP, bm_mesh_allocsize_default, BM_VERT, CD_MASK_BMESH, CD_SET_DEFAULT, CustomData_bmesh_init_pool(), CustomData_init_layout_from(), BMesh::edata, CustomData_MeshMasks::emask, BMesh::ldata, CustomData_MeshMasks::lmask, BMesh::pdata, CustomData_MeshMasks::pmask, BMAllocTemplate::totedge, BMAllocTemplate::totface, BMAllocTemplate::totloop, BMAllocTemplate::totvert, BMesh::vdata, and CustomData_MeshMasks::vmask.
Referenced by BM_mesh_copy(), mesh_separate_arrays(), and mesh_separate_tagged().
| void BM_mesh_copy_init_customdata_all_layers | ( | BMesh * | bm_dst, |
| BMesh * | bm_src, | ||
| char | htype, | ||
| const BMAllocTemplate * | allocsize ) |
Similar to BM_mesh_copy_init_customdata but copies all layers ignoring flags like CD_FLAG_NOCOPY.
| bm_dst | BMesh whose custom-data layers will be added. |
| bm_src | BMesh whose custom-data layers will be copied. |
| htype | Specifies which custom-data layers will be initiated. |
| allocsize | Initialize the memory-pool before use (may be an estimate). |
Definition at line 515 of file bmesh_construct.cc.
References BLI_assert, BM_EDGE, BM_FACE, BM_LOOP, bm_mesh_allocsize_default, BM_VERT, CD_SET_DEFAULT, CustomData_add_layer_named(), CustomData_bmesh_init_pool(), BMesh::edata, l, CustomData::layers, BMesh::ldata, CustomDataLayer::name, BMesh::pdata, BMAllocTemplate::totedge, BMAllocTemplate::totface, CustomData::totlayer, BMAllocTemplate::totloop, BMAllocTemplate::totvert, CustomDataLayer::type, and BMesh::vdata.
Referenced by mesh_customdatacorrect_init_container_generic(), and mesh_separate_arrays().
| void BM_mesh_copy_init_customdata_from_mesh | ( | BMesh * | bm_dst, |
| const Mesh * | me_src, | ||
| const BMAllocTemplate * | allocsize ) |
Definition at line 487 of file bmesh_construct.cc.
References BM_mesh_copy_init_customdata_from_mesh_array().
| void BM_mesh_copy_init_customdata_from_mesh_array | ( | BMesh * | bm_dst, |
| const Mesh * | me_src_array[], | ||
| int | me_src_array_len, | ||
| const BMAllocTemplate * | allocsize ) |
Initialize the bm_dst layers in preparation for populating its contents with multiple meshes. Typically done using multiple calls to BM_mesh_bm_from_me with the same bm argument).
Definition at line 437 of file bmesh_construct.cc.
References BM_EDGE, BM_FACE, BM_LOOP, bm_mesh_allocsize_default, BM_VERT, CD_MASK_BMESH, CD_SET_DEFAULT, Mesh::corner_data, CustomData_bmesh_init_pool(), CustomData_init_layout_from(), CustomData_merge_layout(), CustomData_shallow_copy_remove_non_bmesh_attributes(), BMesh::edata, Mesh::edge_data, CustomData_MeshMasks::emask, Mesh::face_data, CustomData::layers, BMesh::ldata, CustomData_MeshMasks::lmask, MEM_SAFE_FREE, BMesh::pdata, CustomData_MeshMasks::pmask, BMAllocTemplate::totedge, BMAllocTemplate::totface, BMAllocTemplate::totloop, BMAllocTemplate::totvert, BMesh::vdata, Mesh::vert_data, and CustomData_MeshMasks::vmask.
Referenced by BM_mesh_copy_init_customdata_from_mesh(), BMD_mesh_bm_create(), and blender::geometry::boolean::mesh_bm_concat().
Fill in a vertex array from an edge array.
Definition at line 25 of file bmesh_construct.cc.
References BM_edge_share_vert(), and len.
Referenced by BM_face_exists_multi_edge().
Makes an NGon from an un-ordered set of verts.
Assumes:
There can be concave areas but overlapping folds from the center point will fail.
A brief explanation of the method used
Definition at line 290 of file bmesh_construct.cc.
References angle_signed_on_axis_v3v3v3_v3(), BLI_array_alloca, BLI_sortutil_cmp_float(), BM_verts_calc_normal_from_cloud_ex(), BMVert::co, SortIntByFloat::data, len, nor, and SortIntByFloat::sort_value.
Referenced by bmo_contextual_create_exec().