From e329cb5c3acd5b170359e0e8cd28d98b61be935d Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 28 Dec 2014 18:10:02 +0100 Subject: [PATCH] + fixes #0001878: model refine exception --- src/Mod/Part/App/modelRefine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index d6f3d80ee..ae3455cd6 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -519,11 +519,13 @@ bool wireEncirclesAxis(const TopoDS_Wire& wire, const Handle(Geom_CylindricalSur gp_Vec dv = gp_Vec(pend.X(), pend.Y(), pend.Z()) - bv; double dist = dv.Magnitude(); - // Check orientation of this piece in relation to cylinder axis - if ((bv - cv).Crossed(dv).IsOpposite(av, Precision::Confusion())) - dist = -dist; + if (dist > 0) { + // Check orientation of this piece in relation to cylinder axis + if ((bv - cv).Crossed(dv).IsOpposite(av, Precision::Confusion())) + dist = -dist; - length += dist; + length += dist; + } } begin = pend;