Merge pull request #3433 from dubstar-04/fixes/toolbit-simulation

[Path] - Fixes/toolbit simulation
This commit is contained in:
sliptonic
2020-05-06 13:56:45 -05:00
committed by GitHub
7 changed files with 131 additions and 113 deletions

View File

@@ -125,13 +125,21 @@ class PathSimulation:
except Exception:
self.tool = None
# if hasattr(self.operation, "ToolController"):
# self.tool = self.operation.ToolController.Tool
if (self.tool is not None):
toolProf = self.CreateToolProfile(self.tool, Vector(0, 1, 0), Vector(0, 0, 0), float(self.tool.Diameter) / 2.0)
self.cutTool.Shape = Part.makeSolid(toolProf.revolve(Vector(0, 0, 0), Vector(0, 0, 1)))
if isinstance(self.tool, Path.Tool):
# handle legacy tools
toolProf = self.CreateToolProfile(self.tool, Vector(0, 1, 0), Vector(0, 0, 0), float(self.tool.Diameter) / 2.0)
self.cutTool.Shape = Part.makeSolid(toolProf.revolve(Vector(0, 0, 0), Vector(0, 0, 1)))
else:
# handle tool bits
self.cutTool.Shape = self.tool.Shape
if not self.cutTool.Shape.isValid() or self.cutTool.Shape.isNull():
self.EndSimulation()
raise RuntimeError("Path Simulation: Error in tool geometry - {}".format(self.tool.Name))
self.cutTool.ViewObject.show()
self.voxSim.SetCurrentTool(self.tool)
self.voxSim.SetToolShape(self.cutTool.Shape, 0.05 * self.accuracy)
self.icmd = 0
self.curpos = FreeCAD.Placement(self.initialPos, self.stdrot)
# self.cutTool.Placement = FreeCAD.Placement(self.curpos, self.stdrot)