From a96d356afbdc4de15ab0f958b0f139329919a9e0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 27 Apr 2022 18:39:55 +0200 Subject: [PATCH] Part: handle OCC exception inside TopoShape::makeGTransform For more details about the problems an unhandled exception will cause see: https://forum.freecadweb.org/viewtopic.php?f=3&t=61000 --- src/Mod/Part/App/TopoShape.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 41778b4b0d..12a848afc3 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -4372,9 +4372,14 @@ TopoShape &TopoShape::makeGTransform(const TopoShape &shape, mat.SetValue(2,4,rclTrf[1][3]); mat.SetValue(3,4,rclTrf[2][3]); - // geometric transformation - BRepBuilderAPI_GTransform mkTrf(shape.getShape(), mat, copy); - _Shape = mkTrf.Shape(); + try { + // geometric transformation + BRepBuilderAPI_GTransform mkTrf(shape.getShape(), mat, copy); + _Shape = mkTrf.Shape(); + } + catch (const Standard_Failure& e) { + Base::Console().Error("TopoShape::makeGTransform failed: %s\n", e.GetMessageString()); + } return *this; }