diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-10-16 14:29:21 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-10-16 14:29:21 +0400 |
commit | 2d25a12bbdc4dde23810e23726b29841bf13c2cd (patch) | |
tree | df42cd9b325ec6200791a7feb2186e8553482a43 /source/blender/freestyle/intern/stroke | |
parent | d546002476a849524ba938c53a5d9e9a81c50ded (diff) |
Fix for a failure of SVertex::getFEdge due to a discontinuity of underlying FEdges
introduced by chaining operations. When two ViewEdges are concatenated by a chaining
operator, the last vertex of one ViewEdge and the first vertex of the other reside
in the same 3D position, so that the latter vertex is omitted. This caused a pair
of SVertices unconnected by an FEdge. The present commit intends to fix this issue.
The bug was reported by mato_sus304 with a .blend file reproducing the issue. Thanks!
Diffstat (limited to 'source/blender/freestyle/intern/stroke')
-rwxr-xr-x | source/blender/freestyle/intern/stroke/Chain.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/stroke/Chain.cpp b/source/blender/freestyle/intern/stroke/Chain.cpp index 3776cd58a03..dd3c4723cff 100755 --- a/source/blender/freestyle/intern/stroke/Chain.cpp +++ b/source/blender/freestyle/intern/stroke/Chain.cpp @@ -49,6 +49,17 @@ void Chain::push_viewedge_back(ViewEdge *iViewEdge, bool orientation) ++v; else --v; + // Ensure the continuity of underlying FEdges + CurvePoint *cp = _Vertices.back(); + SVertex *sv_last = cp->B(); + if (!sv_last) sv_last = cp->A(); + SVertex *sv_curr = (*v); + FEdge *fe = (orientation) ? iViewEdge->fedgeA() : iViewEdge->fedgeB(); + FEdge *fe2 = fe->duplicate(); + fe2->setVertexA(sv_last); + fe2->setVertexB(sv_curr); + sv_last->AddFEdge(fe2); + sv_curr->AddFEdge(fe2); } else previous = (*v)->point2d(); @@ -99,6 +110,17 @@ void Chain::push_viewedge_front(ViewEdge *iViewEdge, bool orientation) ++v; else --v; + // Ensure the continuity of underlying FEdges + CurvePoint *cp = _Vertices.front(); + SVertex *sv_last = cp->A(); + if (!sv_last) sv_last = cp->B(); + SVertex *sv_curr = (*v); + FEdge *fe = (orientation) ? iViewEdge->fedgeA() : iViewEdge->fedgeB(); + FEdge *fe2 = fe->duplicate(); + fe2->setVertexA(sv_curr); + fe2->setVertexB(sv_last); + sv_last->AddFEdge(fe2); + sv_curr->AddFEdge(fe2); } else previous = (*v)->point2d(); |