From ecd76d99d64d76846f9f1ed24c54a82b6e9ad041 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Tue, 22 Feb 2011 01:39:56 +0000 Subject: Consolidation of stroke drawing. Fixed a complicated bug that caused a failure of CurvePoint::getFEdge() which had affected a number of C/Python API functions such as MaterialF0D. The current view map building procedure may generate ViewEdges whose two-dimensional (2D) length is almost or exactly zero. Such a zero-length ViewEdge is possibly chained with other ViewEdges to form a stroke. When the stroke is finally generated by Operators::create(), an attempt to remove redundant vertices at the same 2D point is made. This possibly breaks the links of ViewEdges on top of which the stroke has been built, and eventually result in a fatal error of CurvePoint::getFEdge() when API functions that rely on this method are called from within a style module. The present fix addresses this issue by automatically removing zero-length ViewEdges (and Chains of them) before stroke drawing is started and after splitting is performed (e.g., using Operators::sequentialSplit()). --- source/blender/freestyle/intern/view_map/ViewMap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/freestyle/intern/view_map') diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index 623348b61a7..a0e60ff7bd7 100755 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -1353,6 +1353,10 @@ void ViewShape::SplitEdge(FEdge *fe, // a new edge, A'B is created. FEdge *newEdge = shape->SplitEdgeIn2(fe, sv); + /* + * One of the two FEdges (fe and newEdge) may have a 2D length less than M_EPSILON. + * (22 Feb 2011, T.K.) + */ ioNewEdges.push_back(newEdge); ViewEdge *newVEdge; -- cgit v1.2.3