diff --git a/src/Mod/Path/PathScripts/PathSimulatorGui.py b/src/Mod/Path/PathScripts/PathSimulatorGui.py index c937230f99..33cef91240 100644 --- a/src/Mod/Path/PathScripts/PathSimulatorGui.py +++ b/src/Mod/Path/PathScripts/PathSimulatorGui.py @@ -6,6 +6,7 @@ import Mesh import PathSimulator import math from FreeCAD import Vector, Base +import PathScripts.PathLog as PathLog from PathScripts.PathGeom import PathGeom _filePath = os.path.dirname(os.path.abspath(__file__)) @@ -382,6 +383,9 @@ class PathSimulation: yp = pos[1] zp = pos[2] h = tool.CuttingEdgeHeight + if h <= 0.0: #set default if user fails to avoid freeze + h = 1.0 + PathLog.error("SET Tool Length") # common to all tools vTR = Vector(xp + yf, yp - xf, zp + h) vTC = Vector(xp, yp, zp + h) diff --git a/src/Mod/Path/PathSimulator/App/PathSim.cpp b/src/Mod/Path/PathSimulator/App/PathSim.cpp index 97f81f6ce2..bc3e2b7ef5 100644 --- a/src/Mod/Path/PathSimulator/App/PathSim.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSim.cpp @@ -87,11 +87,21 @@ void PathSim::SetCurrentTool(Tool * tool) } break; case Tool::CENTERDRILL: + tp = cSimTool::CHAMFER; + angle = tool->CuttingEdgeAngle; + if (angle > 180) + { + angle = 180; + } + break; case Tool::COUNTERSINK: case Tool::COUNTERBORE: case Tool::REAMER: case Tool::TAP: case Tool::ENDMILL: + tp = cSimTool::FLAT; + angle = 180; + break; case Tool::SLOTCUTTER: case Tool::CORNERROUND: case Tool::ENGRAVER: @@ -102,8 +112,10 @@ void PathSim::SetCurrentTool(Tool * tool) angle = 180; } break; - - break; // quiet warnings + default: + tp = cSimTool::FLAT; + angle = 180; + break; } m_tool = new cSimTool(tp, tool->Diameter / 2.0, angle); }