From 65f01daee28bc51f2e98878ad2b4fde3fee1efe0 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 29 Jan 2017 20:25:13 +0800 Subject: [PATCH] Path.Area: fixed auto workplane correction --- src/Mod/Path/App/Area.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index ad339672a..c29cf990b 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -491,14 +491,13 @@ bool Area::findPlane(const TopoDS_Shape &shape, int type, z = BRep_Tool::Pnt(TopoDS::Vertex(it.Current())).Z(); break; } - if(origin.Z() != z) { + if(fabs(origin.Z()-z)>Precision::Confusion()) { Base::Console().Warning("XY plane has wrong Z height %lf, %lf\n",origin.Z(),z); - origin.SetZ(z); gp_Trsf trsf2; - trsf2.SetTranslationPart(gp_XYZ(0,0,-origin.Z())); + trsf2.SetTranslationPart(gp_XYZ(0,0,origin.Z()-z)); trsf.Multiply(trsf2); } - if(top_found && top_z > origin.Z()) + if(top_found && top_z > z) continue; top_found = true; top_z = origin.Z();