EgtMachKerenel :

- ulteriore modifica per controllo punto medio in calcolo assi macchina di tipo centro di lavoro.
This commit is contained in:
Dario Sassi
2024-07-29 10:15:38 +02:00
parent 8156cf92e5
commit 68a92f942c
2 changed files with 12 additions and 8 deletions
+11 -7
View File
@@ -1984,6 +1984,8 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
Vector3d vtBackAux ;
pMachine->GetBackAuxDirFromAngles( vAxRot, vtBackAux) ;
pCamData->SetBackAuxDir( vtBackAux) ;
// tipo di movimento
int nMoveType = pCamData->GetMoveType() ;
// se punto finale di linea
if ( ! bFirst && pCamData->IsLine()) {
// Verifica ricorsiva del punto medio
@@ -1991,7 +1993,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
bool bAxesError ;
if ( ! VerifyLineMidPoint( ptPrec, vtDirPrec, vtAuxPrec, vtCorrPrec, vAxPrec,
ptP, vtDir, vtAux, vtCorr, vAxVal,
0, nEntId, dRot1W, bMidAdded, bAxesError)) {
0, nEntId, dRot1W, nMoveType, bMidAdded, bAxesError)) {
LOG_ERROR( GetEMkLogger(), "Error : VerifyLineMidPoint of CalculateClPathAxesValues failed")
return false ;
}
@@ -2301,7 +2303,7 @@ Operation::CalculateRotAxesValues( bool bFirst, const Vector3d& vtTool, const Ve
bool
Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, const Vector3d& vtAuxPrec, const Vector3d& vtCorrPrec, const DBLVECTOR& vAxPrec,
const Point3d& ptP, const Vector3d& vtDir, const Vector3d& vtAux, const Vector3d& vtCorr, const DBLVECTOR& vAxVal,
int nCnt, int nEntId, double dRot1W, bool& bAdded, bool& bAxError)
int nCnt, int nEntId, double dRot1W, int nMoveType, bool& bAdded, bool& bAxError)
{
// impostazioni
bAdded = false ;
@@ -2340,6 +2342,8 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
return false ;
// LOG_INFO( GetEMkLogger(), ( "Midpoint dist =" + ToString( dDist, 3)).c_str())
double dLinTol = GetApproxLinTol() ;
if ( nMoveType == 0)
dLinTol = max( 10 * dLinTol, LIN_TOL_RAW) ;
// Se posizione in tolleranza, non devo fare alcunché
if ( dDist <= dLinTol)
@@ -2349,13 +2353,13 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
Point3d ptMid = Media( ptPrec, ptP) ;
Vector3d vtDirMid = Media( vtDirPrec, vtDir) ;
if ( ! vtDirMid.Normalize())
return true ;
return ( nMoveType == 0) ;
Vector3d vtAuxMid = Media( vtAuxPrec, vtAux) ;
if ( ! vtAuxPrec.IsSmall() && ! vtAux.IsSmall() && ! vtAuxMid.Normalize())
return true ;
return ( nMoveType == 0) ;
Vector3d vtCorrMid = Media( vtCorrPrec, vtCorr) ;
if ( ! vtCorrPrec.IsSmall() && ! vtCorr.IsSmall() && ! vtCorrMid.Normalize())
return true ;
return ( nMoveType == 0) ;
// inserisco nuova entità e modifico vecchia
int nMidEntId = m_pGeomDB->Copy( nEntId, GDB_ID_NULL, nEntId, GDB_BEFORE) ;
if ( nMidEntId == GDB_ID_NULL)
@@ -2415,7 +2419,7 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
bool bAdded1, bAxError1, bAdded2, bAxError2 ;
if ( ! VerifyLineMidPoint( ptPrec, vtDirPrec, vtAuxPrec, vtCorrPrec, vAxPrec,
ptMid, vtDirMid, vtAuxMid, vtCorrMid, vAxMid,
nCnt, nMidEntId, dRot1W, bAdded1, bAxError1))
nCnt, nMidEntId, dRot1W, nMoveType, bAdded1, bAxError1))
return false ;
if ( bAxError1) {
bAxError = true ;
@@ -2423,7 +2427,7 @@ Operation::VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec,
}
if ( ! VerifyLineMidPoint( ptMid, vtDirMid, vtAuxMid, vtCorrMid, vAxMid,
ptP, vtDir, vtAux, vtCorr, vAxVal,
nCnt, nEntId, dRot1W, bAdded2, bAxError2))
nCnt, nEntId, dRot1W, nMoveType, bAdded2, bAxError2))
return false ;
if ( bAxError2) {
bAxError = true ;