EgtMachKernel :
- aggiunta gestione Spiral in Correzione utensile per Milling - aggiunta gestione Tab e Oscillation in correzione utensile per Milling.
This commit is contained in:
+440
-115
@@ -852,9 +852,6 @@ Milling::Apply( bool bRecalc, bool bPostApply)
|
||||
if ( nLeadInType == MILL_LI_NONE || nLeadInType == MILL_LI_ZIGZAG || nLeadInType == MILL_LI_TG_PERP)
|
||||
m_bToolComp = false ;
|
||||
}
|
||||
// compensazione utensile non applicata nel caso di Step Type Spiral
|
||||
if ( m_bToolComp && m_Params.m_nStepType == MILL_ST_SPIRAL)
|
||||
m_bToolComp = false ;
|
||||
// se compensazione utensile, forzo la componente perpendicolare di LeadIn e LeadOut
|
||||
if ( m_bToolComp) {
|
||||
m_Params.m_dLiCompLen = GetToolCompPerpLen() ;
|
||||
@@ -3810,8 +3807,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
else {
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtEndDepth ;
|
||||
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, bSplitArcs, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( pCrvC->GetType() == CRV_ARC) {
|
||||
@@ -3832,8 +3835,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Vector3d vtN = pArc->GetNormVersor() ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtEndDepth ;
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se ultima entità di ultimo step, uscita e retrazione
|
||||
@@ -3919,7 +3928,6 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
ptStart -= vtStaDepth ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
@@ -3992,8 +4000,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
else {
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtEndDepth ;
|
||||
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, bSplitArcs, GetCorrType( TOOL_CORR_PATH, bInvert), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( pCurve->GetType() == CRV_ARC) {
|
||||
@@ -4015,8 +4029,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptP3 ;
|
||||
pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtEndDepth ;
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dAngCen, vtN, GetCorrType( TOOL_CORR_PATH, bInvert), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se ultima entità di ultimo step, uscita e retrazione
|
||||
@@ -4026,7 +4046,6 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
ptEnd -= vtEndDepth ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -4067,6 +4086,23 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
// se correzione utensile ed ultima entità della curva corrente
|
||||
else if ( m_bToolComp && i == nMaxInd) {
|
||||
// aggiungo tratto perpendicolare in uscita e tratto perpendicolare in entrata per la successiva
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
ptEnd -= vtEndDepth ;
|
||||
Vector3d vtEnd ; pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
Vector3d vtRot = OrthoCompo( vtTool, vtEnd) ;
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Point3d ptMid = ptEnd + GetToolCompPerpLen() * vtPerp ;
|
||||
if ( AddLinearMove( ptMid, bSplitArcs, GetCorrType( TOOL_CORR_OUT, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL ||
|
||||
AddLinearMove( ptEnd, bSplitArcs, GetCorrType( TOOL_CORR_IN, ! bInvert), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5778,8 +5814,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtTool * ( abs( m_Params.m_dOscHeight) * m_dCurrOscillLen / vLenRef[0]) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[0] + 10 * EPS_SMALL) {
|
||||
@@ -5787,8 +5829,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen = vLenRef[0] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5797,8 +5845,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul secondo tratto (parte piatta in basso)
|
||||
@@ -5809,8 +5863,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[1] + 10 * EPS_SMALL) {
|
||||
@@ -5818,8 +5878,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen = vLenRef[1] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5828,8 +5894,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul terzo tratto (rampa ascendente)
|
||||
@@ -5840,16 +5912,28 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 -= vtTool * ( abs( m_Params.m_dOscHeight) * ( vLenRef[2] - m_dCurrOscillLen) / ( vLenRef[2] - vLenRef[1])) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[2] + 10 * EPS_SMALL) {
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrOscillLen = vLenRef[2] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5857,8 +5941,14 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen = vLenRef[2] ;
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti è sul quarto tratto (parte piatta in alto)
|
||||
@@ -5868,16 +5958,28 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrOscillLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[3] + 10 * EPS_SMALL) {
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrOscillLen = 0 ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5885,13 +5987,20 @@ Milling::AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double
|
||||
m_dCurrOscillLen = 0 ;
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
@@ -5921,8 +6030,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtTool * ( abs( m_Params.m_dOscHeight) * m_dCurrOscillLen / vLenRef[0]) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[0] + 10 * EPS_SMALL) {
|
||||
@@ -5931,8 +6046,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5942,8 +6063,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul secondo tratto (parte piatta in basso)
|
||||
@@ -5955,8 +6082,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[1] + 10 * EPS_SMALL) {
|
||||
@@ -5965,8 +6098,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -5976,8 +6115,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 -= vtTool * abs( m_Params.m_dOscHeight) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul terzo tratto (rampa ascendente)
|
||||
@@ -5989,8 +6134,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 -= vtTool * ( abs( m_Params.m_dOscHeight) * ( vLenRef[2] - m_dCurrOscillLen) / ( vLenRef[2] - vLenRef[1])) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[2] + 10 * EPS_SMALL) {
|
||||
@@ -5998,8 +6149,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
m_dCurrOscillLen = vLenRef[2] ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6008,8 +6165,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
double dU ; pArc->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti è sul quarto tratto (parte piatta in alto)
|
||||
@@ -6020,8 +6183,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
m_dCurrOscillLen += dNextLen ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrOscillLen + dNextLen < vLenRef[3] + 10 * EPS_SMALL) {
|
||||
@@ -6029,8 +6198,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
m_dCurrOscillLen = 0 ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6039,8 +6214,14 @@ Milling::AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRa
|
||||
double dU ; pArc->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6358,16 +6539,28 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrTabsLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[0] + 10 * EPS_SMALL) {
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrTabsLen = vLenRef[0] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6375,8 +6568,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen = vLenRef[0] ;
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul secondo tratto (rampa ascendente)
|
||||
@@ -6387,8 +6586,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 += vtTool * ( abs( m_Params.m_dTabHeight) * ( m_dCurrTabsLen - vLenRef[0]) / ( vLenRef[1] - vLenRef[0])) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[1] + 10 * EPS_SMALL) {
|
||||
@@ -6396,8 +6601,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen = vLenRef[1] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6406,8 +6617,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul terzo tratto (parte piatta in alto)
|
||||
@@ -6418,8 +6635,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[2] + 10 * EPS_SMALL) {
|
||||
@@ -6427,8 +6650,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen = vLenRef[2] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6437,8 +6666,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti è sul quarto tratto (rampa discendente)
|
||||
@@ -6449,16 +6684,28 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen += dNextLen ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
ptP3 += vtTool * ( abs( m_Params.m_dTabHeight) * ( vLenRef[3] - m_dCurrTabsLen) / ( vLenRef[3] - vLenRef[2])) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine linea è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[3] + 10 * EPS_SMALL) {
|
||||
dCurrLen = dLen ;
|
||||
m_dCurrTabsLen = vLenRef[3] ;
|
||||
Point3d ptP3 = pLine->GetEnd() ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine linea è oltre
|
||||
else {
|
||||
@@ -6466,8 +6713,14 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
m_dCurrTabsLen = vLenRef[3] ;
|
||||
double dU ; pLine->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pLine->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddLinearMove( ptP3, false, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti passo all'intervallo successivo
|
||||
@@ -6475,7 +6728,7 @@ Milling::AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBL
|
||||
++ nI ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
@@ -6509,8 +6762,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
m_dCurrTabsLen += dNextLen ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine arco è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[0] + 10 * EPS_SMALL) {
|
||||
@@ -6518,8 +6777,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
m_dCurrTabsLen = vLenRef[0] ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine arco è oltre
|
||||
else {
|
||||
@@ -6528,8 +6793,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
double dU ; pArc->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul secondo tratto (rampa ascendente)
|
||||
@@ -6541,8 +6812,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 += vtTool * ( abs( m_Params.m_dTabHeight) * ( m_dCurrTabsLen - vLenRef[0]) / ( vLenRef[1] - vLenRef[0])) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine arco è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[1] + 10 * EPS_SMALL) {
|
||||
@@ -6551,8 +6828,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine arco è oltre
|
||||
else {
|
||||
@@ -6562,8 +6845,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// se inizio è sul terzo tratto (parte piatta in alto)
|
||||
@@ -6575,8 +6864,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine arco è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[2] + 10 * EPS_SMALL) {
|
||||
@@ -6585,8 +6880,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine arco è oltre
|
||||
else {
|
||||
@@ -6596,8 +6897,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
ptP3 += vtTool * abs( m_Params.m_dTabHeight) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti è sul quarto tratto (rampa discendente)
|
||||
@@ -6609,8 +6916,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
ptP3 += vtTool * ( abs( m_Params.m_dTabHeight) * ( vLenRef[3] - m_dCurrTabsLen) / ( vLenRef[3] - vLenRef[2])) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// se fine arco è alla fine del tratto
|
||||
else if ( m_dCurrTabsLen + dNextLen < vLenRef[3] + 10 * EPS_SMALL) {
|
||||
@@ -6618,8 +6931,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
m_dCurrTabsLen = vLenRef[3] ;
|
||||
Point3d ptP3 ; pArc->GetEndPoint( ptP3) ;
|
||||
double dCurrAngCen = dAngCen * dNextLen / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti fine arco è oltre
|
||||
else {
|
||||
@@ -6628,8 +6947,14 @@ Milling::AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVEC
|
||||
double dU ; pArc->GetParamAtLength( dCurrLen, dU) ;
|
||||
Point3d ptP3 ; pArc->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP3) ;
|
||||
double dCurrAngCen = dAngCen * ( dNextLen + dCurrLen - dLen) / dLen ;
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
if ( ! m_bToolComp) {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN, GetCorrType( TOOL_CORR_PATH, false), nullptr, &TOOL_CORR_COLOR) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti passo all'intervallo successivo
|
||||
@@ -7050,16 +7375,16 @@ Milling::GetCorrType( int nToolCompEntity, bool bInvert) const
|
||||
// Se lavorazione lato destro
|
||||
if ( m_Params.m_nWorkSide == MILL_WS_RIGHT) {
|
||||
if ( ! bInvert)
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 141 : 41) ;
|
||||
else
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 142 : 42) ;
|
||||
else
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 141 : 41) ;
|
||||
}
|
||||
// Se lavorazione lato sinistro
|
||||
else if ( m_Params.m_nWorkSide == MILL_WS_LEFT) {
|
||||
if ( ! bInvert)
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 142 : 42) ;
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 141 : 41) ;
|
||||
else
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 141 : 41) ;
|
||||
return ( nToolCompEntity == TOOL_CORR_IN ? 142 : 42) ;
|
||||
}
|
||||
// per gli altri casi
|
||||
return 0 ;
|
||||
|
||||
Reference in New Issue
Block a user