48 float no_face[3], no_edge[3];
49 float tvec_a[3], tvec_b[3];
116 if (
dot_v3v3(r_no, tvec_a) > 0.0f) {
143 const float offset_fac,
144 const float offset_fac_vg,
145 const bool use_replace,
146 const bool use_boundary,
147 const bool use_even_offset,
148 const bool use_relative_offset,
149 const bool use_crease,
150 const float crease_weight,
151 const int defgrp_index,
152 const bool defgrp_invert,
153 const short mat_offset,
158 const float ofs_orig = -(((-offset_fac + 1.0f) * 0.5f) *
offset);
159 const float ofs_new =
offset + ofs_orig;
160 const float ofs_mid = (ofs_orig + ofs_new) / 2.0f;
161 const float inset =
offset / 2.0f;
163 const int cd_dvert_offset = (defgrp_index != -1) ?
166 const float offset_fac_vg_inv = 1.0f - offset_fac_vg;
182 float *verts_relfac = (use_relative_offset || (cd_dvert_offset != -1)) ?
183 MEM_mallocN(
sizeof(
float) * totvert_orig, __func__) :
188 int verts_loop_tot = 0;
196 float fac, fac_shell;
200 if (use_crease && cd_edge_crease_offset == -1) {
208 verts_src[i] = v_src;
227 verts_loop_tot += f_src->
len;
238 for (i = 0; i < totvert_orig; i++) {
239 v_src = verts_src[i];
244 if (use_relative_offset) {
248 verts_relfac[i] = 1.0f;
251 if (cd_dvert_offset != -1) {
256 defgrp_fac = 1.0f - defgrp_fac;
259 if (offset_fac_vg > 0.0f) {
260 defgrp_fac = (offset_fac_vg + (defgrp_fac * offset_fac_vg_inv));
263 verts_relfac[i] *= defgrp_fac;
266 fac *= verts_relfac[i];
279 madd_v3_v3v3fl(verts_neg[i]->co, tvec, v_src->
no, (ofs_orig - ofs_mid) * fac);
280 madd_v3_v3v3fl(verts_pos[i]->co, tvec, v_src->
no, (ofs_new - ofs_mid) * fac);
290 if (use_relative_offset ==
false) {
295 if (use_relative_offset) {
322 if (use_even_offset) {
336 for (i = 0; i < 2; i++) {
337 BMVert *v_boundary = v_pair[i];
353 fac *= verts_relfac[v_boundary_index];
357 if (use_even_offset) {
361 va_other->
co, v_boundary->
co, vb_other->
co, no_face)) *
408 BMVert *v_neg1 = verts_neg[i_1];
409 BMVert *v_neg2 = verts_neg[i_2];
411 BMVert *v_pos1 = verts_pos[i_1];
412 BMVert *v_pos2 = verts_pos[i_2];
443 BMVert *v_b1 = verts_boundary[i_1];
444 BMVert *v_b2 = verts_boundary[i_2];
519 #define VERT_DUPE_TEST_ORIG(v) (verts_neg[BM_elem_index_get(v)] != NULL)
520 #define VERT_DUPE_TEST(v) (verts_pos[BM_elem_index_get(v)] != NULL)
521 #define VERT_DUPE_CLEAR(v) \
523 verts_pos[BM_elem_index_get(v)] = NULL; \
541 if (mix_flag == (1 | 2)) {
544 }
while ((l_iter = l_iter->
next) != l_first);
546 if (mix_flag == (1 | 2)) {
550 }
while ((l_iter = l_iter->
next) != l_first);
555 for (i = 0; i < totvert_orig; i++) {
556 v_src = verts_src[i];
563 #undef VERT_DUPE_TEST_ORIG
564 #undef VERT_DUPE_TEST
565 #undef VERT_DUPE_CLEAR
569 for (i = 0; i < totvert_orig; i++) {
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const struct CustomData *data, int type)
MINLINE float shell_angle_to_dist(float angle)
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
float angle_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_SET_FLOAT(ele, offset, f)
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
void BM_elem_attrs_copy(BMesh *bm_src, BMesh *bm_dst, const void *ele_src, void *ele_dst)
BMFace * BM_face_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, const BMFace *f_example, const eBMCreateFlag create_flag)
Make Quad/Triangle.
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
void BM_vert_kill(BMesh *bm, BMVert *v)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
float BM_vert_calc_median_tagged_edge_length(const BMVert *v)
void BM_loop_calc_face_tangent(const BMLoop *l, float r_tangent[3])
BM_loop_calc_face_tangent.
float BM_loop_calc_face_angle(const BMLoop *l)
void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3])
BMESH EDGE/FACE TANGENT.
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
static BMLoop * bm_edge_tag_faceloop(BMEdge *e)
void BM_mesh_wireframe(BMesh *bm, const float offset, const float offset_fac, const float offset_fac_vg, const bool use_replace, const bool use_boundary, const bool use_even_offset, const bool use_relative_offset, const bool use_crease, const float crease_weight, const int defgrp_index, const bool defgrp_invert, const short mat_offset, const short mat_max, const bool use_tag)
#define VERT_DUPE_CLEAR(v)
#define VERT_DUPE_TEST(v)
static void bm_vert_boundary_tangent(BMVert *v, float r_no[3], float r_no_face[3], BMVert **r_va_other, BMVert **r_vb_other)
#define VERT_DUPE_TEST_ORIG(v)
static bool bm_loop_is_radial_boundary(BMLoop *l_first)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
struct BMLoop * radial_next