Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_array.h"
#include "BLI_math.h"
#include "BLI_noise.h"
#include "BLI_rand.h"
#include "BLI_stack.h"
#include "BKE_customdata.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
#include "intern/bmesh_private.h"
Go to the source code of this file.
Classes | |
struct | SubDParams |
struct | SubDPattern |
struct | SubDFaceData |
Macros | |
#define | SUBD_SPLIT 1 |
#define | EDGE_PERCENT 2 |
#define | FACE_CUSTOMFILL 4 |
#define | ELE_INNER 8 |
#define | ELE_SPLIT 16 |
#define | FLT_FACE_SPLIT_EPSILON 0.00005f |
#define | USE_SPHERE_DUAL_BLEND |
#define | PATTERNS_TOT ARRAY_SIZE(patterns) |
Typedefs | |
typedef struct SubDParams | SubDParams |
typedef void(* | subd_pattern_fill_fp) (BMesh *bm, BMFace *face, BMVert **verts, const SubDParams *params) |
typedef struct SubDPattern | SubDPattern |
typedef struct SubDFaceData | SubDFaceData |
Variables | |
static const SubDPattern | quad_1edge |
static const SubDPattern | quad_2edge_path |
static const SubDPattern | quad_2edge_innervert |
static const SubDPattern | quad_2edge_fan |
static const SubDPattern | quad_3edge |
static const SubDPattern | tri_1edge |
static const SubDPattern | tri_3edge |
static const SubDPattern | quad_4edge |
static const SubDPattern * | patterns [] |
Edge based subdivision with various subdivision patterns.
Definition in file bmo_subdivide.c.
#define EDGE_PERCENT 2 |
Definition at line 92 of file bmo_subdivide.c.
#define ELE_INNER 8 |
Definition at line 97 of file bmo_subdivide.c.
#define ELE_SPLIT 16 |
Definition at line 98 of file bmo_subdivide.c.
#define FACE_CUSTOMFILL 4 |
Definition at line 96 of file bmo_subdivide.c.
#define FLT_FACE_SPLIT_EPSILON 0.00005f |
Definition at line 101 of file bmo_subdivide.c.
#define PATTERNS_TOT ARRAY_SIZE(patterns) |
Definition at line 891 of file bmo_subdivide.c.
#define SUBD_SPLIT 1 |
Definition at line 90 of file bmo_subdivide.c.
#define USE_SPHERE_DUAL_BLEND |
typedef void(* subd_pattern_fill_fp) (BMesh *bm, BMFace *face, BMVert **verts, const SubDParams *params) |
Definition at line 62 of file bmo_subdivide.c.
typedef struct SubDFaceData SubDFaceData |
typedef struct SubDParams SubDParams |
typedef struct SubDPattern SubDPattern |
|
static |
Definition at line 230 of file bmo_subdivide.c.
References add_v3_v3v3(), BLI_assert, BLI_noise_generic_turbulence(), BM_ELEM_CD_GET_VOID_P, bmesh_subd_falloff_calc(), BMVert::co, copy_v3_v3(), fabsf, interp_slerp_co_no_v3(), interp_v3_v3v3(), len, len_squared_v3v3(), len_v3v3(), madd_v3_v3fl(), mid_v3_v3v3(), mul_v3_fl(), BMVert::no, normal, normalize_v3(), normalize_v3_length(), ortho_basis_v3v3_v3(), params, reflect_v3_v3v3(), shell_v3v3_mid_normalized_to_dist(), smooth(), sub_v3_v3(), sub_v3_v3v3(), SUBD_FALLOFF_LIN, UNLIKELY, and v.
Referenced by bm_subdivide_edge_addvert(), and bm_subdivide_multicut().
void BM_mesh_esubdivide | ( | BMesh * | bm, |
const char | edge_hflag, | ||
const float | smooth, | ||
const short | smooth_falloff, | ||
const bool | use_smooth_even, | ||
const float | fractal, | ||
const float | along_normal, | ||
const int | numcuts, | ||
const int | seltype, | ||
const int | cornertype, | ||
const short | use_single_edge, | ||
const short | use_grid_fill, | ||
const short | use_only_quads, | ||
const int | seed | ||
) |
Definition at line 1318 of file bmo_subdivide.c.
References bm, BM_ALL_NOLOOP, BM_EDGE, BM_ELEM_SELECT, BM_FACE, BM_mesh_elem_hflag_disable_all(), BM_mesh_select_flush(), BM_VERT, BMO_FLAG_DEFAULTS, BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_buffer_hflag_enable(), seed, BMOperator::slots_out, smooth(), SUBDIV_SELECT_INNER, SUBDIV_SELECT_LOOPCUT, SUBDIV_SELECT_NONE, and SUBDIV_SELECT_ORIG.
Referenced by edbm_subdivide_exec(), and ringsel_finish().
|
static |
Definition at line 361 of file bmo_subdivide.c.
References alter_co(), bm, BM_edge_split(), BMO_vert_flag_enable, ELE_INNER, interp_v3_v3v3(), BMVert::no, normalize_v3(), and params.
Referenced by quad_2edge_split_innervert(), and subdivide_edge_num().
|
static |
Definition at line 428 of file bmo_subdivide.c.
References alter_co(), bm, BM_CHECK_ELEMENT, BMO_edge_flag_enable, BMO_vert_flag_enable, BMVert::e, ELE_SPLIT, BMLoop::f, BMEdge::l, params, SUBD_SPLIT, subdivide_edge_num(), v, v1, and v2.
Referenced by bmo_bisect_edges_exec(), and bmo_subdivide_edges_exec().
void bmo_bisect_edges_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 1386 of file bmo_subdivide.c.
References bm, BM_ALL_NOLOOP, BM_data_layer_add(), BM_data_layer_free_n(), BM_EDGE, bm_subdivide_multicut(), BMO_ITER, BMO_slot_buffer_from_enabled_flag(), BMO_slot_get(), BMO_slot_int_get(), BMO_slot_map_to_flag(), bmo_subd_init_shape_info(), CD_SHAPEKEY, e, EDGE_PERCENT, ELE_SPLIT, params, BMOperator::slots_in, BMOperator::slots_out, and BMesh::vdata.
|
static |
Definition at line 52 of file bmo_subdivide.c.
References bm, CD_SHAPEKEY, CustomData_get_n_offset(), CustomData_get_offset(), CustomData_number_of_layers(), params, and BMesh::vdata.
Referenced by bmo_bisect_edges_exec(), and bmo_subdivide_edges_exec().
void bmo_subdivide_edges_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 900 of file bmo_subdivide.c.
References Freestyle::a, usdtokens::b(), BLI_array_clear, BLI_array_declare, BLI_array_free, BLI_array_grow_items, BLI_array_len, BLI_assert, BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new_srandom(), BLI_stack_discard(), BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_peek(), BLI_stack_push_r(), bm, BM_ALL_NOLOOP, BM_CHECK_ELEMENT, BM_data_layer_add(), BM_data_layer_free_n(), BM_EDGE, BM_edge_exists(), BM_edge_share_vert_check(), BM_ELEM_CD_GET_VOID_P, BM_FACE, BM_face_split(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_LOOPS_OF_VERT, bm_subdivide_multicut(), BM_vert_in_face(), BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_edge_flag_test, BMO_face_flag_enable, BMO_face_flag_test, BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_get(), BMO_slot_int_get(), BMO_slot_map_to_flag(), bmo_subd_init_shape_info(), BMO_vert_flag_test, BMOpSlot::buf, CD_SHAPEKEY, BMVert::co, SubDPattern::connectexec, copy_v3_v3(), BMOpSlot::data, dot_v3v3(), BMLoop::e, EDGE_PERCENT, ELE_INNER, ELE_SPLIT, BMLoop::f, fabsf, SubDFaceData::face, FACE_CUSTOMFILL, FLT_FACE_SPLIT_EPSILON, if(), l, BMFace::len, BMOpSlot::len, SubDPattern::len, BMLoop::next, normalize_v3(), NULL, params, SubDFaceData::pat, patterns, PATTERNS_TOT, BMLoop::prev, quad_1edge, quad_2edge_fan, quad_2edge_innervert, quad_2edge_path, quad_4edge, seed, SubDPattern::seledges, BMOperator::slots_in, BMOperator::slots_out, smooth(), SubDFaceData::start, sub_v3_v3v3(), SUBD_CORNER_FAN, SUBD_CORNER_INNERVERT, SUBD_CORNER_PATH, SUBD_SPLIT, SubDFaceData::totedgesel, tri_1edge, tri_3edge, BMLoop::v, v, BMEdge::v1, BMEdge::v2, BMesh::vdata, and verts.
|
static |
Definition at line 118 of file bmo_subdivide.c.
References BLI_assert, bm, BM_face_split(), BM_loop_is_adjacent(), BM_vert_pair_share_face_by_len(), BMLoop::e, l_b, and NULL.
Referenced by quad_1edge_split(), quad_2edge_split_fan(), quad_2edge_split_innervert(), quad_2edge_split_path(), quad_3edge_split(), quad_4edge_subdivide(), tri_1edge_split(), and tri_3edge_subdivide().
|
static |
Specialized slerp that uses a sphere defined by each points normal.
Definition at line 151 of file bmo_subdivide.c.
References add_v3_v3v3(), BLI_assert, center, cross_v3_v3v3(), interp_v3_v3v3(), interp_v3_v3v3_slerp(), interpf(), isect_plane_plane_plane_v3(), len_squared_v3v3(), madd_v3_v3v3fl(), mid_v3_v3v3(), normalize_v3(), plane_from_point_normal_v3(), project_v3_plane(), and sub_v3_v3v3().
Referenced by alter_co().
|
static |
v3---------v2 | | | | | | | | v4---v0---v1
Definition at line 472 of file bmo_subdivide.c.
References blender::bke::attribute_accessor_functions::add(), bm, connect_smallest_face(), params, and verts.
|
static |
v6--------v5 | | | |v4s | |v3s | s s | v7-v0--v1-v2
Definition at line 592 of file bmo_subdivide.c.
References bm, connect_smallest_face(), params, and verts.
|
static |
v6--------v5 | | | |v4s | |v3s | s s | v7-v0--v1-v2
Definition at line 548 of file bmo_subdivide.c.
References bm, bm_subdivide_edge_addvert(), connect_smallest_face(), e, params, v, and verts.
|
static |
v6--------v5 | | | |v4s | |v3s | s s | v7-v0--v1-v2
Definition at line 518 of file bmo_subdivide.c.
References bm, connect_smallest_face(), params, and verts.
|
static |
s s v8--v7--v6-v5 | | | v4 s | | | v3 s | s s | v9-v0--v1-v2
Definition at line 627 of file bmo_subdivide.c.
References blender::bke::attribute_accessor_functions::add(), bm, connect_smallest_face(), params, and verts.
|
static |
v8--v7-v6--v5 | s | |v9 s s|v4 first line | | last line |v10s s s|v3 v11-v0--v1-v2 it goes from bottom up
Definition at line 668 of file bmo_subdivide.c.
References Freestyle::a, usdtokens::b(), bm, BMESH_ASSERT, BMO_edge_flag_enable, BMO_face_flag_enable, connect_smallest_face(), e, ELE_INNER, MEM_callocN, MEM_freeN, NULL, params, subdivide_edge_num(), v, v1, v2, and verts.
|
static |
Definition at line 401 of file bmo_subdivide.c.
References bm, bm_subdivide_edge_addvert(), BMO_edge_flag_test, EDGE_PERCENT, float(), and params.
Referenced by bm_subdivide_multicut(), quad_4edge_subdivide(), and tri_3edge_subdivide().
|
static |
v3 / \ / \ / \ / \ / \ v4--v0--v1--v2 s s
Definition at line 751 of file bmo_subdivide.c.
References bm, connect_smallest_face(), params, and verts.
|
static |
v5 / \ s v6/---\ v4 s / \ / \ sv7/---v---\ v3 s / \/ \/ \ v8--v0--v1--v2 s s
v5 / \ s v6/---\ v4 s / \ / \ sv7/---v---\ v3 s / \/ \/ \ v8--v0--v1--v2 s s
Definition at line 782 of file bmo_subdivide.c.
References Freestyle::a, usdtokens::b(), bm, BMO_edge_flag_enable, BMO_face_flag_enable, connect_smallest_face(), e, ELE_INNER, MEM_callocN, MEM_freeN, params, subdivide_edge_num(), v, BMEdge::v1, BMEdge::v2, and verts.
|
static |
Definition at line 882 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 502 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 609 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 576 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 532 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 650 of file bmo_subdivide.c.
|
static |
Definition at line 876 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 764 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().
|
static |
Definition at line 870 of file bmo_subdivide.c.
Referenced by bmo_subdivide_edges_exec().