[Bf-blender-cvs] [e164a50] master: Fix to own previous commit for bevel vertex only case.
Howard Trickey
noreply at git.blender.org
Mon Jan 6 21:54:21 CET 2014
Commit: e164a500c83b6c67ad43da3f15c5477280926cc2
Author: Howard Trickey
Date: Mon Jan 6 15:51:54 2014 -0500
https://developer.blender.org/rBe164a500c83b6c67ad43da3f15c5477280926cc2
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.
===================================================================
M source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 06d35bd..984632d 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 {
More information about the Bf-blender-cvs
mailing list