Path: PathSimulator PCH

This commit is contained in:
Abdullah Tahiri
2019-05-03 14:23:07 +02:00
committed by abdullahtahiriyo
parent 36f512abce
commit 45f44a2d9f
3 changed files with 20 additions and 14 deletions

View File

@@ -24,10 +24,9 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/regex.hpp>
#endif
#include <boost/regex.hpp>
#include <App/Application.h>
#include <App/Document.h>
#include <Base/Exception.h>
@@ -81,7 +80,7 @@ void PathSim::SetCurrentTool(Tool * tool)
case Tool::DRILL:
tp = cSimTool::CHAMFER;
angle = tool->CuttingEdgeAngle;
if (angle > 180)
if (angle > 180)
{
angle = 180;
}
@@ -89,7 +88,7 @@ void PathSim::SetCurrentTool(Tool * tool)
case Tool::CENTERDRILL:
tp = cSimTool::CHAMFER;
angle = tool->CuttingEdgeAngle;
if (angle > 180)
if (angle > 180)
{
angle = 180;
}
@@ -107,7 +106,7 @@ void PathSim::SetCurrentTool(Tool * tool)
case Tool::ENGRAVER:
tp = cSimTool::CHAMFER;
angle = tool->CuttingEdgeAngle;
if (angle > 180)
if (angle > 180)
{
angle = 180;
}
@@ -155,4 +154,4 @@ Base::Placement * PathSim::ApplyCommand(Base::Placement * pos, Command * cmd)

View File

@@ -58,6 +58,9 @@
#include <string>
#include <vector>
// Boost
#include <boost/regex.hpp>
// Xerces
#include <xercesc/util/XercesDefs.hpp>

View File

@@ -21,7 +21,11 @@
***************************************************************************/
#include "PreCompiled.h"
#include <algorithm>
#ifndef _PreComp_
# include <algorithm>
#endif
#include "VolSim.h"
//************************************************************************************************************
@@ -103,7 +107,7 @@ float cStock::FindRectTop(int & xp, int & yp, int & x_size, int & y_size, bool s
}
}
// sweep up y direction
// sweep up y direction
if (yu_ok)
{
int ty = yp + y_size;
@@ -124,7 +128,7 @@ float cStock::FindRectTop(int & xp, int & yp, int & x_size, int & y_size, bool s
}
}
// sweep down y direction
// sweep down y direction
if (yd_ok)
{
int ty = yp - 1;
@@ -249,7 +253,7 @@ void cStock::FindRectBot(int & xp, int & yp, int & x_size, int & y_size, bool sc
}
}
// sweep up y direction
// sweep up y direction
if (yu_ok)
{
int ty = yp + y_size;
@@ -270,7 +274,7 @@ void cStock::FindRectBot(int & xp, int & yp, int & x_size, int & y_size, bool sc
}
}
// sweep down y direction
// sweep down y direction
if (yd_ok)
{
int ty = yp - 1;
@@ -552,7 +556,7 @@ void cStock::ApplyLinearTool(Point3D & p1, Point3D & p2, cSimTool & tool)
for (float r = 0.5f; r <= rad; r += (float)SIM_WALK_RES)
{
Point3D cupCirc(perpDirX * r, perpDirY * r, pi2.z);
float rotang = 180 * SIM_WALK_RES / (3.1415926535 * r);
float rotang = 180 * SIM_WALK_RES / (3.1415926535 * r);
cupCirc.SetRotationAngle(-rotang);
float z = pi2.z + tool.GetToolProfileAt(r / rad);
for (float a = 0; a < cupAngle; a += rotang)
@@ -593,7 +597,7 @@ void cStock::ApplyCircularTool(Point3D & p1, Point3D & p2, Point3D & cent, cSimT
cpx += pi1.x;
cpy += pi1.y;
double eang = atan2(pi2.y - cpy, pi2.x - cpx); // end angle
double ang = eang - sang;
if (!isCCW && ang > 0)
ang -= 2 * 3.1415926;
@@ -609,7 +613,7 @@ void cStock::ApplyCircularTool(Point3D & p1, Point3D & p2, Point3D & cent, cSimT
{
cupCirc.x = xynorm.x * r;
cupCirc.y = xynorm.y * r;
float rotang = (float)SIM_WALK_RES / r;
float rotang = (float)SIM_WALK_RES / r;
int ndivs = (int)(ang / rotang) + 1;
if (!isCCW)
rotang = -rotang;