diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-04 02:53:12 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-06-04 02:53:12 +0400 |
commit | 0f33d5719fd0adc666e7e92e0f062281f4285f13 (patch) | |
tree | 564cbb57a3563460296f1081f91c985ee9f2e5d4 | |
parent | 329b05dcd789bd8421661898697ed060c83b3286 (diff) |
Made an attempt to fix an instability issue in stroke rendering due to a failure
of Normal2DF0D with smooth FEdges. The fix is to avoid generating new FEdgeSmooth
instances whose length is shorter than epsilon.
-rwxr-xr-x | source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp index 7cf177dedb7..10d5fb0de75 100755 --- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp @@ -174,6 +174,8 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer) fl!=flend; ++fl){ fe = BuildSmoothFEdge(feprevious, (*fl)); + if (feprevious && fe == feprevious) + continue; fe->setViewEdge(newVEdge); if(!fefirst) fefirst = fe; @@ -469,6 +471,9 @@ FEdge * ViewEdgeXBuilder::BuildSmoothFEdge(FEdge *feprevious, const OWXFaceLayer Vec3r B2(woeb->GetbVertex()->GetVertex()); Vec3r B(B1+tb*(B2-B1)); + if (feprevious && (B - va->point3D()).norm() < 1e-6) + return feprevious; + vb = MakeSVertex(B, false); // Set normal: Vec3r NB1(ifl.fl->getFace()->GetVertexNormal(woeb->GetaVertex())); |