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:
authorCampbell Barton <ideasman42@gmail.com>2013-05-31 22:58:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-31 22:58:32 +0400
commitb577f0c16ebf16d9cf73e103143a6c7466421c61 (patch)
treede17310723752ddea1d29d4e0ee18a9636b971e2 /source/blender/bmesh/operators/bmo_bridge.c
parent686e6acf5de8c5781bacbdf39da16032d33ab25f (diff)
previous fix for #35578 didnt work right, check direction of the open edge loop too.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_bridge.c')
-rw-r--r--source/blender/bmesh/operators/bmo_bridge.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_bridge.c b/source/blender/bmesh/operators/bmo_bridge.c
index 9da6e812032..ddecfe59aa1 100644
--- a/source/blender/bmesh/operators/bmo_bridge.c
+++ b/source/blender/bmesh/operators/bmo_bridge.c
@@ -175,11 +175,27 @@ static void bridge_loop_pair(BMesh *bm,
BM_edgeloop_calc_normal(bm, el_store_b);
}
else {
+ ListBase *lb_a = BM_edgeloop_verts_get(el_store_a);
+ ListBase *lb_b = BM_edgeloop_verts_get(el_store_b);
+
/* normalizing isn't strictly needed but without we may get very large values */
float no[3];
+ float dir_a[3], dir_b[3];
+
+ sub_v3_v3v3(dir_a,
+ ((BMVert *)(((LinkData *)lb_a->first)->data))->co,
+ ((BMVert *)(((LinkData *)lb_a->last)->data))->co);
+ sub_v3_v3v3(dir_b,
+ ((BMVert *)(((LinkData *)lb_b->first)->data))->co,
+ ((BMVert *)(((LinkData *)lb_b->last)->data))->co);
+
+ /* this isnt totally reliable but works well in most cases */
+ if (dot_v3v3(dir_a, dir_b) < 0.0f) {
+ BM_edgeloop_flip(bm, el_store_b);
+ }
+
normalize_v3_v3(no, el_dir);
BM_edgeloop_calc_normal_aligned(bm, el_store_a, no);
- negate_v3(no);
BM_edgeloop_calc_normal_aligned(bm, el_store_b, no);
}