From aa9cd0d91c1db88bf2999a08987a31894e67f7f1 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 8 Jun 2019 14:16:44 +0200 Subject: [PATCH] Partial Restore: ensure line segment length when x coordinate is exactly zero fixes #4012 --- src/Mod/Part/App/Geometry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 8e949a47eb..2fe18c9972 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -3752,7 +3752,13 @@ void GeomLineSegment::Restore (Base::XMLReader &reader) // the points are too close. The best try to restore is incrementing the distance. // for other objects, the best effort may be just to leave default values. reader.setPartialRestore(true); - end = start + Base::Vector3d(start.x*DBL_EPSILON,0,0); + + if(start.x == 0) { + end = start + Base::Vector3d(DBL_EPSILON,0,0); + } + else { + end = start + Base::Vector3d(start.x*DBL_EPSILON,0,0); + } setPoints(start, end); }