From e814d997e5dca0e231b2d46861556831071277b5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 21 Aug 2014 13:26:35 +0200 Subject: [PATCH] + fix trim mesh with plane --- src/Mod/Mesh/Gui/Command.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 76d5e204e9..5a89a9abee 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -947,18 +947,12 @@ void CmdMeshTrimByPlane::activated(int iMsg) Base::Placement plm = static_cast(plane.front())->Placement.getValue(); Base::Vector3d normal(0,0,1); plm.getRotation().multVec(normal, normal); - Base::Vector3d view; - if (normal == Base::Vector3d(0,0,1)) { - view.Set(0,1,0); - } - else { - Base::Vector3d dir(0,0,1); - view = normal % dir; - } + Base::Vector3d up(-1,0,0); + plm.getRotation().multVec(up, up); + Base::Vector3d view(0,1,0); + plm.getRotation().multVec(view, view); Base::Vector3d base = plm.getPosition(); - Base::Vector3d up = normal % view; - Base::Rotation rot(Base::Vector3d(0,0,1), view); Base::Matrix4D mat; rot.getValue(mat);