diff options
Diffstat (limited to 'source/blender/freestyle/intern')
-rw-r--r-- | source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp | 12 | ||||
-rw-r--r-- | source/blender/freestyle/intern/winged_edge/Curvature.cpp | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp index 9631c93cd7e..2ded242e9ea 100644 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp @@ -40,6 +40,8 @@ #include "../geometry/GeomUtils.h" #include "../geometry/normal_cycle.h" +#include "BKE_global.h" + void FEdgeXDetector::processShapes(WingedEdge& we) { bool progressBarDisplay = false; @@ -171,6 +173,16 @@ void FEdgeXDetector::preProcessFace(WXFace *iFace) void FEdgeXDetector::computeCurvatures(WXVertex *vertex) { + // TODO: for some reason, the 'vertex' may have no associated edges + // (i.e., WVertex::_EdgeList is empty), which causes a crash due to + // a subsequent call of WVertex::_EdgeList.front(). + if (vertex->GetEdges().empty()) { + if (G.debug & G_DEBUG_FREESTYLE) { + printf("Warning: WVertex %d has no associated edges.\n", vertex->GetId()); + } + return; + } + // CURVATURE LAYER // store all the curvature datas for each vertex diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp index 65ebdeac3a8..64b897c5596 100644 --- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp +++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp @@ -586,12 +586,6 @@ static bool sphere_clip_vector(const Vec3r& O, real r, const Vec3r& P, Vec3r& V) // use marking ? (measure *timings* ...) void compute_curvature_tensor(WVertex *start, real radius, NormalCycle& nc) { - // TODO: for some reason, the WVertex 'start' may have no associated edges - // (i.e., WVertex::_EdgeList is empty), which causes a crash due to a call - // of WVertex::_EdgeList.front(). - if (start->GetEdges().empty()) - return; - // in case we have a non-manifold vertex, skip it... if (start->isBoundary()) return; |