diff options
Diffstat (limited to 'source/blender/freestyle/intern/stroke/StrokeRep.cpp')
-rwxr-xr-x | source/blender/freestyle/intern/stroke/StrokeRep.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp index fbe1273bac0..6ae15c71833 100755 --- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp @@ -254,7 +254,14 @@ Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) else _vertices.push_back(new StrokeVertexRep(p-thickness[0]*stripDir)); ++i; - + + if((stripDir+stripDirPrev).norm() <= 1.e-06){ + // the strip is most likely doing a U-turn, we can't compute the average vector. + // We just continue and hope it's ok + vPrev = v; + continue; + } + // if the angle is obtuse, we simply average the directions to avoid the singularity stripDir=stripDir+stripDirPrev; if ((dirNorm<ZERO) || (dirPrevNorm<ZERO) || (stripDir.norm() < ZERO)) { |