From dc224265fa0c0fed4e88eb881b1e7d4968ca6fa9 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Tue, 13 Oct 2015 14:13:21 +0200 Subject: [PATCH] Sketcher: Bug fix: Constraints dissapear after a sketch loses support ===================================================================== Issue: http://freecadweb.org/tracker/view.php?id=2292 Constraints dissapear after a sketch loses support Steps To Reproduce: 1. Make a sketch on a face. 2. Constrain it 3. Select "reorient sketch" 4. Do you want to lose support? Yes 5. Click cancel on the reorientation dialog. 6. Enter edit mode: No constraints... Why? GeoUndef not checked when deleting all external geometry (on dettaching from the support). Solution: Check for GeoUndef. --- src/Mod/Sketcher/App/SketchObject.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index c5fc2703a..646321f54 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2008 * + * Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2008 * * * * This file is part of the FreeCAD CAx development system. * * * @@ -2754,7 +2754,9 @@ int SketchObject::delAllExternal() std::vector< Constraint * > newConstraints(0); for (std::vector::const_iterator it = constraints.begin(); it != constraints.end(); ++it) { - if ((*it)->First > -3 && (*it)->Second > -3 && (*it)->Third > -3) { + if ((*it)->First > -3 && + ((*it)->Second > -3 || (*it)->Second == Constraint::GeoUndef ) && + ((*it)->Third > -3 || (*it)->Third == Constraint::GeoUndef) ) { Constraint *copiedConstr = (*it)->clone(); newConstraints.push_back(copiedConstr);