From 38b7cbbd004ef7268a1c39114d8503906361c1f7 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sun, 4 Jul 2010 23:08:37 +0000 Subject: =?UTF-8?q?Bug=20fixes=20from=20St=C3=A9phane=20Grabli,=20one=20of?= =?UTF-8?q?=20the=20coauthors=20of=20the=20original=20Freestyle:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for making the stroke construction more robust to nearly overlapping vertices. * Fix for a bug in the computation of the occluded surfaces. These changes make the visibility computation more robust and the line quality generally higher. --- .../freestyle/intern/view_map/Functions0D.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'source/blender/freestyle/intern/view_map/Functions0D.cpp') diff --git a/source/blender/freestyle/intern/view_map/Functions0D.cpp b/source/blender/freestyle/intern/view_map/Functions0D.cpp index b28ac575d00..dc38ca34184 100755 --- a/source/blender/freestyle/intern/view_map/Functions0D.cpp +++ b/source/blender/freestyle/intern/view_map/Functions0D.cpp @@ -38,16 +38,9 @@ namespace Functions0D { Interface0DIterator prev = it, next = it; ++next; int count = 1; - while((!prev.isBegin()) && (count < 3)) - { - --prev; - ++count; - } - while((!next.isEnd()) && (count < 3)) - { - ++next; - ++count; - } + if (!it.isBegin() && !next.isEnd()) { + count = 3; + } if(count < 3) { // if we only have 2 vertices @@ -296,9 +289,13 @@ namespace Functions0D { int MaterialF0D::operator()(Interface0DIterator& iter) { FEdge *fe1, *fe2; getFEdges(iter,fe1,fe2); - - if(fe1 == 0) + + if(fe1 == 0) { + // DEBUG getFEdges(iter, fe1, fe2); + return 1; + } + if(fe1->isSmooth()) result = ((FEdgeSmooth*)fe1)->frs_material(); else -- cgit v1.2.3