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-04-27 01:04:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-27 01:04:12 +0400
commit5018ea5e29fad0404ca4871aa3eff4599cc04878 (patch)
treeaa398c63044355030723a0721f310ed8f8343bd2 /source/blender/blenlib/intern/scanfill.c
parent357198d88590dbc90751bdf0daf59f25d984bb59 (diff)
real fix for [#35097], (curve cap flipping).
previous commit was incorrect, the face flipping depended on the orientation of the curve. fix by passing the bevel direction to the fill function so we can have a reliable front/back. This also gives some speedup for all curve filling since we can avoid calculating the normal since its already known.
Diffstat (limited to 'source/blender/blenlib/intern/scanfill.c')
-rw-r--r--source/blender/blenlib/intern/scanfill.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index f6c092356bf..becdf5a9537 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -867,7 +867,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
float *min_xy_p, *max_xy_p;
short a, c, poly = 0, ok = 0, toggle = 0;
int totfaces = 0; /* total faces added */
- int co_x, co_y;
+ float mat_2d[3][3];
/* reset variables */
eve = sf_ctx->fillvertbase.first;
@@ -960,7 +960,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
return 0;
}
- axis_dominant_v3(&co_x, &co_y, n);
+ axis_dominant_v3_to_m3(mat_2d, n);
}
@@ -968,8 +968,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
if (flag & BLI_SCANFILL_CALC_HOLES) {
eve = sf_ctx->fillvertbase.first;
while (eve) {
- eve->xy[0] = eve->co[co_x];
- eve->xy[1] = eve->co[co_y];
+ mul_v2_m3v3(eve->xy, mat_2d, eve->co);
/* get first vertex with no poly number */
if (eve->poly_nr == 0) {
@@ -1016,8 +1015,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
eve = sf_ctx->fillvertbase.first;
while (eve) {
- eve->xy[0] = eve->co[co_x];
- eve->xy[1] = eve->co[co_y];
+ mul_v2_m3v3(eve->xy, mat_2d, eve->co);
eve->poly_nr = poly;
eve = eve->next;
}