EgtMachKernel :
- modifiche a fresature per direzioni di riferimento di attacchi e uscite come inizio e fine dei percorsi originali - migliorata in fresatura visualizzazione movimento lame quando interessano 2 o 3 curve di lavoro.
This commit is contained in:
+67
-58
@@ -1705,6 +1705,9 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
pCompo->ChangeStartPoint( dPar) ;
|
||||
}
|
||||
|
||||
// salvo direzioni iniziale e finale del percorso prima di eventuale offset
|
||||
pCompo->GetStartDir( m_vtStartDir) ;
|
||||
pCompo->GetEndDir( m_vtEndDir) ;
|
||||
// se utensile non centrato, eseguo correzione raggio utensile ed eventuale offset
|
||||
double dOffs = 0.5 * m_TParams.m_dDiam + GetOffsR() ;
|
||||
if ( m_Params.m_nWorkSide != MILL_WS_CENTER && abs( dOffs) > EPS_SMALL) {
|
||||
@@ -2296,8 +2299,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// dati inizio entità
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// determino elevazione su inizio percorso di lavoro
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart + vtWkTip, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
@@ -2325,7 +2327,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pCompo, i) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, i, false, true) ;
|
||||
// aggiungo approccio per frese normali e frese che non lavorano di testa con attacco opportuno oppure fuori
|
||||
if ( ( m_TParams.m_nType & TF_MILL) != 0 &&
|
||||
( m_TParams.m_nType != TT_MILL_NOTIP || LeadInRawIsOk() || m_bStartOutRaw)) {
|
||||
@@ -2382,7 +2384,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
Vector3d vtAppr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtAppr2 = vtDir1 ;
|
||||
if ( ! vtAppr2.Normalize())
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i)) ;
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i, false, true)) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) + 2 * DELTA_ELEV_RAD ;
|
||||
double dSawStartElev1, dSawStartElev2 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest + vtWkTip, ptTestU + vtWkTip, vtTool, GetRadiusForStartEndElevation(), dThick, vtAppr1, dSawStartElev1) ;
|
||||
@@ -2430,7 +2432,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pCompo, i + 1) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, i + 1, false, true) ;
|
||||
// elaborazioni sulla curva corrente
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
@@ -2474,8 +2476,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// dati fine entità
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd + vtWkTip, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -2502,7 +2503,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
if ( ! m_bTiltingTab)
|
||||
bAboveEnd = GetPointAboveRaw( ptP1 + vtWkTip, vtTool) ;
|
||||
else {
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, nMaxInd + 1) ;
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, nMaxInd + 1, false, true) ;
|
||||
if ( GetPointOutOfRaw( ptP1 + vtWkTip, vtTool, vtCorr, dEndElev, dSafeZ))
|
||||
dEndElev = min( dEndElev, dElev) ;
|
||||
}
|
||||
@@ -2555,7 +2556,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
Vector3d vtRetr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtRetr2 = vtDir1 ;
|
||||
if ( ! vtRetr2.Normalize())
|
||||
vtRetr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? vtEnd : CalcCorrDir( pCompo, i + 1)) ;
|
||||
vtRetr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? vtEnd : CalcCorrDir( pCompo, i + 1, false, true)) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) + 2 * DELTA_ELEV_RAD ;
|
||||
double dSawEndElev1, dSawEndElev2 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest + vtWkTip, ptTestU + vtWkTip, vtTool, GetRadiusForStartEndElevation(), dThick, vtRetr1, dSawEndElev1) ;
|
||||
@@ -2658,8 +2659,8 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// dati inizio entità
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
@@ -2687,7 +2688,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i + 1 : i)) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i + 1 : i), false, true) ;
|
||||
// se primo step
|
||||
if ( k == 1) {
|
||||
// aggiungo approccio per frese normali e frese che non lavorano di testa con attacco opportuno oppure fuori
|
||||
@@ -2740,7 +2741,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Vector3d vtAppr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtAppr2 = vtDir1 ;
|
||||
if ( ! vtAppr2.Normalize())
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i)) ;
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i, false, true)) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) ;
|
||||
double dSawStartElev1, dSawStartElev2 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest, vtTool, m_TParams.m_dDiam / 2, dThick, vtAppr1, dSawStartElev1) ;
|
||||
@@ -2821,7 +2822,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i : i + 1)) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i : i + 1), false, true) ;
|
||||
// elaborazioni sulla curva corrente
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
@@ -2865,8 +2866,8 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// dati fine entità
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -2908,7 +2909,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Vector3d vtRetr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtRetr2 = vtDir1 ;
|
||||
if ( ! vtRetr2.Normalize())
|
||||
vtRetr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? vtEnd : CalcCorrDir( pCompo, i + 1)) ;
|
||||
vtRetr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? vtEnd : CalcCorrDir( pCompo, i + 1, false, true)) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) ;
|
||||
double dSawEndElev1, dSawEndElev2 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest, vtTool, m_TParams.m_dDiam / 2, dThick, vtRetr1, dSawEndElev1) ;
|
||||
@@ -2949,7 +2950,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
if ( ! m_bTiltingTab)
|
||||
bAboveEnd = GetPointAboveRaw( ptP1, vtTool) ;
|
||||
else {
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, ( bInvert ? 0 : nMaxInd + 1)) ;
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, ( bInvert ? 0 : nMaxInd + 1), false, true) ;
|
||||
if ( GetPointOutOfRaw( ptP1, vtTool, vtCorr, dElev, dSafeZ))
|
||||
dEndElev = min( dEndElev, dElev) ;
|
||||
}
|
||||
@@ -3032,20 +3033,18 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptStart ;
|
||||
pCompo->GetStartPoint( ptStart) ;
|
||||
ptStart -= vtTool * dDepth ;
|
||||
Vector3d vtStart ;
|
||||
pCompo->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
Point3d ptPs ;
|
||||
Vector3d vtDirs ;
|
||||
CalcLeadInStart( ptStart, vtStart, vtTool, dElev, false, pCompo, ptPs, vtDirs) ;
|
||||
Vector3d vtCs = CalcCorrDir( pCompo, 0) ;
|
||||
Vector3d vtCs = CalcCorrDir( pCompo, 0, false, true) ;
|
||||
Point3d ptEnd ;
|
||||
pCompo->GetEndPoint( ptEnd) ;
|
||||
ptEnd -= vtTool * dDepth ;
|
||||
Vector3d vtEnd ;
|
||||
pCompo->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
Point3d ptPe ;
|
||||
CalcLeadOutEnd( ptEnd, vtEnd, vtTool, dElev, false, pCompo, ptPe) ;
|
||||
Vector3d vtCe = CalcCorrDir( pCompo, pCompo->GetCurveCount()) ;
|
||||
Vector3d vtCe = CalcCorrDir( pCompo, pCompo->GetCurveCount(), false, true) ;
|
||||
// verifico se attacco e uscita entrambi sopra o sotto il grezzo
|
||||
bool bAhAboveStartEnd = false ;
|
||||
bool bUhBelowStartEnd = false ;
|
||||
@@ -3108,10 +3107,10 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// dati inizio entità
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pCompo, i) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, i, false, true) ;
|
||||
// punto inizio attacco
|
||||
Point3d ptP1 ;
|
||||
Vector3d vtDir1 ;
|
||||
@@ -3212,7 +3211,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Vector3d vtAppr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtAppr2 = vtDir1 ;
|
||||
if ( ! vtAppr2.Normalize())
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i)) ;
|
||||
vtAppr2 = ( m_TParams.m_nType == TT_MILL_NOTIP ? -vtStart : CalcCorrDir( pCompo, i, false, true)) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) ;
|
||||
double dSawStartElev1 = 0, dSawStartElev2 = 0 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest, vtTool, m_TParams.m_dDiam / 2, dThick, vtAppr1, dSawStartElev1) ;
|
||||
@@ -3273,7 +3272,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pCompo, i+1) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, i + 1, false, true) ;
|
||||
// elaborazioni sulla curva corrente
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
@@ -3320,8 +3319,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// dati fine entità
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -3402,7 +3401,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Vector3d vtRetr1 = FromNearestHorizontalOrtho( vtTool, vtDir1) ;
|
||||
Vector3d vtRetr2 = vtDir1 ;
|
||||
if ( ! vtRetr2.Normalize())
|
||||
vtRetr2 = CalcCorrDir( pCompo, i + 1) ;
|
||||
vtRetr2 = CalcCorrDir( pCompo, i + 1, false, true) ;
|
||||
double dThick = ( m_TParams.m_nType == TT_MILL_NOTIP ? m_TParams.m_dMaxMat : m_TParams.m_dThick) ;
|
||||
double dSawEndElev1, dSawEndElev2 ;
|
||||
bool bOk1 = GetElevation( m_nPhase, ptTest, vtTool, m_TParams.m_dDiam / 2, dThick, vtRetr1, dSawEndElev1) ;
|
||||
@@ -3504,8 +3503,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptStart ;
|
||||
pCrvC->GetStartPoint( ptStart) ;
|
||||
ptStart -= vtStaDepth ;
|
||||
Vector3d vtStart ;
|
||||
pCrvC->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCrvC->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
@@ -3568,7 +3567,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pCompo, i+1) ;
|
||||
CalcAndSetCorrAuxDir( pCompo, i + 1) ;
|
||||
// elaborazioni sulla curva corrente
|
||||
if ( pCrvC->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pLine = GetCurveLine( pCrvC) ;
|
||||
@@ -3616,8 +3615,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptEnd ;
|
||||
pCrvC->GetEndPoint( ptEnd) ;
|
||||
ptEnd -= vtEndDepth ;
|
||||
Vector3d vtEnd ;
|
||||
pCrvC->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCrvC->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -3692,8 +3691,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
ptStart -= vtStaDepth ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
@@ -3799,8 +3798,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
ptEnd -= vtEndDepth ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
@@ -3952,8 +3951,8 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
// dati inizio entità
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( j == 1) {
|
||||
@@ -3969,12 +3968,12 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtTool, dCalcStElev, bInvert, pMyCompo, ptP1, vtDir1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
Vector3d vtCorr = CalcCorrDir( pMyCompo, i, bInvert) ;
|
||||
Vector3d vtCorr = CalcCorrDir( pMyCompo, i, bInvert, true) ;
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool, vtCorr, dElev, dSafeZ) ;
|
||||
// determino se l'inizio dell'attacco è sopra il grezzo
|
||||
bool bAboveStart = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i, bInvert) ;
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i, bInvert, true) ;
|
||||
// se primo step
|
||||
if ( j == 1) {
|
||||
// verifico di entrare in aria
|
||||
@@ -4003,7 +4002,7 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i + 1, bInvert) ;
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i + 1, bInvert, true) ;
|
||||
// elaborazioni sulla curva corrente
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
@@ -4031,8 +4030,8 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
// dati fine entità
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( j == nStep) {
|
||||
@@ -4138,8 +4137,8 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
// dati inizio entità
|
||||
Point3d ptStart ;
|
||||
pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ;
|
||||
pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtStart = m_vtStartDir ;
|
||||
// pCurve->GetStartDir( vtStart) ;
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( k == 1) {
|
||||
@@ -4155,12 +4154,12 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtTool, dCalcStElev, bReturn, pMyCompo, ptP1, vtDir1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
Vector3d vtCorr = CalcCorrDir( pMyCompo, i, bReturn) ;
|
||||
Vector3d vtCorr = CalcCorrDir( pMyCompo, i, bReturn, true) ;
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool, vtCorr, dElev, dSafeZ) ;
|
||||
// determino se l'inizio dell'attacco è sopra il grezzo
|
||||
bool bAboveStart = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i, bReturn) ;
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i, bReturn, true) ;
|
||||
// se primo step
|
||||
if ( k == 1) {
|
||||
// verifico di entrare in aria
|
||||
@@ -4189,7 +4188,7 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
}
|
||||
}
|
||||
// imposto versore correzione e ausiliario sul punto di arrivo
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i + 1, bReturn) ;
|
||||
CalcAndSetCorrAuxDir( pMyCompo, i + 1, bReturn, true) ;
|
||||
// se Retrazione e ultima entità, dichiaro fine passata
|
||||
if ( bReturn && i == nMaxInd)
|
||||
SetFlag( 301) ;
|
||||
@@ -4225,8 +4224,8 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT
|
||||
// dati fine entità
|
||||
Point3d ptEnd ;
|
||||
pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ;
|
||||
pCurve->GetEndDir( vtEnd) ;
|
||||
Vector3d vtEnd = m_vtEndDir ;
|
||||
// pCurve->GetEndDir( vtEnd) ;
|
||||
// elevazione sul punto finale
|
||||
double dEndElev ;
|
||||
if ( j == nStep) {
|
||||
@@ -6319,7 +6318,7 @@ Milling::GetPointBelowRaw( const Point3d& ptP, const Vector3d& vtTool) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Milling::CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide)
|
||||
Milling::CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide, bool bSawSpecial)
|
||||
{
|
||||
// verifico curva
|
||||
if ( pCompo == nullptr)
|
||||
@@ -6328,7 +6327,7 @@ Milling::CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bI
|
||||
if ( m_Params.m_nWorkSide == MILL_WS_CENTER)
|
||||
return true ;
|
||||
// calcolo del versore correzione
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, dU, bInvertSide) ;
|
||||
Vector3d vtCorr = CalcCorrDir( pCompo, dU, bInvertSide, bSawSpecial) ;
|
||||
// imposto versore correzione
|
||||
SetCorrDir( vtCorr) ;
|
||||
// se rinvio da sotto in uso, non devo impostare direzione aux da correzione
|
||||
@@ -6348,7 +6347,7 @@ Milling::CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bI
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Vector3d
|
||||
Milling::CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide)
|
||||
Milling::CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide, bool bSawSpecial)
|
||||
{
|
||||
// verifico curva
|
||||
if ( pCompo == nullptr)
|
||||
@@ -6356,6 +6355,16 @@ Milling::CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide
|
||||
// se utensile centrato, direzione di correzione nulla
|
||||
if ( m_Params.m_nWorkSide == MILL_WS_CENTER)
|
||||
return V_NULL ;
|
||||
// se speciale lame, aggiusto il parametro di calcolo
|
||||
if ( bSawSpecial && ( m_TParams.m_nType & TF_SAWBLADE) != 0) {
|
||||
if ( pCompo->GetCurveCount() == 3)
|
||||
dU = 1.5 ;
|
||||
else if ( pCompo->GetCurveCount() == 2) {
|
||||
double dLen0 ; pCompo->GetCurve( 0)->GetLength( dLen0) ;
|
||||
double dLen1 ; pCompo->GetCurve( 1)->GetLength( dLen1) ;
|
||||
dU = ( dLen0 > dLen1 ? 0.5 : 1.5) ;
|
||||
}
|
||||
}
|
||||
// angolo di rotazione da tg a versore corr/aux
|
||||
bool bCcwRot = (( m_Params.m_nWorkSide == MILL_WS_LEFT) != bInvertSide) ;
|
||||
double dCaRot = ( bCcwRot ? ANG_RIGHT : -ANG_RIGHT) ;
|
||||
|
||||
@@ -128,8 +128,8 @@ class Milling : public Machining
|
||||
bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, double dSafeZ) const ;
|
||||
bool GetPointAboveRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
|
||||
bool GetPointBelowRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
|
||||
bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false) ;
|
||||
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false) ;
|
||||
bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false, bool bSawSpecial = false) ;
|
||||
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false, bool bSawSpecial = false) ;
|
||||
bool CalcOffset( ICurveComposite* pCompo, double dSignOffs) ;
|
||||
bool TrimExtendCurveToClosedStm( ICurveComposite* pCompo, int nCstmId, bool bInvert) ;
|
||||
|
||||
@@ -187,4 +187,6 @@ class Milling : public Machining
|
||||
double m_dCurrTabsLen ; // lunghezza corrente lungo il percorso per tabs
|
||||
bool m_bStartOutRaw ; // flag forzatura inizio fuori dal grezzo
|
||||
bool m_bEndOutRaw ; // flag forzatura fine fuori dal grezzo
|
||||
Vector3d m_vtStartDir ; // direzione iniziale del percorso in elaborazione
|
||||
Vector3d m_vtEndDir ; // direzione finale del percorso in elaborazione
|
||||
} ;
|
||||
Reference in New Issue
Block a user