EgtMachKernel :
- gestione rinvio da sotto con gestione normale e con rotazione alla MDC.
This commit is contained in:
+100
-84
@@ -41,15 +41,17 @@ using namespace std ;
|
||||
// 2306 = "Error in Milling : Entity GetElevation"
|
||||
// 2307 = "Error in Milling : missing aggregate from bottom"
|
||||
// 2308 = "Error in Milling : path too far from part sides"
|
||||
// 2309 = "Error in Milling : LeadIn not computable"
|
||||
// 2310 = "Error in Milling : LeadOut not computable"
|
||||
// 2311 = "Error in Milling : Linear Approx not computable"
|
||||
// 2312 = "Error in Milling : LeadIn must be out of rawpart"
|
||||
// 2313 = "Error in Milling : Chaining failed"
|
||||
// 2314 = "Error in Milling : Tool MaxMaterial too small (xx)"
|
||||
// 2315 = "Error in Milling : axes values not calculable"
|
||||
// 2316 = "Error in Milling : link movements not calculable"
|
||||
// 2317 = "Error in Milling : post apply not calculable"
|
||||
// 2309 = "Error in Milling : Approach not computable"
|
||||
// 2310 = "Error in Milling : LeadIn not computable"
|
||||
// 2311 = "Error in Milling : LeadOut not computable"
|
||||
// 2312 = "Error in Milling : Retract not computable"
|
||||
// 2313 = "Error in Milling : Linear Approx not computable"
|
||||
// 2314 = "Error in Milling : LeadIn must be out of rawpart"
|
||||
// 2315 = "Error in Milling : Chaining failed"
|
||||
// 2316 = "Error in Milling : Tool MaxMaterial too small (xx)"
|
||||
// 2317 = "Error in Milling : axes values not calculable"
|
||||
// 2318 = "Error in Milling : link movements not calculable"
|
||||
// 2319 = "Error in Milling : post apply not calculable"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkMilling", Milling) ;
|
||||
@@ -456,7 +458,7 @@ Milling::Preview( bool bRecalc)
|
||||
|
||||
// se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria
|
||||
if ( bChain && ! Chain( nAuxId)) {
|
||||
m_pMchMgr->SetLastError( 2313, "Error in Milling : Chaining failed") ;
|
||||
m_pMchMgr->SetLastError( 2315, "Error in Milling : Chaining failed") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -521,7 +523,7 @@ Milling::Apply( bool bRecalc)
|
||||
|
||||
// se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria
|
||||
if ( bChain && ! Chain( nAuxId)) {
|
||||
m_pMchMgr->SetLastError( 2313, "Error in Milling : Chaining failed") ;
|
||||
m_pMchMgr->SetLastError( 2315, "Error in Milling : Chaining failed") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -567,19 +569,19 @@ Milling::Apply( bool bRecalc)
|
||||
if ( ! m_Params.m_sInitAngs.empty())
|
||||
sHint = m_Params.m_sInitAngs ;
|
||||
if ( ! CalculateAxesValues( sHint)) {
|
||||
m_pMchMgr->SetLastError( 2315, "Error in Milling : axes values not calculable") ;
|
||||
m_pMchMgr->SetLastError( 2317, "Error in Milling : axes values not calculable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione
|
||||
if ( ! AdjustStartEndMovements()) {
|
||||
m_pMchMgr->SetLastError( 2316, "Error in Milling : link movements not calculable") ;
|
||||
m_pMchMgr->SetLastError( 2318, "Error in Milling : link movements not calculable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// esecuzione eventuali personalizzazioni
|
||||
if ( ! PostApply()) {
|
||||
m_pMchMgr->SetLastError( 2317, "Error in Milling : post apply not calculable") ;
|
||||
m_pMchMgr->SetLastError( 2319, "Error in Milling : post apply not calculable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -1377,7 +1379,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
( nSplitArcs == SPLAR_NO_XY_PLANE && ! vtExtr.IsZplus()) ||
|
||||
( nSplitArcs == SPLAR_GEN_PLANE && vtExtr.IsGeneric())) ;
|
||||
if ( bSplitArcs && ! ApproxWithLines( pCompo)) {
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : Linear Approx not computable") ;
|
||||
m_pMchMgr->SetLastError( 2313, "Error in Milling : Linear Approx not computable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -1418,7 +1420,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
if ( m_TParams.m_dMaxMat < dElev && m_TParams.m_dMaxMat < MIN_MAXMAT) {
|
||||
string sInfo = "Error in Milling : Tool MaxMaterial too small (" +
|
||||
ToString( m_TParams.m_dMaxMat, 2) + ")" ;
|
||||
m_pMchMgr->SetLastError( 2314, sInfo) ;
|
||||
m_pMchMgr->SetLastError( 2316, sInfo) ;
|
||||
return false ;
|
||||
}
|
||||
// se lo step supera la capacità dell'utensile
|
||||
@@ -1448,10 +1450,9 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
}
|
||||
|
||||
// verifiche per fresatura dal basso
|
||||
m_bAggrBottom = false ;
|
||||
if ( ! VerifyPathFromBottom( pCompo, vtTool)) {
|
||||
m_bAggrBottom = false ;
|
||||
if ( ! VerifyPathFromBottom( pCompo, vtTool))
|
||||
return false ;
|
||||
}
|
||||
|
||||
// se richiesta anteprima
|
||||
if ( nPvId != GDB_ID_NULL) {
|
||||
@@ -1595,17 +1596,11 @@ Milling::VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vt
|
||||
bool bTabTilting = false ;
|
||||
if ( m_pMchMgr->GetCurrMachine()->GetCurrTableIsTilting( bTabTilting) && bTabTilting)
|
||||
return true ;
|
||||
// verifico se c'è rinvio da sotto
|
||||
int nHeadId = m_pMchMgr->GetHeadId( m_TParams.m_sHead) ;
|
||||
int nAgbType ;
|
||||
if ( ! m_pGeomDB->GetInfo( nHeadId, "AGB_TYPE", nAgbType) || nAgbType == 0) {
|
||||
string sOut = "Error in Milling : missing aggregate from bottom" ;
|
||||
m_pMchMgr->SetLastError( 2307, sOut.c_str()) ;
|
||||
// recupero dati di eventuale rinvio da sotto
|
||||
if ( ! GetAggrBottomData( m_TParams.m_sHead, m_AggrBottom) || m_AggrBottom.nType == 0) {
|
||||
m_pMchMgr->SetLastError( 2307, "Error in Milling : missing aggregate from bottom") ;
|
||||
return false ;
|
||||
}
|
||||
// recupero la massima distanza consentita dal rinvio
|
||||
double dAgbDmax = 0 ;
|
||||
m_pGeomDB->GetInfo( nHeadId, "AGB_DMAX", dAgbDmax) ;
|
||||
// calcolo la massima distanza minima del percorso dal contorno del grezzo
|
||||
double dDist = 0 ;
|
||||
Vector3d vtDir ;
|
||||
@@ -1639,9 +1634,8 @@ Milling::VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vt
|
||||
}
|
||||
}
|
||||
// se supera il limite, errore
|
||||
if ( dDist > dAgbDmax) {
|
||||
string sOut = "Error in Milling : path too far from part sides" ;
|
||||
m_pMchMgr->SetLastError( 2308, sOut.c_str()) ;
|
||||
if ( dDist > m_AggrBottom.dDMax) {
|
||||
m_pMchMgr->SetLastError( 2308, "Error in Milling : path too far from part sides") ;
|
||||
return false ;
|
||||
}
|
||||
// assegno direzione di accesso e segnalo utilizzo aggregato da sotto
|
||||
@@ -1757,14 +1751,16 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
dStElev = - LIO_ELEV_TOL ;
|
||||
}
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart))
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : Approach not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti, approccio per lame o diretto
|
||||
else {
|
||||
// verifico di entrare in aria
|
||||
if ( ! bOutStart) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
m_pMchMgr->SetLastError( 2314, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
return false ;
|
||||
}
|
||||
// affondo al punto iniziale
|
||||
@@ -1775,7 +1771,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
@@ -1813,7 +1809,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
// aggiungo retrazione per frese normali
|
||||
@@ -1823,8 +1819,10 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = GetPointAboveRaw( ptP1) ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd))
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd)) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
@@ -1894,8 +1892,10 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// correggo elevazione iniziale con punto inizio attacco
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart))
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : Approach not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti, affondo al punto iniziale
|
||||
else {
|
||||
@@ -1905,7 +1905,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
if ( j == 1) {
|
||||
// verifico di entrare in aria
|
||||
if ( ! bOutStart) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
m_pMchMgr->SetLastError( 2314, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
return false ;
|
||||
}
|
||||
// eseguo affondo
|
||||
@@ -1927,7 +1927,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
@@ -1969,7 +1969,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
// se ultimo step aggiungo retrazione per frese normali
|
||||
@@ -1979,8 +1979,10 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = GetPointAboveRaw( ptP1) ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd))
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd)) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
@@ -2056,14 +2058,16 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
dStElev = ( j - 1) * dStep ;
|
||||
}
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart))
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : Approach not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti, approccio per lame
|
||||
else {
|
||||
// verifico di entrare in aria
|
||||
if ( ! bOutStart) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
m_pMchMgr->SetLastError( 2314, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
return false ;
|
||||
}
|
||||
// affondo al punto iniziale
|
||||
@@ -2075,7 +2079,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
@@ -2116,7 +2120,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
// aggiungo retrazione per frese normali
|
||||
@@ -2126,8 +2130,10 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = GetPointAboveRaw( ptP1) ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd))
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd)) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
@@ -2200,14 +2206,16 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// correggo elevazione iniziale con punto inizio attacco
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart))
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : Approach not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti, affondo al punto iniziale per lame
|
||||
else {
|
||||
// verifico di entrare in aria
|
||||
if ( ! bOutStart) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
m_pMchMgr->SetLastError( 2314, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
return false ;
|
||||
}
|
||||
// eseguo affondamento
|
||||
@@ -2218,7 +2226,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
@@ -2260,7 +2268,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
// aggiungo retrazione per frese normali
|
||||
@@ -2270,8 +2278,10 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = GetPointAboveRaw( ptP1) ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd))
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd)) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
@@ -2326,8 +2336,10 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se l'inizio dell'attacco è sopra il grezzo
|
||||
bool bAboveStart = GetPointAboveRaw( ptP1) ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart))
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart, bAboveStart)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : Approach not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// altrimenti, affondo per lame
|
||||
else {
|
||||
@@ -2338,7 +2350,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
@@ -2380,7 +2392,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
m_pMchMgr->SetLastError( 2311, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
// aggiungo retrazione per frese normali
|
||||
@@ -2390,8 +2402,10 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = GetPointAboveRaw( ptP1) ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd))
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bAboveEnd)) {
|
||||
m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// per lame non è necessario
|
||||
}
|
||||
@@ -2409,11 +2423,6 @@ Milling::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ,
|
||||
SetFlag( 1) ;
|
||||
// se con aggregato da sotto
|
||||
if ( m_bAggrBottom) {
|
||||
// ne recupero alcuni dati
|
||||
double dAgbEncH = 0 ;
|
||||
double dAgbEncV = 0 ;
|
||||
m_pGeomDB->GetInfo( m_pMchMgr->GetHeadId( m_TParams.m_sHead), "AGB_ENCH", dAgbEncH) ;
|
||||
m_pGeomDB->GetInfo( m_pMchMgr->GetHeadId( m_TParams.m_sHead), "AGB_ENCV", dAgbEncV) ;
|
||||
// aggiuntivo in Z
|
||||
double dAggZ = max( dElev + max( dSafeAggrBottZ, dAppr), 0.) ;
|
||||
// distanza dal bordo del pezzo
|
||||
@@ -2421,18 +2430,27 @@ Milling::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ,
|
||||
if ( ! GetDistanceFromRawSide( m_nPhase, ptP, m_vtAux, dDistBottom))
|
||||
dDistBottom = 0 ;
|
||||
// pre-approccio
|
||||
Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAux * ( dDistBottom + dAgbEncH + dSafeZ) ;
|
||||
Point3d ptP00 = ptP0 + Z_AX * ( dAgbEncV + m_TParams.m_dLen + dAggZ - dElev) ;
|
||||
Vector3d vtAux = m_vtAux ;
|
||||
vtAux.Rotate( Z_AX, 90) ;
|
||||
SetAuxDir( vtAux) ;
|
||||
if ( AddRapidStart( ptP00, MCH_CL_AGB_DWN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
vtAux.Rotate( Z_AX, - 90) ;
|
||||
SetAuxDir( vtAux) ;
|
||||
SetFlag( 0) ;
|
||||
if ( AddRapidMove( ptP0, MCH_CL_AGB_IN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAux * ( dDistBottom + m_AggrBottom.dEncH + dSafeZ) ;
|
||||
Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAggZ - dElev) ;
|
||||
// se rinvio da sotto che richiede speciale rotazione
|
||||
if ( m_AggrBottom.nType == 1) {
|
||||
Vector3d vtAux = m_vtAux ;
|
||||
vtAux.Rotate( Z_AX, 90) ;
|
||||
SetAuxDir( vtAux) ;
|
||||
if ( AddRapidStart( ptP00, MCH_CL_AGB_DWN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
SetAuxDir( m_vtAux) ;
|
||||
SetFlag( 0) ;
|
||||
if ( AddRapidMove( ptP0, MCH_CL_AGB_IN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti rinvio normale
|
||||
else {
|
||||
SetAuxDir( m_vtAux) ;
|
||||
if ( AddRapidStart( ptP0, MCH_CL_AGB_IN) == GDB_ID_NULL)
|
||||
return false ;
|
||||
SetFlag( 0) ;
|
||||
}
|
||||
}
|
||||
// se non sono già sopra il pezzo e sopra attacco c'è spazio per sicurezza o approccio
|
||||
double dSafeDist = ( m_bAggrBottom ? dSafeAggrBottZ : dSafeZ) ;
|
||||
@@ -2506,11 +2524,6 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ,
|
||||
}
|
||||
// se con aggregato da sotto
|
||||
if ( m_bAggrBottom) {
|
||||
// ne recupero alcuni dati
|
||||
double dAgbEncH = 0 ;
|
||||
double dAgbEncV = 0 ;
|
||||
m_pGeomDB->GetInfo( m_pMchMgr->GetHeadId( m_TParams.m_sHead), "AGB_ENCH", dAgbEncH) ;
|
||||
m_pGeomDB->GetInfo( m_pMchMgr->GetHeadId( m_TParams.m_sHead), "AGB_ENCV", dAgbEncV) ;
|
||||
// aggiuntivo in Z
|
||||
double dAggZ = max( dElev + max( dSafeAggrBottZ, dAppr), 0.) ;
|
||||
// distanza dal bordo del pezzo
|
||||
@@ -2518,15 +2531,18 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ,
|
||||
if ( ! GetDistanceFromRawSide( m_nPhase, ptP, m_vtAux, dDistBottom))
|
||||
dDistBottom = 0 ;
|
||||
// post-retract
|
||||
Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAux * ( dDistBottom + dAgbEncH + dSafeZ) ;
|
||||
Point3d ptP00 = ptP0 + Z_AX * ( dAgbEncV + m_TParams.m_dLen + dAggZ - dElev) ;
|
||||
Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAux * ( dDistBottom + m_AggrBottom.dEncH + dSafeZ) ;
|
||||
Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAggZ - dElev) ;
|
||||
if ( AddRapidMove( ptP0, MCH_CL_AGB_OUT) == GDB_ID_NULL)
|
||||
return false ;
|
||||
Vector3d vtAux = m_vtAux ;
|
||||
vtAux.Rotate( Z_AX, 90) ;
|
||||
SetAuxDir( vtAux) ;
|
||||
if ( AddRapidMove( ptP00, MCH_CL_AGB_UP) == GDB_ID_NULL)
|
||||
return false ;
|
||||
// se rinvio da sotto che richiede speciale rotazione
|
||||
if ( m_AggrBottom.nType == 1) {
|
||||
Vector3d vtAux = m_vtAux ;
|
||||
vtAux.Rotate( Z_AX, 90) ;
|
||||
SetAuxDir( vtAux) ;
|
||||
if ( AddRapidMove( ptP00, MCH_CL_AGB_UP) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user