diff options
Diffstat (limited to 'source/blender/bmesh/tools')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index d8c2057bb56..0ff89aa3127 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -7145,7 +7145,7 @@ static void bevel_limit_offset(BevelParams *bp, BMesh *bm) void BM_mesh_bevel(BMesh *bm, const float offset, const int offset_type, - const float segments, + const int segments, const float profile, const bool vertex_only, const bool use_weights, @@ -7176,7 +7176,7 @@ void BM_mesh_bevel(BMesh *bm, bp.offset = offset; bp.offset_type = offset_type; - bp.seg = (int)segments; + bp.seg = segments; bp.profile = profile; bp.pro_super_r = -logf(2.0) / logf(sqrtf(profile)); /* Convert to superellipse exponent. */ bp.vertex_only = vertex_only; @@ -7207,6 +7207,10 @@ void BM_mesh_bevel(BMesh *bm, bp.miter_inner = BEVEL_MITER_SHARP; } + if (bp.seg <= 1) { + bp.seg = 1; + } + if (profile >= 0.950f) { /* r ~ 692, so PRO_SQUARE_R is 1e4 */ bp.pro_super_r = PRO_SQUARE_R; } diff --git a/source/blender/bmesh/tools/bmesh_bevel.h b/source/blender/bmesh/tools/bmesh_bevel.h index 45bebbb33ce..479a8a3f6d6 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.h +++ b/source/blender/bmesh/tools/bmesh_bevel.h @@ -27,7 +27,7 @@ struct MDeformVert; void BM_mesh_bevel(BMesh *bm, const float offset, const int offset_type, - const float segments, + const int segments, const float profile, const bool vertex_only, const bool use_weights, |