Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2014-01-07 00:51:54 +0400
committerHoward Trickey <howard.trickey@gmail.com>2014-01-07 00:53:22 +0400
commite164a500c83b6c67ad43da3f15c5477280926cc2 (patch)
tree294a6e00ab9530d8dfd3aaf8f592852312ad74b9 /source/blender
parent62c8bae872b7081eb71a0be3d55df91a672b95e7 (diff)
Fix to own previous commit for bevel vertex only case.
In separating out the adj mesh change from a profile change, I'd forgotten that some profiles need to be flat (in particular, for vertex-only bevels). This fixes that.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 06d35bd0abc..984632d807d 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -89,11 +89,12 @@ typedef struct EdgeHalf {
} EdgeHalf;
/* Profile specification.
- * For now, only have round profiles so only need midpoint.
+ * For now, only have round profiles and straight profiles, so only need midpoint.
* The start and end points of the profile are stored separately.
* TODO: generalize to superellipse profiles.
*/
typedef struct Profile {
+ bool flat;
float midco[3]; /* mid control point for profile */
} Profile;
@@ -181,6 +182,7 @@ static BoundVert *add_new_bound_vert(MemArena *mem_arena, VMesh *vm, const float
tail->next = ans;
vm->boundstart->prev = ans;
}
+ ans->profile.flat = true;
vm->count++;
return ans;
}
@@ -829,6 +831,7 @@ static void set_profile_params(BoundVert *bndv)
e = bndv->ebev;
if (e) {
+ bndv->profile.flat = false;
project_to_edge(e->e, bndv->nv.co, bndv->next->nv.co,
bndv->profile.midco);
}
@@ -1006,7 +1009,7 @@ static void get_profile_point(const Profile *pro, const float va[3], const float
copy_v3_v3(r_co, va);
else if (u >= 2.0f)
copy_v3_v3(r_co, vb);
- else if (!make_unit_square_map(va, pro->midco, vb, m)) {
+ else if (pro->flat || !make_unit_square_map(va, pro->midco, vb, m)) {
interp_v3_v3v3(r_co, va, vb, u / 2.0f);
}
else {