EgtMachKernel 2.1l6 :
- aggiunta possibilità di avere direzioni utensili e direzioni assi di mlde lievemente diverse dal disegno.
This commit is contained in:
+33
-11
@@ -36,7 +36,9 @@ Machine::Machine( void)
|
||||
m_nGroupId = GDB_ID_NULL ;
|
||||
m_nTempGroupId = GDB_ID_NULL ;
|
||||
m_dAxisMaxAdjust = EPS_SMALL ;
|
||||
m_dAxisMaxRotAdj = 10 * EPS_ANG_SMALL ;
|
||||
m_dExitMaxAdjust = EPS_SMALL ;
|
||||
m_dExitMaxRotAdj = 10 * EPS_ANG_SMALL ;
|
||||
m_dAngDeltaMinForHome = INFINITO ;
|
||||
m_nCalcTabId = GDB_ID_NULL ;
|
||||
m_nCalcHeadId = GDB_ID_NULL ;
|
||||
@@ -376,10 +378,19 @@ Machine::AdjustAxis( int nLay, const string& sPart, const string& sName,
|
||||
// altrimenti asse rotante, devo verificarne direzione e coassialità (questa solo se non abilitato movimento)
|
||||
else {
|
||||
Vector3d vtDirN = vtDir ;
|
||||
if ( ! vtDirN.Normalize() || ! AreSameVectorApprox( vtAxis, vtDirN)) {
|
||||
string sOut = " Wrong Axis Vector or Dir " + sPart ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
if ( ! vtDirN.Normalize() || ! AreSameVectorEpsilon( vtAxis, vtDirN, 10 * SIN_EPS_ANG_SMALL)) {
|
||||
double dAngRot ;
|
||||
if ( ! vtAxis.GetAngle( vtDirN, dAngRot) || abs( dAngRot) > m_dExitMaxRotAdj) {
|
||||
string sOut = " Wrong Axis Vector or Dir " + sPart ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
Vector3d vtRotAx = vtAxis ^ vtDirN ; vtRotAx.Normalize() ;
|
||||
string sOut = " Axis " + sName + " rotation = (" + ToString( dAngRot) + "/" + ToString( vtRotAx) + ")" ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
m_pGeomDB->RotateGlob( nId, ptBase, vtRotAx, dAngRot) ;
|
||||
}
|
||||
}
|
||||
Vector3d vtDelta = ptPos - ptBase ;
|
||||
Vector3d vtDeltaPerp = vtDelta - ( vtDelta * vtDirN) * vtDirN ;
|
||||
@@ -390,7 +401,7 @@ Machine::AdjustAxis( int nLay, const string& sPart, const string& sName,
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
string sOut = " Move = (" + ToString( vtDelta) + ")" ;
|
||||
string sOut = " Axis " + sName + " move = (" + ToString( vtDelta) + ")" ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
m_pGeomDB->TranslateGlob( nId, vtDelta) ;
|
||||
}
|
||||
@@ -777,12 +788,12 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
|
||||
Vector3d vtDelta = vMuExit[i].ptPos - ptPos ;
|
||||
if ( ! vtDelta.IsSmall()) {
|
||||
if ( vtDelta.Len() > m_dExitMaxAdjust) {
|
||||
string sOut = " Wrong Exit Position " + sName + " move = (" + ToString( vtDelta) +")" ;
|
||||
string sOut = " Wrong Exit Position " + sName + " move = (" + ToString( vtDelta) + ")" ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
string sOut = " Exit " + sName + " move = (" + ToString( vtDelta) +")" ;
|
||||
string sOut = " Exit " + sName + " move = (" + ToString( vtDelta) + ")" ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
vtDelta.ToLoc( frHead) ;
|
||||
frFrame.Translate( vtDelta) ;
|
||||
@@ -790,10 +801,21 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
|
||||
}
|
||||
}
|
||||
Vector3d vtDirN = vMuExit[i].vtTDir ;
|
||||
if ( ! vtDirN.Normalize() || ! AreSameVectorApprox( vtTDir, vtDirN)) {
|
||||
string sOut = " Wrong Exit Vector " + sName ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
if ( ! vtDirN.Normalize() || ! AreSameVectorEpsilon( vtTDir, vtDirN, 10 * SIN_EPS_ANG_SMALL)) {
|
||||
double dAngRot ;
|
||||
if ( ! vtTDir.GetAngle( vtDirN, dAngRot) || abs( dAngRot) > m_dExitMaxRotAdj) {
|
||||
string sOut = " Wrong Exit Vector " + sName ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
Vector3d vtRotAx = vtTDir ^ vtDirN ; vtRotAx.Normalize() ;
|
||||
string sOut = " Exit " + sName + " rotation = (" + ToString( dAngRot) + "/" + ToString( vtRotAx) + ")" ;
|
||||
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
|
||||
vtRotAx.ToLoc( frHead) ;
|
||||
frFrame.Rotate( frFrame.Orig(), vtRotAx, dAngRot) ;
|
||||
GetGeoFrame3d( m_pGeomDB->GetGeoObj( nT))->Set( frFrame) ;
|
||||
}
|
||||
}
|
||||
// inserisco gruppo con riferimento del frame
|
||||
int nGT = m_pGeomDB->InsertGroup( GDB_ID_NULL, nT, GDB_BEFORE, frFrame) ;
|
||||
|
||||
Reference in New Issue
Block a user