EgtMachKernel 1.6s5 :

- migliorato controllo elevazione utensile in fresatura su attacco e uscita.
This commit is contained in:
Dario Sassi
2016-07-18 18:11:52 +00:00
parent 828deddc66
commit 60d97d5657
5 changed files with 61 additions and 21 deletions
BIN
View File
Binary file not shown.
+21 -13
View File
@@ -999,7 +999,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
// calcolo l'elevazione massima
double dElev ;
if ( CalcElevation( pCompo, vtTool, dDepth, dElev)) {
if ( CalcPathElevation( pCompo, vtTool, dDepth, dElev)) {
if ( dElev < EPS_SMALL && AreSameVectorApprox( vtExtr, Z_AX)) {
BBox3d b3Crv ;
pCompo->GetLocalBBox( b3Crv) ;
@@ -1047,8 +1047,8 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
//----------------------------------------------------------------------------
bool
Milling::CalcElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth,
double& dElev)
Milling::CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth,
double& dElev)
{
dElev = 0 ;
int nMaxInd = pCompo->GetCurveCount() - 1 ;
@@ -1110,7 +1110,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
// aggiungo approccio per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dStElev ;
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, dStElev))
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
dStElev = dElev ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
return false ;
@@ -1170,7 +1170,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
// aggiungo retrazione per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dEndElev ;
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, dEndElev))
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
dEndElev = dElev ;
// aggiungo retrazione
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
@@ -1229,7 +1229,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// se primo step aggiungo approccio per frese normali
if ( j == 1 && ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dStElev ;
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, dStElev))
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
dStElev = dElev ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
return false ;
@@ -1303,7 +1303,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// se ultimo step aggiungo retrazione per frese normali
if ( j == nStep && ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dEndElev ;
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, dEndElev))
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
dEndElev = dElev ;
// aggiungo retrazione
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
@@ -1359,7 +1359,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo approccio per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dStElev ;
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, dStElev))
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
dStElev = dElev ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
return false ;
@@ -1419,7 +1419,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo retrazione per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dEndElev ;
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, dEndElev))
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
dEndElev = dElev ;
// aggiungo retrazione
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
@@ -1481,7 +1481,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo approccio per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dStElev ;
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, dStElev))
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
dStElev = 0 ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
return false ;
@@ -1544,7 +1544,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo retrazione per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dEndElev ;
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, dEndElev))
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
dEndElev = dElev ;
// aggiungo retrazione
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
@@ -1593,7 +1593,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo approccio per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dStElev ;
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, dStElev))
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
dStElev = dElev ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
return false ;
@@ -1656,7 +1656,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
// aggiungo retrazione per frese normali
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
double dEndElev ;
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, dEndElev))
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
dEndElev = dElev ;
// aggiungo retrazione
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
@@ -1985,3 +1985,11 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
return false ;
}
}
//----------------------------------------------------------------------------
double
Milling::GetRadiusForStartEndElevation( void)
{
const double DELTA_ELEV_RAD = 20.0 ;
return ( 0.5 * m_TParams.m_dTDiam + DELTA_ELEV_RAD) ;
}
+2 -1
View File
@@ -66,7 +66,7 @@ class Milling : public Machining
ICurve* GetCurve( SelData Id) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double& dElev) ;
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double& dElev) ;
bool AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, bool bSplitArcs) ;
bool AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
@@ -83,6 +83,7 @@ class Milling : public Machining
const Vector3d& vtN, bool bInvert, bool bSplitArcs) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
bool bInvert, bool bSplitArcs, Point3d& ptP1) ;
double GetRadiusForStartEndElevation( void) ;
private :
double GetSpeed() const
+36 -7
View File
@@ -217,13 +217,42 @@ Operation::GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, c
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// approssimo l'arco con due linee
double dElev1, dElev2 ;
if ( ! GetElevation( nPhase, ptP1, ptP2, vtDir, dElev1))
return false ;
if ( ! GetElevation( nPhase, ptP2, ptP3, vtDir, dElev2))
return false ;
dElev = max( dElev1, dElev2) ;
return true ;
double dElev1, dElev2 ;
if ( ! GetElevation( nPhase, ptP1, ptP2, vtDir, dElev1))
return false ;
if ( ! GetElevation( nPhase, ptP2, ptP3, vtDir, dElev2))
return false ;
dElev = max( dElev1, dElev2) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double dRad, double& dElev)
{
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// considero il punto
if ( ! GetElevation( nPhase, ptP, vtDir, dElev))
return false ;
// considero i 4 punti sulla circonferenza
Frame3d frLoc ;
frLoc.Set( ptP, vtDir) ;
double dElevT ;
if ( ! GetElevation( nPhase, ptP + frLoc.VersX() * dRad, vtDir, dElevT))
return false ;
dElev = max( dElev, dElevT) ;
if ( ! GetElevation( nPhase, ptP - frLoc.VersX() * dRad, vtDir, dElevT))
return false ;
dElev = max( dElev, dElevT) ;
if ( ! GetElevation( nPhase, ptP + frLoc.VersY() * dRad, vtDir, dElevT))
return false ;
dElev = max( dElev, dElevT) ;
if ( ! GetElevation( nPhase, ptP - frLoc.VersY() * dRad, vtDir, dElevT))
return false ;
dElev = max( dElev, dElevT) ;
return true ;
}
//----------------------------------------------------------------------------
+2
View File
@@ -58,6 +58,8 @@ class Operation : public IUserObj
const Vector3d& vtDir, double& dElev) ;
bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3,
const Vector3d& vtDir, double& dElev) ;
bool GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double dRad, double& dElev) ;
bool GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist) ;
bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist) ;
bool GetRawGlobBox( int nPhase, int nPathId, BBox3d& b3Raw) ;