EgtMachKernel :
- In PocketingNT corrette le retroazioni.
This commit is contained in:
+45
-10
@@ -4591,13 +4591,24 @@ PocketingNT::AddPocket( STEPINFOPOVECTOR& vStepInfo, const Vector3d& vtTool, dou
|
||||
return false ;
|
||||
}
|
||||
// calcolo l'elevazione al di sopra del punto corrente
|
||||
double dLastElev = 0. ;
|
||||
if ( ! GetElevation( m_nPhase, ptP1, vtTool, m_TParams.m_dDiam / 2., m_TParams.m_dLen, 0., vtTool, dLastElev))
|
||||
dLastElev = - currStep.dDepth ;
|
||||
// aggiungo retroazione finale
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dLastElev, dAppr, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 3015, "Error in PocketingNT : Retract not computable") ;
|
||||
double dLastElev = 0., dEscapeElev = 0. ;
|
||||
Vector3d vtEscape ;
|
||||
if ( ! CalcLastElevation( ptEnd, ptP1, vtTool, currStep, dSafeZ, dStep, dLastElev, dEscapeElev, vtEscape))
|
||||
return false ;
|
||||
if ( dEscapeElev > 10 * EPS_SMALL && vtEscape.SqLen() > 100 * EPS_SMALL) {
|
||||
AddLinearMove( ptP1 + vtTool * dLastElev) ;
|
||||
vtEscape.Normalize() ;
|
||||
if ( ! AddRetract( ptP1 + vtTool * dLastElev, vtEscape, dSafeZ, dSafeAggrBottZ, dEscapeElev, dAppr, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 3015, "Error in PocketingNT : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// aggiungo retroazione finale
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dLastElev, dAppr, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 3015, "Error in PocketingNT : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se ho un percorso successivo
|
||||
@@ -4699,10 +4710,9 @@ PocketingNT::AddPocket( STEPINFOPOVECTOR& vStepInfo, const Vector3d& vtTool, dou
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
PocketingNT::CalcFirstElevation( const Point3d& ptStart, const Point3d& ptP1, const Vector3d& vtTool, const StepInfoPO& currStep,
|
||||
double dSafeZ, double dStep, double& dCurrElev)
|
||||
double dSafeZ, double dStep, double& dCurrElev) const
|
||||
{
|
||||
// l'elevazione è il massimo tra lo Step e l'elevazione calcolata mediante intersezione con grezzo
|
||||
// ( per gestire le collisioni con i movimenti in rapido )
|
||||
// elevazione per ingresso
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dCurrElev))
|
||||
dCurrElev = - currStep.dDepth + 10 * EPS_SMALL ;
|
||||
else
|
||||
@@ -4718,6 +4728,31 @@ PocketingNT::CalcFirstElevation( const Point3d& ptStart, const Point3d& ptP1, co
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
PocketingNT::CalcLastElevation( const Point3d& ptEnd, const Point3d& ptP1, const Vector3d& vtTool, const StepInfoPO& currStep,
|
||||
double dSafeZ, double dStep, double& dCurrElev, double& dEscapeElev, Vector3d& vtEscape) const
|
||||
{
|
||||
// elevazione per uscita
|
||||
if ( ! GetElevation( m_nPhase, ptP1, vtTool, GetRadiusForStartEndElevation(), m_TParams.m_dLen, vtTool, dCurrElev))
|
||||
dCurrElev = - currStep.dDepth ;
|
||||
dEscapeElev = 0 ;
|
||||
vtEscape = V_NULL ;
|
||||
double dMyEscapeEvel = 0 ;
|
||||
Vector3d vtMyEscape = vtTool ; vtMyEscape.z = 0 ;
|
||||
bool bAhUnderRaw = m_bAboveHead && ! m_bAggrBottom && ! m_bTiltingTab &&
|
||||
GetAhPointUnderRaw( ptP1 + vtTool * dCurrElev, vtTool, 0, GetRadiusForStartEndElevation(),
|
||||
m_TParams.m_dLen, false, dSafeZ, vtMyEscape, dMyEscapeEvel) ;
|
||||
bool bUhAboveRaw = ! m_bAboveHead &&
|
||||
GetUhPointAboveRaw( ptP1 + vtTool * dCurrElev, vtTool, 0, GetRadiusForStartEndElevation(),
|
||||
m_TParams.m_dLen, false, dSafeZ, vtMyEscape, dMyEscapeEvel) ;
|
||||
if ( bAhUnderRaw || bUhAboveRaw || m_bTiltingTab) {
|
||||
dEscapeElev = dMyEscapeEvel ;
|
||||
vtEscape = vtMyEscape ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
double
|
||||
PocketingNT::GetRightFeed( const Vector3d& vtMove, const Vector3d& vtTool)
|
||||
@@ -5390,7 +5425,7 @@ PocketingNT::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
double
|
||||
PocketingNT::GetRadiusForStartEndElevation( void)
|
||||
PocketingNT::GetRadiusForStartEndElevation( void) const
|
||||
{
|
||||
const double DELTA_ELEV_RAD = 4.0 ;
|
||||
double dDeltaRad = min( DELTA_ELEV_RAD, 0.5 * m_TParams.m_dTDiam) ;
|
||||
|
||||
+4
-2
@@ -149,14 +149,16 @@ class PocketingNT : public Machining
|
||||
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
||||
double dElev, double dAppr, bool bSplitArcs) ;
|
||||
bool CalcFirstElevation( const Point3d& ptStart, const Point3d& ptP1, const Vector3d& vtTool, const StepInfoPO& currStep,
|
||||
double dSafeZ, double dStep, double& dCurrElev) ;
|
||||
double dSafeZ, double dStep, double& dCurrElev) const ;
|
||||
bool CalcLastElevation( const Point3d& ptStart, const Point3d& ptP1, const Vector3d& vtTool, const StepInfoPO& currStep,
|
||||
double dSafeZ, double dStep, double& dCurrElev, double& dEscapeElev, Vector3d& vtEscape) const ;
|
||||
bool CalcLeadInStart( Point3d& ptStart, const Vector3d& vtTool, const ICurveComposite* pCrvPath, Point3d& ptP1) ;
|
||||
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
||||
const ISurfFlatRegion* pSfr, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs,
|
||||
bool bNoneForced, bool bSkipControl) ;
|
||||
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, const ISurfFlatRegion* pSfr,
|
||||
const ICurveComposite* pRCrv, bool bSplitArcs, bool bNoneForced, Point3d& ptP1) ;
|
||||
double GetRadiusForStartEndElevation( void) ;
|
||||
double GetRadiusForStartEndElevation( void) const ;
|
||||
bool GetForcedClosed( void) ;
|
||||
bool GetMidOfLongestOpenSide( const ICurveComposite* pCompo, Point3d& ptMid, Vector3d& vtMidOut) ;
|
||||
bool AdjustContourWithOpenEdges( ICurveComposite* pCompo) ;
|
||||
|
||||
Reference in New Issue
Block a user