Blender  V3.3
bmesh_boolean.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #include "BLI_array.hh"
10 #include "BLI_math.h"
11 #include "BLI_math_mpq.hh"
12 #include "BLI_mesh_boolean.hh"
13 #include "BLI_mesh_intersect.hh"
14 
15 #include "bmesh.h"
16 #include "bmesh_boolean.h"
17 #include "bmesh_edgesplit.h"
18 
19 #include "PIL_time.h"
20 
21 // #define PERF_DEBUG
22 
23 namespace blender::meshintersect {
24 
25 #ifdef WITH_GMP
26 
36 static IMesh mesh_from_bm(BMesh *bm,
37  struct BMLoop *(*looptris)[3],
38  const int looptris_tot,
39  IMesh *r_triangulated,
40  IMeshArena *arena)
41 {
42  BLI_assert(r_triangulated != nullptr);
45  /* Account for triangulation and intersects. */
46  const int estimate_num_outv = 3 * bm->totvert;
47  const int estimate_num_outf = 4 * bm->totface;
48  arena->reserve(estimate_num_outv, estimate_num_outf);
49  Array<const Vert *> vert(bm->totvert);
50  for (int v = 0; v < bm->totvert; ++v) {
51  BMVert *bmv = BM_vert_at_index(bm, v);
52  vert[v] = arena->add_or_find_vert(mpq3(bmv->co[0], bmv->co[1], bmv->co[2]), v);
53  }
54  Array<Face *> face(bm->totface);
55  constexpr int estimated_max_facelen = 100;
56  Vector<const Vert *, estimated_max_facelen> face_vert;
57  Vector<int, estimated_max_facelen> face_edge_orig;
58  for (int f = 0; f < bm->totface; ++f) {
59  BMFace *bmf = BM_face_at_index(bm, f);
60  int flen = bmf->len;
61  face_vert.clear();
62  face_edge_orig.clear();
63  BMLoop *l = bmf->l_first;
64  for (int i = 0; i < flen; ++i) {
65  const Vert *v = vert[BM_elem_index_get(l->v)];
66  face_vert.append(v);
67  int e_index = BM_elem_index_get(l->e);
68  face_edge_orig.append(e_index);
69  l = l->next;
70  }
71  face[f] = arena->add_face(face_vert, f, face_edge_orig);
72  }
73  /* Now do the triangulation mesh.
74  * The loop_tris have accurate v and f members for the triangles,
75  * but their next and e pointers are not correct for the loops
76  * that start added-diagonal edges. */
77  Array<Face *> tri_face(looptris_tot);
78  face_vert.resize(3);
79  face_edge_orig.resize(3);
80  for (int i = 0; i < looptris_tot; ++i) {
81  BMFace *bmf = looptris[i][0]->f;
82  int f = BM_elem_index_get(bmf);
83  for (int j = 0; j < 3; ++j) {
84  BMLoop *l = looptris[i][j];
85  int v_index = BM_elem_index_get(l->v);
86  int e_index;
87  if (l->next->v == looptris[i][(j + 1) % 3]->v) {
88  e_index = BM_elem_index_get(l->e);
89  }
90  else {
91  e_index = NO_INDEX;
92  }
93  face_vert[j] = vert[v_index];
94  face_edge_orig[j] = e_index;
95  }
96  tri_face[i] = arena->add_face(face_vert, f, face_edge_orig);
97  }
98  r_triangulated->set_faces(tri_face);
99  return IMesh(face);
100 }
101 
102 static bool bmvert_attached_to_wire(const BMVert *bmv)
103 {
104  /* This is not quite right. It returns true if the only edges
105  * Attached to \a bmv are wire edges. TODO: iterate through edges
106  * attached to \a bmv and check #BM_edge_is_wire. */
107  return BM_vert_is_wire(bmv);
108 }
109 
110 static bool bmvert_attached_to_hidden_face(BMVert *bmv)
111 {
112  BMIter iter;
113  for (BMFace *bmf = static_cast<BMFace *>(BM_iter_new(&iter, nullptr, BM_FACES_OF_VERT, bmv));
114  bmf;
115  bmf = static_cast<BMFace *>(BM_iter_step(&iter))) {
116  if (BM_elem_flag_test(bmf, BM_ELEM_HIDDEN)) {
117  return true;
118  }
119  }
120  return false;
121 }
122 
123 static bool face_has_verts_in_order(BMesh *bm, BMFace *bmf, const BMVert *v1, const BMVert *v2)
124 {
125  BMIter liter;
126  BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
127  while (l != nullptr) {
128  if (l->v == v1 && l->next->v == v2) {
129  return true;
130  }
131  l = static_cast<BMLoop *>(BM_iter_step(&liter));
132  }
133  return false;
134 }
135 
137 constexpr uint KEEP_FLAG = (1 << 6);
138 
146 static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out, bool keep_hidden)
147 {
148  bool any_change = false;
149 
150  m_out.populate_vert();
151 
152  /* Initially mark all existing verts as "don't keep", except hidden verts
153  * (if keep_hidden is true), and verts attached to wire edges. */
154  for (int v = 0; v < bm->totvert; ++v) {
155  BMVert *bmv = BM_vert_at_index(bm, v);
156  if ((keep_hidden &&
157  (BM_elem_flag_test(bmv, BM_ELEM_HIDDEN) || bmvert_attached_to_hidden_face(bmv))) ||
158  bmvert_attached_to_wire(bmv)) {
159  BM_elem_flag_enable(bmv, KEEP_FLAG);
160  }
161  else {
162  BM_elem_flag_disable(bmv, KEEP_FLAG);
163  }
164  }
165 
166  /* Reuse old or make new #BMVert's, depending on if there's an orig or not.
167  * For those reused, mark them "keep".
168  * Store needed old #BMVert's in new_bmvs first, as the table may be unusable after
169  * creating a new #BMVert. */
170  Array<BMVert *> new_bmvs(m_out.vert_size());
171  for (int v : m_out.vert_index_range()) {
172  const Vert *vertp = m_out.vert(v);
173  int orig = vertp->orig;
174  if (orig != NO_INDEX) {
175  BLI_assert(orig >= 0 && orig < bm->totvert);
176  BMVert *bmv = BM_vert_at_index(bm, orig);
177  new_bmvs[v] = bmv;
178  BM_elem_flag_enable(bmv, KEEP_FLAG);
179  }
180  else {
181  new_bmvs[v] = nullptr;
182  }
183  }
184  for (int v : m_out.vert_index_range()) {
185  const Vert *vertp = m_out.vert(v);
186  if (new_bmvs[v] == nullptr) {
187  float co[3];
188  const double3 &d_co = vertp->co;
189  for (int i = 0; i < 3; ++i) {
190  co[i] = static_cast<float>(d_co[i]);
191  }
192  BMVert *bmv = BM_vert_create(bm, co, nullptr, BM_CREATE_NOP);
193  new_bmvs[v] = bmv;
194  BM_elem_flag_enable(bmv, KEEP_FLAG);
195  any_change = true;
196  }
197  }
198 
199  /* Initially mark all existing faces as "don't keep", except hidden faces (if keep_hidden).
200  * Also, save current #BMFace pointers as creating faces will disturb the table. */
201  Array<BMFace *> old_bmfs(bm->totface);
203  for (int f = 0; f < bm->totface; ++f) {
204  BMFace *bmf = BM_face_at_index(bm, f);
205  old_bmfs[f] = bmf;
206  if (keep_hidden && BM_elem_flag_test(bmf, BM_ELEM_HIDDEN)) {
207  BM_elem_flag_enable(bmf, KEEP_FLAG);
208  }
209  else {
210  BM_elem_flag_disable(bmf, KEEP_FLAG);
211  }
212  }
213 
214  /* Save the original #BMEdge's so we can use them as examples. */
215  Array<BMEdge *> old_edges(bm->totedge);
216  std::copy(bm->etable, bm->etable + bm->totedge, old_edges.begin());
217 
218  /* Reuse or make new #BMFace's, as the faces are identical to old ones or not.
219  * If reusing, mark them as "keep". First find the maximum face length
220  * so we can declare some arrays outside of the face-creating loop. */
221  int maxflen = 0;
222  for (const Face *f : m_out.faces()) {
223  maxflen = max_ii(maxflen, f->size());
224  }
225  Array<BMVert *> face_bmverts(maxflen);
226  Array<BMEdge *> face_bmedges(maxflen);
227  for (const Face *f : m_out.faces()) {
228  const Face &face = *f;
229  int flen = face.size();
230  for (int i = 0; i < flen; ++i) {
231  const Vert *v = face[i];
232  int v_index = m_out.lookup_vert(v);
233  BLI_assert(v_index < new_bmvs.size());
234  face_bmverts[i] = new_bmvs[v_index];
235  }
236  BMFace *bmf = BM_face_exists(face_bmverts.data(), flen);
237  /* #BM_face_exists checks if the face exists with the vertices in either order.
238  * We can only reuse the face if the orientations are the same. */
239  if (bmf != nullptr && face_has_verts_in_order(bm, bmf, face_bmverts[0], face_bmverts[1])) {
240  BM_elem_flag_enable(bmf, KEEP_FLAG);
241  }
242  else {
243  int orig = face.orig;
244  BMFace *orig_face;
245  /* There should always be an orig face, but just being extra careful here. */
246  if (orig != NO_INDEX) {
247  orig_face = old_bmfs[orig];
248  }
249  else {
250  orig_face = nullptr;
251  }
252  /* Make or find #BMEdge's. */
253  for (int i = 0; i < flen; ++i) {
254  BMVert *bmv1 = face_bmverts[i];
255  BMVert *bmv2 = face_bmverts[(i + 1) % flen];
256  BMEdge *bme = BM_edge_exists(bmv1, bmv2);
257  if (bme == nullptr) {
258  BMEdge *orig_edge = nullptr;
259  if (face.edge_orig[i] != NO_INDEX) {
260  orig_edge = old_edges[face.edge_orig[i]];
261  }
262  bme = BM_edge_create(bm, bmv1, bmv2, orig_edge, BM_CREATE_NOP);
263  if (orig_edge != nullptr) {
264  BM_elem_select_copy(bm, bme, orig_edge);
265  }
266  }
267  face_bmedges[i] = bme;
268  if (face.is_intersect[i]) {
270  }
271  else {
273  }
274  }
275  BMFace *bmf = BM_face_create(
276  bm, face_bmverts.data(), face_bmedges.data(), flen, orig_face, BM_CREATE_NOP);
277  if (orig_face != nullptr) {
278  BM_elem_select_copy(bm, bmf, orig_face);
279  }
280  BM_elem_flag_enable(bmf, KEEP_FLAG);
281  /* Now do interpolation of loop data (e.g., UV's) using the example face. */
282  if (orig_face != nullptr) {
283  BMIter liter;
284  BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
285  while (l != nullptr) {
286  BM_loop_interp_from_face(bm, l, orig_face, false, true);
287  l = static_cast<BMLoop *>(BM_iter_step(&liter));
288  }
289  }
290  any_change = true;
291  }
292  }
293 
294  /* Now kill the unused faces and verts, and clear flags for kept ones. */
295  /* #BM_ITER_MESH_MUTABLE macro needs type casts for C++, so expand here.
296  * TODO(howard): make some nice C++ iterators for #BMesh. */
297  BMIter iter;
298  BMFace *bmf = static_cast<BMFace *>(BM_iter_new(&iter, bm, BM_FACES_OF_MESH, nullptr));
299  while (bmf != nullptr) {
300 # ifdef DEBUG
302 # endif
303  BMFace *bmf_next = static_cast<BMFace *>(BM_iter_step(&iter));
304  if (BM_elem_flag_test(bmf, KEEP_FLAG)) {
305  BM_elem_flag_disable(bmf, KEEP_FLAG);
306  }
307  else {
308  BM_face_kill_loose(bm, bmf);
309 # if 0
310  BM_face_kill(bm, bmf);
311 # endif
312  any_change = true;
313  }
314  bmf = bmf_next;
315  }
316  BMVert *bmv = static_cast<BMVert *>(BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, nullptr));
317  while (bmv != nullptr) {
318 # ifdef DEBUG
320 # endif
321  BMVert *bmv_next = static_cast<BMVert *>(BM_iter_step(&iter));
322  if (BM_elem_flag_test(bmv, KEEP_FLAG)) {
323  BM_elem_flag_disable(bmv, KEEP_FLAG);
324  }
325  else {
326  BM_vert_kill(bm, bmv);
327  any_change = true;
328  }
329  bmv = bmv_next;
330  }
331 
332  return any_change;
333 }
334 
335 static bool bmesh_boolean(BMesh *bm,
336  struct BMLoop *(*looptris)[3],
337  const int looptris_tot,
338  int (*test_fn)(BMFace *f, void *user_data),
339  void *user_data,
340  int nshapes,
341  const bool use_self,
342  const bool use_separate_all,
343  const bool keep_hidden,
344  const bool hole_tolerant,
345  const BoolOpType boolean_mode)
346 {
347  IMeshArena arena;
348  IMesh m_triangulated;
349 # ifdef PERF_DEBUG
350  double start_time = PIL_check_seconds_timer();
351 # endif
352  IMesh m_in = mesh_from_bm(bm, looptris, looptris_tot, &m_triangulated, &arena);
353 # ifdef PERF_DEBUG
354  double mesh_time = PIL_check_seconds_timer();
355  std::cout << "bmesh_boolean, imesh_from_bm done, time = " << mesh_time - start_time << "\n";
356 # endif
357  std::function<int(int)> shape_fn;
358  if (use_self && boolean_mode == BoolOpType::None) {
359  /* Unary knife operation. Want every face where test_fn doesn't return -1. */
360  BLI_assert(nshapes == 1);
361  shape_fn = [bm, test_fn, user_data](int f) {
362  BMFace *bmf = BM_face_at_index(bm, f);
363  if (test_fn(bmf, user_data) != -1) {
364  return 0;
365  }
366  return -1;
367  };
368  }
369  else {
370  shape_fn = [bm, test_fn, user_data](int f) {
371  BMFace *bmf = BM_face_at_index(bm, f);
372  int test_val = test_fn(bmf, user_data);
373  if (test_val >= 0) {
374  return test_val;
375  }
376  return -1;
377  };
378  }
379  IMesh m_out = boolean_mesh(
380  m_in, boolean_mode, nshapes, shape_fn, use_self, hole_tolerant, &m_triangulated, &arena);
381 # ifdef PERF_DEBUG
382  double boolean_time = PIL_check_seconds_timer();
383  std::cout << "boolean done, time = " << boolean_time - mesh_time << "\n";
384 # endif
385  bool any_change = apply_mesh_output_to_bmesh(bm, m_out, keep_hidden);
386 # ifdef PERF_DEBUG
387  double apply_mesh_time = PIL_check_seconds_timer();
388  std::cout << "applied boolean output to bmesh, time = " << apply_mesh_time - boolean_time
389  << "\n";
390 # endif
391  if (use_separate_all) {
392  /* We are supposed to separate all faces that are incident on intersection edges. */
393  BM_mesh_edgesplit(bm, false, true, false);
394  }
395  return any_change;
396 }
397 
398 #endif // WITH_GMP
399 
400 } // namespace blender::meshintersect
401 
402 extern "C" {
419 #ifdef WITH_GMP
420 bool BM_mesh_boolean(BMesh *bm,
421  struct BMLoop *(*looptris)[3],
422  const int looptris_tot,
423  int (*test_fn)(BMFace *f, void *user_data),
424  void *user_data,
425  const int nshapes,
426  const bool use_self,
427  const bool keep_hidden,
428  const bool hole_tolerant,
429  const int boolean_mode)
430 {
431  return blender::meshintersect::bmesh_boolean(
432  bm,
433  looptris,
434  looptris_tot,
435  test_fn,
436  user_data,
437  nshapes,
438  use_self,
439  false,
440  keep_hidden,
441  hole_tolerant,
442  static_cast<blender::meshintersect::BoolOpType>(boolean_mode));
443 }
444 
446  struct BMLoop *(*looptris)[3],
447  const int looptris_tot,
448  int (*test_fn)(BMFace *f, void *user_data),
449  void *user_data,
450  const int nshapes,
451  const bool use_self,
452  const bool use_separate_all,
453  const bool hole_tolerant,
454  const bool keep_hidden)
455 {
456  return blender::meshintersect::bmesh_boolean(bm,
457  looptris,
458  looptris_tot,
459  test_fn,
460  user_data,
461  nshapes,
462  use_self,
463  use_separate_all,
464  keep_hidden,
465  hole_tolerant,
466  blender::meshintersect::BoolOpType::None);
467 }
468 #else
470  struct BMLoop *(*looptris)[3],
471  const int UNUSED(looptris_tot),
472  int (*test_fn)(BMFace *, void *),
473  void *UNUSED(user_data),
474  const int UNUSED(nshapes),
475  const bool UNUSED(use_self),
476  const bool UNUSED(keep_hidden),
477  const bool UNUSED(hole_tolerant),
478  const int UNUSED(boolean_mode))
479 {
480  UNUSED_VARS(looptris, test_fn);
481  return false;
482 }
483 
493  struct BMLoop *(*looptris)[3],
494  const int UNUSED(looptris_tot),
495  int (*test_fn)(BMFace *, void *),
496  void *UNUSED(user_data),
497  const int UNUSED(nshapes),
498  const bool UNUSED(use_self),
499  const bool UNUSED(use_separate_all),
500  const bool UNUSED(hole_tolerant),
501  const bool UNUSED(keep_hidden))
502 {
503  UNUSED_VARS(looptris, test_fn);
504  return false;
505 }
506 #endif
507 
508 } /* extern "C" */
#define BLI_assert(a)
Definition: BLI_assert.h:46
MINLINE int max_ii(int a, int b)
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED_VARS(...)
#define UNUSED(x)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Platform independent time functions.
bool BM_mesh_boolean(BMesh *UNUSED(bm), struct BMLoop *(*looptris)[3], const int UNUSED(looptris_tot), int(*test_fn)(BMFace *, void *), void *UNUSED(user_data), const int UNUSED(nshapes), const bool UNUSED(use_self), const bool UNUSED(keep_hidden), const bool UNUSED(hole_tolerant), const int UNUSED(boolean_mode))
bool BM_mesh_boolean_knife(BMesh *UNUSED(bm), struct BMLoop *(*looptris)[3], const int UNUSED(looptris_tot), int(*test_fn)(BMFace *, void *), void *UNUSED(user_data), const int UNUSED(nshapes), const bool UNUSED(use_self), const bool UNUSED(use_separate_all), const bool UNUSED(hole_tolerant), const bool UNUSED(keep_hidden))
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_EDGE
Definition: bmesh_class.h:384
@ BM_ELEM_HIDDEN
Definition: bmesh_class.h:472
@ BM_ELEM_TAG
Definition: bmesh_class.h:484
void BM_elem_select_copy(BMesh *bm_dst, void *ele_dst_v, const void *ele_src_v)
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.
Definition: bmesh_core.c:41
void BM_vert_kill(BMesh *bm, BMVert *v)
Definition: bmesh_core.c:939
void BM_face_kill(BMesh *bm, BMFace *f)
Definition: bmesh_core.c:828
void BM_face_kill_loose(BMesh *bm, BMFace *f)
Definition: bmesh_core.c:872
BMFace * BM_face_create(BMesh *bm, BMVert **verts, BMEdge **edges, const int len, const BMFace *f_example, const eBMCreateFlag create_flag)
Definition: bmesh_core.c:395
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
Definition: bmesh_core.c:123
@ BM_CREATE_NOP
Definition: bmesh_core.h:12
void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, const bool copy_select)
#define BM_elem_index_get(ele)
Definition: bmesh_inline.h:110
#define BM_elem_flag_disable(ele, hflag)
Definition: bmesh_inline.h:15
#define BM_elem_flag_test(ele, hflag)
Definition: bmesh_inline.h:12
#define BM_elem_flag_enable(ele, hflag)
Definition: bmesh_inline.h:14
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
Definition: bmesh_interp.c:682
int BM_iter_mesh_count(const char itype, BMesh *bm)
@ BM_FACES_OF_VERT
@ BM_VERTS_OF_MESH
@ BM_FACES_OF_MESH
@ BM_LOOPS_OF_FACE
#define BM_iter_new(iter, bm, itype, data)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
Definition: bmesh_mesh.cc:558
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
Definition: bmesh_mesh.cc:446
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
Definition: bmesh_mesh.h:115
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
Definition: bmesh_mesh.h:103
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
Definition: bmesh_query.c:1553
bool BM_vert_is_wire(const BMVert *v)
Definition: bmesh_query.c:688
BMFace * BM_face_exists(BMVert **varr, int len)
Definition: bmesh_query.c:1612
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
void * user_data
vec_base< double, 3 > double3
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
int len
Definition: bmesh_class.h:267
BMLoop * l_first
Definition: bmesh_class.h:261
struct BMVert * v
Definition: bmesh_class.h:153
struct BMEdge * e
Definition: bmesh_class.h:164
struct BMLoop * next
Definition: bmesh_class.h:233
float co[3]
Definition: bmesh_class.h:87
int totvert
Definition: bmesh_class.h:297
BMEdge ** etable
Definition: bmesh_class.h:322
int totedge
Definition: bmesh_class.h:297
int totface
Definition: bmesh_class.h:297
double PIL_check_seconds_timer(void)
Definition: time.c:64