Blender  V3.3
bmo_bevel.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #include "BLI_utildefines.h"
10 
11 #include "BKE_curveprofile.h"
12 #include "DNA_curveprofile_types.h"
13 #include "bmesh.h"
14 #include "bmesh_tools.h"
15 
16 #include "intern/bmesh_operators_private.h" /* own include */
17 
19 {
20  const float offset = BMO_slot_float_get(op->slots_in, "offset");
21  const int offset_type = BMO_slot_int_get(op->slots_in, "offset_type");
22  const int profile_type = BMO_slot_int_get(op->slots_in, "profile_type");
23  const int seg = BMO_slot_int_get(op->slots_in, "segments");
24  const int affect_type = BMO_slot_int_get(op->slots_in, "affect");
25  const float profile = BMO_slot_float_get(op->slots_in, "profile");
26  const bool clamp_overlap = BMO_slot_bool_get(op->slots_in, "clamp_overlap");
27  const int material = BMO_slot_int_get(op->slots_in, "material");
28  const bool loop_slide = BMO_slot_bool_get(op->slots_in, "loop_slide");
29  const bool mark_seam = BMO_slot_bool_get(op->slots_in, "mark_seam");
30  const bool mark_sharp = BMO_slot_bool_get(op->slots_in, "mark_sharp");
31  const bool harden_normals = BMO_slot_bool_get(op->slots_in, "harden_normals");
32  const int face_strength_mode = BMO_slot_int_get(op->slots_in, "face_strength_mode");
33  const int miter_outer = BMO_slot_int_get(op->slots_in, "miter_outer");
34  const int miter_inner = BMO_slot_int_get(op->slots_in, "miter_inner");
35  const float spread = BMO_slot_float_get(op->slots_in, "spread");
36  const float smoothresh = BMO_slot_float_get(op->slots_in, "smoothresh");
37  const CurveProfile *custom_profile = BMO_slot_ptr_get(op->slots_in, "custom_profile");
38  const int vmesh_method = BMO_slot_int_get(op->slots_in, "vmesh_method");
39 
40  if (offset > 0) {
41  BMOIter siter;
42  BMEdge *e;
43  BMVert *v;
44 
45  /* first flush 'geom' into flags, this makes it possible to check connected data,
46  * BM_FACE is cleared so we can put newly created faces into a bmesh slot. */
48 
49  BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
51  }
52 
53  BMO_ITER (e, &siter, op->slots_in, "geom", BM_EDGE) {
54  if (BM_edge_is_manifold(e)) {
56  /* in case verts were not also included in the geom */
59  }
60  }
61 
63  offset,
64  offset_type,
65  profile_type,
66  seg,
67  profile,
68  affect_type,
69  false,
70  clamp_overlap,
71  NULL,
72  -1,
73  material,
74  loop_slide,
75  mark_seam,
76  mark_sharp,
77  harden_normals,
78  face_strength_mode,
79  miter_outer,
80  miter_inner,
81  spread,
82  smoothresh,
83  custom_profile,
84  vmesh_method);
85 
89  }
90 }
void BM_mesh_bevel(BMesh *bm, const float offset, const int offset_type, const int profile_type, const int segments, const float profile, const bool affect_type, const bool use_weights, const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const float smoothresh, const struct CurveProfile *custom_profile, const int vmesh_method)
Definition: bmesh_bevel.c:7704
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_EDGE
Definition: bmesh_class.h:384
@ BM_ELEM_TAG
Definition: bmesh_class.h:484
#define BM_elem_flag_enable(ele, hflag)
Definition: bmesh_inline.h:14
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag)
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void * BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void bmo_bevel_exec(BMesh *bm, BMOperator *op)
Definition: bmo_bevel.c:18
Material material
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]