From 7ae0c936fa070da0bf10782e77c4500bf9bd57a8 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sat, 26 Jan 2013 18:53:16 +0000 Subject: Fix for a crash in curvature calculation due to a WVertex with no associated edges. (TODO: identify the reason why such a strange WVertex is generated.) Problem report by Vicente Carro with a .blend for reproducing the issue. Thanks a lot! --- source/blender/freestyle/intern/winged_edge/Curvature.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/freestyle/intern/winged_edge/Curvature.cpp') diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp index acefe1aa5fc..65ebdeac3a8 100644 --- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp +++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp @@ -586,8 +586,14 @@ 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()) + if (start->isBoundary()) return; std::set vertices; -- cgit v1.2.3