EgtMachKernel 1.6n10 :

- modifiche per consentire adattamento della geometria macchina alla descrizione cinematica.
This commit is contained in:
Dario Sassi
2016-03-02 10:52:09 +00:00
parent 289aa0a2b4
commit b8b7f42c34
4 changed files with 38 additions and 8 deletions
+26 -8
View File
@@ -34,6 +34,8 @@ Machine::Machine( void)
m_pGeomDB = nullptr ;
m_nGroupId = GDB_ID_NULL ;
m_nTempGroupId = GDB_ID_NULL ;
m_dAxisMaxAdjust = EPS_SMALL ;
m_dExitMaxAdjust = EPS_SMALL ;
m_nCalcTabId = GDB_ID_NULL ;
m_nCalcHeadId = GDB_ID_NULL ;
m_nCalcExitId = GDB_ID_NULL ;
@@ -336,9 +338,16 @@ Machine::AdjustAxisVector( int nLay, const string& sPart, const string& sName,
Vector3d vtDelta = ptPos - ptBase ;
vtDelta -= ( vtDelta * vtDirN) * vtDirN ;
if ( ! vtDelta.IsSmall()) {
string sOut = " Wrong Axis Base move = (" + ToString( vtDelta) + ")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
return false ;
if ( vtDelta.Len() > m_dAxisMaxAdjust) {
string sOut = " Wrong Axis Base move = (" + ToString( vtDelta) + ")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
return false ;
}
else {
string sOut = " Move = (" + ToString( vtDelta) + ")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
m_pGeomDB->TranslateGlob( nId, vtDelta) ;
}
}
return true ;
}
@@ -545,18 +554,27 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
int nT = m_pGeomDB->GetFirstNameInGroup( nLay, sName) ;
if ( nT != GDB_ID_NULL && m_pGeomDB->GetGeoType( nT) == GEO_FRAME3D) {
// recupero frame
const Frame3d& frFrame = GetGeoFrame3d( m_pGeomDB->GetGeoObj( nT))->GetFrame() ;
Frame3d frFrame = GetGeoFrame3d( m_pGeomDB->GetGeoObj( nT))->GetFrame() ;
// verifico dati frame rispetto ad uscita (in globale)
Point3d ptPos = frFrame.Orig() ;
ptPos.ToGlob( frHead) ;
Vector3d vtTDir = frFrame.VersZ() ;
vtTDir.ToGlob(frHead) ;
vtTDir.ToGlob( frHead) ;
vtTDir.Normalize() ;
Vector3d vtDelta = vMuExit[i].ptPos - ptPos ;
if ( ! vtDelta.IsSmall()) {
string sOut = " Wrong Exit Position " + sName + " move = (" + ToString( vtDelta) +")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
return false ;
if ( vtDelta.Len() > m_dExitMaxAdjust) {
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) +")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
vtDelta.ToLoc( frHead) ;
frFrame.Translate( vtDelta) ;
GetGeoFrame3d( m_pGeomDB->GetGeoObj( nT))->Set( frFrame) ;
}
}
Vector3d vtDirN = vMuExit[i].vtTDir ;
if ( ! vtDirN.Normalize() || ! AreSameVectorApprox( vtTDir, vtDirN)) {