Blender V5.3
bmesh_wireframe.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include <algorithm>
12
13#include "MEM_guardedalloc.h"
14
15#include "bmesh.hh"
16
17#include "BLI_math_geom_c.hh"
18#include "BLI_math_vector_c.hh"
19
20#include "BKE_customdata.hh"
21#include "BKE_deform.hh"
22
23#include "bmesh_wireframe.hh"
24
25namespace blender {
26
28{
29 BMLoop *l, *l_first;
30
31 l = l_first = e->l;
32 do {
34 return l;
35 }
36 } while ((l = l->radial_next) != l_first);
37
38 /* in the case this is used, we know this will never happen */
39 return nullptr;
40}
41
43 BMVert *v, float r_no[3], float r_no_face[3], BMVert **r_va_other, BMVert **r_vb_other)
44{
45 BMIter iter;
46 BMEdge *e_iter;
47
48 BMEdge *e_a = nullptr, *e_b = nullptr;
49 BMVert *v_a, *v_b;
50
51 BMLoop *l_a, *l_b;
52
53 float no_face[3], no_edge[3];
54 float tvec_a[3], tvec_b[3];
55
56 /* get 2 boundary edges, there should only _be_ 2,
57 * in case there are more - results won't be valid of course */
58 BM_ITER_ELEM (e_iter, &iter, v, BM_EDGES_OF_VERT) {
59 if (BM_elem_flag_test(e_iter, BM_ELEM_TAG)) {
60 if (e_a == nullptr) {
61 e_a = e_iter;
62 }
63 else {
64 e_b = e_iter;
65 break;
66 }
67 }
68 }
69
70 if (e_a && e_b) {
71 /* NOTE: with an incorrectly flushed selection this can crash. */
72 l_a = bm_edge_tag_faceloop(e_a);
74
75 /* average edge face normal */
76 add_v3_v3v3(no_face, l_a->f->no, l_b->f->no);
77 normalize_v3(no_face);
78
79 /* average edge direction */
80 v_a = BM_edge_other_vert(e_a, v);
81 v_b = BM_edge_other_vert(e_b, v);
82
83 sub_v3_v3v3(tvec_a, v->co, v_a->co);
84 sub_v3_v3v3(tvec_b, v_b->co, v->co);
85 normalize_v3(tvec_a);
86 normalize_v3(tvec_b);
87 add_v3_v3v3(no_edge, tvec_a, tvec_b); /* not unit length but this is ok */
88
89 /* check are we flipped the right way */
90 BM_edge_calc_face_tangent(e_a, l_a, tvec_a);
91 BM_edge_calc_face_tangent(e_b, l_b, tvec_b);
92 add_v3_v3(tvec_a, tvec_b);
93
94 *r_va_other = v_a;
95 *r_vb_other = v_b;
96 }
97 else {
98 /* degenerate case - vertex connects a boundary edged face to other faces,
99 * so we have only one boundary face - only use it for calculations */
100 l_a = bm_edge_tag_faceloop(e_a);
101
102 copy_v3_v3(no_face, l_a->f->no);
103
104 /* edge direction */
105 v_a = BM_edge_other_vert(e_a, v);
106 v_b = nullptr;
107
108 sub_v3_v3v3(no_edge, v->co, v_a->co);
109
110 /* check are we flipped the right way */
111 BM_edge_calc_face_tangent(e_a, l_a, tvec_a);
112
113 *r_va_other = nullptr;
114 *r_vb_other = nullptr;
115 }
116
117 /* find the normal */
118 cross_v3_v3v3(r_no, no_edge, no_face);
119 normalize_v3(r_no);
120
121 if (dot_v3v3(r_no, tvec_a) > 0.0f) {
122 negate_v3(r_no);
123 }
124
125 copy_v3_v3(r_no_face, no_face);
126}
127
128/* check if we are the only tagged loop-face around this edge */
130{
131 BMLoop *l = l_first->radial_next;
132
133 if (l == l_first) {
134 return true; /* a real boundary */
135 }
136
137 do {
139 return false;
140 }
141 } while ((l = l->radial_next) != l_first);
142
143 return true;
144}
145
147 const float offset,
148 const float offset_fac,
149 const float offset_fac_vg,
150 const bool use_replace,
151 const bool use_boundary,
152 const bool use_even_offset,
153 const bool use_relative_offset,
154 const bool use_crease,
155 const float crease_weight,
156 const int defgrp_index,
157 const bool defgrp_invert,
158 const short mat_offset,
159 const int mat_max,
160 /* for operators */
161 const bool use_tag)
162{
163 const float ofs_orig = -(((-offset_fac + 1.0f) * 0.5f) * offset);
164 const float ofs_new = offset + ofs_orig;
165 const float ofs_mid = (ofs_orig + ofs_new) / 2.0f;
166 const float inset = offset / 2.0f;
167 int cd_edge_crease_offset = use_crease ? CustomData_get_offset_named(
168 &bm->edata, CD_PROP_FLOAT, "crease_edge") :
169 -1;
170 const int cd_dvert_offset = (defgrp_index != -1) ?
172 -1;
173 const float offset_fac_vg_inv = 1.0f - offset_fac_vg;
174
175 const int totvert_orig = bm->totvert;
176
177 BMIter iter;
178 BMIter itersub;
179
180 /* filled only with boundary verts */
181 BMVert **verts_src = MEM_new_array_uninitialized<BMVert *>(totvert_orig, __func__);
182 BMVert **verts_neg = MEM_new_array_uninitialized<BMVert *>(totvert_orig, __func__);
183 BMVert **verts_pos = MEM_new_array_uninitialized<BMVert *>(totvert_orig, __func__);
184
185 /* Will over-allocate, but makes for easy lookups by index to keep aligned. */
186 BMVert **verts_boundary = use_boundary ?
187 MEM_new_array_uninitialized<BMVert *>(totvert_orig, __func__) :
188 nullptr;
189
190 float *verts_relfac = (use_relative_offset || (cd_dvert_offset != -1)) ?
191 MEM_new_array_uninitialized<float>(totvert_orig, __func__) :
192 nullptr;
193
194 /* May over-allocate if not all faces have wire. */
195 BMVert **verts_loop;
196 int verts_loop_tot = 0;
197
198 BMVert *v_src;
199
200 BMFace *f_src;
201 BMLoop *l;
202
203 float tvec[3];
204 float fac, fac_shell;
205
206 int i;
207
208 if (use_crease && cd_edge_crease_offset == -1) {
209 BM_data_layer_add_named(bm, &bm->edata, CD_PROP_FLOAT, "crease_edge");
210 cd_edge_crease_offset = CustomData_get_offset_named(&bm->edata, CD_PROP_FLOAT, "crease_edge");
211 }
212
213 BM_ITER_MESH_INDEX (v_src, &iter, bm, BM_VERTS_OF_MESH, i) {
214 BM_elem_index_set(v_src, i); /* set_inline */
215
216 verts_src[i] = v_src;
218 }
220
221 /* setup tags, all faces and verts will be tagged which will be duplicated */
222
223 BM_ITER_MESH_INDEX (f_src, &iter, bm, BM_FACES_OF_MESH, i) {
224 BM_elem_index_set(f_src, i); /* set_inline */
225
226 if (use_tag) {
227 if (!BM_elem_flag_test(f_src, BM_ELEM_TAG)) {
228 continue;
229 }
230 }
231 else {
233 }
234
235 verts_loop_tot += f_src->len;
236 BM_ITER_ELEM (l, &itersub, f_src, BM_LOOPS_OF_FACE) {
238
239 /* also tag boundary edges */
241 }
242 }
244
245 /* duplicate tagged verts */
246 for (i = 0; i < totvert_orig; i++) {
247 v_src = verts_src[i];
248 if (BM_elem_flag_test(v_src, BM_ELEM_TAG)) {
249 fac = 1.0f;
250
251 if (verts_relfac) {
252 if (use_relative_offset) {
253 verts_relfac[i] = BM_vert_calc_median_tagged_edge_length(v_src);
254 }
255 else {
256 verts_relfac[i] = 1.0f;
257 }
258
259 if (cd_dvert_offset != -1) {
260 MDeformVert *dvert = static_cast<MDeformVert *>(
261 BM_ELEM_CD_GET_VOID_P(v_src, cd_dvert_offset));
262 float defgrp_fac = BKE_defvert_find_weight(dvert, defgrp_index);
263
264 if (defgrp_invert) {
265 defgrp_fac = 1.0f - defgrp_fac;
266 }
267
268 if (offset_fac_vg > 0.0f) {
269 defgrp_fac = (offset_fac_vg + (defgrp_fac * offset_fac_vg_inv));
270 }
271
272 verts_relfac[i] *= defgrp_fac;
273 }
274
275 fac *= verts_relfac[i];
276 }
277
278 verts_neg[i] = BM_vert_create(bm, nullptr, v_src, BM_CREATE_NOP);
279 verts_pos[i] = BM_vert_create(bm, nullptr, v_src, BM_CREATE_NOP);
280
281 if (offset == 0.0f) {
282 madd_v3_v3v3fl(verts_neg[i]->co, v_src->co, v_src->no, ofs_orig * fac);
283 madd_v3_v3v3fl(verts_pos[i]->co, v_src->co, v_src->no, ofs_new * fac);
284 }
285 else {
286 madd_v3_v3v3fl(tvec, v_src->co, v_src->no, ofs_mid * fac);
287
288 madd_v3_v3v3fl(verts_neg[i]->co, tvec, v_src->no, (ofs_orig - ofs_mid) * fac);
289 madd_v3_v3v3fl(verts_pos[i]->co, tvec, v_src->no, (ofs_new - ofs_mid) * fac);
290 }
291 }
292 else {
293 /* could skip this */
294 verts_neg[i] = nullptr;
295 verts_pos[i] = nullptr;
296 }
297
298 /* conflicts with BM_vert_calc_median_tagged_edge_length */
299 if (use_relative_offset == false) {
301 }
302 }
303
304 if (use_relative_offset) {
306 }
307
308 verts_loop = MEM_new_array_uninitialized<BMVert *>(verts_loop_tot, __func__);
309 verts_loop_tot = 0; /* count up again */
310
311 BM_ITER_MESH (f_src, &iter, bm, BM_FACES_OF_MESH) {
312
313 if (use_tag && !BM_elem_flag_test(f_src, BM_ELEM_TAG)) {
314 continue;
315 }
316
317 BM_ITER_ELEM (l, &itersub, f_src, BM_LOOPS_OF_FACE) {
318 /* Because some faces might be skipped! */
319 BM_elem_index_set(l, verts_loop_tot); /* set_dirty */
320
322
323 /* create offset vert */
324 fac = 1.0f;
325
326 if (verts_relfac) {
327 fac *= verts_relfac[BM_elem_index_get(l->v)];
328 }
329
330 fac_shell = fac;
331 if (use_even_offset) {
332 fac_shell *= shell_angle_to_dist((float(M_PI) - BM_loop_calc_face_angle(l)) * 0.5f);
333 }
334
335 madd_v3_v3v3fl(tvec, l->v->co, tvec, inset * fac_shell);
336 if (offset != 0.0f) {
337 madd_v3_v3fl(tvec, l->v->no, ofs_mid * fac);
338 }
339 verts_loop[verts_loop_tot] = BM_vert_create(bm, tvec, l->v, BM_CREATE_NOP);
340
341 if (use_boundary) {
342 if (BM_elem_flag_test(l->e, BM_ELEM_TAG)) { /* is this a boundary? */
343 BMVert *v_pair[2] = {l->v, l->next->v};
344
345 for (i = 0; i < 2; i++) {
346 BMVert *v_boundary = v_pair[i];
347 if (!BM_elem_flag_test(v_boundary, BM_ELEM_TAG)) {
348 const int v_boundary_index = BM_elem_index_get(v_boundary);
349 float no_face[3];
350 BMVert *va_other;
351 BMVert *vb_other;
352
353 BM_elem_flag_enable(v_boundary, BM_ELEM_TAG);
354
355 bm_vert_boundary_tangent(v_boundary, tvec, no_face, &va_other, &vb_other);
356
357 /* create offset vert */
358 /* similar to code above but different angle calc */
359 fac = 1.0f;
360
361 if (verts_relfac) {
362 fac *= verts_relfac[v_boundary_index];
363 }
364
365 fac_shell = fac;
366 if (use_even_offset) {
367 if (va_other) { /* for verts with only one boundary edge - this will be nullptr */
368 fac_shell *= shell_angle_to_dist(
370 va_other->co, v_boundary->co, vb_other->co, no_face)) *
371 0.5f);
372 }
373 }
374
375 madd_v3_v3v3fl(tvec, v_boundary->co, tvec, inset * fac_shell);
376 if (offset != 0.0f) {
377 madd_v3_v3fl(tvec, v_boundary->no, ofs_mid * fac);
378 }
379 verts_boundary[v_boundary_index] = BM_vert_create(
380 bm, tvec, v_boundary, BM_CREATE_NOP);
381 }
382 }
383 }
384 }
385
386 verts_loop_tot++;
387 }
388 }
390
391 BM_ITER_MESH (f_src, &iter, bm, BM_FACES_OF_MESH) {
392
393 /* skip recently added faces */
394 if (BM_elem_index_get(f_src) == -1) {
395 continue;
396 }
397
398 if (use_tag && !BM_elem_flag_test(f_src, BM_ELEM_TAG)) {
399 continue;
400 }
401
403
404 BM_ITER_ELEM (l, &itersub, f_src, BM_LOOPS_OF_FACE) {
405 BMFace *f_new;
406 BMLoop *l_new;
407 BMLoop *l_next = l->next;
408 BMVert *v_l1 = verts_loop[BM_elem_index_get(l)];
409 BMVert *v_l2 = verts_loop[BM_elem_index_get(l_next)];
410
411 BMVert *v_src_l1 = l->v;
412 BMVert *v_src_l2 = l_next->v;
413
414 const int i_1 = BM_elem_index_get(v_src_l1);
415 const int i_2 = BM_elem_index_get(v_src_l2);
416
417 BMVert *v_neg1 = verts_neg[i_1];
418 BMVert *v_neg2 = verts_neg[i_2];
419
420 BMVert *v_pos1 = verts_pos[i_1];
421 BMVert *v_pos2 = verts_pos[i_2];
422
423 f_new = BM_face_create_quad_tri(bm, v_l1, v_l2, v_neg2, v_neg1, f_src, BM_CREATE_NOP);
424 if (mat_offset) {
425 f_new->mat_nr = std::clamp(f_new->mat_nr + mat_offset, 0, mat_max);
426 }
428 l_new = BM_FACE_FIRST_LOOP(f_new);
429
430 BM_elem_attrs_copy(bm, l, l_new);
431 BM_elem_attrs_copy(bm, l, l_new->prev);
432 BM_elem_attrs_copy(bm, l_next, l_new->next);
433 BM_elem_attrs_copy(bm, l_next, l_new->next->next);
434
435 f_new = BM_face_create_quad_tri(bm, v_l2, v_l1, v_pos1, v_pos2, f_src, BM_CREATE_NOP);
436
437 if (mat_offset) {
438 f_new->mat_nr = std::clamp(f_new->mat_nr + mat_offset, 0, mat_max);
439 }
441 l_new = BM_FACE_FIRST_LOOP(f_new);
442
443 BM_elem_attrs_copy(bm, l_next, l_new);
444 BM_elem_attrs_copy(bm, l_next, l_new->prev);
445 BM_elem_attrs_copy(bm, l, l_new->next);
446 BM_elem_attrs_copy(bm, l, l_new->next->next);
447
448 if (use_boundary) {
450 /* we know its a boundary and this is the only face user (which is being wire'd) */
451 /* we know we only touch this edge/face once */
452 BMVert *v_b1 = verts_boundary[i_1];
453 BMVert *v_b2 = verts_boundary[i_2];
454
455 f_new = BM_face_create_quad_tri(bm, v_b2, v_b1, v_neg1, v_neg2, f_src, BM_CREATE_NOP);
456 if (mat_offset) {
457 f_new->mat_nr = std::clamp(f_new->mat_nr + mat_offset, 0, mat_max);
458 }
460 l_new = BM_FACE_FIRST_LOOP(f_new);
461
462 BM_elem_attrs_copy(bm, l_next, l_new);
463 BM_elem_attrs_copy(bm, l_next, l_new->prev);
464 BM_elem_attrs_copy(bm, l, l_new->next);
465 BM_elem_attrs_copy(bm, l, l_new->next->next);
466
467 f_new = BM_face_create_quad_tri(bm, v_b1, v_b2, v_pos2, v_pos1, f_src, BM_CREATE_NOP);
468 if (mat_offset) {
469 f_new->mat_nr = std::clamp(f_new->mat_nr + mat_offset, 0, mat_max);
470 }
472 l_new = BM_FACE_FIRST_LOOP(f_new);
473
474 BM_elem_attrs_copy(bm, l, l_new);
475 BM_elem_attrs_copy(bm, l, l_new->prev);
476 BM_elem_attrs_copy(bm, l_next, l_new->next);
477 BM_elem_attrs_copy(bm, l_next, l_new->next->next);
478
479 if (use_crease) {
480 BMEdge *e_new;
481 e_new = BM_edge_exists(v_pos1, v_b1);
482 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
483
484 e_new = BM_edge_exists(v_pos2, v_b2);
485 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
486
487 e_new = BM_edge_exists(v_neg1, v_b1);
488 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
489
490 e_new = BM_edge_exists(v_neg2, v_b2);
491 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
492 }
493 }
494 }
495
496 if (use_crease) {
497 BMEdge *e_new;
498 e_new = BM_edge_exists(v_pos1, v_l1);
499 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
500
501 e_new = BM_edge_exists(v_pos2, v_l2);
502 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
503
504 e_new = BM_edge_exists(v_neg1, v_l1);
505 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
506
507 e_new = BM_edge_exists(v_neg2, v_l2);
508 BM_ELEM_CD_SET_FLOAT(e_new, cd_edge_crease_offset, crease_weight);
509 }
510 }
511 }
512
513 if (use_boundary) {
514 MEM_delete(verts_boundary);
515 }
516
517 if (verts_relfac) {
518 MEM_delete(verts_relfac);
519 }
520
521 if (use_replace) {
522
523 if (use_tag) {
524/* only remove faces which are original and used to make wire,
525 * use 'verts_pos' and 'verts_neg' to avoid a feedback loop. */
526
527/* vertex must be from 'verts_src' */
528#define VERT_DUPE_TEST_ORIG(v) (verts_neg[BM_elem_index_get(v)] != nullptr)
529#define VERT_DUPE_TEST(v) (verts_pos[BM_elem_index_get(v)] != nullptr)
530#define VERT_DUPE_CLEAR(v) \
531 { \
532 verts_pos[BM_elem_index_get(v)] = nullptr; \
533 } \
534 (void)0
535
536 /* first ensure we keep all verts which are used in faces that weren't
537 * entirely made into wire. */
538 BM_ITER_MESH (f_src, &iter, bm, BM_FACES_OF_MESH) {
539 int mix_flag = 0;
540 BMLoop *l_iter, *l_first;
541
542 /* skip new faces */
543 if (BM_elem_index_get(f_src) == -1) {
544 continue;
545 }
546
547 l_iter = l_first = BM_FACE_FIRST_LOOP(f_src);
548 do {
549 mix_flag |= (VERT_DUPE_TEST_ORIG(l_iter->v) ? 1 : 2);
550 if (mix_flag == (1 | 2)) {
551 break;
552 }
553 } while ((l_iter = l_iter->next) != l_first);
554
555 if (mix_flag == (1 | 2)) {
556 l_iter = l_first = BM_FACE_FIRST_LOOP(f_src);
557 do {
558 VERT_DUPE_CLEAR(l_iter->v);
559 } while ((l_iter = l_iter->next) != l_first);
560 }
561 }
562
563 /* now remove any verts which were made into wire by all faces */
564 for (i = 0; i < totvert_orig; i++) {
565 v_src = verts_src[i];
566 BLI_assert(i == BM_elem_index_get(v_src));
567 if (VERT_DUPE_TEST(v_src)) {
568 BM_vert_kill(bm, v_src);
569 }
570 }
571
572#undef VERT_DUPE_TEST_ORIG
573#undef VERT_DUPE_TEST
574#undef VERT_DUPE_CLEAR
575 }
576 else {
577 /* simple case, no tags - replace all */
578 for (i = 0; i < totvert_orig; i++) {
579 BM_vert_kill(bm, verts_src[i]);
580 }
581 }
582 }
583
584 MEM_delete(verts_src);
585 MEM_delete(verts_neg);
586 MEM_delete(verts_pos);
587 MEM_delete(verts_loop);
588}
589
590} // namespace blender
CustomData interface, see also DNA_customdata_types.h.
support for deformation groups and hooks.
#define M_PI
Read Blender memory allocation and freeing.
#define BM_ELEM_CD_SET_FLOAT(ele, offset, f)
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#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)
#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)
#define VERT_DUPE_CLEAR(v)
#define VERT_DUPE_TEST(v)
#define VERT_DUPE_TEST_ORIG(v)
BMesh Iterators.
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3])
BMESH EDGE/FACE TANGENT.
MINLINE void copy_v3_v3(float r[3], const float a[3])
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
float BM_vert_calc_median_tagged_edge_length(const BMVert *v)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void BM_vert_kill(BMesh *bm, BMVert *v)
static BMLoop * bm_edge_tag_faceloop(BMEdge *e)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static bool bm_loop_is_radial_boundary(BMLoop *l_first)
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.
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BM_loop_calc_face_tangent(const BMLoop *l, float r_tangent[3])
BM_loop_calc_face_tangent.
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 madd_v3_v3fl(float r[3], const float a[3], float f)
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.
float BKE_defvert_find_weight(const MDeformVert *dvert, int defgroup)
Definition deform.cc:779
@ BM_CREATE_NOP
Definition bmesh_core.hh:34
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, StringRef name)
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
MINLINE void negate_v3(float r[3])
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 int mat_max, const bool use_tag)
float BM_loop_calc_face_angle(const BMLoop *l)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
MINLINE float normalize_v3(float n[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const StringRef name)
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)
void BM_elem_attrs_copy(BMesh *bm, const BMCustomDataCopyMap &map, const BMVert *src, BMVert *dst)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
MINLINE float shell_angle_to_dist(float angle)
struct BMLoop * next
struct BMLoop * prev
struct BMVert * v
struct BMLoop * radial_next
struct BMFace * f
struct BMLoop * radial_next