diff --git a/src/Mod/Path/PathSimulator/App/PathSim.cpp b/src/Mod/Path/PathSimulator/App/PathSim.cpp index 64afa13f67..621efe5b99 100644 --- a/src/Mod/Path/PathSimulator/App/PathSim.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSim.cpp @@ -33,7 +33,6 @@ #include #include "PathSim.h" -//#include "VolSim.h" using namespace Base; using namespace PathSimulator; @@ -54,69 +53,15 @@ PathSim::~PathSim() delete m_tool; } - void PathSim::BeginSimulation(Part::TopoShape * stock, float resolution) { Base::BoundBox3d bbox = stock->getBoundBox(); m_stock = new cStock(bbox.MinX, bbox.MinY, bbox.MinZ, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution); } -void PathSim::SetCurrentTool(Tool * tool) +void PathSim::SetToolShape(const TopoDS_Shape& toolShape, float resolution) { - cSimTool::Type tp = cSimTool::FLAT; - float angle = 180; - switch (tool->Type) - { - case Tool::BALLENDMILL: - tp = cSimTool::ROUND; - break; - - case Tool::CHAMFERMILL: - tp = cSimTool::CHAMFER; - angle = tool->CuttingEdgeAngle; - break; - - case Tool::UNDEFINED: - case Tool::DRILL: - tp = cSimTool::CHAMFER; - angle = tool->CuttingEdgeAngle; - if (angle > 180) - { - angle = 180; - } - 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: - tp = cSimTool::CHAMFER; - angle = tool->CuttingEdgeAngle; - if (angle > 180) - { - angle = 180; - } - break; - default: - tp = cSimTool::FLAT; - angle = 180; - break; - } - m_tool = new cSimTool(tp, tool->Diameter / 2.0, angle); + m_tool = new cSimTool(toolShape, resolution); } Base::Placement * PathSim::ApplyCommand(Base::Placement * pos, Command * cmd) diff --git a/src/Mod/Path/PathSimulator/App/PathSim.h b/src/Mod/Path/PathSimulator/App/PathSim.h index 5ad93dbb99..90be142766 100644 --- a/src/Mod/Path/PathSimulator/App/PathSim.h +++ b/src/Mod/Path/PathSimulator/App/PathSim.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "VolSim.h" @@ -51,7 +50,7 @@ namespace PathSimulator ~PathSim(); void BeginSimulation(Part::TopoShape * stock, float resolution); - void SetCurrentTool(Tool * tool); + void SetToolShape(const TopoDS_Shape& toolShape, float resolution); Base::Placement * ApplyCommand(Base::Placement * pos, Command * cmd); public: