diff --git a/src/Mod/Path/PathSimulator/App/VolSim.cpp b/src/Mod/Path/PathSimulator/App/VolSim.cpp index 85185814bf..bc46e76b47 100644 --- a/src/Mod/Path/PathSimulator/App/VolSim.cpp +++ b/src/Mod/Path/PathSimulator/App/VolSim.cpp @@ -783,11 +783,14 @@ cSimTool::cSimTool(const TopoDS_Shape& toolShape, float res){ float cSimTool::GetToolProfileAt(float pos) // pos is -1..1 location along the radius of the tool (0 is center) { - float radPos = std::abs(pos) * radius; - toolShapePoint test; test.radiusPos = radPos; - auto it = std::lower_bound(m_toolShape.begin(), m_toolShape.end(), test, toolShapePoint::less_than()); - - return it->heightPos; + try{ + float radPos = std::abs(pos) * radius; + toolShapePoint test; test.radiusPos = radPos; + auto it = std::lower_bound(m_toolShape.begin(), m_toolShape.end(), test, toolShapePoint::less_than()); + return it->heightPos; + }catch(...){ + return 0; + } } bool cSimTool::isInside(const TopoDS_Shape& toolShape, Base::Vector3d pnt, float res)