Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BKE_customdata.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
#include "BLI_strict_flags.h"
Go to the source code of this file.
Macros | |
#define | EDGE_MARK 4 |
#define | FACE_OUT 16 |
#define | BARYCENTRIC_INTERP |
#define | XY(_x, _y) ((_x) + ((_y) * (xtot))) |
#define | USE_FLIP_DETECT |
Functions | |
static void | quad_edges_to_normal (float no[3], const float co_a1[3], const float co_a2[3], const float co_b1[3], const float co_b2[3]) |
static void | quad_verts_to_barycentric_tri (float tri[3][3], const float co_a[3], const float co_b[3], const float co_a_next[3], const float co_b_next[3], const float co_a_prev[3], const float co_b_prev[3], const bool is_flip) |
static void | barycentric_weights_v2_grid_cache (const uint xtot, const uint ytot, float(*weight_table)[4]) |
static void | bm_grid_fill_array (BMesh *bm, BMVert **v_grid, const uint xtot, const uint ytot, const short mat_nr, const bool use_smooth, const bool use_flip, const bool use_interp_simple) |
static void | bm_grid_fill (BMesh *bm, struct BMEdgeLoopStore *estore_a, struct BMEdgeLoopStore *estore_b, struct BMEdgeLoopStore *estore_rail_a, struct BMEdgeLoopStore *estore_rail_b, const short mat_nr, const bool use_smooth, const bool use_interp_simple) |
static void | bm_edgeloop_flag_set (struct BMEdgeLoopStore *estore, char hflag, bool set) |
static bool | bm_edge_test_cb (BMEdge *e, void *bm_v) |
static bool | bm_edge_test_rail_cb (BMEdge *e, void *UNUSED(bm_v)) |
void | bmo_grid_fill_exec (BMesh *bm, BMOperator *op) |
Handle Loop Pairs | |
static void | bm_loop_pair_from_verts (BMVert *v_a, BMVert *v_b, BMLoop *l_pair[2]) |
static void | bm_loop_pair_test_copy (BMLoop *l_pair_a[2], BMLoop *l_pair_b[2]) |
static void | bm_loop_interp_from_grid_boundary_4 (BMesh *bm, BMLoop *l, BMLoop *l_bound[4], const float w[4]) |
static void | bm_loop_interp_from_grid_boundary_2 (BMesh *bm, BMLoop *l, BMLoop *l_bound[2], const float t) |
Fill 2 isolated, open edge loops with a grid of quads.
Definition in file bmo_fill_grid.c.
#define BARYCENTRIC_INTERP |
Definition at line 25 of file bmo_fill_grid.c.
#define EDGE_MARK 4 |
Definition at line 22 of file bmo_fill_grid.c.
#define FACE_OUT 16 |
Definition at line 23 of file bmo_fill_grid.c.
#define USE_FLIP_DETECT |
#define XY | ( | _x, | |
_y | |||
) | ((_x) + ((_y) * (xtot))) |
|
static |
Avoids calling barycentric_weights_v2_quad often by caching weights into an array.
Definition at line 161 of file bmo_fill_grid.c.
References barycentric_weights_v2_quad(), KDL::cos(), float(), UNPACK4, x, and y.
Referenced by bm_grid_fill_array().
Definition at line 568 of file bmo_fill_grid.c.
References BMO_edge_flag_test_bool, e, and EDGE_MARK.
Referenced by bmo_grid_fill_exec().
Definition at line 573 of file bmo_fill_grid.c.
References BM_edge_is_boundary(), BM_edge_is_wire(), BM_elem_flag_test, BM_ELEM_HIDDEN, and e.
Referenced by bmo_grid_fill_exec().
|
static |
Definition at line 554 of file bmo_fill_grid.c.
References BM_edge_exists(), BM_edgeloop_verts_get(), BM_elem_flag_set, LinkData::data, e, ListBase::first, LinkData::next, and LinkData::prev.
Referenced by bmo_grid_fill_exec().
|
static |
estore_b +------------------+ ^ | | end | | | | | | | |estore_rail_a |estore_rail_b | | | start | | | |estore_a | +------------------+ ---> start -> end
Definition at line 459 of file bmo_fill_grid.c.
References BLI_assert, bm, BM_edge_exists(), BM_edge_is_boundary(), BM_edgeloop_length_get(), BM_edgeloop_verts_get(), bm_grid_fill_array(), LinkData::data, e, ListBase::first, ListBase::last, MEM_callocN, MEM_freeN, LinkData::next, NULL, x, and y.
Referenced by bmo_grid_fill_exec().
|
static |
This may be useful outside the bmesh operator.
v_grid | 2d array of verts, all boundary verts must be set, we fill in the middle. |
Definition at line 189 of file bmo_fill_grid.c.
References barycentric_weights_v2_grid_cache(), BLI_assert, bm, BM_CREATE_NOP, BM_elem_attrs_copy(), BM_elem_flag_enable, BM_ELEM_SMOOTH, BM_face_as_array_loop_quad(), BM_face_create_quad_tri(), BM_FACE_FIRST_LOOP, bm_loop_interp_from_grid_boundary_2(), bm_loop_interp_from_grid_boundary_4(), bm_loop_pair_from_verts(), bm_loop_pair_test_copy(), BM_vert_create(), BMO_face_flag_enable, CustomData_bmesh_interp(), CustomData_has_interp(), BMHeader::data, BMLoop::f, FACE_OUT, float(), BMVert::head, interp_v3_v3v3(), BMesh::ldata, madd_v3_v3fl(), BMFace::mat_nr, MEM_freeN, MEM_mallocN, BMLoop::next, NULL, quad_verts_to_barycentric_tri(), t, transform_point_by_tri_v3(), v, BMesh::vdata, w(), x, XY, y, and zero_v3().
Referenced by bm_grid_fill().
|
static |
Definition at line 144 of file bmo_fill_grid.c.
References bm, CustomData_bmesh_interp(), BMHeader::data, BMLoop::head, l, BMesh::ldata, NULL, t, and w().
Referenced by bm_grid_fill_array().
|
static |
Interpolate from boundary loops.
Definition at line 133 of file bmo_fill_grid.c.
References bm, CustomData_bmesh_interp(), BMHeader::data, BMLoop::head, l, BMesh::ldata, NULL, and w().
Referenced by bm_grid_fill_array().
Assign a loop pair from 2 verts (which must share an edge)
Definition at line 91 of file bmo_fill_grid.c.
References BM_edge_exists(), e, and NULL.
Referenced by bm_grid_fill_array().
Copy loop pair from one side to the other if either is missing, this simplifies interpolation code so we only need to check if x/y are missing, rather than checking each loop.
Definition at line 115 of file bmo_fill_grid.c.
References NULL.
Referenced by bm_grid_fill_array().
void bmo_grid_fill_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 583 of file bmo_fill_grid.c.
References BLI_assert, BLI_gset_free(), BLI_gset_ptr_new(), BLI_gsetIterator_getKey(), BLI_listbase_is_empty(), bm, BM_EDGE, BM_edge_collapse(), bm_edge_test_cb(), bm_edge_test_rail_cb(), BM_edgeloop_expand(), bm_edgeloop_flag_set(), BM_edgeloop_flip(), BM_edgeloop_is_closed(), BM_edgeloop_length_get(), BM_edgeloop_overlap_check(), BM_edgeloop_verts_get(), BM_ELEM_HIDDEN, BM_FACE, bm_grid_fill(), BM_mesh_edgeloops_find(), BM_mesh_edgeloops_find_path(), BM_mesh_edgeloops_free(), BMO_ERROR_CANCEL, BMO_error_raise(), BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_int_get(), count, data, e, EDGE_MARK, FACE_OUT, ListBase::first, GSET_ITER, ListBase::last, NULL, BMOperator::slots_in, and BMOperator::slots_out.
|
static |
2 edge vectors to normal.
Definition at line 31 of file bmo_fill_grid.c.
References add_v3_v3v3(), normalize_v3(), and sub_v3_v3v3().
Referenced by quad_verts_to_barycentric_tri().
|
static |
Definition at line 48 of file bmo_fill_grid.c.
References add_v3_v3(), copy_v3_v3(), len_v3v3(), mid_v3_v3v3(), mul_v3_fl(), negate_v3(), normalize_v3(), and quad_edges_to_normal().
Referenced by bm_grid_fill_array().