[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41047] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/stroke/Chain.cpp: Fix for a failure of SVertex:: getFEdge due to a discontinuity of underlying FEdges

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun Oct 16 12:29:22 CEST 2011


Revision: 41047
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41047
Author:   kjym3
Date:     2011-10-16 10:29:21 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
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!

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.cpp	2011-10-16 09:51:23 UTC (rev 41046)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.cpp	2011-10-16 10:29:21 UTC (rev 41047)
@@ -49,6 +49,17 @@
       ++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 @@
       ++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(); 




More information about the Bf-blender-cvs mailing list